Replies: 1 comment
-
Hello @OverOrion Created #7700 Regards, Dmitriy |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
#7223 PR introduced this behaviour, which will result in false positives many times.
For example https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/crypt/_python_rsa.py
contains the following string literals for detecting private keys:
Once this gets compiled into a
*.pyc file
, then running thestrings
command on it yields the following:$ strings _python_rsa.cpython-312.pyc | grep PRIV -----BEGIN RSA PRIVATE KEY-----z -----END RSA PRIVATE KEY-----) -----BEGIN PRIVATE KEY-----z -----END PRIVATE KEY-----c
And this will match (regex101) the given regular expression in your rule set:
Desired Behavior
This should not be reported as a
HIGH: AsymmetricPrivateKey (private-key)
.The private key detection should not be just a regex.
Actual Behavior
Because of the validation logic this (and I believe many more will) gets reported as a published secret.
Reproduction Steps
Target
None
Scanner
None
Output Format
None
Mode
None
Debug Output
Operating System
Ubuntu
Version
Checklist
trivy clean --all
Beta Was this translation helpful? Give feedback.
All reactions