allowed pattern, literal are failing
- Dominant language
- Shell
- Stars
- 13.4k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Research direction
Reproduce the failure with `git secrets --add --allowed` followed by `git secrets --scan --untracked test.js`, testing both the line-number pattern and the `--literal` value shown in the report. Trace how allowed patterns are stored and matched, and consider the issue done when both examples suppress the reported secret without weakening prohibited-pattern scanning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100