Join our Newsletter — 33% off our NHI Course
Home› Guides› How Non-Human Identities Appear in Cloud and SaaS…
Guide Non-Human Identity (NHI)

How Non-Human Identities Appear in Cloud and SaaS Audit Logs: Fields to Read and Pivot On

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 11 min read
On this page

Most cloud and SaaS audit events are now performed by service accounts, roles, apps and tokens, yet analysts often cannot tell from a log record whether a human or a machine acted, which credential was used, or who the machine was acting for. Each platform records non-human identities (NHIs) differently: a role session in AWS, a service principal or managed identity in Microsoft Entra, an impersonation chain in Google Cloud, a hashed token in GitHub. This guide maps the fields that identify the machine, the credential and the delegation chain on each platform, and shows how to correlate them into one view. It is for SOC analysts, detection engineers and NHI owners. Platforms are listed alphabetically; the order is not a ranking.

Key takeaways

  • Read three things on every record. Which identity acted, which credential it presented, and whether it was acting on behalf of someone else. Every platform below exposes all three, in different fields.
  • Delegation fields carry the real story. AWS sessionContext.sessionIssuer and sourceIdentity, Google Cloud serviceAccountDelegationInfo and Entra FederatedCredentialId show the identity behind the session.
  • Credential identifiers are the best pivot. Access key IDs, credential key IDs and thumbprints, service account key names and GitHub hashed_token values let you find every action taken with one secret.
  • Machine sign-ins live in their own logs. Entra writes service principal and managed identity sign-ins to separate logs from user sign-ins, and Google Workspace records OAuth app activity in the token audit log.
  • Normalise before you detect. Map each platform's fields to a common schema (actor, actor type, credential ID, delegated principal, source IP) so one rule covers every platform.

Why NHI log identification matters

Attackers who steal an API key or token act as that machine identity, and their activity blends with legitimate automation unless the analyst can see which credential was used and from where. ATT&CK describes the patterns: T1078.004 Cloud Accounts, T1550.001 Application Access Token and T1098.001 Additional Cloud Credentials. Each of these is detected by reading the identity fields correctly, not by the event name alone.

  • Attribution: an action by a role or service account needs tracing back to the workload, pipeline or person that obtained the session.
  • Scoping: when a secret leaks, the first question is "what did this credential do?", which needs a credential identifier in every record.
  • Ownership: unowned identities show up as actors nobody recognises. Log identification feeds the inventory. See the NHI Discovery Across Cloud, SaaS, CI/CD and On-Premises Environments guide.
  • Detection quality: baselines per identity only work if the identity field is stable. See the Service Account Behavioural Baselining Guide.

AWS

Every CloudTrail event carries a userIdentity element. Its type field takes values including Root, IAMUser, Role, FederatedUser, Directory, AWSAccount, AWSService, IdentityCenterUser, BuilderIdUser and Unknown; role sessions appear as AssumedRole in the documentation examples, and SAMLUser and WebIdentityUser mark calls to AssumeRoleWithSAML and AssumeRoleWithWebIdentity.

  • Who acted: arn and principalId. For a role session the ARN ends in the role session name, which pipelines and workloads often set to something meaningful.
  • Which credential: accessKeyId, the key that signed the request (for temporary credentials, the temporary key ID). credentialId is set when a bearer token, such as an IAM Identity Center access token, was used.
  • Delegation: sessionContext.sessionIssuer (type, ARN, account and name of the role or user that issued the session), sessionContext.sourceIdentity (the original identity carried through role chaining), webIdFederationData.federatedProvider for OIDC federation, and onBehalfOf, whose subjectType is user or workload.
  • Service involvement: invokedBy names the AWS service that made the call; inScopeOf shows the resource that credentials were issued to, with issuerType such as AWS::Lambda::Function.
  • Workload hints: sessionContext.ec2RoleDelivery records 1.0 for IMDSv1 or 2.0 for IMDSv2, and attributes.mfaAuthenticated shows whether MFA was used for the session.

Pivot on sessionIssuer.arn to see every session of a role, and on accessKeyId to scope a leaked key. See the AWS CloudTrail Guide and How to Investigate CloudTrail for a Compromised Access Key.

Azure

