Private key recognition hook is not accurate
See original GitHub issueHi Team!
I just discovered your work, and it is fantastic. Many thanks for putting this together, it is very useful.
I have a use case where code is extracting private keys, and contains lines such as
String keyContents = base64Content.VersionData.tostring();
keyContents = keyContents.replace('-----BEGIN RSA PRIVATE KEY-----', '');
keyContents = keyContents.replace('-----END RSA PRIVATE KEY-----', '');
keyContents = keyContents.replace('\n', '');
This is caught by the private key discoverer and it makes the tests fail.
Technically, private keys or certs would have a pattern that is (-----BEGIN RSA PRIVATE KEY-----)( base64 stuff)(-----END RSA PRIVATE KEY-----)
The current code seems to just check if the words “BEGIN RSA PRIVATE KEY” appears in the code, which is slightly weak.
As a result, I am using a combination of pre-commit and Talisman but I would love to have a single code base for everything.
Best, Sam
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Google Cloud Composer get default service account private key
Now I'm trying to do the same in Cloud Composer but I can't find how to access the private key from the default...
Read more >Best practices for managing service account keys - IAM
Because the private key lets you authenticate as the service account, having access to the private key is similar to knowing a user's...
Read more >Secret Detection - GitLab Docs
By default, Secret Detection scans only the current state of the Git repository. Any secrets contained in the repository's history are not detected....
Read more >How To Force SSH Client To Use Given Private Key/Identity File
Explains how to force SSH client to use given private key ( identity file ) under Linux, macOS, *BSD and Unix.
Read more >Web Authentication: An API for accessing Public Key ... - W3C
A public key credential is created and stored by a WebAuthn Authenticator at ... If the credential ID is not recognized by the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @asottile. Allowing .pre-commit-config.yaml to point to a different fork/sha made it very easy to test. Great design, Ill be tweeting and letting my co-workers know about your work!
Always open to improvements @nicain 😃