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
lastLogonTimestamplags 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.
| Platform | Native signal | Counts | Blind spots and lag |
|---|---|---|---|
| AWS access keys | Credential report access_key_N_last_used_date; get-access-key-last-used | Last time the key signed an API request, with region and service | Only 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 users | Last accessed information; IAM Access Analyzer unused access findings | Service access over at least 400 days; unused roles, keys, passwords and permissions within a chosen window | Action-level data is control plane only, not data plane; iam:PassRole not tracked; console lag about four hours |
| Microsoft Entra service principals | Service 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 keyId | Preview APIs; requires Entra ID P1 or P2 to view sign-in data |
| Microsoft Entra applications | Recommendation "Remove unused applications" | No tokens issued or requested for more than 90 days | Excludes Microsoft-managed apps, token-less scenarios and apps under 90 days old |
| Google Cloud service accounts | Service account insights google.iam.serviceAccount.Insight | No authentication in the past 90 days | Cloud Monitoring usage metrics can track authentications, such as domain-wide delegation, that insights miss |
| Kubernetes legacy tokens | Secret label kubernetes.io/legacy-token-last-used | Date a legacy Secret-based token was last used | Applies to legacy tokens, not bound projected tokens |
| Active Directory | lastLogonTimestamp | Domain logon, replicated | Only updated when older than msDS-LogonTimeSyncInterval, so it can lag by around two weeks; never-used accounts have no value |
| SaaS and source control tokens | Platform last-used fields where offered; audit logs | Varies by platform | Some 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 class | Suggested window | Reason |
|---|---|---|
| CI/CD and deployment credentials | 30 to 45 days | Pipelines that matter run at least monthly |
| Application service accounts and workload identities | 45 days | Matches CIS 5.3; production services authenticate constantly |
| Second credential on an identity during rotation | 7 to 14 days after the new one is in use | The old credential should be dormant by design |
| Integration and SaaS API tokens | 60 to 90 days | Matches the 90-day thresholds Entra and Google Cloud use |
| Quarterly or annual jobs, DR and break-glass | Explicit exception with next expected run date | Dormant 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
| Situation | Action | Why |
|---|---|---|
| Dormant, privileged, no owner | Disable now; retire after watch period | Highest risk, nobody to ask; outage risk is low if truly unused |
| Dormant, privileged, owner known | Quarantine with owner notice; retire on approval | Owner confirms before permanent change |
| Dormant credential on an active identity | Deactivate the credential only | Removes risk without touching the working identity |
| Dormant, low privilege, owner known | Notify, then disable at next cycle | Batch with the attestation campaign |
| Dormant but exposed in a leak or breach | Revoke the credential immediately regardless of use | Exposure overrides dormancy logic |
| Dormant by design (DR, annual job) | Keep with exception; alert on every use | Use 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 disablestops applications using the account and can be undone withenable. 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-sincelabel 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
- 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.
- 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.
- 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.
- 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.
- Retire. Delete after the watch period with owner approval or, for ownerless identities, after the period passes with no claim.
- 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-invalidatedand the metricinvalid_legacy_auto_token_uses_totalshow 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
- 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.
- 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.
- Look at the first actions. Reconnaissance (listing identities, roles or buckets), credential creation or policy edits in the first minutes are takeover patterns.
- Contain if unexplained. Deactivate the credential and quarantine the identity using the same reversible controls as the dormancy process, then confirm with the owner.
- 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
| Framework | Reference | Relevance |
|---|---|---|
| CIS Controls v8.1 | Safeguard 5.3 Disable Dormant Accounts; 5.5 Inventory of Service Accounts | 45-day dormancy rule; owner and review date for service accounts |
| NIST SP 800-53 Rev 5 | AC-2(3) Disable Accounts, AC-2, IA-5, AU-6 | Disable inactive accounts; manage authenticators; review logs |
| NIST CSF 2.0 | PR.AA-01, PR.AA-05, DE.CM-03 | Managed credentials; reviewed permissions; monitoring of technology usage |
| OWASP Non-Human Identities Top 10 2025 | NHI1 Improper Offboarding, NHI7 Long-Lived Secrets | Dormant and long-lived credentials left in place |
| MITRE ATT&CK | T1078.004 Cloud Accounts, T1078.002 Domain Accounts, T1098.001 Additional Cloud Credentials | Use 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
- CIS: Control 5 Account Management
- NIST: SP 800-53 Rev 5 Security and Privacy Controls
- AWS: Refine permissions using last accessed information
- AWS: IAM Access Analyzer findings
- Microsoft Learn: Remove unused applications recommendation
- Google Cloud: Service account insights
- Google Cloud: Disable and enable service accounts
- Kubernetes: Managing service accounts
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