mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 04:34:46 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f348991d21 | ||
|
|
e0745adbd2 | ||
|
|
1ddc924a67 | ||
|
|
0b07625567 |
No files matched your search
@@ -4,3 +4,8 @@
|
|||||||
entry: gitleaks protect --verbose --redact --staged
|
entry: gitleaks protect --verbose --redact --staged
|
||||||
language: golang
|
language: golang
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
- id: gitleaks-docker
|
||||||
|
name: Detect hardcoded secrets
|
||||||
|
description: Detect hardcoded secrets using Gitleaks
|
||||||
|
entry: zricethezav/gitleaks:v8.5.2 protect --verbose --redact --staged
|
||||||
|
language: docker_image
|
||||||
+2
-15
@@ -537,22 +537,9 @@ secretGroup = 4
|
|||||||
[allowlist]
|
[allowlist]
|
||||||
description = "global allow lists"
|
description = "global allow lists"
|
||||||
regexes = [
|
regexes = [
|
||||||
'''219-09-9999''',
|
'''219-09-9999''',
|
||||||
'''078-05-1120''',
|
'''078-05-1120''',
|
||||||
'''(9[0-9]{2}|666)-\d{2}-\d{4}''',
|
'''(9[0-9]{2}|666)-\d{2}-\d{4}''',
|
||||||
'''process''',
|
|
||||||
'''getenv''',
|
|
||||||
'''\.env''',
|
|
||||||
'''env\(''',
|
|
||||||
'''env\.''',
|
|
||||||
'''setting''',
|
|
||||||
'''load''',
|
|
||||||
'''token''',
|
|
||||||
'''password''',
|
|
||||||
'''secret''',
|
|
||||||
'''api\_key''',
|
|
||||||
'''apikey''',
|
|
||||||
'''api\-key''',
|
|
||||||
]
|
]
|
||||||
paths = [
|
paths = [
|
||||||
'''gitleaks.toml''',
|
'''gitleaks.toml''',
|
||||||
|
|||||||
@@ -149,6 +149,11 @@ func (d *Detector) detectRule(fragment Fragment, rule *config.Rule) []report.Fin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if path only rule, skip content checks
|
||||||
|
if rule.Regex == nil {
|
||||||
|
return findings
|
||||||
|
}
|
||||||
|
|
||||||
matchIndices := rule.Regex.FindAllStringIndex(fragment.Raw, -1)
|
matchIndices := rule.Regex.FindAllStringIndex(fragment.Raw, -1)
|
||||||
for _, matchIndex := range matchIndices {
|
for _, matchIndex := range matchIndices {
|
||||||
// extract secret from match
|
// extract secret from match
|
||||||
|
|||||||
Reference in new issue
Block a user