refactor(generic-api-key): remove hard-coded 'magic' (#1600)

This commit is contained in:
Richard Gomez authored and GitHub committed 2025-01-13 19:57:25 -06:00
1 parent 748076d976
commit c4526b2c55
4 files changed
+11 -23

No files matched your search

+7
View File
@@ -39,6 +39,13 @@ func GenericCredential() *config.Rule {
},
Entropy: 3.5,
Allowlists: []config.Allowlist{
{
// NOTE: this is a goofy hack to get around the fact there golang's regex engine does not support positive lookaheads.
// Ideally we would want to ensure the secret contains both numbers and alphabetical characters, not just alphabetical characters.
Regexes: []*regexp.Regexp{
regexp.MustCompile(`^[a-zA-Z_.-]+$`),
},
},
{
Description: "Allowlist for Generic API Keys",
MatchCondition: config.AllowlistMatchOr,