Skip to content
Cloud Governance Tools

Custom constraint limiting IAM role grants to organization members

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."

Sources

  1. Custom constraint limiting IAM role grants to organization members, read 10 Nov 2026
  2. How to test it first, read 10 Nov 2026

Last reviewed 16 Nov 2026.