Skip to content
Cloud Governance Tools

Deny service account key create and delete to a group on one project

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

Sources

  1. Deny service account key create and delete to a group on one project, read 10 Nov 2026
  2. How to test it first, read 10 Nov 2026

Last reviewed 16 Nov 2026.