id: snyk-api-token

info:
  name: Snyk API Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/snyk-api-token.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/snyk-api-token.yaml
  metadata:
    verified: true
    max-request: 1
  tags: snyk,exposure,tokens,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)(?:snyk_token|snyk_key|snyk_api_token|snyk_api_key|snyk_oauth_token)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4b0a00483046022100e7bf16203a2808813af05111fbacf30efad68390ae1ef92e2daea2128f586308022100f55d76a0c742c75add51fd871da9835b60c1d32e3e074b304c48c220e95abb6d:922c64590222798bb761d5b6d8e72950