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
Add custom detectors configuration parsing #927
Conversation
Also create protoyaml package to test YAML unmarshalling the configuration.
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.
🙌
repeated string keywords = 1; | ||
map<string, string> regex = 2; | ||
repeated VerifierConfig verify = 3; | ||
} |
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.
I think we probably want to combine CustomDetector and CustomRegex together here. Because in config, I think it makes sense for them to be an array of maps containing all of the custom detectors, and the custom detector itself would look like CustomRegex plus the name
. We might not actually need type
for these, and I think we can forego having connection
and instead combine these two messages into one. e.g.
message CustomDetector {
string type = 1;
string name = 2;
repeated string keywords = 3;
map<string, string> regex = 4;
repeated VerifierConfig verify = 6;
}
const testCustomRegexYaml = `name: Internal bi tool | ||
keywords: | ||
- secret_v1_ | ||
- pat_v2_ | ||
regex: | ||
id_pat_example: ([a-zA-Z0-9]{32}) | ||
secret_pat_example: ([a-zA-Z0-9]{32}) | ||
verify: | ||
- endpoint: http://localhost:8000/{id_pat_example} | ||
unsafe: true | ||
headers: | ||
- 'Authorization: Bearer {secret_pat_example.0}' | ||
successRanges: | ||
- 200-250 | ||
- '288'` |
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.
I think we need to revisit the design document, this is not what was proposed and reviewed previously.
No description provided.