id: databricks-token

info:
  name: Databricks API Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/databricks-api-token.yaml
    - https://github.com/returntocorp/semgrep-rules/blob/develop/generic/secrets/gitleaks/databricks-api-token.go
    - https://docs.databricks.com/en/dev-tools/auth/pat.html
  metadata:
    verified: true
    max-request: 1
  tags: databricks,exposure,tokens

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)\b(dapi[a-h0-9]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)
# digest: 4b0a00483046022100e9c41ceb894a9db995fdfc0467f37d51cce7ea039c2ee2cf2781eb60b594c3a60221009aa4b89e68e62b15f6e09f56d9762ea6ce09ed1ea67fb337a2fae490b1fd7ae9:922c64590222798bb761d5b6d8e72950