Skip to content

Commit 6a7bb5a

Browse files
revert rule test
1 parent 1185aa9 commit 6a7bb5a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

engine/rules/aws.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ func AWS() *config.Rule {
1010
return &config.Rule{
1111
RuleID: "aws-access-token",
1212
Description: "Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.", //nolint:lll
13-
Regex: regexp.MustCompile(`a`),
13+
Regex: regexp.MustCompile(`\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\b`),
14+
Entropy: 3,
15+
Keywords: []string{
16+
// https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-unique-ids
17+
"A3T", // todo: might not be a valid AWS token
18+
"AKIA", // Access key
19+
"ASIA", // Temporary (AWS STS) access key
20+
"ABIA", // AWS STS service bearer token
21+
"ACCA", // Context-specific credential
22+
},
23+
Allowlists: []*config.Allowlist{
24+
{
25+
Regexes: []*regexp.Regexp{
26+
regexp.MustCompile(`.+EXAMPLE$`),
27+
},
28+
},
29+
},
1430
}
1531
}

0 commit comments

Comments
 (0)