Skip to content

Commit bc6f54f

Browse files
Fix the false positive
1 parent 35fcb7b commit bc6f54f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

engine/rules/ruledefine/generic_credential.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var genericCredentialRegex = generateSemiGenericRegexIncludingXml([]string{
1616
"passw(?:or)?d",
1717
"secret",
1818
"token",
19-
}, `[\w.=\-~?!@]{10,150}|[a-z0-9][a-z0-9+/]{11,}={0,3}`, true).String()
19+
}, `[\w.=\-~?!:@]{10,150}|[a-z0-9][a-z0-9+/]{11,}={0,3}`, true).String()
2020

2121
func GenericCredential() *Rule {
2222
return &Rule{
@@ -42,7 +42,7 @@ func GenericCredential() *Rule {
4242
// NOTE: this is a goofy hack to get around the fact there golang's regex engine does not support positive lookaheads.
4343
// Ideally we would want to ensure the secret contains both numbers and alphabetical characters, not just alphabetical characters.
4444
Regexes: []string{
45-
regexp.MustCompile(`^[a-zA-Z_.-]+$`).String(),
45+
regexp.MustCompile(`^[a-zA-Z_.-]+:?$`).String(),
4646
},
4747
},
4848
{

0 commit comments

Comments
 (0)