What is gserviceaccount.com? Find the owner
An address ending in gserviceaccount.com is a Google Cloud service account. Read its format to tell user-managed, default and Google-managed accounts apart and find the owning project.
TL;DR. gserviceaccount.com is the domain of Google Cloud service accounts: identities used by code, VMs and Google services, not by people. The address itself tells you most of what you need. NAME@PROJECT_ID.iam.gserviceaccount.com is an account someone created in project PROJECT_ID. PROJECT_NUMBER-compute@developer.gserviceaccount.com and PROJECT_ID@appspot.gserviceaccount.com are the Compute Engine and App Engine default accounts. service-PROJECT_NUMBER@… addresses are Google-managed service agents. A service account has no mailbox, so treat any "email from gserviceaccount.com" with suspicion, but expect to see these addresses in IAM policies, Drive shares and audit logs.
You usually meet the domain in one of four places: a Drive file shared "by" an address you do not recognise, an IAM binding nobody remembers adding, a principalEmail in Cloud Audit Logs, or the client_email field of a JSON key file. The answer to "who is this?" depends on which format the address uses.
The address formats and what each means
Google documents the formats in service account types and service agents:
| Address | Kind | Who created it | Identifier in the address |
|---|---|---|---|
NAME@PROJECT_ID.iam.gserviceaccount.com | User-managed service account | Someone in your organization (or another one), by hand, Terraform or a deployment tool | Project ID |
PROJECT_NUMBER-compute@developer.gserviceaccount.com | Compute Engine default service account | Created automatically when the Compute Engine API is enabled | Project number |
PROJECT_ID@appspot.gserviceaccount.com | App Engine default service account | Created automatically with an App Engine app | Project ID |
PROJECT_NUMBER@cloudservices.gserviceaccount.com | Google APIs Service Agent | Project number | |
service-PROJECT_NUMBER@gcp-sa-SERVICE.iam.gserviceaccount.com | Service agent (Google-managed) | Google, when a service is used | Project number |
service-folder-FOLDER_NUMBER@gcp-sa-SERVICE.iam.gserviceaccount.com | Folder-level service agent | Folder number | |
service-org-ORGANIZATION_NUMBER@gcp-sa-SERVICE.iam.gserviceaccount.com | Organization-level service agent | Organization number |
Some older service agents do not follow the gcp-sa- pattern. A few you will see often:
service-PROJECT_NUMBER@compute-system.iam.gserviceaccount.com: Compute Engine Service Agentservice-PROJECT_NUMBER@container-engine-robot.iam.gserviceaccount.com: Kubernetes Engine Service Agentservice-PROJECT_NUMBER@gs-project-accounts.iam.gserviceaccount.com: Cloud Storage service agentservice-PROJECT_NUMBER@serverless-robot-prod.iam.gserviceaccount.com: Cloud Run Service Agentservice-PROJECT_NUMBER@gcp-sa-pubsub.iam.gserviceaccount.com: Pub/Sub service agent
Two practical consequences:
- User-managed accounts are the ones to investigate. Service agents are created and used by Google to run a service on your behalf. Their activity in your logs is normally expected. User-managed and default accounts are the ones that get keys, broad roles and leaked credentials.
- The default accounts are powerful by accident. Depending on when the project was created and on the
iam.automaticIamGrantsForDefaultServiceAccountsorganization policy, the Compute Engine and App Engine default accounts may hold the Editor role on the project. A VM running asPROJECT_NUMBER-compute@developer.gserviceaccount.comwith the default scopes is a common pivot.
Google notes that the format of default service accounts is "subject to change", so treat the table as a reading aid, not a validation rule.
Is it legitimate or phishing?
The domain belongs to Google: its name servers are ns1 to ns4.google.com. That says nothing about who controls a given account, because anyone with a Google Cloud project can create anything@their-project.iam.gserviceaccount.com. The address is as trustworthy as the project behind it.
Where these addresses legitimately show up:
- Google Drive, Sheets, Docs: an application using the Drive API as a service account owns or shares files. If you share a sheet with an integration, you share it with its service account address. A file shared to you by an unknown service account is an application, not a colleague, acting on someone's behalf. The project ID in the address is the clue to whose.
- Google Calendar: service accounts can create events and invite attendees through the Calendar API.
- IAM policies: bindings such as
serviceAccount:NAME@PROJECT_ID.iam.gserviceaccount.comgranting a role, including cross-project grants to accounts that live in another project. - Google Workspace admin settings: domain-wide delegation grants list a service account's OAuth client ID, not its address. Map a client ID back to an account with the
oauth2ClientIdfield shown below.
Where they do not belong: as the sender of an ordinary email. gserviceaccount.com publishes no MX record, so a service account cannot receive mail, and its DMARC record is p=none, which does not tell receivers to reject mail spoofing the domain. You can check both yourself:
dig +short MX gserviceaccount.com # empty
dig +short TXT _dmarc.gserviceaccount.com # "v=DMARC1; p=none; ..."
A notification email from Google itself ("X shared a file with you") comes from Google's own sending domains and names the service account in the body. A message whose From: header is a @gserviceaccount.com address deserves a look at its Authentication-Results header before anyone clicks anything.
Find the project that owns it
Start from the address:
-
Project ID in the address (
NAME@PROJECT_ID.iam…,PROJECT_ID@appspot…): you already have it. If the project is in your organization, describe the account:gcloud iam service-accounts describe NAME@PROJECT_ID.iam.gserviceaccount.comThe output gives
displayName,description,disabled,uniqueId(the numeric ID that also appears in some logs) andoauth2ClientId(the client ID you will see in a Workspace domain-wide delegation grant). -
Project number in the address (
PROJECT_NUMBER-compute@…,service-PROJECT_NUMBER@…,PROJECT_NUMBER@cloudservices…): resolve the number.gcloud projects describeaccepts either an ID or a number:gcloud projects describe 123456789012 --format="value(projectId,name,parent)" -
Where is it used across the organization? Cloud Asset Inventory answers both "does this account exist here" and "where is it granted a role":
gcloud asset search-all-resources --scope=organizations/ORG_ID \ --asset-types=iam.googleapis.com/ServiceAccount \ --query="name:NAME@PROJECT_ID.iam.gserviceaccount.com" gcloud asset search-all-iam-policies --scope=organizations/ORG_ID \ --query="policy:NAME@PROJECT_ID.iam.gserviceaccount.com"The second command is the one to run when an unknown account appears in an IAM policy: it lists every resource where that principal holds a role.
If neither the project nor the account is visible to you, the account lives in another organization. You cannot look it up, and Google will not tell you who owns it. What you control is what it can do in your resources: remove its bindings, stop sharing files with it, revoke its delegation.
Seeing it in audit logs
In Cloud Audit Logs, a service account appears in protoPayload.authenticationInfo.principalEmail. How it authenticated changes the other fields:
| What you see | Meaning | Where to go next |
|---|---|---|
principalEmail is the service account and serviceAccountKeyName ends with /keys/KEY_ID | The call used a downloadable, user-managed key | Leaked service account key |
principalEmail is the service account and serviceAccountDelegationInfo lists another principal | Someone impersonated it with a short-lived token | Service account impersonation |
principalEmail is the service account, no key name, no delegation, caller IP inside Google Cloud | An attached service account: a VM, Cloud Run service or function running as it | The workload's own logs |
principalEmail is a service-PROJECT_NUMBER@… service agent | Google acting for a service you use | Usually expected; check that the service is one you run |
To list everything a given account did, filter on it directly:
protoPayload.authenticationInfo.principalEmail="NAME@PROJECT_ID.iam.gserviceaccount.com"
and, to find who gave it its rights, look for the binding being added:
protoPayload.methodName="SetIamPolicy"
protoPayload.serviceData.policyDelta.bindingDeltas.member="serviceAccount:NAME@PROJECT_ID.iam.gserviceaccount.com"
The analyzer does this for an exported log file: the Entities tab lists each principal it saw, the keys used with their creators and caller IPs, and the identities that impersonated each service account.
Frequently asked questions
What is gserviceaccount.com?
It is the domain Google uses for service accounts: non-human identities that applications, VMs and Google services use to call Google APIs. An address ending in gserviceaccount.com is a Google Cloud service account, not a person's mailbox. The part before the domain tells you which project owns it and what kind of account it is.
Is an email from gserviceaccount.com legitimate?
A service account has no mailbox and gserviceaccount.com publishes no MX record, so nobody can reply to one. A service account can legitimately share a Google Drive file or appear in a Calendar invite through the APIs. A message whose From: header claims gserviceaccount.com should be checked like any other: the domain's DMARC policy is p=none, so receivers are not told to reject spoofed mail.
How do I find which project a service account belongs to?
For NAME@PROJECT_ID.iam.gserviceaccount.com and PROJECT_ID@appspot.gserviceaccount.com, the project ID is in the address. For PROJECT_NUMBER-compute@developer.gserviceaccount.com and service-PROJECT_NUMBER@… service agents, run gcloud projects describe PROJECT_NUMBER, which works if you can see the project. You cannot look up projects in another organization.
What does iam.gserviceaccount.com mean?
The iam subdomain is used by user-managed service accounts (NAME@PROJECT_ID.iam.gserviceaccount.com) and by most Google-managed service agents (service-PROJECT_NUMBER@gcp-sa-SERVICE.iam.gserviceaccount.com). The label just before .iam tells you which: a project ID for a user-managed account, a Google-owned label such as gcp-sa-pubsub or compute-system for a service agent.
Further reading
- Service account types — Google Cloud documentation.
- Service agents — the full list of Google-managed addresses.
- Search allow policies with Cloud Asset Inventory.
- Leaked GCP service account key: how to investigate it.