What a Private key looks like
A block of base64 between -----BEGIN … PRIVATE KEY----- and -----END … PRIVATE KEY----- lines, with RSA, EC, OPENSSH or nothing in between. Public keys and certificates use the same armour but say PUBLIC KEY or CERTIFICATE; those are safe to share.
A fake example, in the right format:
-----BEGIN PRIVATE KEY-----
MIIEvFAKEFAKEFAKEDEMOONLY…
-----END PRIVATE KEY-----ScrubLogs replaces it with <PRIVATE_KEY_1>.
Why a leak is dangerous
With a TLS private key an attacker can impersonate your server; with an SSH key, log into every machine that trusts it; with a signing key, publish releases as you.
If yours leaked: rotate it
Redacting a copy doesn’t un-leak the original. If the real value was shared anywhere, replace it:
- Generate a new key pair. Don’t reuse the old one.
- Install the new key and remove the old public key everywhere it is trusted: authorized_keys, GitHub deploy keys, CI.
- For TLS, ask your certificate authority to revoke the old certificate and issue a new one.