Skip to content
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

Appending to allowed literal will pass the check #53

Closed
spinwang opened this issue Sep 4, 2017 · 2 comments
Closed

Appending to allowed literal will pass the check #53

spinwang opened this issue Sep 4, 2017 · 2 comments

Comments

@spinwang
Copy link

spinwang commented Sep 4, 2017

I ran the following to add somethingsecret as an allowed password in literal form:

git secrets --add 'password\s*=\s*.+'
git secrets --add --allowed --literal 'somethingsecret'

But I found that password=somethingsecret1, will also pass the check.

@mtdowling
Copy link
Contributor

This looks like it's working as intended.

Allowed patterns are evaluated after checking for prohibited patterns. git-secrets will first identify that "password=somethingsecret1" is prohibited. It will then pipe the matching grep output for that line to another grep that checks for allowed patterns. If any of the allowed patterns match, then the text that was found is ignore.

I don't know what you're trying to do, but one way to mitigate these kinds of situations is to be more specific with your allowed patterns.

@spinwang
Copy link
Author

spinwang commented Sep 5, 2017

@mtdowling I think I misunderstood the syntax. Thanks!!

@spinwang spinwang closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants