50 of 50 in All Controls
gcp

Enable Policy Analyzer and IAM Recommender

IDGCP-IAM-004
Severity
medium
Automation
Auto
Category
iam
Enforcementmandatory
Complexity / Impact
low(low impact)
Risk Profile
high likelihood(low residual)
Cloud Scopegcp:organization
Environments
productionnon-production
Target Resources
IAMPolicyServiceAccountRecommenderOrganizationProject
Services
iamrecommendercloudassetlogging
Tags
gcpiamrecommenderleast-privilegepolicy-analyzersecurity-posture
Frameworks
CIS GCPNIST 800-53ISO 27001PCI DSSSOC 2
Governance
cloud-security-team (monthly)
Created
2026-08-28
Last Updated
2026-08-28

Specification & Description

Activate Google Cloud Policy Analyzer and IAM Recommender at the organization level to continuously analyze effective access, discover overprivileged accounts, identify unused permissions, and safely enforce least-privilege IAM bindings across all projects.

Technical Specifications

Google Cloud Policy Intelligence provides two foundational IAM governance capabilities that should be activated organization-wide:

  1. Policy Analyzer: Evaluates effective access across your entire resource hierarchy. It answers complex questions like "Which external users can read this BigQuery dataset?", "Who can impersonate this deployment service account?", and "What effective permissions does a specific engineer have across all folders?" It traces group memberships, inherited bindings, and service account impersonation chains.

  2. IAM Recommender: Continuously analyzes rolling 90-day Cloud Audit Logs per principal (users, groups, and service accounts). When an identity holds broad permissions that are never exercised (e.g., assigned roles/editor but only calling Cloud Storage APIs), the recommender suggests safe, tailored role reductions.

  3. Unused Service Account Discovery: Identifies active service accounts with zero API activity over 90 days, flagging them for safe disabling and decommissioning.

  4. Policy Simulator: Validates proposed permission removals against historical activity before applying them in production, guaranteeing that legitimate workload traffic is not disrupted.

Security Rationale

Role accumulation is a primary cause of privilege creep in growing organizations. Developers and operational service accounts are frequently granted broad administrative roles during initial provisioning and never scoped down. Overprivileged identities dramatically expand the blast radius if credentials are leaked: an attacker who compromises a single service account can exploit unused admin permissions to move laterally and access sensitive data. Together, Policy Analyzer and IAM Recommender provide data-driven evidence of effective access paths and actual permission usage, eliminating the guesswork and fear of breaking production workloads when right-sizing IAM policies.

Business & Security Impact

Enables continuous visibility into excess permissions and inactive service accounts. Applying recommendations tightens permissions without breaking workloads because suggestions are derived from verified 90-day telemetry. High-impact production changes should be validated via Policy Simulator prior to applying.

Policy Exceptions (1)

Break-glass emergency identities and disaster recovery service accounts that are intentionally idle during standard operations are exempt from automated 90-day inactivity deletion, provided they are documented in the emergency access register and tested semi-annually.

Operational & Implementation Notes

IAM Recommender requires a minimum of 90 days of continuous Cloud Audit Logging to establish high-confidence recommendations. In newly created landing zone projects, the recommender will gather telemetry before producing role reduction suggestions. Always pair recommender reviews with Policy Simulator to prevent accidental removal of seasonal or monthly cron job permissions.

Compliance Framework Mappings (5)

Regulatory baselines and industry standards mapped to this control specification.

Beta
Framework / StandardMapped Requirements & ControlsControls
CIS Google Cloud Platform Foundation Benchmark v3.0CIS GCP
1.11.15
2
NIST 800-53 Rev 5NIST 800-53
AC-2(2)AC-6IA-2
3
ISO 27001:2022ISO 27001
A.8.2A.8.5
2
PCI DSS v4.0PCI DSS
7.2.17.2.2
2
SOC 2SOC 2
CC6.1CC6.3
2

* Compliance framework mappings are provided for informational architectural reference. Always verify control alignment against your organization's formal audit requirements.

Automated Detection & Rule Logic

Detection Engine: gcp-api • Automated: Yes

Run Policy Analyzer to discover effective administrative access across the organization hierarchy, and query the Recommender API for active recommendations under google.iam.policy.Recommender across all projects. Flag principals with active recommendations in the 'ACTIVE' state older than 30 days as candidates for least-privilege review.

Policy Analyzer - Query Effective Permissionsbash
ORG_ID="YOUR_ORGANIZATION_ID"

# Analyze which identities hold administrative roles across the organization
gcloud asset analyze-iam-policy \
  --organization="${ORG_ID}" \
  --roles="roles/owner,roles/resourcemanager.organizationAdmin"
Audit Active IAM Recommendationsbash
# Check active recommendations for a project
gcloud recommender recommendations list \
  --recommender="google.iam.policy.Recommender" \
  --location="global" \
  --project="PROJECT_ID" \
  --filter="stateInfo.state=ACTIVE"

# Or loop across all active landing zone projects
for proj in $(gcloud projects list --filter="lifecycleState=ACTIVE" --format="value(projectId)"); do
  echo "=== Recommendations for: $proj ==="
  gcloud recommender recommendations list \
    --recommender="google.iam.policy.Recommender" \
    --location="global" \
    --project="$proj" \
    --filter="stateInfo.state=ACTIVE" 2>/dev/null || true
done

Preventative Enforcement Policies

Terraform - Centralized BigQuery Recommendation Exporthcl
# 1. Enable Recommender and Cloud Asset APIs in Management Project
resource "google_project_service" "recommender_api" {
  project = var.management_project_id
  service = "recommender.googleapis.com"
}

resource "google_project_service" "cloudasset_api" {
  project = var.management_project_id
  service = "cloudasset.googleapis.com"
}

# 2. Central BigQuery Dataset for Organization Recommendations
resource "google_bigquery_dataset" "iam_insights" {
  project    = var.management_project_id
  dataset_id = "iam_recommender_export"
  location   = "US"
}

# 3. Schedule daily Asset Inventory and IAM Policy Analysis Export
resource "google_cloud_asset_organization_feed" "iam_feed" {
  billing_project = var.management_project_id
  org_id          = var.organization_id
  feed_id         = "iam-policy-changes"
  content_type    = "IAM_POLICY"

  feed_output_config {
    pubsub_destination {
      topic = "projects/${var.management_project_id}/topics/iam-policy-events"
    }
  }
}
gcloud CLI - Inspect and Apply Recommendationsbash
# List all IAM role reduction recommendations across a project
gcloud recommender recommendations list \
  --recommender="google.iam.policy.Recommender" \
  --location="global" \
  --project="PROJECT_ID" \
  --format="table(name.basename(),stateInfo.state,description)"

# Describe a specific recommendation to view proposed role changes
gcloud recommender recommendations describe "RECOMMENDATION_ID" \
  --recommender="google.iam.policy.Recommender" \
  --location="global" \
  --project="PROJECT_ID"

Remediation Guide & Automation

Enable the Recommender and Cloud Asset APIs at the organization level, establish centralized BigQuery exports, run Policy Analyzer to inspect effective access paths, and systematically apply IAM role downsizing recommendations on a regular sprint cadence.

Step-by-Step Instructions

  1. Enable recommender.googleapis.com and cloudasset.googleapis.com across your centralized governance project.
  2. Grant roles/recommender.iamAdmin and roles/cloudasset.viewer to the central cloud security team at the organization root.
  3. Run Policy Analyzer to inspect effective access graphs and identify excessive administrative permissions on sensitive folders.
  4. Review high-priority role reduction recommendations in the Google Cloud Console (IAM > Policy Intelligence > Recommender).
  5. Test proposed role changes in staging projects using IAM Policy Simulator to verify no required permissions are missing.
  6. Apply approved recommendations via gcloud, Terraform, or the Cloud Console to revoke unused permissions.
  7. Disable and subsequently delete service accounts flagged as having zero activity over the trailing 90 days.
Remediation Script: Fetch and Review Overprivileged SAsbash
# Query IAM recommendations for unused or overprivileged service accounts
gcloud recommender recommendations list \
  --recommender="google.iam.policy.Recommender" \
  --location="global" \
  --project="PROJECT_ID" \
  --filter="description ~ 'unused' OR stateInfo.state=ACTIVE" \
  --format="json" | jq '.[] | {name: .name, description: .description, state: .stateInfo.state}'

Cross-Cloud Policy Equivalence

Equivalent controls across multi-cloud provider platforms.

We value your privacy

We use analytics cookies to understand how visitors interact with our site and to improve the user experience. You can choose to accept or decline these cookies.