Cross-project impersonation or domain-wide delegation abused
An attacker with one foothold, such as a service account key or a user who has Service Account Token Creator, impersonates service accounts across projects to reach roles the foothold lacks. A service account with domain-wide delegation lets the attacker act as any Workspace user and read mail, files or the directory within the authorized scopes. External principals in IAM policies give the same reach from outside your control, so cut delegation and impersonation grants first.
Look here
Log
Search for
Data Access audit log for iamcredentials.googleapis.com (only if enabled)
Tokens minted for service accounts. Run it in every project that owns a service account in scope: gcloud logging read 'protoPayload.serviceName="iamcredentials.googleapis.com" AND protoPayload.methodName=("GenerateAccessToken" OR "SignJwt" OR "SignBlob" OR "GenerateIdToken")' --project=<project> --freshness=30d
Any audit log entry made by an impersonated service account
What one principal did through others. The entry's principalEmail is the service account: protoPayload.authenticationInfo.serviceAccountDelegationInfo.firstPartyPrincipal.principalEmail="<origin>"
Admin Activity audit log
Grants of roles/iam.serviceAccountTokenCreator or roles/iam.serviceAccountUser to principals outside the project or the organization, through google.iam.admin.v1.SetIAMPolicy on service accounts and SetIamPolicy on projects and folders
Admin console, Security > Access and data control > API controls > Manage Domain Wide Delegation
Every client ID and scope list. Match a client ID to its service account under IAM & Admin > Service Accounts > the account > Show advanced settings. Treat mail, Drive and Admin SDK scopes as high risk, such as: https://mail.google.com/, https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/admin.directory.user
Admin console, Admin log events and OAuth log events
Who changed delegation and when: AUTHORIZE_API_CLIENT_ACCESS and REMOVE_API_CLIENT_ACCESS. Filter OAuth log events on the client ID, event activity. Delegated calls may not appear there, so also read Drive and Gmail log events for the impersonated users
Cloud Asset Inventory
External domains in IAM policies: gcloud asset search-all-iam-policies --scope=organizations/<org-id> --query='policy:"domain:<partner-domain>"'
Cloud Asset Inventory
Impersonation grants across the organization: gcloud asset search-all-iam-policies --scope=organizations/<org-id> --query='roles:roles/iam.serviceAccountTokenCreator'
Policy Analyzer
What one service account can reach: gcloud asset analyze-iam-policy --organization=<org-id> --identity='serviceAccount:<sa-email>' --expand-groups
Activity Analyzer
Dormant accounts that suddenly authenticated. The results omit the most recent events and domain-wide delegation calls to Workspace APIs: gcloud policy-intelligence query-activity --activity-type=serviceAccountLastAuthentication --project=<project>
Security Command Center (Event Threat Detection, Premium or Enterprise tier)
Impersonation and delegation findings: Privilege Escalation: Suspicious Cross-Project Permission UsePrivilege Escalation: Suspicious Token Generation (cross-project access token)Privilege Escalation: Suspicious Token Generation (implicit delegation)Privilege Escalation: Anomalous Multistep Service Account Delegation for Admin ActivityPrivilege Escalation: Anomalous Impersonation of Service Account for Admin Activity
Contain
#
Item
1
Save the policy of each service account in the chain, the project, folder and organization policies, and the delegation client IDs and scopes from the Admin console: gcloud iam service-accounts get-iam-policy <sa-email> --format=json
2
Delete the attacker's domain-wide delegation entry in the Admin console destructive. Deletion stops the application immediately, while an edit that narrows scopes can take up to 24 hours
3
Disable each service account in the chain. Workloads using it stop: gcloud iam service-accounts disable <sa-email>
4
Remove impersonation grants. Repeat for roles/iam.serviceAccountUser, and check project and folder policies, where one grant covers every service account below: gcloud iam service-accounts remove-iam-policy-binding <sa-email> --member='<type>:<member>' --role=roles/iam.serviceAccountTokenCreator --all
5
Remove external principals the attacker or a partner added: gcloud projects remove-iam-policy-binding <project> --member='<type>:<member>' --role=<role> --all
Reset sign-in cookies and passwords for Workspace users the delegation impersonated, and revoke their app grants
Eradicate and recover
#
Item
1
Treat mailboxes and files the delegated scopes could reach as exposed. Read the Gmail and Drive log events for the impersonated users over the window
2
Re-enable the service accounts the business needs, at least 60 minutes after disabling them: gcloud iam service-accounts enable <sa-email>
3
Re-authorize delegation with the narrowest scope list, one service account per application
4
Purge external members first, then enforce iam.managed.allowedPolicyMembers (legacy iam.allowedPolicyMemberDomains) with your organization principal set or Workspace customer ID as allowed values. The constraint applies to new bindings only and leaves existing ones in place
5
Keep cross-project service account use blocked on projects that own service accounts, so other projects cannot attach them to resources: iam.disableCrossProjectServiceAccountUsage
6
Enable Data Access audit logs for iamcredentials.googleapis.com at the organization level
7
Alert on the token methods in the first Look here row
Token minting with GenerateAccessToken appears only where Data Access logs for iamcredentials.googleapis.com were on. Without them, follow serviceAccountDelegationInfo in the audit entries the impersonated account produced.
Policy Analyzer reads allow policies only, so deny policies are not evaluated, and results can lag recent changes. --analyze-service-account-impersonation runs many queries, so export with gcloud asset analyze-iam-policy-longrunning for a large organization.
The domain-wide delegation entry is separate from the service account. Delete the entry as well as disabling the account.
Google Cloud documentation: Service account impersonation; IAM audit logging examples for service accounts; Best practices for service accounts; Attach service accounts to resources; Restrict IAM service account usage; Restrict domains for sharing; Cloud Asset Inventory IAM policy search; Policy Analyzer for allow policies; Activity Analyzer for service account authentication; deny policy support; IAM threat findings. Google Workspace documentation: control API access with domain-wide delegation; OAuth token audit activity events; Admin audit events for domain settings. Checked September 2026.