id: sendgrid-api-key

info:
  name: Sendgrid API Key Disclosure
  author: Ice3man,DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/sendgrid-api-token.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/sendgrid-api-token.yaml
    - https://docs.sendgrid.com/ui/account-and-settings/api-keys
  metadata:
    max-request: 1
  tags: exposure,token,sendgrid

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)\b(SG\.(?i)[a-z0-9=_\-\.]{66})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 490a0046304402206bfb20e801260c6f4106dd3a18249ad432dfa6a5e0f626e2d8ae896c8e9e94f302202e5fdaab6b48b120ff25210fe19beb1308a4535f0ec7050a3532f2374da5234f:922c64590222798bb761d5b6d8e72950