Monitoring non-human identities means watching a short list of signals of misuse or decay: unused identities and credentials, credentials used from an unexpected network or outside their workload, new permissions, new credentials and leaked secrets. Each signal appears in a specific log: AWS CloudTrail, Azure and Microsoft Entra logs, Google Cloud Audit Logs and Kubernetes audit logs.
This page covers what to watch and where each signal is recorded. It is the Monitor stage of the NHI Governance lifecycle model v2 (an analytical model, not a standard). How to write detections, triage alerts and contain an incident is covered in NHI in security operations. Platform log fields and built-in detections below are taken from each provider's documentation as read on 10 October 2026; the signal list, baselines and acceptance criteria are our interpretation.
Why non-human identities need their own monitoring
Three properties change what works:
- Behaviour is narrow. A service account or cloud role usually calls the same APIs from the same workload. Deviation is easier to see than for a person, but only if you have recorded what normal looks like.
- There is no sign-in prompt. Workloads present keys, tokens or certificates directly. A stolen credential used from an attacker's server produces an ordinary API call, not a failed login.
- The logs are not always on. Kubernetes writes no audit events unless the API server is given an audit policy file. Google Cloud Data Access audit logs are disabled by default except for BigQuery. AWS CloudTrail event history keeps 90 days of management events per Region, and the Azure Activity Log keeps 90 days. Check coverage before writing any rule.
Monitoring also assumes an inventory. A signal on an identity with no recorded owner, workload or expected network has nothing to be compared against and nobody to confirm it. Build those records first; see the discovery methodology and assigning an owner to every identity.
Six signals and what each one catches
The six signals below cover most of the OWASP Non-Human Identities Top 10 (2025) risks that can be seen in logs at all. Each needs a baseline from the inventory; without one, the signal produces noise.
| Signal | What it can indicate | Baseline needed | OWASP NHI risk (our mapping) |
|---|---|---|---|
| 1. Identity or credential not used for a set period (this site uses 90 days) | Orphaned identity, retired workload, forgotten key | Last authentication per identity and per credential | NHI1 Improper Offboarding |
| 2. Credential used from an unexpected source address or network | Stolen credential, or a person using a machine credential from a laptop | Expected IP ranges, NAT gateways or cluster egress for each identity | NHI2 Secret Leakage, NHI10 Human Use of NHI, NHI3 Vulnerable Third-Party NHI |
| 3. New permission grant or trust change | Privilege escalation or persistence, or unreviewed change | Change process: who may grant, through which pipeline | NHI5 Overprivileged NHI, NHI6 Insecure Cloud Deployment Configurations |
| 4. New credential created for an existing identity | Persistence (attacker adds own key), or a team bypassing federation | Which identities are expected to hold no stored credential | NHI7 Long-Lived Secrets |
| 5. Token used outside its expected workload or environment | Credential copied off its host, or non-production identity reaching production | Workload, node or environment each identity belongs to | NHI2, NHI8 Environment Isolation, NHI9 NHI Reuse |
| 6. Secret exposure alert | Credential published in code, a package or a public repository | Mapping from credential to identity and owner | NHI2 Secret Leakage |
Source networks are recorded as IP addresses. Matching an address to an autonomous system number (ASN) or hosting provider needs an external IP-to-ASN data set; none of the four platforms below records the ASN in the event itself, as far as their field references show. In our view an ASN change (for example from your cloud provider's range to a residential or unrelated hosting network) is a stronger signal than an individual IP change, because workload addresses change often within one provider.
The fields that name the caller and the source
Every signal starts from two questions: which identity made the call, and from where. The fields differ by platform.
| Platform and log | Which identity | From where | Notes |
|---|---|---|---|
| AWS CloudTrail | userIdentity: type (for example IAMUser, AssumedRole, WebIdentityUser), arn, accessKeyId, and sessionContext.sessionIssuer for the role behind temporary credentials | sourceIPAddress; for actions by AWS services this shows a service name or AWS Internal | AssumeRoleWithWebIdentity events record subjectFromWebIdentityToken, which ties a federated session to the external workload |
| Microsoft Entra sign-in logs | Service principal sign-ins (apps and service principals presenting a certificate or client secret) and a separate managed identity sign-in log | IP address is one of the fields service principal sign-ins are grouped by | Managed identity sign-ins are only in the managed identity log, not the service principal log |
| Azure Activity Log | "Event initiated by" identity for each control plane operation | Caller details per event | Control plane only; data plane operations are in resource logs |
| Google Cloud Audit Logs | AuthenticationInfo (principal email); serviceAccountKeyName when a user-managed key was used; serviceAccountDelegationInfo when a service account was impersonated | RequestMetadata.callerIp | Some services, including App Engine and Compute Engine, do not log serviceAccountKeyName |
| Kubernetes audit log | user; service accounts appear as system:serviceaccount:NAMESPACE:NAME; impersonatedUser if impersonation was used | sourceIPs, ordered by X-Forwarded-For, X-Real-Ip, then the connection's remote address | userAgent is supplied by the client and should not be trusted |
Signal to log source map
The table names the event or feature to watch for each signal. Event names are those used in each provider's documentation. It is a starting point; your estate may log more or less depending on configuration.
| Signal | AWS | Azure and Microsoft Entra | Google Cloud | Kubernetes |
|---|---|---|---|---|
| 1. Unused identity or credential | IAM last accessed and last used information (role last used, access key last used); IAM Access Analyzer unused access findings for unused roles, access keys and permissions (a charged feature) | Absence of entries in service principal and managed identity sign-in logs over the period (our method) | Service account insights: service accounts that have not authenticated in the past 90 days (Pre-GA at the time of writing) | For legacy Secret-based tokens, the kubernetes.io/legacy-token-last-used label; for others, absence from audit logs (our method) |
| 2. Unexpected source | sourceIPAddress per accessKeyId or role session | Service principal sign-ins by IP address | callerIp per principal | sourceIPs per service account |
| 3. New permission or trust | IAM API calls in CloudTrail (CloudTrail captures all IAM and AWS STS API calls), such as policy attachment and trust policy updates | Activity Log Microsoft.Authorization/roleAssignments/write; Entra audit log activities "Add app role assignment to service principal", "Add delegated permission grant", "Consent to application" | Admin Activity log entries for SetIamPolicy (Admin Activity logs are always written) | Create or update of RoleBindings and ClusterRoleBindings, if the audit policy logs them |
| 4. New credential | CreateAccessKey in CloudTrail | Entra audit log "Add service principal credentials" and "Update application - Certificates and secrets management" | google.iam.admin.v1.CreateServiceAccountKey (Admin Activity) | Creation of Secrets of type kubernetes.io/service-account-token; requests to the serviceaccounts/token subresource |
| 5. Use outside the workload | GuardDuty findings UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS and .InsideAWS for EC2 instance credentials used elsewhere | Entra ID Protection workload identity detection "Suspicious Sign-ins" (sign-in properties unusual for that service principal) | callerIp outside the expected range for the service account (our method) | Service account token used from a sourceIPs value outside the pod and node ranges (our method) |
| 6. Secret exposure | AWS applies the managed policy AWSCompromisedKeyQuarantineV3 when an IAM user's credentials are compromised or exposed publicly | Entra ID Protection detection "Leaked Credentials" | Exposed service account keys are disabled automatically by default since 16 June 2024, controlled by constraints/iam.serviceAccountKeyExposureResponse; project owners and security contacts are notified | No built-in detector documented (our reading); rely on repository and registry secret scanning |
Repository-side detection matters for signal 6 because most leaks start in code. GitHub secret scanning runs on public repositories free of charge, scans full Git history, and notifies partner service providers when it finds their credential types so they can revoke them. For private organisation repositories it requires GitHub Secret Protection. OWASP NHI2 recommends integrating secret scanning into CI/CD pipelines.
Built-in detections and their limits
Each cloud provider offers detections for workload identities. They help, but none is complete, and each has scope limits worth recording in your monitoring design:
- Amazon GuardDuty raises anomaly findings such as
Discovery:IAMUser/AnomalousBehavior, which it describes as produced by an anomaly detection machine learning model, and findings for API calls from Tor exit nodes or known malicious IP addresses. The credential exfiltration findings apply to credentials created for an EC2 instance through its launch role. - Microsoft Entra ID Protection detects risk on single-tenant, non-Microsoft SaaS and multitenant apps. Managed identities are not currently in scope. Full risk details and risk-based Conditional Access need Workload Identities Premium; without it you still receive the detections with limited reporting detail.
- Google Cloud notifies on and, by default, disables exposed service account keys. Organisations that chose
WAIT_FOR_ABUSEstill receive the notification but the key stays active. - Kubernetes documentation, as we read it, describes no built-in anomaly detection. What you get is the audit log, at the level your policy sets:
Metadatarecords the requesting user, timestamp, resource and verb without request bodies.
Check log coverage before writing rules
A rule that queries a log nobody collects will never fire. The checks below are our suggestion; each has an acceptance criterion you can test.
| Check | Acceptance criterion |
|---|---|
| CloudTrail trail or event data store covers every account and Region in the organisation | Events from each account and Region arrive in the central store; event history alone (90 days, management events, one Region per search) is not relied on |
| STS logging location understood | Searches include US East (N. Virginia) for requests to the AWS STS global endpoint, which are logged there; regional endpoint calls are logged in their own Region |
| Azure Activity Log exported | A diagnostic setting sends the Activity Log to a workspace or storage with retention beyond the default 90 days |
| Entra service principal and managed identity sign-in logs exported | Both log types reach the SIEM, not only interactive user sign-ins |
| Google Cloud Data Access logs enabled where workload data access matters | An explicit decision, recorded per service, because they are off by default except for BigQuery |
| Kubernetes audit policy set on every cluster | The API server runs with --audit-policy-file and a log or webhook backend; on managed clusters, the provider's control plane audit logging is switched on |
| Inventory joined to logs | Each event can be joined to an inventory record giving owner, workload and expected network |
How this maps to the OWASP NHI Top 10
The mapping is ours, not OWASP's. Where an OWASP entry itself mentions monitoring or auditing, the table says so.
| OWASP risk | Signals | What OWASP's entry says about detection |
|---|---|---|
| NHI1 Improper Offboarding | 1 | Regularly audit active NHIs to monitor ongoing usage, and recertify that they are still needed and owned |
| NHI2 Secret Leakage | 2, 5, 6 | Integrate secret scanning into CI/CD pipelines |
| NHI3 Vulnerable Third-Party NHI | 2, 3 | Continuously monitor third-party activity using logs, API call tracking and behaviour analytics |
| NHI4 Insecure Authentication | 4 (partly) | Periodically review authentication methods; this is mainly a configuration review, not a log signal |
| NHI5 Overprivileged NHI | 3 | Continuously assess granted permissions |
| NHI6 Insecure Cloud Deployment Configurations | 3 | Validate tokens strictly and restrict trust relationships; watch trust policy changes |
| NHI7 Long-Lived Secrets | 1, 4 | Prefer short-lived credentials and automated rotation; watch for new long-lived credentials |
| NHI8 Environment Isolation | 5 | Unique identities per environment; a non-production identity seen in production is a finding |
| NHI9 NHI Reuse | 5 | Audit identities with their assigned components; one identity seen from several workloads suggests reuse |
| NHI10 Human Use of NHI | 2 | Use tools that audit and track NHI usage so human use is detectable |
Acceptance criteria for the Monitor stage
These are our suggested tests that the Monitor stage is operating, not requirements from any standard. They are written so that an internal auditor can check each one from records.
- Every identity in the inventory has a last-authentication date that is no more than one collection cycle old.
- Identities and credentials with no authentication in 90 days appear on a report sent to their named owner, and each has a recorded decision (keep with reason, disable, or retire).
- New credential creation for identities marked "no stored credential" raises an alert within one working day.
- Permission and trust changes to non-human identities outside the approved pipeline raise an alert.
- Each provider-side detection that applies (GuardDuty, Entra ID Protection, Google key exposure response, repository secret scanning) is switched on, or its absence is a recorded decision.
- Each alert record names both the identity and the credential involved, and the owner who confirmed or dismissed it.
- The coverage checks above are re-run at least quarterly and the result is kept as evidence.
For metrics to report upward, see NHI metrics and board reporting. For how to turn these signals into tested detections and a response, see NHI in security operations. Access reviews, which use the same last-used data, are covered in running an NHI access review.
Frequently asked questions
What should you monitor for non-human identities?
Six signals cover most cases: identities or credentials unused for a set period, credentials used from an unexpected network, new permission grants or trust changes, new credentials on existing identities, tokens used outside their expected workload or environment, and secret exposure alerts. Each needs a baseline from your inventory: owner, workload and expected network.
Which logs show service account and workload identity activity?
AWS CloudTrail (userIdentity and sourceIPAddress), the Azure Activity Log plus Microsoft Entra service principal and managed identity sign-in logs and audit logs, Google Cloud Audit Logs (AuthenticationInfo and callerIp), and Kubernetes audit logs, where service accounts appear as system:serviceaccount:NAMESPACE:NAME with sourceIPs.
Are Kubernetes audit logs on by default?
Not on a self-managed API server. Kubernetes documentation states that the audit policy is passed with the --audit-policy-file flag and that if the flag is omitted, no events are logged. On managed services, check the provider setting for control plane audit logs.
How do you find unused non-human identities?
Use last-used data: AWS IAM last accessed information or IAM Access Analyzer unused access findings, Google Cloud service account insights (accounts that have not authenticated in 90 days), and the absence of sign-in log entries for Entra service principals and managed identities. Send the list to each named owner for a recorded decision.
Is monitoring NHIs required by law?
No law we know of names NHI monitoring as such. Frameworks such as the OWASP NHI Top 10 (guidance) recommend auditing NHI usage. Whether a specific regulation applies to your logging depends on your sector and jurisdiction; treat the criteria on this page as our suggestion, not a legal requirement.
Sources
- OWASP Non-Human Identities Top 10 (2025), OWASP Foundation, 2025
- AWS CloudTrail User Guide, CloudTrail userIdentity element, Amazon Web Services, accessed 16 Oct 2026
- AWS CloudTrail User Guide, CloudTrail record contents, Amazon Web Services, accessed 10 Oct 2026
- AWS CloudTrail User Guide, Working with CloudTrail event history, Amazon Web Services, accessed 10 Oct 2026
- AWS IAM User Guide, Logging IAM and AWS STS API calls with AWS CloudTrail, Amazon Web Services, accessed 16 Oct 2026
- AWS IAM User Guide, IAM Access Analyzer findings, Amazon Web Services, accessed 16 Oct 2026
- Amazon GuardDuty User Guide, IAM finding types, Amazon Web Services, accessed 10 Oct 2026
- AWS Managed Policy Reference, AWSCompromisedKeyQuarantineV3, Amazon Web Services, accessed 16 Oct 2026
- Microsoft Learn, Service principal sign-ins in Microsoft Entra, Microsoft, accessed 10 Oct 2026
- Microsoft Learn, Microsoft Entra audit log activity reference, Microsoft, accessed 16 Oct 2026
- Microsoft Learn, Securing workload identities with ID Protection, Microsoft, accessed 10 Oct 2026
- Microsoft Learn, Azure Monitor activity log, Microsoft, accessed 10 Oct 2026
- Microsoft Learn, View activity logs for Azure RBAC changes, Microsoft, accessed 10 Oct 2026
- Google Cloud, Cloud Audit Logs overview, Google Cloud, accessed 10 Oct 2026
- Google Cloud, IAM audit logging, Google Cloud, accessed 10 Oct 2026
- Google Cloud, Examples of audit logs for service accounts, Google Cloud, accessed 16 Oct 2026
- Google Cloud, Find unused service accounts, Google Cloud, accessed 10 Oct 2026
- Google Cloud blog, Automatically disabling leaked service account keys: what you need to know, Google Cloud, 15 May 2024
- Kubernetes documentation, Auditing, Kubernetes project, accessed 10 Oct 2026
- Kubernetes documentation, kube-apiserver Audit Configuration (v1), Kubernetes project, accessed 10 Oct 2026
- audit.k8s.io/v1 Event type definitions (sourceIPs, userAgent, impersonatedUser), Kubernetes source code, accessed 16 Oct 2026
- Kubernetes documentation, Authenticating (service account tokens), Kubernetes project, accessed 10 Oct 2026
- Kubernetes documentation, Managing Service Accounts, Kubernetes project, accessed 10 Oct 2026
- GitHub Docs, About secret scanning, GitHub, accessed 10 Oct 2026
From the publisher
HumanAudit, which publishes this site, is preparing the NHI Governance pack: an NHI policy, ownership register, lifecycle procedures and one control set mapped, as our interpretation, to PCI DSS v4.0.1, ISO/IEC 27001:2022, NIS2 and DORA. Planned for March 2027; not yet on sale, and no price has been published.