base64_encoded.toml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # We want to be able to find this key regardless if it's b64 encoded or not
  2. [[rules]]
  3. id = 'private-key'
  4. description = 'Private Key'
  5. regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]*?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----'''
  6. tags = ['key', 'private']
  7. keywords = [
  8. '-----begin',
  9. ]
  10. # This exists to test what would happen if a normal rule matched something that
  11. # also gets decoded. We don't want to break anyone's existing rules that might
  12. # be looking for specific segments of b64 encoded data.
  13. [[rules]]
  14. id = 'b64-encoded-private-key'
  15. description = 'Private Key'
  16. regex = '''(?:LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0t|0tLS0tQkVHSU4gUFJJVkFURSBLRVktLS0tL|tLS0tLUJFR0lOIFBSSVZBVEUgS0VZLS0tLS)[a-zA-Z0-9+\/]+={0,3}'''
  17. tags = ['key', 'private']
  18. keywords = [
  19. 'ls0tls1crudjtibquklwqvrfietfws0tls0t',
  20. '0tls0tqkvhsu4gufjjvkfursblrvktls0tl',
  21. 'tls0tlujfr0loifbssvzbveugs0vzls0tls',
  22. ]
  23. [[rules]]
  24. id = 'aws-iam-unique-identifier'
  25. description = 'AWS IAM Unique Identifier'
  26. # The funky not group at the beginning consists of ascii ranges
  27. regex = '''(?:^|[^!$-&\(-9<>-~])((?:A3T[A-Z0-9]|ACCA|ABIA|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16})\b'''
  28. tags = ['aws', 'identifier']
  29. entropy = 3.2
  30. secretGroup = 1
  31. keywords = [
  32. 'a3t',
  33. 'abia',
  34. 'acca',
  35. 'agpa',
  36. 'aida',
  37. 'aipa',
  38. 'akia',
  39. 'anpa',
  40. 'anva',
  41. 'aroa',
  42. 'asia',
  43. ]
  44. [[rules]]
  45. id = 'aws-secret-access-key'
  46. description = 'AWS Secret Access Key'
  47. regex = '''(?i)aws[\w\-]{0,32}[\'\"]?\s*?[:=\(]\s*?[\'\"]?([a-z0-9\/+]{40})\b'''
  48. tags = ['aws', 'secret']
  49. entropy = 4
  50. secretGroup = 1
  51. keywords = [
  52. 'aws',
  53. ]
  54. [[rules]]
  55. # Use a small one for making sure things shifting around are kept up with
  56. # appropriately
  57. id = 'small-secret'
  58. description = 'Small Secret'
  59. regex = '''\bsmall-secret\b'''
  60. tags = ['small', 'secret']
  61. [[rules]]
  62. # When the example value is decoded this will overlap and this is here to
  63. # test that the location information is reported accurately when the match
  64. # goes outside the bounds of the encoded value
  65. id = 'overlapping'
  66. description = 'Overlapping'
  67. regex = '''secret=(decoded-secret-value)'''
  68. tags = ['overlapping']
  69. secretGroup = 1