Skip to content

01Governance and loggingService 1 of 13

Resource Manager and Organization Policysecurity hardening

Harden the Google Cloud organization: folder hierarchy, super admins, admin groups, default roles, liens, org policy constraints and a CIS audit workflow.

Baseline
11 controls
Category
Governance and logging
Updated
Reading
13 min read

Every control you apply in Google Cloud attaches to a node of the resource hierarchy (organization, folder, project) and flows downward: IAM bindings, organization policies, hierarchical firewall policies, log sinks and the Security Command Center scope. Left at defaults, that hierarchy works against you. Every user in the domain can create projects and billing accounts, projects created before the organization existed sit outside it, super admin accounts double as daily mailboxes, and organizations created before May 2024 enforce no guardrails at all, so any project owner can create service account keys, grant roles to Gmail accounts or make a bucket public. The orphan project with a public bucket and the forgotten key belonging to a default service account with Editor are the classic results. This page covers the hierarchy, who holds its keys, the organization policy constraints that turn it into guardrails, and how to measure the result against the CIS Benchmark.

Baseline controls

Apply these at the organization node before any workload lands, and re-check them on every audit. CIS IDs refer to the CIS GCP Foundations Benchmark v5.0.1.

ControlWhyHow to checkCIS / SCC
Use a shared, dedicated super admin addressNo single person owns the root of trustAdmin console: Account > Admin rolesCIS 1.1.1
Keep super admins out of daily Google Cloud workLimits exposure of the top accountgcloud organizations get-iam-policy ORG_IDCIS 1.1.2
Enforce security keys for admin accountsPhishing-resistant MFA on the keys to the orgAdmin console: Security > 2-Step VerificationCIS 1.4
Structure folders by environment and sensitivityPolicy attaches cleanly per foldergcloud resource-manager folders list --organization=ORG_IDCIS 1.1.3
Set organization policies at the org nodeOne place for guardrailsgcloud org-policies list --organization=ORG_IDCIS 1.1.4
Restrict IAM members to your directoryBlocks Gmail and outside accountsgcloud org-policies describe iam.allowedPolicyMemberDomains --organization=ORG_IDCIS 1.2, NON_ORG_IAM_MEMBER
Block service account key creationRemoves the most leaked credential typegcloud org-policies describe iam.managed.disableServiceAccountKeyCreation --organization=ORG_IDCIS 1.5, USER_MANAGED_SERVICE_ACCOUNT_KEY
Remove domain-wide Project Creator and Billing Account CreatorStops shadow projects and billinggcloud organizations get-iam-policy ORG_IDn/a
Configure Essential ContactsSecurity notices reach a monitored inboxgcloud essential-contacts list --organization=ORG_IDCIS 1.17, ESSENTIAL_CONTACTS_NOT_CONFIGURED
Skip default network creationNo permissive VPC in new projectsgcloud org-policies describe compute.skipDefaultNetworkCreation --organization=ORG_IDCIS 3.1, DEFAULT_NETWORK
Put liens on foundation projectsLogging and KMS projects cannot be deletedgcloud alpha resource-manager liens list --project=PROJECT_IDn/a

Resource hierarchy

Bring every project under the organization

An organization resource exists once you have a Cloud Identity or Google Workspace account and a project is created under that domain. Projects created earlier, or by users outside any organization, are "no organization" projects that none of your policies reach. Find them:

gcloud organizations list
gcloud projects list --format="table(projectId,parent.type,parent.id)"

Any project with an empty parent.type is outside your hierarchy. Move it in (roles/resourcemanager.projectMover is needed on source and target) or shut it down:

gcloud projects move PROJECT_ID --organization=ORG_ID

Design folders for policy, not for the org chart

Folders exist to group resources that share policy. For each folder, ask which IAM bindings, organization policies and firewall policies will attach there. If the answer is none, the folder is noise. A layout that matches Google's enterprise foundations blueprint:

Organization (example.com)
  fldr-bootstrap       seed project, Terraform state, CI identity
  fldr-common          logging, security tooling, KMS, Shared VPC hosts
  fldr-production
    prj-website-prod
    prj-app2-prod
  fldr-nonproduction
  fldr-development

Environment folders at the top level make the strictest controls easy to scope: production gets compute.managed.vmExternalIpAccess and a VPC Service Controls perimeter, development keeps more freedom. The common folder holds what must outlive any application: the central logging project (see Cloud Logging), the Security Command Center tooling project and the Cloud KMS key projects. Google allows up to ten folder levels; two or three is enough, since each extra level is another place for a binding to hide.

gcloud resource-manager folders create \
  --display-name="fldr-production" --organization=ORG_ID

Manage the hierarchy as code. The terraform-example-foundation repository implements the blueprint in stages (bootstrap, org, environments, networks, projects). The CI identity that applies it holds organization-level power, so it must authenticate keylessly with Workload Identity Federation (see IAM) and every change must go through review.

Protect foundation projects with liens

A lien blocks project deletion until someone with resourcemanager.projects.updateLiens removes it. Put one on the logging, security and KMS projects (the lien commands are only in the gcloud alpha track):

gcloud alpha resource-manager liens create \
  --project=prj-c-logging \
  --restrictions=resourcemanager.projects.delete \
  --reason="Central audit log project"

gcloud alpha resource-manager liens list --project=prj-c-logging

For Shared VPC host projects, enforce compute.restrictXpnProjectLienRemoval so only principals with the permission at organization level can remove the lien Shared VPC creates.

Console: IAM & Admin > Manage resources.

Super admins and admin groups

Protect the Cloud Identity super admins

Super administrators in Cloud Identity or Workspace sit above Google Cloud IAM. A super admin can grant themselves roles/resourcemanager.organizationAdmin, reset other admins' passwords and change sign-in policy, so one compromised super admin is a compromised organization. MITRE ATT&CK tracks this as valid cloud accounts.

  • Keep two to four super admin accounts. Two prevents lock-out; more increases exposure.
  • Use dedicated accounts (for example admin-ops@example.com) that are not used for mail, browsing or daily cloud work. CIS 1.1.1 asks that the super admin address is not tied to a single user.
  • Enforce 2-Step Verification with FIDO2 security keys for every admin (CIS 1.4). Do not allow SMS as a fallback.
  • Grant super admins no Google Cloud IAM role by default (CIS 1.1.2). They elevate only when the organization admins are unavailable.
  • Set recovery to an address outside the domain and review super admin sign-ins in the Admin console audit log, which you can also route to Cloud Logging (see Cloud Logging).

Bind every admin role to a group

The organization admin role is a Google Cloud IAM role, separate from super admin. Grant it, and every other org-level role, to Google Groups, never to individual users. Groups survive staff changes and are reviewable in one place.

GroupTypical roles at org level
gcp-organization-admins@roles/resourcemanager.organizationAdmin, roles/resourcemanager.folderAdmin
gcp-billing-admins@roles/billing.admin on the billing account
gcp-network-admins@roles/compute.networkAdmin, roles/compute.xpnAdmin
gcp-security-admins@roles/iam.securityAdmin, roles/orgpolicy.policyAdmin, roles/securitycenter.admin
gcp-auditors@roles/iam.securityReviewer, roles/logging.privateLogViewer
gcloud organizations add-iam-policy-binding ORG_ID \
  --member="group:gcp-security-admins@example.com" \
  --role="roles/iam.securityAdmin"

Verify that no user is bound directly at the organization:

gcloud organizations get-iam-policy ORG_ID \
  --flatten="bindings[].members" \
  --filter="bindings.members:user:" \
  --format="table(bindings.role,bindings.members)"

Remove the default organization roles

When the organization resource is created, Google grants every user in the domain Project Creator (roles/resourcemanager.projectCreator) and Billing Account Creator (roles/billing.creator) at the organization. Any employee can then create projects outside your folders and open new billing accounts. Check and remove them:

gcloud organizations get-iam-policy ORG_ID \
  --flatten="bindings[].members" \
  --filter="bindings.members:domain:" \
  --format="table(bindings.role,bindings.members)"

gcloud organizations remove-iam-policy-binding ORG_ID \
  --member="domain:example.com" \
  --role="roles/resourcemanager.projectCreator"

gcloud organizations remove-iam-policy-binding ORG_ID \
  --member="domain:example.com" \
  --role="roles/billing.creator"

