Join our Newsletter — 33% off our NHI Course
Home› Guides› GCP Audit Log Principal Fields: Finding Who Really…
Guide Cloud & Workload Identity

GCP Audit Log Principal Fields: Finding Who Really Acted Behind a Service Account

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

When a Google Cloud audit log says a service account made a change, the real question is who or what was holding that service account's credentials at the time. The answer sits in a handful of fields inside protoPayload.authenticationInfo: principalEmail, principalSubject, serviceAccountKeyName and the serviceAccountDelegationInfo array. This guide explains what each field means according to Google's AuditLog reference, how to read an impersonation chain from start to finish, how keys, impersonation and workload identity federation each look in the logs, and which detections to build. It is written for GCP security engineers and SOC analysts. Log types, retention and sinks are covered in the Google Cloud Audit Logs and Log Sinks Guide, so this page goes straight to the identity fields.

This is an independent guide from NHI Mgmt Group, based on Google Cloud's public documentation as of November 2026. It is not sponsored or reviewed by Google. Product features change, so confirm settings against Google Cloud's current documentation.

Key takeaways

  • principalEmail is the identity the token represents: after impersonation it shows the service account, not the human or workload that obtained the token.
  • serviceAccountDelegationInfo names the real caller: each entry carries a firstPartyPrincipal.principalEmail for a Google identity or a principalSubject for a federated one.
  • serviceAccountKeyName means a key was used: its presence shows a downloaded or uploaded service account key created the credential, which no delegation field can trace back to a person.
  • The token minting step is a Data Access log: GenerateAccessToken and STS ExchangeToken entries only appear if Data Access audit logs are enabled for the IAM and Security Token Service APIs.
  • Know which services record which fields: Google notes that App Engine and Google Kubernetes Engine do not log the identity that created short-lived credentials, and App Engine and Compute Engine do not log the key name.

Where principal information lives in an audit log entry

Every Cloud Audit Logs entry is a LogEntry whose protoPayload holds an AuditLog object of type type.googleapis.com/google.cloud.audit.AuditLog. The logName ends in cloudaudit.googleapis.com%2Factivity, %2Fdata_access, %2Fsystem_event or %2Fpolicy. Identity information is in authenticationInfo; what was attempted and whether it was allowed is in authorizationInfo; network context is in requestMetadata.

FieldMeaning (from Google's AuditLog reference)How analysts use it
authenticationInfo.principalEmailThe email address of the authenticated user, or of the service account acting on behalf of a third-party principal, making the requestThe identity whose permissions were used
authenticationInfo.principalSubjectString representation of the requesting party's identity, populated for first-party and third-party identitiesIdentifies federated callers that have no email address
authenticationInfo.serviceAccountKeyNameThe name of the service account key used to create or exchange credentials, as a full resource nameShows key-based access and which key
authenticationInfo.serviceAccountDelegationInfo[]Identity delegation history of an authenticated service account that makes the requestFinds the identity behind an impersonated service account
authenticationInfo.thirdPartyPrincipalThird-party identification, if any, of the authenticated userExternal identity context
authenticationInfo.serviceDelegationHistoryHistory of delegated resource access across Google services, as a result of the original user's actionExplains a Google service acting for a user; distinct from impersonation
authenticationInfo.oauthInfo.oauthClientIdThe OAuth client ID of the first-party or third-party application acting on behalf of the userTies activity to an OAuth application
authorizationInfo[].permission, .granted, .resourceThe IAM permission required, whether it was granted, and the resourceSeparates attempts from successes
requestMetadata.callerIp, .callerSuppliedUserAgentSource address and user agent reported for the callLocation and tooling context; user agent is caller supplied

Google's audit logging overview states that the caller's principal email is not redacted for successful access or for any write operation. For read-only operations that fail with permission denied, the email might be redacted unless the caller is a service account, and some services (BigQuery, Cloud Storage usage-log entries, VPC Service Controls and Organization Policy denials) apply their own redaction rules.

principalEmail and principalSubject

  • Human user: principalEmail is the user's Google or Cloud Identity address and there is no delegation array.
  • Service account using its own attached credentials: principalEmail is the service account email, with no key name and no delegation array. The workload it is attached to (a VM, Cloud Run service or function) is the actor.
  • Service account through a key: principalEmail is the service account and serviceAccountKeyName holds a value of the form //iam.googleapis.com/projects/PROJECT_ID/serviceAccounts/SA_EMAIL/keys/KEY_ID.
  • Federated principal acting directly: principalSubject carries the federated identity. Google's reference gives the format principal://iam.googleapis.com/{identity pool name}/subject/{subject}, with a legacy serviceAccount:{identity pool name}[{subject}] form still used for certain GKE identity types.

The practical rule: never stop at principalEmail when it ends in gserviceaccount.com. Check the key name and the delegation array before deciding who acted.

serviceAccountDelegationInfo and impersonation chains

Impersonation produces two kinds of entries, and you need both. Google's service account audit logging examples show the pattern.

  1. The minting entry. A caller with Service Account Token Creator (roles/iam.serviceAccountTokenCreator) calls GenerateAccessToken on iamcredentials.googleapis.com. This is written to the data_access log, only if IAM Data Access audit logs are enabled. Here principalEmail is the caller, and resource.labels.email_id (with resource.type service_account) is the service account being impersonated.
  2. The action entry. The caller uses the short-lived token, for example to create a Pub/Sub topic, which lands in the activity log. Now principalEmail is the impersonated service account and serviceAccountDelegationInfo[].firstPartyPrincipal.principalEmail is the user who created the credentials.

An annotated, generic action entry (values replaced with placeholders) looks like this:

1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.

Sample 1
"protoPayload": {
  "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
  "serviceName": "pubsub.googleapis.com",
  "methodName": "google.pubsub.v1.Publisher.CreateTopic",
  "authenticationInfo": {
    "principalEmail": "deploy-sa@PROJECT_ID.iam.gserviceaccount.com",   // identity whose permissions were used
    "serviceAccountDelegationInfo": [
      { "firstPartyPrincipal": { "principalEmail": "[email protected]" } }   // who minted the token
    ]
  },
  "authorizationInfo": [ { "permission": "pubsub.topics.create", "granted": true } ],
  "requestMetadata": { "callerIp": "203.0.113.10" }
}

For a federated workload, the entry inside the array carries principalSubject (a principal:// value) instead of firstPartyPrincipal.

Reading a chain step by step

  1. Start at the action: note principalEmail, methodName, the resource and the timestamp.
  2. Classify the credential: key name present means key-based access; delegation array present means impersonation; neither means attached credentials or a direct user.
  3. Read every delegation entry: record each firstPartyPrincipal.principalEmail or principalSubject. Google's examples show a single entry, so in multi-hop chains treat the array as the set of identities involved and confirm order from the minting entries rather than assuming it.
  4. Find the minting entry: search data_access for GenerateAccessToken where resource.labels.email_id matches the service account, shortly before the action. Its principalEmail or principalSubject is the caller at that hop.
  5. Follow intermediate hops: delegated requests pass through intermediate service accounts listed in the delegates field, and each account must hold Token Creator on the next. Repeat the search for each intermediate account.
  6. For federated callers, go one step further: find the STS ExchangeToken entry, whose principalSubject is the external identity provider's subject (for example an AWS role ARN, an Azure managed identity object ID or an OIDC sub claim) and whose metadata.mapped_principal is the principal:// form.
  7. Check token lifetime: access tokens default to a maximum of one hour, extendable to 12 hours only for service accounts listed in the constraints/iam.allowServiceAccountCredentialLifetimeExtension organisation policy. Actions long after the minting entry point to another token.

To find who could impersonate a service account in the first place, use How to Audit GCP Service Account Impersonation Rights.

Service account keys versus impersonation versus workload identity federation

Access methodprincipalEmail on the actionDistinguishing fieldEarlier entry to findAttribution to a person or workload
Attached service account (VM, Cloud Run, function)Service accountNone of the belowWorkload deployment historyThrough the resource it is attached to
Service account keyService accountserviceAccountKeyNamegoogle.iam.admin.v1.CreateServiceAccountKey in activityOnly as far as who created or holds the key
Impersonation by a Google identityService accountserviceAccountDelegationInfo[].firstPartyPrincipal.principalEmailGenerateAccessToken in data_accessDirect, in the action entry
Workload identity federation with impersonationService accountserviceAccountDelegationInfo[].principalSubjectSTS ExchangeToken and GenerateAccessToken in data_accessTo the external identity provider subject
Workload identity federation, direct resource accessFederated identityprincipalSubjectSTS ExchangeTokenTo the external subject

Keys are the weakest link for attribution: once a key file is copied, every holder looks identical in the logs. That is why the Google Cloud Service Account Keys Security Guide and the Workload Identity Federation Guide recommend replacing keys with federation or attached identities where possible.

Enabling the logs you need

Admin Activity and System Event logs are always written. Data Access logs are disabled by default except for BigQuery. To see the minting step, enable Data Access audit logs for the IAM APIs; for federation, Google's workload identity examples call for the Admin Read log type on both the IAM API and the Security Token Service API. Roll this out in stages:

  1. Enable Data Access logs for iamcredentials.googleapis.com and sts.googleapis.com at organisation level in a test folder first, and measure volume.
  2. Confirm entries appear by impersonating a test service account and exchanging a test federated token.
  3. Extend to the whole organisation and route the logs to your aggregated sink and SIEM.
  4. If volume or cost is a problem, use exclusion filters on low-value methods rather than disabling the service; roll back by removing the audit configuration for the service.

Detection use cases

DetectionLogicATT&CK
Human impersonating a production service accountGenerateAccessToken where caller is a user and target is in a production project; or action entries with a user in the delegation array outside change windowsT1550.001 Application Access Token
Token Creator grantedSetIamPolicy adding roles/iam.serviceAccountTokenCreator, especially at project or folder levelT1098.001 Additional Cloud Credentials (related persistence)
New service account keygoogle.iam.admin.v1.CreateServiceAccountKey in activity; alert on any where key creation should be blockedT1098.001 Additional Cloud Credentials
Key used from an unexpected networkEntries with serviceAccountKeyName and a callerIp outside known rangesT1078.004 Cloud Accounts
Dormant key suddenly activeFirst appearance of a serviceAccountKeyName value after a long gapT1078.004 Cloud Accounts
Unexpected federated subjectExchangeToken with a principalSubject not in the expected list for that providerT1078.004 Cloud Accounts

Metrics that show the logging works:

  • Attribution rate: share of service account actions in production attributable to a named workload, human or federated subject.
  • Key-based share: percentage of service account API calls carrying serviceAccountKeyName, trending down.
  • Minting coverage: share of impersonated action entries with a matching GenerateAccessToken entry found.
  • Token Creator grants reviewed: new grants triaged within one working day.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev. 5AU-2 Event Logging; AU-6 Audit Record Review; AU-9 Protection of Audit Information; AC-6 Least PrivilegeEnabling, reviewing and protecting identity logs; limiting Token Creator
NIST CSF 2.0PR.PS-04; DE.CM-09Log generation and monitoring of runtime activity
MITRE ATT&CK v20T1078.004; T1550.001; T1098.001Abuse of cloud accounts, tokens and added credentials

Common failure patterns

  • Stopping at principalEmail: incident timelines that name a service account as the actor without checking the delegation array, so the real user is never identified.
  • Data Access logs never enabled: action entries show a user in the delegation array, but there is no minting entry to show when, from where or through which intermediate accounts.
  • Federation without STS logs: the principal:// subject is visible but the external identity and provider are not, because Admin Read logging was not enabled for the Security Token Service API.
  • Keys left in service: long-lived keys make attribution impossible; enforce the iam.disableServiceAccountKeyCreation organisation policy constraint where workloads do not need keys.
  • Expecting fields a service does not record: analysts expect delegation details from App Engine or GKE, or key names from Compute Engine, where Google says they are not logged; plan compensating evidence such as deployment records.
  • Broad Token Creator grants: granting the role at project or folder level lets one compromised identity impersonate many service accounts. See the Google Cloud IAM and Service Accounts Guide.

Practitioner checklist

  • Enable Data Access audit logs for the IAM credentials and Security Token Service APIs across the organisation.
  • Route all audit logs to an aggregated sink your SOC can query.
  • Teach analysts to check serviceAccountKeyName and serviceAccountDelegationInfo on every service account action.
  • Build a saved query that joins action entries to GenerateAccessToken minting entries by service account and time.
  • Alert on Token Creator grants, new service account keys and unexpected federated subjects.
  • Track and reduce key-based API calls; block key creation by organisation policy where possible.
  • Record which services Google documents as not logging the creating identity or key name, and gather deployment evidence for them.
  • Review Token Creator holders regularly and scope grants to individual service accounts.

Standards and references

Related NHI Mgmt Group resources: Google Cloud Audit Logs and Log Sinks Guide, How to Audit GCP Service Account Impersonation Rights, How to Find GCP Service Accounts With Owner or Editor Roles, Workload Identity Federation Guide, Google Cloud Service Account Keys Security Guide

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.