title: Web Server Serving OAuth2 JWT SAML Signing Keys or Merchant mTLS Bundles id: 7c48a1b2-93d4-4e61-a801-954800100001 status: experimental description: Detects HTTP 200 or 206 responses serving files with private-key, PKCS12 keystore, certificate, or debug-log extensions (.key, .pem, .p12, .pfx, .log) from a web server. author: Odin by Brandefense date: 2026-11-21 references: - https://attack.mitre.org/techniques/T1552/004/ - https://attack.mitre.org/techniques/T1606/002/ logsource: category: webserver detection: selection_status: sc-status: - 200 - 206 selection_uri: cs-uri-stem|endswith: - '.key' - '.pem' - '.p12' - '.pfx' - '.log' condition: selection_status and selection_uri falsepositives: - Publicly served X.509 certificate (.pem) downloads or test fixtures; private signing keys, PKCS12 keystores, and debug logs must never be served over HTTP. level: critical tags: - attack.credential-access - attack.t1552.004 - attack.t1606.002 --- title: Ad-Hoc HTTP Directory Server or Permissive Mode Change on Signing Keys id: 7c48a1b2-93d4-4e61-a801-954800100002 status: experimental description: Detects ad-hoc Python or PHP HTTP directory servers or chmod invocations referencing key or PKCS12 keystore extensions (.key, .pem, .p12, .pfx) on Linux application servers. author: Odin by Brandefense date: 2026-11-21 references: - https://attack.mitre.org/techniques/T1552/004/ logsource: product: linux category: process_creation detection: selection_http_listener: Image|endswith: - '/python' - '/python3' - '/php' CommandLine|contains: - '-m http.server' - 'SimpleHTTPServer' - '-S 0.0.0.0:' selection_key_chmod: Image|endswith: - '/chmod' CommandLine|contains: - '.key' - '.pem' - '.p12' - '.pfx' filter_approved_hosts: ComputerName: - 'pki-vault-builder-01.corp.example' - 'ci-artifact-signer-01.corp.example' condition: (selection_http_listener or selection_key_chmod) and not filter_approved_hosts falsepositives: - Dedicated PKI build or CI signing runners explicitly listed in filter_approved_hosts. level: high tags: - attack.credential-access - attack.t1552.004 --- title: Signing Key or Merchant PKCS12 Bundle Written Inside Public Web Root id: 7c48a1b2-93d4-4e61-a801-954800100003 status: experimental description: Detects creation of private key or PKCS12 keystore files (.key, .pem, .p12, .pfx) directly inside web server document roots (/var/www/, /public_html/, /htdocs/). author: Odin by Brandefense date: 2026-11-21 references: - https://attack.mitre.org/techniques/T1552/004/ - https://www.rfc-editor.org/rfc/rfc7519 logsource: product: linux category: file_event detection: selection_public_dir: TargetFilename|contains: - '/var/www/' - '/public_html/' - '/htdocs/' selection_key_ext: TargetFilename|endswith: - '.key' - '.pem' - '.p12' - '.pfx' filter_approved_hosts: ComputerName: - 'pki-vault-builder-01.corp.example' - 'ci-artifact-signer-01.corp.example' condition: selection_public_dir and selection_key_ext and not filter_approved_hosts falsepositives: - None expected inside public document roots; store keys outside document root with 0600 permissions. level: high tags: - attack.credential-access - attack.t1552.004