Then create projects only through a pipeline (a project factory) that places them in the right folder, labels them and enables only the APIs they need.

Essential Contacts

Google sends security notifications (abuse reports, compromised credential alerts, incident notices) to the contacts registered for the organization. Without them, notices go to owners or organization admins, often the wrong person.

gcloud essential-contacts create \
  --email="cloud-security@example.com" \
  --notification-categories=security,technical,legal,suspension \
  --language=en \
  --organization=ORG_ID

gcloud essential-contacts list --organization=ORG_ID

Use a monitored distribution list, not a person. Enforce essentialcontacts.managed.allowedContactDomains (legacy name essentialcontacts.allowedContactDomains) so contacts stay inside your domain.

Console: IAM & Admin > Essential Contacts.

Organization policy constraints

IAM decides who can do something; organization policy decides what can be done at all. A project owner with full IAM rights still cannot create a service account key if key creation is blocked above the project. Setting policies needs roles/orgpolicy.policyAdmin at the organization; grant it only to the security admins group.

Constraint types and names

  • Managed constraints carry a .managed. segment (for example iam.managed.disableServiceAccountKeyCreation). They are built on the custom constraint engine, support dry run and some accept parameters. Prefer them where they exist.
  • Legacy predefined constraints are boolean (storage.uniformBucketLevelAccess) or list (gcp.resourceLocations). You will still see them in existing policies and in CIS tooling.
  • Custom constraints are your own CEL conditions on supported resource types.

Organizations created on or after May 3, 2024 are secure by default and already enforce iam.managed.disableServiceAccountKeyCreation, iam.disableServiceAccountKeyUpload, iam.automaticIamGrantsForDefaultServiceAccounts, iam.allowedPolicyMemberDomains, essentialcontacts.managed.allowedContactDomains, compute.managed.restrictProtocolForwardingCreationForTypes and storage.uniformBucketLevelAccess. Older organizations have none of these. Check what is actually in force, including after inheritance:

gcloud org-policies list --organization=ORG_ID

gcloud org-policies describe iam.managed.disableServiceAccountKeyCreation \
  --project=PROJECT_ID --effective

Constraints to enforce first

Managed constraintLegacy nameEffect
iam.managed.allowedPolicyMembersiam.allowedPolicyMemberDomainsRoles only to your principals
iam.managed.disableServiceAccountKeyCreationiam.disableServiceAccountKeyCreationNo new user-managed keys
iam.managed.disableServiceAccountKeyUploadiam.disableServiceAccountKeyUploadNo uploaded public keys
iam.managed.preventPrivilegedBasicRolesForDefaultServiceAccountsiam.automaticIamGrantsForDefaultServiceAccountsDefault SAs get no Editor
compute.managed.vmExternalIpAccesscompute.vmExternalIpAccessNo external IPs on VMs
compute.managed.requireOsLogincompute.requireOsLoginOS Login on all VMs
compute.managed.disableSerialPortAccesscompute.disableSerialPortAccessNo interactive serial console
sql.managed.restrictPublicIpsql.restrictPublicIpNo public IP on Cloud SQL
sql.managed.restrictAuthorizedNetworkssql.restrictAuthorizedNetworksNo public authorized networks
nonestorage.publicAccessPreventionBuckets cannot be made public
nonestorage.uniformBucketLevelAccessNo object ACLs
nonecompute.skipDefaultNetworkCreationNo default VPC
nonegcp.resourceLocationsResources only in allowed regions

The product pages explain the resource-level effect: IAM, Compute Engine, Cloud Storage, Cloud SQL and VPC. For GKE, the container.managed.* family (Workload Identity, private nodes, Shielded Nodes, Binary Authorization) is covered on the GKE page.

Write and apply policies

Policies use the v2 format. A boolean managed constraint:

# disable-sa-key-creation.yaml
name: organizations/ORG_ID/policies/iam.managed.disableServiceAccountKeyCreation
spec:
  rules:
    - enforce: true

The managed member restriction takes parameters. Allow your organization's principal set (which also covers service agents of resources in the organization) plus any explicit exceptions:

