Skip to content

resolve additional matching issue#11

Closed
RollerMatic wants to merge 2 commits into
facebookincubator:mainfrom
RollerMatic:export-D64148191
Closed

resolve additional matching issue#11
RollerMatic wants to merge 2 commits into
facebookincubator:mainfrom
RollerMatic:export-D64148191

Conversation

@RollerMatic

Copy link
Copy Markdown

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

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
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D64148191

Comment thread authorize_fields.go Outdated
Co-authored-by: Joe Hrbek <joe.hrbek@gmail.com>

@RollerMatic RollerMatic left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ Joe's suggestion

@RollerMatic RollerMatic reopened this Oct 14, 2024
@RollerMatic

Copy link
Copy Markdown
Author

I am going to create another PR, don't see a way for merging this

@RollerMatic
RollerMatic deleted the export-D64148191 branch October 14, 2024 17:48
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants