Appearance
Why It Matters
SEC312 flags markdown that contains committed private key material in PEM form.
Unlike general secret-pattern heuristics, this rule looks for real PEM private-key markers. That makes it a much stronger signal that sensitive key material has been committed into documentation or examples.
What Triggers
SEC312 triggers when markdown contains a PEM-style private key marker such as:
-----BEGIN RSA PRIVATE KEY----------BEGIN OPENSSH PRIVATE KEY----------BEGIN EC PRIVATE KEY----------BEGIN PRIVATE KEY-----
Example that triggers:
pem
-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----Examples that stay clean:
- public key PEM blocks such as
-----BEGIN PUBLIC KEY----- - search-string literals like
memory search "BEGIN RSA PRIVATE KEY" - obviously redacted placeholders such as
example private key
False Positives
This is one of the cleaner markdown security signals because it requires a real PEM private-key marker instead of a generic substring. Recent fixes explicitly stopped matching search-string literals like "BEGIN RSA PRIVATE KEY" without PEM framing.
Remediation
Remove the private key from the repository, rotate the affected credential if it was real, and replace the example with a redacted placeholder or non-sensitive public material.