Remove IAM identifiers for non-credential resources in the aws-access-token rule (#1307)

* Remove IAM identifiers for non-credential resources

Only detects: 
AWS STS service bearer token
Context-specific credential
Access key
Temporary (AWS STS) access key IDs use this prefix, but are unique only in combination with the secret access key and the session token.

* Update gitleaks.toml

* Update testdata

* Update tests
This commit is contained in:
Kieran Smith authored and GitHub committed 2024-01-31 13:21:53 -06:00
1 parent afe046b3b4
commit 76c9e3175b
10 files changed
+16 -20

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ title = "simple config with allowlist for a specific commit"
[[rules]]
description = "AWS Access Key"
id = "aws-access-key"
regex = '''(?:A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
regex = '''(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[rules.allowlist]
commits = ['''allowthiscommit''']