By NHI Mgmt Group Editorial TeamBased on Truffle Security: “74% of publicly leaked keys are never revoked” (January 10, 2024)

TL;DR: Truffle Security found that 74% of publicly leaked keys were still live or valid 31 days after exposure, and more than half of secrets removed from GitHub were never rotated. Deleting the file is not revocation, so remediation has to target the credential itself, not just the exposure path.


At a glance

What this is: This is a secrets-leak analysis showing that exposed AWS keys often remain usable long after discovery, because file removal and credential revocation are not the same control.

Why it matters: It matters because IAM, PAM, and NHI teams need to treat leaked secrets as active credentials until rotation is complete, not as solved incidents once the repository copy disappears.

By the numbers:

👉 Read Truffle Security's analysis of leaked AWS key validity after exposure


Context

Leaked cloud credentials create a governance gap when organisations confuse hiding the evidence with removing the access path. A secret that still authenticates after exposure remains an active identity asset, even if the file that contained it is gone.

For NHI programmes, the problem is not discovery alone but the failure to convert discovery into revocation, rotation, and verification. Leaked credential and secret incident response should be treated as a lifecycle process, not a cleanup task.


Key questions

Q: What breaks when a leaked secret is only removed from the repository?

A: The control fails because file removal does not revoke the credential. The secret can still authenticate until it is rotated or invalidated at the issuer, which means the attacker may retain access even after the exposure is hidden. Closure should depend on proof that the old value no longer works, not on whether the file is gone.

Q: Why does a leaked API key remain dangerous after the code is removed?

A: A leaked key stays dangerous because copies can persist in forks, clones, package mirrors, commit history, and other downstream systems outside your control. Attackers may also copy and use the key during the exposure window. Once a key is exposed, the safest assumption is that it is compromised until it is rotated and every dependent integration is updated.

Q: What are the signs that a leaked secret has not been remediated properly?

A: A common warning sign is that the exposed file has been removed, but the credential still authenticates successfully. Another sign is that a live key remains active for days after disclosure, which indicates the team focused on cleanup rather than revocation. If automation, cloud access, or application traffic still works with the exposed secret, remediation is incomplete.

Q: Should teams prioritise rotation or repository cleanup after a secret leak?

A: Rotation should take priority because access risk persists until the secret no longer works. Repository cleanup is still important, but it only reduces exposure. If the credential remains valid, the incident is not fully contained and the attacker may still have a usable path into cloud or application resources.


Technical breakdown

Why secret quarantine is not revocation

Quarantine means the leaked credential is harder to find, but revocation means the credential can no longer be used. In cloud environments, deleting a file, removing a repository, or unpublishing a gist only affects exposure, not authentication state. If the API key, token, or password still validates, the attacker can continue to use it until the secret value changes or the binding is invalidated. That is why exposure response must distinguish content removal from credential lifecycle control.

Practical implication: separate repository hygiene from credential invalidation and measure success by authentication failure, not by file removal.

Why leaked secrets persist after exposure is fixed

A leaked secret often survives because the team closes the visible incident rather than the underlying credential. Developers may delete the file, but unless the secret is rotated, every copy remains usable. In practice, the identity system and the source repository are decoupled: the repository change does not propagate to the secret issuer. This creates a hidden window where the organisation thinks exposure ended while the attacker still holds a valid credential. Read Guide to NHI Rotation Challenges.

Practical implication: build a revoke-or-rotate step into the same workflow that flags exposure so the secret cannot outlive the incident.

How leaked credentials create long-tail identity risk

Leaked keys become long-tail risk because they blur incident response, access governance, and asset ownership. A secret discovered in code is not just a code quality issue; it is an identity object with an owner, a scope, and a termination requirement. When no one owns the rotation step, remediation stalls. That failure pattern is what turns a one-time leak into persistent access, especially when the credential has broad cloud permissions or is embedded in CI/CD automation. Read Top 10 NHI Issues.

Practical implication: assign a named owner for every secret and require evidence of revocation before closing the incident.


Threat narrative

Attacker objective: The attacker’s objective is to preserve usable access to cloud or application resources for as long as the leaked credential remains valid.

  1. Entry occurs when a secret is publicly exposed in source control or another public location, making the credential available to anyone who can observe the leak.
  2. Credential access continues because the exposed key remains valid after the file is deleted or hidden, so the attacker can use the credential directly.
  3. Impact follows when the attacker leverages the still-live secret to access cloud resources, automate actions, or persist in the environment before rotation occurs.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Secret exposure is not the breach boundary. The breach boundary is the point at which the credential stops authenticating, not the point at which the file disappears. Truffle Security's analysis shows that teams often close the visible exposure while leaving the underlying access path intact. The practitioner implication is that remediation discipline has to be measured in credential state, not repository state.

Leaked secret remediation is a lifecycle failure, not a hygiene issue. A leaked AWS key becomes an active identity problem the moment it is still valid after exposure. That means ownership, rotation authority, and revocation proof matter more than whether the repository was cleaned up. The implication is that NHI governance has to treat leaked secrets as live accounts with an end-of-life requirement.

