Skip to content

LS-KEY-004: OpenSSH Private Key

Severity CRITICAL
Blast radius Server access
Rotate at https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

If this leaks

Grants direct SSH access to every server and account that trusts the matching public key.

What to do

  1. Rotate or revoke the credential at https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.
  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

-----BEGIN OPENSSH PRIVATE KEY-----

Suppress

On one line: # leakscan:ignore LS-KEY-004. For the whole project:

disable_rules: [LS-KEY-004]