Skip to content

Commit

Permalink
add example regex to allow rules (#4827)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen authored Jul 17, 2023
1 parent 4bc8d29 commit 4cecd17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/fanal/secret/builtin-allow-rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var builtinAllowRules = []AllowRule{
ID: "examples",
Description: "Avoid example files and paths", // e.g. https://github.com/boto/botocore/blob/develop/botocore/data/organizations/2016-11-28/examples-1.json
Path: MustCompile(`example`),
Regex: MustCompile("(?i)example"),
},
{
ID: "vendor",
Expand Down
3 changes: 2 additions & 1 deletion pkg/fanal/secret/testdata/aws-secrets.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'AWS_secret_KEY'="12ASD34qwe56CXZ78tyH10Tna543VBokN85RHCas"
AWS_ACCESS_KEY_ID=AKIA0123456789ABCDEF
"aws_account_ID":'1234-5678-9123'
"aws_account_ID":'1234-5678-9123'
AWS_example=AKIAIOSFODNN7EXAMPLE

0 comments on commit 4cecd17

Please sign in to comment.