-
Notifications
You must be signed in to change notification settings - Fork 0
Add Regexp Targeting #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ttstarck
wants to merge
7
commits into
master
Choose a base branch
from
PASSION_add_regex_matching_for_targeting
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Regexp Targeting #115
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
402ccfc
Add substring targeting
ttstarck 3af2fba
fix pattern matching to not match on internal embedded slashes
ttstarck 7a82f9b
use regex matching example in readme
ttstarck c2e5de2
swap wording to regex instead of substring
ttstarck 8730e8e
utilize ruby yaml parser's regex keyword
ttstarck c6d10fe
use safe_load_file with only Regexp as permitted class
ttstarck 9809f61
update static_context_hash in target to use regex as well
ttstarck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module ProcessSettings | ||
| VERSION = '0.19.0' | ||
| VERSION = '0.20.0.pre.2' | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| # | ||
| # Don't edit this file directly! It was generated by combine_process_settings from the files in staging/settings/. | ||
| # | ||
| - filename: honeypot.yml | ||
| settings: | ||
| honeypot: | ||
| max_recording_seconds: 600 | ||
| answer_odds: 100 | ||
| status_change_min_days: | ||
| - filename: regex_target.yml | ||
| target: | ||
| service: !ruby/regexp /frontend/ | ||
| settings: | ||
| test_setting: 100 | ||
| - filename: telecom/log_level.yml | ||
| target: | ||
| app: telecom | ||
| settings: | ||
| logging: | ||
| level: debug | ||
| - filename: telecom/stop_incoming_requests.yml | ||
| target: | ||
| app: telecom | ||
| region: west | ||
| settings: | ||
| incoming_requests: 0 | ||
| - filename: telecom/debug_sip_private_caller_id.yml | ||
| target: | ||
| app: telecom | ||
| region: west | ||
| caller_id: | ||
| - "+18053334444" | ||
| - "+12755554321" | ||
| - "+18052223344" | ||
| settings: | ||
| log_stream: | ||
| sip: caller_id_privacy | ||
| - filename: cca/tech-1234_call_counts_drift_investigation.yml | ||
| target: | ||
| app: ccn | ||
| settings: | ||
| call_counts: | ||
| complete_sync_seconds: 60 | ||
| - meta: | ||
| version: 20 | ||
| END: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| target: | ||
| service: !ruby/regexp /frontend/ | ||
| settings: | ||
| test_setting: 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa! This is really cool to not preclude slashes around strings. In the past we've been nervous about using this YAML ruby class support because it has a much wider surface area for security vulnerabilities (since this Ruby class will be invoked). That doesn't seem like a big deal here, but we might want to get an opinion from someone with a security background.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the source for how
Pyschparses it this value:https://github.com/ruby/psych/blob/master/lib/psych/visitors/to_ruby.rb#L96-L110
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ColinDKelley @jebentier It looks like we technically are already open to this potential vulnerability! I can switch how we are parsing yaml to use
Pysch.safe_load_fileand specify allowing onlyRegexpas a permitted class besides the default permitted classesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
process_settings/lib/process_settings/targeted_settings.rb
Line 76 in 6ff07b4
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point--we are already vulnerable! And because the process_settings are set by developers, I think we'll be fine? Worth mentioning that to in the request for a security sign-off. (It's the cases where raw YAML is parsed from the outside world that have caused serious security problems. And that's why
safe_load_filewas invented.)And if it doesn't add much scope, I really like your suggestion of switching over to
Pysch.safe_load_filehere with onlyRegexppermitted. But if that takes more than a couple minutes, feel free to create a ticket for Octothorpe instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added: c6d10fe