# allowed-members.yaml
name: organizations/ORG_ID/policies/iam.managed.allowedPolicyMembers
spec:
  rules:
    - enforce: true
      parameters:
        allowedPrincipalSets:
          - //cloudresourcemanager.googleapis.com/organizations/ORG_ID
        allowedMemberSubjects:
          - user:partner-admin@example.com

If you still use the legacy list constraint, its value is your directory customer ID (from gcloud organizations list), not the domain name:

name: organizations/ORG_ID/policies/iam.allowedPolicyMemberDomains
spec:
  rules:
    - values:
        allowedValues:
          - C01abcd23

Restrict locations with a value group:

name: organizations/ORG_ID/policies/gcp.resourceLocations
spec:
  rules:
    - values:
        allowedValues:
          - in:eu-locations

Apply each file:

gcloud org-policies set-policy disable-sa-key-creation.yaml
gcloud org-policies set-policy allowed-members.yaml --update-mask=spec

set-policy replaces the policy on that resource, so keep the files in version control and apply them from your pipeline. Enforcement is not retroactive: existing keys, ACLs and public IPs keep working. Pair each policy with an inventory query (Cloud Asset Inventory, see Cloud Logging) and clean up the past separately.

Console: IAM & Admin > Organization policies.

Dry run before you enforce

For constraints that can block live operations, such as the member restriction or external IP restrictions, set a dryRunSpec first:

name: organizations/ORG_ID/policies/compute.managed.vmExternalIpAccess
dryRunSpec:
  rules:
    - enforce: true

Violations are written to audit logs without blocking the call. On the policy page, View dry-run logs opens Logs Explorer with the right query, and the organization-wide sink captures the same entries for analysis at scale. Run the dry run for one to two weeks, fix or except what would break, then move the rules from dryRunSpec to spec. Policy Simulator for Organization Policy can also test a proposed policy against your existing resources.

Scope exceptions with tags

Grant exceptions on the narrowest resource. Tag-based conditions are easier to audit than scattered project overrides, because binding a tag is itself controlled by IAM (roles/resourcemanager.tagUser):

name: organizations/ORG_ID/policies/storage.publicAccessPrevention
spec:
  rules:
    - condition:
        expression: "resource.matchTag('ORG_ID/public-website', 'true')"
      enforce: false
    - enforce: true

Keep a register of every exception with an owner and a review date.

Custom constraints for the gaps

Custom constraints let you write a CEL condition against the resource being created or updated, for supported services. For example, deny GKE node pools with auto-upgrade turned off:

# custom-gke-autoupgrade.yaml
name: organizations/ORG_ID/customConstraints/custom.requireGkeNodeAutoUpgrade
resourceTypes:
  - container.googleapis.com/NodePool
methodTypes:
  - CREATE
  - UPDATE
condition: "resource.management.autoUpgrade == false"
actionType: DENY
displayName: Require node auto-upgrade on GKE node pools
description: Node pools must keep auto-upgrade enabled.
gcloud org-policies set-custom-constraint custom-gke-autoupgrade.yaml

Then enforce it with a policy named organizations/ORG_ID/policies/custom.requireGkeNodeAutoUpgrade, dry run first. Before writing a custom constraint, check whether a managed one already exists; Google recommends iam.managed.allowedPolicyMembers over custom IAM member constraints, for example.

CIS audit workflow

The CIS Google Cloud Platform Foundation Benchmark v5.0.1 groups recommendations into IAM (including the organization controls above), logging and monitoring, networking, virtual machines, storage, Cloud SQL, BigQuery and Dataproc, each with an audit procedure and a Level 1 or Level 2 profile. Keep the PDF next to your findings: the audit procedure tells you exactly what a check tests when you suspect a false positive.

Security Command Center for continuous posture

Security Command Center activated at organization level runs Security Health Analytics continuously and, in the Premium tier, shows compliance against CIS. It is the source of truth for alerting. Its tiers, mute rules and exports are covered on its own page.

Prowler for a portable CIS report

Prowler maps its checks to CIS GCP versions and produces reports auditors can read. Run it with a dedicated read-only identity (roles/viewer and roles/iam.securityReviewer at the organization), from Cloud Run jobs or a VM with an attached service account, or with impersonation. Never with a key.

