Join our Newsletter — 33% off our NHI Course

What should teams do when a service is decommissioned but secrets may remain active?

They should treat decommissioning as a secret retirement event, not just an infrastructure change. Every associated token, key, certificate, and environment reference should be revoked or deleted as part of the shutdown path, because orphaned credentials often outlive the workload and remain usable in adjacent systems.

What decommissioning should include when secrets may still be live

Shutdown is not complete when the workload disappears. If a service ever used API keys, certificates, tokens, SSH keys, or other secret material, the decommissioning workflow should include retirement of those credentials, removal of any stored references, and confirmation that no dependent system can still authenticate with them.

The practical test is simple: if the service could still be called, signed, or queried with that material after the workload is gone, the decommission was incomplete. Treat the shutdown path as a credential lifecycle event, not an infrastructure ticket closure.

Why orphaned secrets remain a real security problem

Orphaned secrets create a hidden access path. Even when the owning service is offline, an unreclaimed token or key can still authenticate to adjacent platforms, CI/CD systems, third-party APIs, storage layers, or admin consoles. That creates avoidable blast radius because the secret often outlives the asset that once justified it.

Long-lived credentials are especially dangerous when they are embedded in environment variables, deployment descriptors, configuration stores, or application documentation. A team may believe the risk ended with the decommission, while the credential remains valid and discoverable elsewhere in the stack.

In practice, the security issue is not only theft. Forgotten secrets also create governance gaps, because nobody can confidently answer who owns the credential, where it is used, or whether it should still exist.

What good shutdown hygiene looks like

Decommissioning should pair asset removal with explicit credential retirement. That means revoking tokens, deleting unused keys, expiring or rotating certificates, clearing secret references from config and automation, and checking vaults, pipelines, container definitions, and secret scanners for leftovers.

Where possible, teams should prefer short-lived or dynamically issued credentials so the shutdown event naturally collapses access. For static secrets, the shutdown checklist needs a forced validation step, because deletion of the application does not automatically delete the authentication material it used.

For broader guidance on reducing secret sprawl and shortening credential lifetime, Secrets Management Guide is a useful starting point. Teams that need a deeper model of lifecycle and offboarding can also use Ultimate Guide to NHIs to connect service credentials back to the identities they represent.

Risk and Threat Considerations

Residual secrets are a post-decommission access path. If they remain active, an attacker who later finds them in logs, repos, backups, images, or configuration exports may gain a credential that no one is watching closely anymore. That makes retired services a common source of stale but still usable access.

Failure mechanism: The asset is removed, but the credential lifecycle is not completed. Inactive references, unrevoked tokens, and unexpired certificates preserve trust in systems that are no longer operationally owned.

Impact: Unauthorized access, lateral movement, and delayed detection become more likely because the organization assumes the service is gone while the secret remains valid elsewhere. This can also complicate incident response, since teams may not know that a retired integration is still an active entry point.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 addresses the attack surface, NIST SP 800-53 Rev 5 sets the technical controls, and ISO/IEC 27001:2022 defines the regulatory obligations.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-01 — Improper Offboarding Service shutdown must retire related secrets and access paths.
NHI-02 — Secret Leakage Orphaned secrets remaining after shutdown are a leakage risk.
NHI-07 — Long-Lived Secrets Residual validity after decommissioning is a long-lived secret problem.
Recommendation — Revoke and delete all credentials during decommissioning to prevent orphaned access. Scan shutdown outputs and residual stores for exposed secrets and remove them. Replace static secrets with short-lived credentials and expire remaining long-lived ones.
NIST SP 800-53 Rev 5 IA-5 — Authenticator Management Credential retirement and revocation are central to this shutdown task.
Recommendation — Retire authenticators promptly and verify revocation across dependent systems.
ISO/IEC 27001:2022 A.5.16 — Identity management Decommissioning must remove identity credentials tied to the service.
Recommendation — Remove or invalidate identities and credentials when the service is retired.

Practitioner Guidance

What to verify: Do not trust an application shutdown until you can show that the corresponding secrets were revoked, deleted, or cryptographically invalidated. The proof should cover every place the secret could persist, not only the primary runtime.

Implementation sequence:

  • Identify every credential type the service used.
  • Revoke or rotate each credential before or during shutdown.
  • Remove secret references from automation, configuration, backups, and documentation.
  • Confirm no dependent integration still authenticates with the retired material.
  • Record the retirement evidence so future audits can distinguish a dead service from a live secret.

Practitioner takeaway: If decommissioning does not end credential validity, the service is not truly retired from a security perspective; it is only retired from production visibility.