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/
  metadata:
    verified: true
    max-request: 1
  tags: grafana,exposure,tokens

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: 4a0a00473045022100fdb73b24eca75581e49a09c6aa04d33a0f61372e3f393f6b08eb07bae1484b6a022048c37dfdafa8f3802246cb13a1c173bcfa8e59dca0c76104192a67f967241141:922c64590222798bb761d5b6d8e72950