id: grafana-serviceaccount-token

info:
  name: Grafana Service Account Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/grafana-service-account-token.yaml
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/grafana-service-account-token.go
    - https://grafana.com/docs/grafana/latest/administration/service-accounts/
  metadata:
    verified: true
    max-request: 1
  tags: grafana,exposure,tokens,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4b0a00483046022100e065ffbb7db72f92f64f6cafd5f7b89a47274bf61a330fea065465aeba92ffa6022100e848b0a2bccd61905a9bbde4b77a1ef872ef0d7533e898d0baf6a64a05f93535:922c64590222798bb761d5b6d8e72950