Microsoft Entra writes machine sign-ins to two logs separate from interactive user sign-ins: service principal sign-ins (apps authenticating with their own certificate or client secret, with no user involved) and managed identity sign-ins. Managed identity sign-ins appear only in the managed identity log. In Log Analytics they land in the AADServicePrincipalSignInLogs and AADManagedIdentitySignInLogs tables.

  • Who acted: ServicePrincipalId, ServicePrincipalName and AppId; for managed identities, ManagedServiceIdentity gives detail of the identity used.
  • Which credential: ServicePrincipalCredentialKeyId and ServicePrincipalCredentialThumbprint identify the secret or certificate; ClientCredentialType shows the credential type.
  • Delegation and federation: FederatedCredentialId identifies a workload identity federation credential, which links the sign-in to an external issuer such as a CI platform.
  • Target and context: ResourceDisplayName and ResourceIdentity show what the identity signed in to; IPAddress, ConditionalAccessStatus, ResultType and UniqueTokenIdentifier complete the picture. Location is the region of the resource emitting the event; use LocationDetails for sign-in location.

In the Azure activity log, the Administrative category's caller is the email, UPN claim or SPN claim of whoever performed the operation, claims holds the JWT used against Resource Manager (including appid), and correlationId groups events that belong to one operation. Join activity log claims.appid to sign-in AppId to connect a resource change to the credential that authenticated it. See the Entra ID Sign-In and Audit Log Detection Guide and the Azure Managed Identities Security Guide.

Google Cloud

Cloud Audit Logs record identity in protoPayload.authenticationInfo.

  • Who acted: principalEmail (the user or service account email; populated as principalSubject instead for third-party callers) and principalSubject, which is set for both first-party and third-party identities.
  • Which credential: serviceAccountKeyName, the full resource name of the service account key used to create or exchange the credentials. Its presence means a long-lived key was used rather than attached or impersonated credentials.
  • Delegation: serviceAccountDelegationInfo, an ordered list of the real authorities that accessed resources through a service account, each with a principalSubject and either a firstPartyPrincipal or a thirdPartyPrincipal. Federated workload identities appear in principal://iam.googleapis.com/... form.
  • Applications: oauthInfo.oauthClientId names the OAuth client acting on a user's behalf.
  • Context: requestMetadata.callerIp and callerSuppliedUserAgent.

Pivot on serviceAccountKeyName to scope a leaked key, and on the first entry of serviceAccountDelegationInfo to find who started an impersonation chain. The GCP Audit Log Principal Fields guide walks through chains step by step.

SaaS platforms

SaaS audit logs vary more than cloud logs, but the same three questions apply. Three common platforms, alphabetically:

GitHub

GitHub audit log events carry token data for personal access tokens, OAuth tokens, GitHub Apps (as an installation or on behalf of a user), deploy keys and SSH keys (the last two in public preview). hashed_token is the SHA-256 hash of the token used, programmatic_access_type the authentication type, and token_scopes the scopes where applicable. To scope a token, hash it (base64 output), then search hashed_token:"VALUE"; UI and REST searches do not return Git events, so export the audit log for those. The oauth_application, integration_installation and personal_access_token categories cover app and token lifecycle. See the GitHub Audit Log Detection Guide.

Google Workspace

The OAuth Token audit log (Reports API applicationName=token) records authorize, revoke and activity events. Each carries app_name, client_id and client_type; authorisations add scope, and activity events add api_name, method_name and num_response_bytes, which shows how much data an app pulled. Pivot on client_id across users to see an app's full reach. See the Google Workspace Audit Log Detection Guide.

Okta

The Okta System Log identifies the acting identity in the actor object (filter with actor.id), and transaction.detail.requestApiTokenId returns events made with a specific API token. transaction.id groups events from one operation, and authenticationContext.rootSessionId groups actions by an Okta system actor with the user sessions they belong to. See How to audit Okta API tokens and service apps.

Field reference by platform

PlatformIdentity fieldCredential fieldDelegation fieldGrouping field
AWS CloudTrailuserIdentity.arn, typeaccessKeyId, credentialIdsessionContext.sessionIssuer, sourceIdentity, onBehalfOfsessionContext.attributes.creationDate with accessKeyId
Azure (Entra sign-ins, activity log)ServicePrincipalId, AppId, activity callerServicePrincipalCredentialKeyId, ServicePrincipalCredentialThumbprintFederatedCredentialIdUniqueTokenIdentifier, activity correlationId
Google Cloud Audit LogsprincipalEmail, principalSubjectserviceAccountKeyNameserviceAccountDelegationInfooauthInfo.oauthClientId
GitHub audit logactorhashed_token, programmatic_access_typeGitHub App acting on behalf of a user (token type)token_scopes
Google Workspace token auditapp_name, client_idclient_type, scopeUser who authorised the app (event actor)api_name, method_name
Okta System Logactor.idtransaction.detail.requestApiTokenIdSystem actor linked by rootSessionIdtransaction.id

