Join our Newsletter — 33% off our NHI Course
Home› Guides› NHI Dormancy Detection: Find unused machine identities and…
Guide SOC & Detection Engineering

NHI Dormancy Detection: Find unused machine identities and act without breaking production

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 28 October 2026 13 min read
On this page

Dormant non-human identities are free access for attackers: nobody watches them, their credentials rarely rotate, and the first activity in months is often the intrusion. Yet disabling a service account that a quarterly batch job depends on causes exactly the outage that makes teams stop cleaning up. This guide gives a risk-based method for NHI dormancy: how to define "used" for each platform, which native signals to trust and where they are blind, how to set windows that respect real schedules, and when to disable, quarantine or retire. It also covers the detection side, because a dormant identity that wakes up is one of the strongest NHI alerts a SOC can have. It is for detection engineers, identity operations and cloud platform teams.

Key takeaways

  • Define dormancy per credential, not per identity. An identity can be busy through a role while an old access key or client secret attached to it has not been used for a year; the key is the dormant risk.
  • Know each signal's blind spots. Active Directory lastLogonTimestamp lags real logons, AWS last accessed data covers control plane actions only, and Google Cloud service account insights can miss authentications that Cloud Monitoring catches.
  • Use reversible steps first. Deactivate a key, disable a service account or mark a token invalid before deleting anything; Kubernetes and Google Cloud both build this mark-then-remove pattern into their own tooling.
  • Weight by privilege and exposure. A dormant identity with administrator rights or a credential stored outside a vault goes first; a dormant read-only reporting key can wait for the next cycle.
  • Alert on reactivation. Any authentication by an identity flagged dormant, especially from a new network, should page someone rather than reset a counter.

What "used" means on each platform

Dormancy is the absence of use, so the definition of use decides the result. Native signals differ in what they count, how far back they reach and how quickly they update.

PlatformNative signalCountsBlind spots and lag
AWS access keysCredential report access_key_N_last_used_date; get-access-key-last-usedLast time the key signed an API request, with region and serviceOnly the first two keys per user in the report; repeated uses within 15 minutes record the first; report regenerates at most every four hours
AWS roles and usersLast accessed information; IAM Access Analyzer unused access findingsService access over at least 400 days; unused roles, keys, passwords and permissions within a chosen windowAction-level data is control plane only, not data plane; iam:PassRole not tracked; console lag about four hours
Microsoft Entra service principalsService principal sign-in activity; application credential activity (beta Graph reports)Last sign-in as client or resource, delegated or app-only; last use per credential keyIdPreview APIs; requires Entra ID P1 or P2 to view sign-in data
Microsoft Entra applicationsRecommendation "Remove unused applications"No tokens issued or requested for more than 90 daysExcludes Microsoft-managed apps, token-less scenarios and apps under 90 days old
Google Cloud service accountsService account insights google.iam.serviceAccount.InsightNo authentication in the past 90 daysCloud Monitoring usage metrics can track authentications, such as domain-wide delegation, that insights miss
Kubernetes legacy tokensSecret label kubernetes.io/legacy-token-last-usedDate a legacy Secret-based token was last usedApplies to legacy tokens, not bound projected tokens
Active DirectorylastLogonTimestampDomain logon, replicatedOnly updated when older than msDS-LogonTimeSyncInterval, so it can lag by around two weeks; never-used accounts have no value
SaaS and source control tokensPlatform last-used fields where offered; audit logsVaries by platformSome tokens show "never used" because their use is not counted, for example tokens used only for data ingestion

Where a native signal is weak, build your own from authentication logs in the SIEM: the latest event per credential identifier (access key ID in CloudTrail, appId and key ID in Entra sign-in logs, key ID in Google Cloud audit logs). Take the latest date across all trustworthy sources, and record which source supplied it.

Be careful with "used" for data plane access. A role that only reads objects from storage may show no recent control plane activity in last accessed data while it serves production traffic every minute. Before quarantining an identity that looks idle, confirm against data events (for example object-level logging) or the application's own logs, and treat "no data available" as unknown rather than unused.

Setting dormancy windows

CIS Controls v8.1 Safeguard 5.3 (Disable Dormant Accounts) sets 45 days of inactivity as the point to delete or disable accounts. That suits interactive and frequently scheduled machine identities. Others need a window tied to their real schedule.

Identity classSuggested windowReason
CI/CD and deployment credentials30 to 45 daysPipelines that matter run at least monthly
Application service accounts and workload identities45 daysMatches CIS 5.3; production services authenticate constantly
Second credential on an identity during rotation7 to 14 days after the new one is in useThe old credential should be dormant by design
Integration and SaaS API tokens60 to 90 daysMatches the 90-day thresholds Entra and Google Cloud use
Quarterly or annual jobs, DR and break-glassExplicit exception with next expected run dateDormant by design; monitor every use instead

