resolve additional matching issue#11
Closed
RollerMatic wants to merge 2 commits into
Closed
Conversation
Summary: Go's Match string function is similar to a substring matcher, as opposed to python's regex `match` function which matches from the beginning of the string. For example `cat.*` will match the command `bash /etc/some_folder/file_name_contains_cat.sh` as per go matchers. An easy way to restrict this is to add boundary characters inside expressions as tacquito reads them. There are two places we could add these boundary characters 1) config 2) the server code Within facebook's infra , it would be okay to attach this to either of the places since we control the config. But the stringy module is a part of the OSS modules, and in that case it's better to add the guardrails to the server code so the boundaries are not *optional* Reviewed By: elizabethjoshi Differential Revision: D64148191
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D64148191 |
Co-authored-by: Joe Hrbek <joe.hrbek@gmail.com>
Author
|
I am going to create another PR, don't see a way for merging this |
facebook-github-bot
pushed a commit
that referenced
this pull request
Oct 15, 2024
Summary: Pull Request resolved: #11 Go's Match string function is similar to a substring matcher, as opposed to python's regex `match` function which matches from the beginning of the string. For example `cat.*` will match the command `bash /etc/some_folder/file_name_contains_cat.sh` as per go matchers. An easy way to restrict this is to add boundary characters inside expressions as tacquito reads them. There are two places we could add these boundary characters 1) config 2) the server code Within facebook's infra , it would be okay to attach this to either of the places since we control the config. But the stringy module is a part of the OSS modules, and in that case it's better to add the guardrails to the server code so the boundaries are not *optional* Reviewed By: elizabethjoshi Differential Revision: D64148191 fbshipit-source-id: 16f45c8a3e21c4d5d0509d9fe20a52fdedcbc22c
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
Go's Match string function is similar to a substring matcher, as opposed to python's regex
matchfunction which matches from the beginning of the string. For examplecat.*will match the commandbash /etc/some_folder/file_name_contains_cat.shas per go matchers.
An easy way to restrict this is to add boundary characters inside expressions as tacquito reads them.
There are two places we could add these boundary characters
Within facebook's infra , it would be okay to attach this to either of the places since we control the config. But the stringy module is a part of the OSS modules, and in that case it's better to add the guardrails to the server code so the boundaries are not optional
Reviewed By: elizabethjoshi
Differential Revision: D64148191