id: private-key

info:
  name: Private Key Detect
  author: 302Found
  severity: high

file:
  - extensions:
      - all

    extractors:
      - type: regex
        regex:
          - "\"BEGIN OPENSSH PRIVATE KEY\""
          - "\"BEGIN PRIVATE KEY\""
          - "\"BEGIN RSA PRIVATE KEY\""
          - "\"BEGIN DSA PRIVATE KEY\""
          - "\"BEGIN EC PRIVATE KEY\""
          - "\"BEGIN PGP PRIVATE KEY BLOCK\""
          - "\"ssh-rsa\""