How it works
Google Cloud IAM accepts a Google group as a principal. A binding such as group:gcp-prod-admins@corp.example.com with roles/owner gives the role to everyone who is a member when a request is evaluated. Google Workspace does the same on its side: an administrator role can be assigned to a group, and its members receive the role's privileges.
This is convenient role-based access control, and it moves the real access decision out of IAM. The text of the allow policy stays fixed while the population it covers changes. Whoever can change the group's membership can hand out the role, and that right is governed by Cloud Identity and Workspace, by different people and different logs than IAM:
- Direct addition. A group owner or manager, or an administrator with the Groups Admin role, adds a user or service account. Group ownership is a role inside the group; it is not a Google Cloud role and is often held by team leads who were never meant to grant production access.
- Join settings. Collaboration-style groups can be configured so that anyone in the organization can join. If such a group ends up in an IAM binding, every employee can grant themselves the role.
- Nesting. Membership is transitive. If the role-bearing group contains another group, control over the inner group, at any depth, is control over the role. Nesting groups with different membership policies lets people who do not meet the outer group's requirements become members.
- Directory sync. Groups provisioned from Active Directory or another identity provider take their membership from that source. Adding a member there adds it in Google at the next sync, and a manual removal on the Google side is undone at the next reconciliation. See Google Cloud Directory Sync abuse.
- Dynamic groups. Membership follows a query over user attributes. Changing the query, or an attribute the query reads, changes the members.
- External members. A group can contain accounts from outside the organization. Domain restricted sharing checks the group named in a binding, not the group's members, so an external member of an allowed group passes the constraint.
Unlike setIamPolicy privilege escalation, nothing in Google Cloud is written. The escalation is a directory change.
Prerequisites
- A group that is named in an IAM allow policy (on a resource, project, folder or the organization), that holds impersonation rights on a service account, or that is assigned a Workspace admin role.
- The ability to change that group's effective membership, by any of:
- the OWNER or MANAGER role in the group, or in any group nested inside it;
- the Groups Admin role, or another Workspace admin role with group privileges;
- a join setting that lets the attacker's account add itself;
- write access to the source directory group, or to the sync configuration, for synced groups;
- the ability to edit a dynamic group's query or the user attributes it reads.
- An identity to add: the attacker's own account, a second account kept for persistence, a service account, or an external account where the group allows external members.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Find role-bearing groups
# Every IAM binding in the organization that names a group
gcloud asset search-all-iam-policies \
--scope='organizations/123456789012' \
--query='memberTypes:group'
# Bindings of one group
gcloud asset search-all-iam-policies \
--scope='organizations/123456789012' \
--query='policy:gcp-prod-admins@corp.example.com'
Rank the groups by the roles they hold. Owner, Editor, IAM administration roles and service account impersonation roles on a folder or the organization come first.
2. Map who controls each group
# Direct members and their roles in the group (OWNER, MANAGER, MEMBER)
gcloud identity groups memberships list \
--group-email='gcp-prod-admins@corp.example.com'
# All members, including those who arrive through nested groups
gcloud identity groups memberships search-transitive-memberships \
--group-email='gcp-prod-admins@corp.example.com'
# Every group the current identity belongs to, directly or indirectly
gcloud identity groups memberships search-transitive-groups \
--member-email='alice@corp.example.com' \
--labels='cloudidentity.googleapis.com/groups.discussion_forum'
Look for an inner group the current identity owns or manages, a group with an open join setting, and groups without the security label (cloudidentity.googleapis.com/groups.security), which accept any kind of group as a member.
3. Add the member
Directly, with owner or manager rights on the role-bearing group:
gcloud identity groups memberships add \
--group-email='gcp-prod-admins@corp.example.com' \
--member-email='alice@corp.example.com'
Through nesting, by adding to an inner group, or by nesting a group the attacker controls:
gcloud identity groups memberships add \
--group-email='platform-oncall@corp.example.com' \
--member-email='alice@corp.example.com'
gcloud identity groups memberships add \
--group-email='gcp-prod-admins@corp.example.com' \
--member-email='team-sandbox@corp.example.com'
A service account can be the member, which gives a non-human identity the role without any binding that names it:
gcloud identity groups memberships add \
--group-email='gcp-prod-admins@corp.example.com' \
--member-email='svc-app@example-project.iam.gserviceaccount.com'
To keep control of the group itself, raise the added member to owner:
gcloud identity groups memberships modify-membership-roles \
--group-email='gcp-prod-admins@corp.example.com' \
--member-email='alice@corp.example.com' \
--add-roles=OWNER
Where the group allows self-service joining, the attacker joins from the Google Groups interface with an ordinary account and needs none of the commands above.
4. Confirm and use the access
gcloud identity groups memberships check-transitive-membership \
--group-email='gcp-prod-admins@corp.example.com' \
--member-email='alice@corp.example.com'
gcloud projects get-iam-policy example-prod-project
Membership changes are not instant at every consuming service; allow for propagation before concluding that the path does not work.
5. Synced and dynamic groups
For a group provisioned from Active Directory, add the account to the source group and wait for the next sync run; the membership then appears in Google as a change made by the sync identity. For a dynamic group, the change is to the membership query or to the attribute it selects on, for example a department value on the attacker's user object.
Impact
The added identity holds every role bound to the group, on every resource where the group is bound, plus any Workspace admin role assigned to it. For an administrators group bound at the organization that is control of the cloud estate, obtained through a change that an IAM review cannot see: policy exports before and after are identical.
It is equally useful as persistence. A second account or a service account placed in a nested group several levels down survives the reset of the first compromised account and rarely appears in access reviews, which tend to list the bindings and stop at the group name. Removing a direct role assignment from a person also leaves a group-derived one in place.
OPSEC and artifacts
- No Google Cloud write. There is no
SetIamPolicyevent and no change to any allow policy. The record is in the Workspace admin log asADD_GROUP_MEMBER(parametersGROUP_EMAIL,USER_EMAIL), and asUPDATE_GROUP_MEMBERwhen a role in the group changes. In Cloud Audit Logs it exists only if Workspace data sharing with Google Cloud is enabled. - Going in through a nested group. The event names the inner group, which may have an innocuous name and no entry on any watch list. The role-bearing group shows no membership event at all.
- Self-service joins and owner actions. A join through an open setting, or an addition by the group's legitimate owner account, looks like everyday collaboration.
- Sync as cover. A change made in the source directory arrives in Google under the sync identity, at the usual sync time, among many other changes. The originating action is in the source directory's logs, for Active Directory as a group membership change there.
- Service accounts as members. A service account in a group draws less attention than a new user, and Google advises against expiring service account memberships, so it tends to stay.
- Short stays. Adding the member, minting long-lived artifacts (a service account key, a new binding) and leaving the group again limits the window. Both membership events are logged, and what was created during the window remains.
- Use looks legitimate. Resource audit logs show the member's own identity acting with a role it holds. Nothing in those entries says the role came from a group joined minutes earlier.
Detection
The detection problem is a join between two data sets: which groups carry authority, and who changed their membership.
1. Build the watch list. From Cloud Asset Inventory, list every group in an IAM binding; from the Admin console, the groups that hold admin roles. Expand each one with search-transitive-memberships so that nested groups are on the list too. Refresh it on a schedule, because a new binding or a new nesting adds groups.
2. Watch membership and settings of those groups. In the Admin SDK Reports API:
applicationName=admin
userKey=all
eventName=ADD_GROUP_MEMBER
Also collect UPDATE_GROUP_MEMBER (role changes inside the group, with OLD_VALUE and NEW_VALUE), REMOVE_GROUP_MEMBER and CHANGE_GROUP_SETTING (SETTING_NAME, OLD_VALUE, NEW_VALUE), which records a join or posting policy being opened up.
With Workspace audit logs shared to Google Cloud, the organization's Admin Activity log carries the same events:
log_id("cloudaudit.googleapis.com/activity")
((protoPayload.serviceName="admin.googleapis.com" AND
(protoPayload.methodName="google.admin.AdminService.addGroupMember" OR
protoPayload.methodName="google.admin.AdminService.updateGroupMember")) OR
(protoPayload.serviceName="cloudidentity.googleapis.com" AND
protoPayload.methodName="google.apps.cloudidentity.groups.v1.MembershipsService.UpdateMembership"))
Read the actor, the affected group and the affected member as three separate facts, confirm the member's type (user, service account, group, external), and evaluate the event against the group's stable id, because a similarly named group can produce a misleading alert.
3. Related rules and sources. The dynamic group membership query changed rules cover dynamic groups, and group changes through the Cloud Identity API appear in the UpdateGroup source. The privileged role granted rules show when a group first receives a privileged role, which is the moment to add it to the watch list. Admin roles assigned to groups surface through the admin role assigned rules and the assignRole source.
4. Correlate with use. A member added to a role-bearing group who exercises a privileged permission shortly after, and a member who is added and removed within a short time, are the two sequences worth an alert of their own.
Workspace commonly keeps admin log events for six months; export them if investigations need to look further back.
Mitigation
- Separate access groups from other groups. Use dedicated groups for IAM access, named so that their purpose is obvious, and do not grant roles to mailing lists, team groups or organizational groups. Do not use collaboration groups for access control.
- Lock down membership of access groups. Owners invite or approve; no open join setting; membership visible only to members; membership that expires by default for people. Give every access group designated owners who understand that ownership grants the role.
- Do not nest access groups. Nesting hides who has access and lets members bypass a stricter membership policy. Where nesting is unavoidable, nest only groups with identical membership policies.
- Use security groups and group restrictions. The security label limits nesting to other security groups in the domain, can only be set by a Super Admin or Groups Admin, and cannot be removed again. Use group restrictions to decide whether external members are allowed.
- Keep external members out of access groups unless that is the group's stated purpose, because domain restricted sharing does not look inside groups.
- Treat Groups Admin and group-capable admin roles as privileged, and do not give the Groups Admin role to deployment pipelines; a custom role that can only create groups is enough for them.
- Do not provision access groups from an external directory where avoidable. If you do, the source group's membership controls are part of your cloud access model and need the same protection.
- Prefer narrower bindings for the highest privileges. For organization-level administration, bind a small, tightly controlled group, in line with least privilege, or use time-bound elevation instead of standing membership.
- Send Cloud Identity audit logs to Cloud Logging by enabling Workspace data sharing, and alert on membership and setting changes for the watch list.
Detection rules for this attack
Log events to collect
FAQ
Why does adding a group member count as privilege escalation in Google Cloud?
IAM can grant a role to a Google group, and the binding then applies to whoever is in the group at the time of the request. Adding a member changes who holds the role without touching the allow policy, so the people who control group membership effectively control the role.
Does a nested group inherit the roles of its parent group?
Yes. Membership is transitive: if group B is a member of group A and A holds a role, every member of B holds it too. An attacker who cannot change A but can change B, or any group further down the chain, reaches the same roles.
How do you detect group-based privilege escalation?
Keep a list of groups that appear in IAM bindings or hold admin roles, including the groups nested in them, and alert on ADD_GROUP_MEMBER, UPDATE_GROUP_MEMBER and CHANGE_GROUP_SETTING events for those groups in the Workspace admin log. Sharing Workspace audit logs with Google Cloud puts the same events in the organization's Cloud Audit Logs.
References
- Account Manipulation: Additional Cloud Roles, T1098.003 (MITRE ATT&CK)
- Best practices for using Google groups (Google Cloud IAM)
- Query group memberships, including transitive membership (Cloud Identity)
- Updating a Google Group to a security group (Cloud Identity)
- Admin audit activity events: group settings (Admin SDK Reports API)
- Audit logs for Google Workspace (Cloud Logging)
- gcloud identity groups memberships (Google Cloud SDK reference)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.