id: segment-public-token

info:
  name: Segment Public API Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/segment.yml
    - https://segment.com/docs/api/public-api/
    - https://segment.com/blog/how-segment-proactively-protects-customer-api-tokens/
  metadata:
    verified: true
    max-request: 1
  tags: segment,token,exposure

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

    extractors:
      - type: regex
        part: body
        regex:
          - '(sgp_[a-zA-Z0-9]{64})'
# digest: 4b0a00483046022100f83aa7c6bdde5951950de9c58547fb9ce6435a92349ffa3da618a3ec87824b370221009a1ad530d6f270efadd9bd8f2e4b52fff57a7b2e45660080e38092a9bb394aae:922c64590222798bb761d5b6d8e72950