Skip to content

LS-KEY-006: PKCS8 Encrypted Key

Severity CRITICAL
Blast radius Server access or identity impersonation
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

If the encryption passphrase is also exposed or weak, this provides the same access as an unencrypted private 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 ENCRYPTED PRIVATE KEY-----

Suppress

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

disable_rules: [LS-KEY-006]