Safeguard
Security Guides•

Which credentials should you rotate after a zero-day exploit?

After a zero-day on a server, rotate what that server could read: service accounts, API keys, certificates, tokens and config secrets. A prioritised list.

Safeguard Security Team
3 min read

After a zero-day exploit, rotate every credential the affected system could read or use: secrets in configuration files and environment variables, service account passwords, API keys, tokens, TLS private keys and any stored user credentials. Start with the ones that grant the widest access.

Why rotation is part of the fix

An attacker who ran code on a host can copy whatever it can read. Patching removes the flaw but does not invalidate stolen keys. If you skip rotation, the attacker may return with a valid login.

Find what the host could read

List secrets by where they live.

LocationExamples
Config and environmentDatabase passwords, API keys, cloud access keys
Key stores and filesTLS private keys, SSH keys, signing keys
Memory and sessionsActive session tokens, cached credentials
Connected servicesOAuth grants, service accounts used by the host
Stored user dataPassword hashes, API tokens issued to customers

If the host was a gateway, it may also hold VPN or directory credentials. Edge devices and stored credentials covers why those are high value.

Order of rotation

  1. Privileged and cloud credentials. Anything that can create or change infrastructure.
  2. Credentials to data stores. Databases, object storage, queues.
  3. Keys that sign or encrypt. Certificates, signing keys, token secrets. Rotating these may need coordination.
  4. Service-to-service tokens.
  5. User credentials. Force resets or session invalidation when user secrets were reachable.

Rotate safely

Create the new secret first, deploy it, then revoke the old one. Revoking first causes an outage. Log each rotation with a time stamp. Check access logs for use of the old secret before you revoke it, because use from an unfamiliar address is evidence of compromise.

When you cannot rotate quickly

Some secrets are embedded in devices or partner systems. For these, add monitoring on their use, restrict by network address where possible, and put the rotation on a dated plan.

Prevent the next one

Prefer short lived credentials and a secrets manager over long lived keys in files. Then a stolen secret expires on its own. Safeguard has an agent identity capability for managing credentials issued to AI agents.

Document what you did

Keep a table of each secret, where it lived, when you rotated it and who confirmed the old one no longer works. This is useful for the review and for auditors, and it shows which secrets were hardest to rotate so you can fix that before the next event.

Quick check

Do we rotate if we found no evidence of compromise?

If the host was exposed and held broad secrets, yes, as a precaution. Document the decision either way.

What order do we rotate in?

Start with privileged and cloud credentials, then data store access, then signing keys, then service tokens, then user credentials.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.