id: openai-api-key

info:
  name: OpenAI API Key
  author: DhiyaneshDK,Chemo850
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/builtin/rules/openai.yml
    - https://platform.openai.com/docs/api-reference
    - https://platform.openai.com/docs/api-reference/authentication
    - https://platform.openai.com/settings/organization/api-keys
  metadata:
    verified: true
    max-request: 1
  tags: openai,token,exposure,vuln,ai

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

    extractors:
      - type: regex
        part: body
        regex:
          - "(sk-[a-zA-Z0-9]{48})"
          - "sk-proj-[A-Za-z0-9_-]{74}T3BlbkFJ[A-Za-z0-9_-]{74}"
# digest: 4b0a00483046022100f450467c78ca9066858a9c63097152b0c7c2ae28166ffcec3c1484aacf39a106022100871dbae6a37f02901eabb9ba486132d663f8b20a17eaf4dbf780aa2280decfd2:922c64590222798bb761d5b6d8e72950