Skip to content

LS-GEN-006: Private Key File Path

Severity MEDIUM
Blast radius Information disclosure (key location)
Rotate at https://vasishta03.github.io/leakscan/rules/

If this leaks

This itself is just a file path, but it points to where a private key is stored on disk, useful information for an attacker who already has some access.

What to do

  1. Rotate or revoke the credential at https://vasishta03.github.io/leakscan/rules/.
  2. Check the provider's audit logs for use you don't recognise.
  3. Remove it from git history (leakscan purge --help) and load it from an environment variable or secret manager instead.

Pattern

(?i)(?:identity_file|private_key(?:_file)?)\s*[=:]\s*['\"]?([~\/][^\s'\"]+\.pem)['\"]?

Suppress

On one line: # leakscan:ignore LS-GEN-006. For the whole project:

disable_rules: [LS-GEN-006]