Deny service account key create and delete to a group on one project
Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.
Deny service account key create and delete to a group on one project is a Google Cloud guardrail written in iAM deny policies. Denies the serviceAccountKeys.create and serviceAccountKeys.delete permissions to a group on the project or folder where the deny policy is attached, even when the group holds the Service Account Key Admin role.
More identity and privilege guardrails ยท About IAM deny policies
{
"deniedPrincipals": [
"principalSet://goog/group/eng@example.com"
],
"deniedPermissions": [
"iam.googleapis.com/serviceAccountKeys.create",
"iam.googleapis.com/serviceAccountKeys.delete"
]
}
- Blocks
- Denies the serviceAccountKeys.create and serviceAccountKeys.delete permissions to a group on the project or folder where the deny policy is attached, even when the group holds the Service Account Key Admin role.
- Breaks
- Google documents that a denied principal cannot use the permission whatever roles they hold, so an exception group (exceptionPrincipals) is needed for anyone who must keep the access. (source)
- Test before applying
- Google documents troubleshooting deny policies with Policy Troubleshooter, which examines the allow, deny and Principal Access Boundary policies that affect a principal; it does not enforce in a preview mode. (source)
- Mechanism
- IAM deny policies: Principals named in the deny rules, on the resource the policy is attached to and its descendants.
- Taken from
- provider documentation, provider documentation
What the source says
"Instead of granting the Service Account Key Admin role on each individual project, you create the following deny rule, which denies create and delete permissions in the Service Account Key Admin role to the principals in the eng group:" (read 10 Nov 2026).
On what it breaks: "When a principal is denied a permission, they can't do anything that requires that permission, regardless of the IAM roles they've been granted."
Related guardrails
- Prevent root credentials management in member accountsAWS, Service control policies (SCPs), identity and privilege
- Deny the root user except for S3 bucket policy changesAWS, Service control policies (SCPs), identity and privilege
- Deny critical IAM user actionsAWS, Service control policies (SCPs), identity and privilege
- Disable service account key creationGoogle Cloud, Organization Policy Service (managed and legacy constraints), identity and privilege
- Disable automatic IAM grants for default service accountsGoogle Cloud, Organization Policy Service (managed and legacy constraints), identity and privilege
- Require OS LoginGoogle Cloud, Organization Policy Service (managed and legacy constraints), identity and privilege
Related pages
Sources
- Deny service account key create and delete to a group on one project, read 10 Nov 2026
- How to test it first, read 10 Nov 2026
Last reviewed 16 Nov 2026.