id: npm-accesstoken

info:
  name: NPM Access Token (fine-grained)
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/npm.yml
    - https://docs.npmjs.com/about-access-tokens
    - https://github.com/github/roadmap/issues/557
    - https://github.blog/changelog/2022-12-06-limit-scope-of-npm-tokens-with-the-new-granular-access-tokens/
  metadata:
    verified: true
  tags: keys,file,npm,token
file:
  - extensions:
      - all

    extractors:
      - type: regex
        part: body
        regex:
          - "\b(npm_[A-Za-z0-9]{36})\b"
# digest: 4b0a00483046022100bd9dfe404f077477d6595c20c441212efbb7f9d32e28d0bb39bd0f426b049da30221008dc3cf8cc167688d5554eff601676cb14673f550785a957134c05e3f6a3eb652:922c64590222798bb761d5b6d8e72950