mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Allow tag (#809)
* gitleaks:allow signature * readd all tests * fixing tests
This commit is contained in:
1 parent
57f9bc83d1
commit
3e5e63956e
3 files changed
+78
-10
No files matched your search
@@ -29,6 +29,8 @@ const (
|
||||
DetectType GitScanType = iota
|
||||
ProtectType
|
||||
ProtectStagedType
|
||||
|
||||
gitleaksAllowSignature = "gitleaks:allow"
|
||||
)
|
||||
|
||||
// Detector is the main detector struct
|
||||
@@ -170,6 +172,11 @@ func (d *Detector) detectRule(fragment Fragment, rule *config.Rule) []report.Fin
|
||||
Tags: rule.Tags,
|
||||
}
|
||||
|
||||
if strings.Contains(fragment.Raw[loc.startLineIndex:loc.endLineIndex],
|
||||
gitleaksAllowSignature) {
|
||||
continue
|
||||
}
|
||||
|
||||
// extract secret from secret group if set
|
||||
if rule.SecretGroup != 0 {
|
||||
groups := rule.Regex.FindStringSubmatch(secret)
|
||||
|
||||
Reference in new issue
Block a user