Correlation

Cross-platform investigations fail when the same machine identity has a different name in every log. Build a normalised view first, then detections on top.

Common fieldPurposePopulate from
actor_idStable identifier of the acting identityARN, service principal object ID, service account email, GitHub actor, client ID, Okta actor ID
actor_typeHuman, workload, app, token, platform serviceCloudTrail type, sign-in log table name, principalSubject form, programmatic_access_type, client_type
credential_idThe specific secret, key, certificate or tokenAccess key ID, credential key ID or thumbprint, key name, hashed token, API token ID
delegated_fromHuman or workload behind the sessionsessionIssuer and sourceIdentity, federated credential, delegation chain, authorising user
ownerAccountable teamNHI inventory join on actor_id or credential_id
  1. Collect the machine logs explicitly. Turn on Entra service principal and managed identity sign-in categories in diagnostic settings, Google Cloud Data Access logs where needed, GitHub audit log streaming and the Workspace token audit log. See the Cloud Logging and Audit Trail Guide.
  2. Map fields to the common schema in the SIEM parser, keeping the raw fields alongside.
  3. Join to the inventory on actor_id and credential_id so every event carries an owner. Unmatched identities are discovery findings.
  4. Pilot detections in alert-only mode for two weeks, tune against known automation, then promote. Roll back by returning a rule to alert-only.
  5. Write cross-platform rules: one credential_id used from two new networks, a federated identity minting long-lived keys (for example a new access key or service account key followed by use from an unknown IP), an app's num_response_bytes or API call volume far above its baseline.

Decision guidance: a small organisation on one cloud and two SaaS platforms can start with saved searches per platform keyed on credential IDs. A large multi-cloud estate needs the normalised schema and an inventory join, because analysts cannot memorise six field models during an incident. See the Detection Engineering for Non-Human Identities Guide.

Measurement

  • Attribution rate: percentage of machine-actor events that join to an inventoried, owned identity (target above 95 per cent).
  • Credential coverage: percentage of events with a non-empty credential_id.
  • Log category coverage: machine sign-in and token audit categories enabled per tenant, project and organisation (target 100 per cent).
  • Time to scope a credential: minutes from a leaked secret report to a complete list of its actions.
  • Unknown actor count: distinct machine actors seen in logs but absent from the inventory, trending down.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev 5AU-3 Content of Audit Records; AU-6 Audit Record Review, Analysis, and ReportingRecords must identify the identity and credential; review across sources
NIST SP 800-53 Rev 5AC-2 Account Management; IA-9 Service Identification and AuthenticationService identities inventoried, owned and authenticated
NIST CSF 2.0DE.CM-03; DE.AE-03Monitoring technology usage; correlating across sources
MITRE ATT&CK v20T1078.004; T1550.001; T1098.001Cloud account use, token reuse and added credentials

Common failure patterns

  • Reading only the role ARN: every pipeline using one role looks identical; without sourceIdentity or session names, attribution stops at the role.
  • Missing machine sign-in logs: collecting only interactive Entra sign-ins leaves every service principal and managed identity authentication invisible.
  • Ignoring the delegation chain: attributing a Google Cloud action to the final service account rather than the first principal in serviceAccountDelegationInfo blames the wrong owner.
  • Not keeping credential IDs: parsers that drop accessKeyId, thumbprints or hashed_token make leaked-secret scoping impossible.
  • Treating platform service actors as noise: blanket suppression of service-initiated events hides attacker activity carried out through a trusted integration.

Practitioner checklist

  • Enable machine sign-in, token and data access audit categories on every cloud and SaaS tenant.
  • Record actor, credential and delegation fields for each platform in a field map.
  • Normalise to a common schema with actor_id, actor_type, credential_id and delegated_from.
  • Join audit events to the NHI inventory and alert on unknown machine actors.
  • Require meaningful role session names and set sourceIdentity where pipelines assume roles.
  • Prepare saved searches that scope a credential by its identifier on each platform.
  • Track attribution rate and time to scope a credential monthly.

Standards and references

Related NHI Mgmt Group resources: Detection Engineering for Non-Human Identities Guide · GCP Audit Log Principal Fields · Bot Accounts vs Service Principals · NHI Dormancy Detection

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.

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 both boxes to continue.