awslabs / git-secrets

Prevents you from committing secrets and credentials into git repositories
Apache License 2.0
12.36k stars 1.17k forks source link

allowed pattern, literal are failing #122

Open nkumar-topcoder opened 5 years ago

nkumar-topcoder commented 5 years ago

So far allowed pattern was working as expected if i give line number as allowed. For example

echo "AKIAIOSFODNN7EXAM123" > test.js
git secrets --scan --untracked test.js
test.js:1:AKIAIOSFODNN7EXAM123

Now, Just add line number and this Key will be whitelisted.

git secrets --add --allowed "test.js:1:.*"

earlier If scanned again, the alert won't come. But, recently the line number whitelisting is failing

bash-4.4# git secrets --add --allowed "test.js:1:.*"
bash-4.4# git secrets --scan --untracked test.js
test.js:1:AKIAIOSFODNN7EXAM123

[ERROR] Matched one or more prohibited patterns

I tried inside the git repos too, same issue.

Also, tried below options with allowed --literal option too but same issue

bash-4.4# git secrets --add --allowed "AKIAIOSFODNN7EXAM123"
bash-4.4# git secrets --scan --untracked test.js
test.js:1:AKIAIOSFODNN7EXAM123

[ERROR] Matched one or more prohibited patterns

Whitelisting of file with line number I use a lot and it used to work perfectly. only from last 2-3 weeks facing these issues.