id: truenas-api

info:
  name: TrueNAS API Key (WebSocket)
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/truenas.yml
    - https://www.truenas.com/docs/api/core_websocket_api.html
    - https://www.truenas.com/docs/api/scale_rest_api.html
    - https://www.truenas.com/docs/scale/scaletutorials/toptoolbar/managingapikeys/
    - https://www.truenas.com/docs/scale/scaleclireference/auth/cliapikey/
    - https://www.truenas.com/docs/scale/api/
    - https://www.truenas.com/community/threads/api-examples-in-perl-python.108053/
  metadata:
    verified: true
  tags: truenas,keys,file

file:
  - extensions:
      - all

    extractors:
      - type: regex
        part: body
        regex:
          - '"params"\s*:\s*\[\s*"(\d+-[a-zA-Z0-9]{64})"\s*\]'
# digest: 4a0a00473045022066bf028517e5efd5f4bcc809a5a6fe1405380737774fdf9f35737f93583bf8e60221009b85cb24f1b96f9827e2a2003358583ac6c1957cadefeea5dcf632e48c7c1397:922c64590222798bb761d5b6d8e72950