Skip to content

Commit

Permalink
adding access to generic rule keywords and identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
zricethezav committed Jul 5, 2022
1 parent f4ddeda commit 1fc27ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/generate/config/rules/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func GenericCredential() *config.Rule {
"passwd",
"password",
"auth",
"access",
}, `[0-9a-z\-_.=]{10,150}`),
SecretGroup: 1,
Keywords: []string{
Expand All @@ -29,6 +30,7 @@ func GenericCredential() *config.Rule {
"passwd",
"password",
"auth",
"access",
},
Entropy: 3.5,
Allowlist: config.Allowlist{
Expand Down
4 changes: 2 additions & 2 deletions config/gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1139,11 +1139,11 @@ keywords = [
[[rules]]
description = "Generic API Key"
id = "generic-api-key"
regex = '''(?i)(?:key|api|token|secret|client|passwd|password|auth)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60]|$)'''
regex = '''(?i)(?:key|api|token|secret|client|passwd|password|auth|access)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60]|$)'''
secretGroup = 1
entropy = 3.5
keywords = [
"key","api","token","secret","client","passwd","password","auth",
"key","api","token","secret","client","passwd","password","auth","access",
]
[rules.allowlist]
stopwords= [
Expand Down

0 comments on commit 1fc27ee

Please sign in to comment.