pipx install prowler
gcloud auth application-default login

prowler gcp --list-compliance

prowler gcp \
  --organization-id ORG_ID \
  --compliance cis_5.0_gcp \
  --output-formats csv html json-ocsf

Use --project-ids prj-website-prod prj-app2-prod to scope a run. Prowler skips checks when a project has the relevant API disabled, so read the manual and skipped sections, not just the failures. The OCSF JSON feeds a SIEM; the HTML report is readable by non-specialists.

ScoutSuite for exploring an unfamiliar estate

ScoutSuite from NCC Group collects configuration through the APIs and builds an offline HTML report. Its rules overlap CIS but are not labelled per CIS ID, and its release cadence has slowed, so treat it as a complement:

pipx install scoutsuite
scout gcp --user-account --organization-id ORG_ID

The principal needs Viewer, Security Reviewer and Stackdriver Account Viewer, and the Cloud Resource Manager API must be enabled in scanned projects.

Triage findings into owned work

A first scan of an older organization produces hundreds of findings. Do not fix them in order.

  1. Stop the growth with organization policy. If fifty buckets lack uniform access, enforce the constraint first, then remediate.
  2. Exposure first. Public buckets, SSH or RDP open to 0.0.0.0/0, user-managed service account keys and basic roles on service accounts.
  3. Route by owner. Group findings by folder or project label and send each team its own list.
  4. Accept explicitly. Mute intended findings in SCC or record the exception, with an owner and a review date.
  5. Track the trend. Open high and critical findings over time is the useful metric, not the raw count.

Keep it from drifting

Run Prowler weekly or monthly and diff against the previous run, keep SCC notifications flowing to owning teams, and review mute rules and policy exceptions every quarter. A Security Command Center posture deployed on the organization reports drift from your intended org policies as findings.

Logging and detection

Organization policy, IAM and folder changes are Admin Activity audit logs, always on and kept 400 days in the _Required bucket. Route them through the organization sink described on the Cloud Logging page and alert on any policy change, since an attacker with orgpolicy.policyAdmin can relax a constraint before acting:

protoPayload.serviceName="orgpolicy.googleapis.com"
protoPayload.methodName:("CreatePolicy" OR "UpdatePolicy" OR "DeletePolicy" OR "CreateCustomConstraint" OR "UpdateCustomConstraint")

Also alert on organization-level IAM changes, lien changes and project or folder moves:

(protoPayload.methodName="SetIamPolicy" AND resource.type="organization")
OR (protoPayload.serviceName="cloudresourcemanager.googleapis.com"
    AND protoPayload.methodName:("lien" OR "move"))

The : operator is a case-insensitive substring match, so the second clause catches move operations such as cloudresourcemanager.v3.projects.move and cloudresourcemanager.v3.folders.move whatever the API version. Check the exact lien method names against a test entry in your own logs before relying on the alert.

Dry-run violations appear in the same audit logs and are worth a dashboard during rollouts. In Security Command Center, watch NON_ORG_IAM_MEMBER, USER_MANAGED_SERVICE_ACCOUNT_KEY, ESSENTIAL_CONTACTS_NOT_CONFIGURED and posture drift findings, and Event Threat Detection's IAM anomaly detectors such as Persistence: IAM Anomalous Grant.

Common mistakes

  • Assuming an older organization has the secure-by-default constraints. Only organizations created on or after May 3, 2024 got them; check with gcloud org-policies list.
  • Leaving the domain-wide Project Creator and Billing Account Creator bindings in place, which lets anyone build shadow infrastructure outside your folders.
  • Using a super admin account for daily mail and cloud work, or protecting it with SMS codes instead of security keys.
  • Granting exceptions at folder level or with enforce: false at the organization to unblock one project, instead of a project override or a tag condition.
  • Enforcing a blocking constraint without a dry run, then rolling it back under pressure and never re-enforcing it.
  • Treating enforcement as cleanup. Existing keys, public ACLs and external IPs survive; they need an inventory and a remediation plan.
  • Letting audit findings pile up without owners, so the CIS score stays flat while the count grows.

References

About the author

Security engineer writing practical, benchmark-aligned guides to hardening Google Cloud organizations, projects and workloads.

Related services

All services