-
Notifications
You must be signed in to change notification settings - Fork 94
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 new rule for Kubernetes Bootstrap Token #235
Add new rule for Kubernetes Bootstrap Token #235
Conversation
c24acd1
to
0b9692a
Compare
Thanks for the submission @sinkozs! This submission looks good, but I think the rule can be made more precise. I ran a scan with this rule enabled over 1.8TB of input files, and nearly all the matches are false positives. The rule as written, adapted from the regex in the Kubernetes docs on the token format:
Note, the actual code that generates bootstrap tokens does indeed appear to use the full Some kinds of false positivesStrings from executable files:
Strings from source code:
Domain names:
Variable assignments:
Improving precisionThis rule as written lacks a distinctive prefix or suffix to match on, and so matches many unrelated things. Modifying the rule to require some leading context should do the trick. I re-tested with this version on the 1.8TB inputs, got almost no false positives:
|
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 revised the rule to improve precision. Thank you for the contribution!
I also added 1 additional new rule for cases like in the documentation where the token ID and secret get split across 2 adjacent YAML fields. |
No description provided.