id: adafruit-api-key

info:
  name: Adafruit API Key
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/adafruit-api-key.yaml
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/adafruit-api-key.go
    - https://io.adafruit.com/api/docs
  classification:
    cwe-id: CWE-522,CWE-540
  metadata:
    verified: true
    max-request: 1
  tags: adafruit,exposure,tokens,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)(?:adafruit)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9_-]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4b0a00483046022100dc6ce0c68da6a6ba28e61cbb4e6655391906db8581d89b65ba1dabdd897ed3fe022100d53d7243d9c4d7b700451d8d874c471e86e31f9b21887b6a961981e5f61e6991:922c64590222798bb761d5b6d8e72950