id: grafana-cloud-token

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

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)\b(glc_[A-Za-z0-9+/]{32,400}={0,2})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4b0a00483046022100f5eece83f6953bec3bea0336f0c54fdc17a9bc0a9001033a15246993ed769557022100ae52164d389487f4bd919a3e8a244b8e2a019eeb6d7f1726dfe79fff0c0277ea:922c64590222798bb761d5b6d8e72950