Custom constraint limiting IAM role grants to organization members
Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.
Custom constraint limiting IAM role grants to organization members is a Google Cloud guardrail written in custom organization policy constraints. A custom constraint on iam.googleapis.com/AllowPolicy that permits an IAM allow policy only if every member is in the organization principal set, or is allUsers or allAuthenticatedUsers.
More data exfiltration guardrails ยท About Custom organization policy constraints
name: organizations/ORGANIZATION_ID/customConstraints/custom.allowInternalAndSpecialIdentitiesOnly
resourceTypes: iam.googleapis.com/AllowPolicy
methodTypes:
- CREATE
- UPDATE
condition:
"resource.bindings.all(
binding,
binding.members.all(member,
(
MemberInPrincipalSet(member, ['//cloudresourcemanager.googleapis.com/organizations/ORG_ID'])
||
MemberSubjectMatches(member, ['allUsers', 'allAuthenticatedUsers'])
)
)
)"
actionType: ALLOW
displayName: Only allow organization members, allusers, and allAuthenticatedUsers to be granted roles
- Blocks
- A custom constraint on iam.googleapis.com/AllowPolicy that permits an IAM allow policy only if every member is in the organization principal set, or is allUsers or allAuthenticatedUsers.
- Breaks
- Google documents that with the ALLOW action every case not explicitly listed in the condition is blocked, so any other member type in an allow policy is refused. (source)
- Test before applying
- Google documents Policy Simulator for Organization Policy, which previews the impact of a new custom constraint before it is enforced, and org policies in dry-run mode. (source)
- Mechanism
- Custom organization policy constraints: Fields of resource types in services that support custom constraints, in the organization where the constraint is created.
- Taken from
- provider documentation, provider documentation
What the source says
"For example, the following condition expression restricts role grants to members in your organization, allUsers , and allAuthenticatedUsers :" (read 10 Nov 2026).
On what it breaks: "The allow action means that if the condition evaluates to true, the operation to create or update the resource is permitted. This also means that every other case except the one explicitly listed in the condition is blocked."
Related guardrails
- Deny AWS RAM sharing with external accountsAWS, Service control policies (SCPs), data exfiltration
- Block public sharing of EBS snapshots (declarative policy)AWS, Declarative policies, data exfiltration
- Storage SAS tokens should adhere to 7 day maximum validityAzure, Azure Policy (built-in definitions), data exfiltration
- Domain restricted sharingGoogle Cloud, Organization Policy Service (managed and legacy constraints), data exfiltration
- Service perimeter around managed servicesGoogle Cloud, VPC Service Controls (service perimeters), data exfiltration
- Allowed destinations for exporting resourcesGoogle Cloud, Organization Policy Service (managed and legacy constraints), data exfiltration
Related pages
- Principal access boundary limiting the resources principals can access (Google Cloud Principal access boundary (PAB) policies)
- Enforce public access prevention on Cloud Storage (Google Cloud Organization Policy Service)
- Restrict public IP access on Cloud SQL instances (Google Cloud Organization Policy Service)
Sources
- Custom constraint limiting IAM role grants to organization members, read 10 Nov 2026
- How to test it first, read 10 Nov 2026
Last reviewed 16 Nov 2026.