Store the expected cadence with the identity in the inventory. "Dormant" is then a comparison of last use against expected cadence, not a single global number. See the NHI Inventory Reconciliation guide for combining last-used values from several sources.

Deciding to disable, quarantine or retire

SituationActionWhy
Dormant, privileged, no ownerDisable now; retire after watch periodHighest risk, nobody to ask; outage risk is low if truly unused
Dormant, privileged, owner knownQuarantine with owner notice; retire on approvalOwner confirms before permanent change
Dormant credential on an active identityDeactivate the credential onlyRemoves risk without touching the working identity
Dormant, low privilege, owner knownNotify, then disable at next cycleBatch with the attestation campaign
Dormant but exposed in a leak or breachRevoke the credential immediately regardless of useExposure overrides dormancy logic
Dormant by design (DR, annual job)Keep with exception; alert on every useUse is rare and meaningful

Quarantine here means making the identity unusable while leaving it intact for fast recovery. Use the platform's native reversible control:

  • AWS: set unused access keys to Inactive with aws iam update-access-key --status Inactive; for roles, attach a deny-all inline policy or tighten the trust policy, keeping the original documents in the change record.
  • Google Cloud: gcloud iam service-accounts disable stops applications using the account and can be undone with enable. Google recommends disabling before deleting to confirm nothing critical depends on it. Disable individual user-managed keys where only a key is dormant.
  • Microsoft Entra ID: disable sign-in for the service principal and remove unused client secrets and certificates. For unused applications, Microsoft's recommendation is soft delete, wait 15 days, then permanently delete.
  • Kubernetes: the legacy token cleaner shows the model: it marks unused auto-generated legacy tokens invalid with the kubernetes.io/legacy-token-invalid-since label and deletes them only after a further unused period (one year by default for each stage). Removing the label temporarily restores use.
  • Active Directory: disable the account and move it to a quarantine OU with no group-based access; record its group memberships and SPNs before any change.

Retirement itself (deleting identities, credentials, trust relationships and references) is covered in the NHI Offboarding and Decommissioning Guide.

A phased rollout that does not break production

  1. Report only (weeks 1 to 4). Calculate dormancy for every credential and identity, publish to owners, and measure how many flagged items owners say are still needed. That rate tells you how much to trust your signals.
  2. Credentials first (weeks 4 to 8). Deactivate dormant secondary credentials on identities that are otherwise active: old access keys, expired-rotation client secrets, unused service account keys. The identity keeps working through its current credential, so outage risk is minimal.
  3. Privileged dormant identities (weeks 6 to 10). Quarantine dormant identities with administrative or sensitive data access, with a named on-call contact and a documented re-enable command.
  4. Watch period. Keep quarantined items for at least one full business cycle for their class (a month for most, a quarter where quarterly jobs are suspected). Log any failed authentication against them as a re-enable request or an attack signal.
  5. Retire. Delete after the watch period with owner approval or, for ownerless identities, after the period passes with no claim.
  6. Automate. Run the cycle continuously with the thresholds above and exceptions stored in the inventory.

Rollback: every quarantine action records the exact reverse command and the original policy documents, and the on-call runbook allows re-enabling in minutes without a change board. Fast rollback is what keeps owners co-operating.

Detecting dormant identities that wake up

Reactivation of a dormant NHI is a high-signal detection because legitimate reactivations are rare and usually announced. Build rules on the SIEM's last-seen table per credential identifier:

  • Dormant credential authenticates: any successful authentication by a credential not seen for longer than its window. Raise severity when the source IP, ASN or user agent has never been seen for that identity.
  • Quarantined identity attempts use: failed authentications against deactivated keys or disabled accounts. Either an application needs re-enabling or someone holds a stolen credential.
  • Dormant identity changes permissions: a long-idle identity that suddenly creates keys, edits policies or adds credentials (MITRE ATT&CK T1098.001 Additional Cloud Credentials) is a likely takeover.
  • Exception identities used off schedule: DR and annual-job identities used outside their expected date.
  • Kubernetes invalidated tokens: the audit annotation authentication.k8s.io/legacy-token-invalidated and the metric invalid_legacy_auto_token_uses_total show attempts to use invalidated legacy tokens.

These rules map to T1078.004 Cloud Accounts and, for on-premises service accounts, T1078.002 Domain Accounts. See the NHI Detection Engineering Guide for rule structure and the Service Account Behavioural Baselining Guide for the baselines behind "new source".

