simple_regex_and_allowlist_config.toml 834 B

12345678910111213
  1. # This config contains a single rule that checks for AWS keys. However, it also contains a allowlist table
  2. # where you can define one or more allowlists. What this means is that if you have an example AWS key as part of your
  3. # code (in a test for example), then you can allowlist that specific key so gitleaks will not label it as a leak.
  4. # If this line was present in a git history: `aws_access_key_id='AKIAIO5FODNN7EXAMPLE``, gitleaks would match this line
  5. # with the rule below, but since we have a allowlist against that specific key, it would be ignored.
  6. [[rules]]
  7. description = "AWS Access Key"
  8. regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
  9. tags = ["key", "AWS"]
  10. [rules.allowlist]
  11. regexes = ['''AKIAIO5FODNN7EXAMPLE.*''']
  12. description = "ignore example aws key"