Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .2ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1383,3 +1383,4 @@ ignore-result:
- fcaf9a97bbcf85b33f88738b1e817e098e9c37e1 # unit test from e2e_test.go
- fe08c7c6c7f8bb715022aa4cd16ae1c69906ebba # test data from expectedReportWithValidation.json
- 5858849b35c4d0c6061a61c28c39e28b98844333 # unit test from rule_test.go
- 9da5434e08eee9b501cf1a1e81e069c4887031eb # unit test from generic_credential_test.go
4 changes: 2 additions & 2 deletions engine/rules/ruledefine/generic_credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var genericCredentialRegex = generateSemiGenericRegexIncludingXml([]string{
"passw(?:or)?d",
"secret",
"token",
}, `[\w.=-]{10,150}|[a-z0-9][a-z0-9+/]{11,}={0,3}`, true).String()
}, `[\w.=\-~?!:@]{10,150}|[a-z0-9][a-z0-9+/]{11,}={0,3}`, true).String()

func GenericCredential() *Rule {
return &Rule{
Expand Down Expand Up @@ -60,7 +60,7 @@ func GenericCredential() *Rule {
`|rapid|capital` + // common words containing "api"
`|[a-z0-9-]*?api[a-z0-9-]*?:jar:` + // Maven META-INF dependencies that contain "api" in the name.
// Auth
`|author` +
`|\bauthor\b` +
`|X-MS-Exchange-Organization-Auth` + // email header
`|Authentication-Results` + // email header
// Credentials
Expand Down
1 change: 1 addition & 0 deletions engine/rules/ruledefine/generic_credential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func TestGenericCredential(t *testing.T) {
" utils.GetEnvOrDefault(\"api_token\", \"dafa7817-e246-48f3-91a7-e87653d587b8\")",
// xml cases
"<key>API_KEY</key>\n<string>AIzaSyATDL7Wz3Ze6BU31Yv3fVVth30Skyib29g</string>",
"Authorization.ClientSecret: e55wsdasfsgs-sdsdas_2sdasjVM~ggadASaADASsad",
},
falsePositives: []string{
"issuerKeyHash=npmXsmT2_C1iJZ-SD7RuL8exZ=6ucd",
Expand Down
Loading