Triage of a reactivation alert

  1. Check for a planned change. Look up the identity's owner, expected cadence and any change ticket; DR tests and annual jobs should be in the calendar.
  2. Compare the source. Same host, workload or runner as the last known use is reassuring; a new country, cloud provider or residential network is not.
  3. Look at the first actions. Reconnaissance (listing identities, roles or buckets), credential creation or policy edits in the first minutes are takeover patterns.
  4. Contain if unexplained. Deactivate the credential and quarantine the identity using the same reversible controls as the dormancy process, then confirm with the owner.
  5. Rotate whatever it could reach. If the use was hostile, treat secrets the identity could read as exposed and follow the Leaked Credential Response Playbook.

Small and large organisations

  • Small estates: native reports are enough. A weekly job that pulls the AWS credential report, Entra recommendations and Google Cloud service account insights, plus a SIEM rule on dormant reactivation, covers most of the risk. Quarantine by hand with a shared runbook.
  • Large estates: dormancy needs the reconciled inventory, because last-used dates must be combined across sources and tenants. Automate quarantine for low-risk classes, keep human approval for privileged and production identities, and run the process per business unit so owners see only their own items.
  • Regulated environments: keep evidence of each decision (signal, window, approver, action, reverse command). Auditors asking about CIS 5.3 or NIST AC-2(3) want to see the rule and its exceptions, not only the outcome. See Audit Readiness for AI Agents and NHIs.

Measuring dormancy management

  • Dormant privileged identities: count of dormant identities with administrative or sensitive access (target: zero older than the watch period).
  • Dormant credentials on active identities: unused second keys and secrets; should fall sharply after phase 2.
  • Owner "still needed" rate: share of flagged items owners keep; a high rate means the signal or window is wrong.
  • Quarantine-caused incidents: outages traced to quarantine; aim for zero, and track time to re-enable when they happen.
  • Median dormant age: how long identities sit dormant before action.
  • Reactivation alerts triaged within SLA: share handled within the agreed time.

Framework mapping

FrameworkReferenceRelevance
CIS Controls v8.1Safeguard 5.3 Disable Dormant Accounts; 5.5 Inventory of Service Accounts45-day dormancy rule; owner and review date for service accounts
NIST SP 800-53 Rev 5AC-2(3) Disable Accounts, AC-2, IA-5, AU-6Disable inactive accounts; manage authenticators; review logs
NIST CSF 2.0PR.AA-01, PR.AA-05, DE.CM-03Managed credentials; reviewed permissions; monitoring of technology usage
OWASP Non-Human Identities Top 10 2025NHI1 Improper Offboarding, NHI7 Long-Lived SecretsDormant and long-lived credentials left in place
MITRE ATT&CKT1078.004 Cloud Accounts, T1078.002 Domain Accounts, T1098.001 Additional Cloud CredentialsUse of valid dormant accounts and persistence through new credentials

Common failure patterns

  • Believing a single "unused" signal. The Cloudflare breach started with a service token and three service account credentials that were not rotated after the Okta breach because they were wrongly believed to be unused. Exposed credentials must be rotated whatever the dormancy result.
  • Deleting first. Teams that delete instead of quarantining cause one outage and lose permission to clean up for a year.
  • Measuring identities, not credentials. An active role hides a dormant access key on the same user, and the key is what leaks.
  • Ignoring source control and SaaS tokens. In the Klue OAuth breach, a GitHub personal access token issued in 2022 for an abandoned pilot was still active and was used to inject code into an integration service.
  • Forgotten test environments. The Microsoft Midnight Blizzard breach used a legacy test tenant and a legacy test OAuth application that still had elevated access.
  • Resetting the clock on reactivation. A dormant identity that suddenly authenticates is treated as "active again" by the hygiene job instead of raising an alert.

Practitioner checklist

  • Compute last use per credential identifier from native reports and authentication logs, and record each source's lag.
  • Store expected cadence and dormancy window per identity class, with explicit exceptions for DR and annual jobs.
  • Start in report-only mode and measure the owner "still needed" rate.
  • Deactivate dormant secondary credentials on active identities first.
  • Quarantine dormant privileged identities with a documented, tested re-enable command.
  • Hold a watch period of at least one business cycle before deletion.
  • Revoke exposed credentials immediately, whatever their dormancy status.
  • Alert on any authentication or failed authentication by dormant or quarantined credentials.
  • Report dormant privileged identities and quarantine-caused incidents monthly.

Standards and references

Related NHI Mgmt Group resources: Detection Engineering for Non-Human Identities Guide · NHI Offboarding and Decommissioning Guide · NHI Discovery Across Cloud, SaaS, CI/CD and On-Premises Environments · NHI Ownership Attestation Campaigns Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 28 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.