id: azure-connection

info:
  name: Azure Connection String
  author: DhiyaneshDK
  severity: info
  reference:
    - https://github.com/praetorian-inc/noseyparker/blob/main/crates/noseyparker/data/default/rules/azure.yml
    - https://azure.microsoft.com/en-us/blog/windows-azure-web-sites-how-application-strings-and-connection-strings-work/
    - https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string
  metadata:
    verified: true
    max-request: 1
  tags: azure,exposure,token,vuln

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

    extractors:
      - type: regex
        part: body
        regex:
          - (?i)(?:AccountName|SharedAccessKeyName|SharedSecretIssuer)\s*=\s*([^;]{1,80})\s*;\s*.{0,10}\s*(?:AccountKey|SharedAccessKey|SharedSecretValue)\s*=\s*([^;]{1,100})(?:;|$)
# digest: 490a00463044022057f6a7f6d0a67c3c8995d833c70549041624ec00d5c2f48f69c17595f963010f022078d6ffe635f43c3ab10d3605c326aa3d0d3fe615f0dc2ee55b97ebd1e111600d:922c64590222798bb761d5b6d8e72950