id: azure-connection-string

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
  tags: file,keys,azure,token

file:
  - extensions:
      - all

    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: 4a0a00473045022100994ab57a929f072482d3df4fc0b075b268d7a922bf6bd29646d928c3dafd6cd3022010f10a268f45d2e9a5b229610791cba4d19fc98d984989926a7237f0bf5113d4:922c64590222798bb761d5b6d8e72950