Subscribe to the Non-Human & AI Identity Journal

How should security teams protect non-human identities from infostealers?

Security teams should reduce the value of any stolen credential by combining secret discovery, short-lived issuance, runtime attestation, and narrow authorization scope. The goal is not to prevent every theft. It is to make stolen NHI material expire quickly and fail outside the context where it was issued.

Why This Matters for Security Teams

Infostealers do not need a perfect environment to cause damage. They only need one exposed token, API key, certificate, or cached secret that still works long enough to be reused. For NHI security, the core problem is that stolen material often has too much scope and too much lifespan. That is why current guidance favors secret discovery, short-lived issuance, runtime attestation, and tight authorization boundaries over static credential protection alone.

NHI exposure also tends to hide inside build systems, cloud automation, scripts, and third-party integrations. The research gap is well documented: 91.6% of secrets remain valid five days after notification, which gives attackers a wide reuse window even when defenders know the secret has leaked. NHI Mgmt Group has also shown how frequently organizations store secrets outside proper managers and how often those secrets remain over-privileged. The issue is not just theft. It is the speed at which stolen identity material can be replayed before controls react. See The State of Non-Human Identity Security and NIST Cybersecurity Framework 2.0 for the governance lens.

In practice, many security teams encounter compromise only after an infostealer has already turned a stale secret into a live foothold.

How It Works in Practice

The most effective response is to reduce the value of any secret that can be copied. Start with discovery: find credentials embedded in code, config files, CI/CD variables, developer endpoints, and unmanaged vaults. Then replace long-lived secrets with short-lived issuance wherever possible. If an NHI must authenticate, issue the credential for a narrow purpose and a narrow time window, then revoke it automatically when the task ends.

That model works best when identity is tied to runtime proof, not just possession of a token. For workload-based NHIs, use attestation, workload identity, and policy decisions that evaluate context at request time. Current best practice is to combine those checks with least privilege, but there is no universal standard for every platform yet. The practical aim is to make a stolen secret fail outside the environment, workload, or time period in which it was issued. That is why guidance from NIST Cybersecurity Framework 2.0 pairs well with incident patterns seen in the JetBrains GitHub plugin token exposure case and the Schneider Electric credentials breach.

  • Inventory all secrets and service accounts, then remove any credential that is not actively needed.
  • Prefer JIT issuance and ephemeral tokens over static keys in code or pipelines.
  • Bind each credential to a workload identity, environment, or attested runtime state.
  • Use RBAC only as a baseline, then narrow scope with contextual checks at request time.
  • Alert on token use outside normal geographies, runtimes, and service boundaries.

These controls tend to break down when legacy automation depends on shared secrets across many tools because revocation and scoping become operationally brittle.

Common Variations and Edge Cases

Tighter secret controls often increase deployment overhead, requiring organisations to balance faster revocation against developer and platform friction. That tradeoff is real in CI/CD, service mesh, and cross-cloud environments where teams still depend on static credentials for compatibility. Current guidance suggests treating those cases as migration targets rather than permanent exceptions.

One common edge case is third-party access. If an external tool or vendor integration cannot support short-lived identity, the blast radius should be constrained with dedicated accounts, strict network boundaries, and explicit review intervals. Another is emergency recovery access. Break-glass paths may still require longer-lived secrets, but they should be rare, monitored, and rotated immediately after use. For modern NHI programs, the important question is not whether a secret can be stolen. It is whether the stolen secret can still authorize anything useful when replayed. That is why the visibility and rotation issues highlighted in The State of Non-Human Identity Security matter so much in operational terms.

In environments with many unmanaged scripts, shadow automation, or vendor-managed integrations, even strong policy will fail if teams cannot discover where credentials live or who can still use them.

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 and reducing reusable credential value.
NIST CSF 2.0 PR.AC-4 Least-privilege access is essential when stolen secrets are replayed.
NIST Zero Trust (SP 800-207) Zero Trust supports runtime verification before allowing NHI actions.

Rotate NHI secrets aggressively and replace static credentials with short-lived issuance.