Agentic AI Module Added To NHI Training Course

What do security teams get wrong about secrets in third-party code and integrations?

They often treat secret rotation as a cleanup task instead of an access-control event. Once a token or key is exposed, the important question is not only where it came from, but what systems still trust it and for how long. Exposure without rapid revocation turns a single leak into persistent identity risk.

Why Security Teams Misread Third-Party Secrets Exposure

Security teams often focus on where a secret was found, instead of where it is still trusted. That is the core mistake. A token in a public commit, ticketing system, or vendor integration is not just an exposure event, it is an access event that can survive long after the leak is discovered. NHIMG research shows that 64% of valid secrets leaked in 2022 are still valid and exploitable today, which is why detection without revocation is incomplete. The pattern is visible in supply-chain incidents such as the Reviewdog GitHub Action supply chain attack and the Shai Hulud npm malware campaign, where exposed secrets became reusable identity material across downstream systems. Current guidance from the OWASP Non-Human Identity Top 10 treats secret handling as an identity control problem, not a housekeeping task.

The operational issue is that third-party code and integrations often inherit trust faster than teams can map it. In practice, many security teams encounter persistent credential misuse only after the integration has already been chained into CI/CD, SaaS automations, or partner workflows, rather than through intentional control design.

How It Works in Practice When Secrets Leave the Codebase

Once a secret appears outside intended storage, the right response is to trace its blast radius, not only rotate it. That means asking which workloads, bots, agents, or vendors can still present that credential, whether it is duplicated elsewhere, and whether the credential has an expiry boundary at all. NHIMG research shows that 62% of all secrets are duplicated and stored in multiple locations, which means a single rotation can fail if every copy is not invalidated. The Guide to the Secret Sprawl Challenge and the 52 NHI Breaches Analysis both show that secrets often persist because ownership is unclear across engineering, security, and platform teams.

  • Classify the secret as an identity, then determine every trust relationship attached to it.
  • Revoke or disable the credential at the source before rotating any replacement.
  • Search code, tickets, chat, logs, build output, and vendor config for duplicate instances.
  • Prefer short-lived, task-bound credentials so exposure window is measured in minutes, not months.
  • Use workload identity where possible, so systems authenticate by cryptographic proof of workload rather than a reusable static token.

The practical goal is to move from static trust to ephemeral trust. That aligns with the OWASP Non-Human Identity Top 10 and with the emerging view in supply-chain defense that credentials embedded in build and integration paths must be continuously revalidated. The CI/CD pipeline exploitation case study illustrates why build systems are especially fragile when long-lived tokens are reused across jobs and environments. These controls tend to break down when secrets are shared across many services because ownership, revocation authority, and inventory data are split across multiple teams.

Where the Standard Answer Breaks Down in Real Environments

Tighter secret controls often increase operational overhead, requiring organisations to balance faster revocation against integration stability. That tradeoff becomes visible in legacy vendor connections, shared service accounts, and environments that still depend on long-lived API keys for automation. In those cases, best practice is evolving, not settled: some teams can adopt just-in-time provisioning quickly, while others need a staged migration because a hard cutover would disrupt production. The 230M AWS environment compromise is a reminder that cloud-scale access paths amplify the damage when one credential is reused too broadly.

There is also a difference between secret leakage and identity misuse. A leaked API key in a low-risk sandbox may still matter if it is accepted by a production-adjacent integration or an over-privileged agent. That is why current guidance suggests pairing secret hygiene with RBAC review, privilege scoping, and expiry enforcement, rather than treating rotation as an isolated event. The Ultimate Guide to NHIs — Static vs Dynamic Secrets is useful here because static secrets are the default failure mode in multi-system integrations. In practice, teams usually learn the hard way that a “rotated” secret is still active wherever the old trust path was never fully removed.

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 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Directly addresses secret rotation, exposure, and revocation for non-human identities.
NIST CSF 2.0 PR.AC-4 Least-privilege access is central when third-party secrets are reused across systems.
NIST Zero Trust (SP 800-207) SC, AC Zero trust helps reduce reliance on static secrets and broad implicit trust.

Treat every leaked secret as an identity event and revoke all trusted copies before issuing replacements.