id: particle-access-token

info:
  name: particle.io Access Token
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/particle.io.yml
    - https://docs.particle.io/reference/cloud-apis/api/
  metadata:
    verified: true
    max-request: 1
  tags: particle,exposure,tokens

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

    extractors:
      - type: regex
        part: body
        regex:
          - 'https://api\.particle\.io/v1/[a-zA-Z0-9_\-\s/"\\?]*(?:access_token=|Authorization:\s*Bearer\s*)\b([a-zA-Z0-9]{40})\b'
          - '(?:access_token=|Authorization:\s*Bearer\s*)\b([a-zA-Z0-9]{40})\b[\s"\\]*https://api\.particle\.io/v1'
# digest: 4b0a004830460221009b80268c4d7ca9c3d8d14a354ec46543ea2ca09273c9629e3514f8ff0e41f1ac022100b3c732bed510cf3f4825667d582c04487835152bfabe97a7773eb2999bc5bbdc:922c64590222798bb761d5b6d8e72950