Persisting validity creates identity blast radius. When more than half of removed secrets remain live, the blast radius extends far beyond the original commit or file. The organisation may believe the incident is resolved while the attacker still has a functioning credential. The implication is that incident closure criteria need to include cryptographic or authentication invalidation, not just content removal.

Credential quarantine is a broken assumption in many NHI programmes. The assumption that removing the exposed artifact removes the risk was designed for static evidence handling, not for live authentication material. That assumption fails when a secret remains valid after quarantine because the attacker does not need the file, only the credential. The implication is that governance models must stop equating concealment with revocation.

Leaked secret incident response: The most useful concept here is that a leaked secret has two states, exposed and usable, and the second one governs real risk. This article shows that organisations often address the first state and ignore the second. Practitioners should therefore build their response around invalidating the credential itself and proving that no valid copies remain.

From our research library:

What this signals

Credential exposure windows are now a governance metric, not just a detection metric. When a leaked secret stays valid after discovery, the real control question becomes how quickly the organisation can invalidate it and prove that no live copies remain. That shifts accountability from scanning alone to lifecycle enforcement across repositories, build systems, and secret stores.

Leaked secret response needs an ownership model, not a ticket queue. Teams that cannot name the owner of a secret also cannot reliably retire it. The more widely a secret propagates, the more likely cleanup will outpace revocation unless the programme assigns revocation authority as part of the incident path.

Secret blast radius is shaped by persistence, not exposure alone. A secret that remains valid after the file is removed can keep moving through cloud resources, automation, and service integrations. The operational signal is simple: if invalidation is not the closure criterion, the programme is still measuring the wrong thing.


For practitioners

  • Rotate the credential, not just the repository copy Treat every exposed API key, token, or password as valid until the issuing system confirms the value has changed and old copies fail authentication.
  • Assign ownership before closing the incident Require a named owner for the leaked secret and make closure contingent on documented revocation or rotation evidence from the system that issued it.
  • Check for surviving valid copies Search for the same secret in caches, CI variables, build logs, and duplicated repositories because deleting one public file often leaves other valid copies behind.
  • Measure remediation by authentication failure Use failed validation of the old secret as the proof point, not the disappearance of the leaked file from public view.

Key takeaways

  • Leaked secrets remain an active identity risk until the credential itself is revoked, not merely hidden or deleted from source control.
  • The article shows that 74% of leaked keys were still live after 31 days, which means discovery without invalidation leaves a long attack window.
  • The practical control is proof of invalidation, supported by owner assignment and rotation evidence, before an incident can be closed.

Related NHI Mgmt Group resources: Leaked Credential and Secret Incident Response Playbook · Guide to NHI Rotation Challenges · Ultimate Guide to NHIs: Key Challenges and Risks · 17,000+ Secrets Exposed in Public GitLab Repositories


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 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe article is about exposed secrets that remain usable after public disclosure.
NHI-07 — Long-Lived SecretsThe core failure is that leaked keys remain valid for weeks after exposure.
Recommendation — Scan for leaked NHI secrets and revoke any valid exposures immediately. Shorten secret lifetime and enforce rotation when exposure is detected.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementAuthenticator lifecycle control governs rotation and invalidation of exposed credentials.
Recommendation — Apply IA-5 to ensure exposed authenticators are changed and retired promptly.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsLeaked keys are live authorizations until the secret is revoked.
Recommendation — Review and remove entitlements tied to exposed credentials before closure.
MITRE ATT&CKTA0006 — Credential AccessLeaked keys enable attacker credential access rather than forcing exploitation.
Recommendation — Hunt for exposed credentials as TA0006 events and prioritize revocation.

Key terms

  • Secrets Leakage: Secrets leakage is the exposure of credentials such as API keys, tokens, or certificates in places where they can be discovered and reused. The risk is not just disclosure, but unauthorized authentication that turns a coding or pipeline mistake into active access.
  • Credential Revocation: Credential revocation is the process of disabling a secret, token, or key so it can no longer authenticate or authorize action. It is the operational half of detection, because exposed credentials remain dangerous until they are invalidated and replaced across every dependent system.
  • Rotation Window: A rotation window is the period in which a secret must be replaced, such as seven or thirty days after creation. The window defines policy intent, but it does not guarantee enforcement. Security teams need monitoring that detects when a secret remains unchanged beyond its allowed lifetime.
  • Identity Blast Radius: The amount of damage a compromised identity can cause across systems, data, and infrastructure. In NHI environments, it is shaped by permissions, network reach, and administrative capability rather than by the credential alone. Reducing blast radius is a containment strategy that limits lateral movement and data exposure.

What's in the full report

Truffle Security's full article covers the operational detail this post intentionally leaves for the source:

  • The 31-day tracking method used to measure whether leaked keys were still valid after exposure
  • The difference between unpublishing a file and actually rotating the leaked secret
  • How many exposed secrets were still public, still valid, or both at the end of the observation period
  • The surrounding Forager and HowToRotate.com context for teams that need remediation workflows

👉 The full Truffle Security post covers the 31-day tracking method and the mismatch between file cleanup and key revocation.

Deepen your knowledge

NHI governance, secrets management, and workload identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on October 19, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org