Skip to main content

Command menu

Jump to a page or search the catalog

AI Tools & Scripts

GCP IAM Policy Check

Check Google Cloud IAM in Terraform, policy files, Config Connector, CI files and gcloud or gsutil commands: key files, public write grants, domain-wide Owner, project-wide impersonation, authoritative policies and open workload identity.

$5.00

What you get: 1 file · 52.79 KB · ZIP

See purchase options

Product description

A CI service account with roles/editor, a google_project_iam_binding for roles/owner that quietly removes every other owner Terraform does not know about, roles/iam.serviceAccountUser on the whole project so a developer can act as any service account, and a GitHub Actions workload identity provider without an attribute condition, so a workflow in someone else's repository can get tokens for your pool. This skill finds those patterns and the others listed below before you apply or commit, and tells you how to fix each one.

Your agent runs a scanner on Terraform (every google_*_iam_member, _binding and _policy resource, google_iam_policy data sources, the terraform-google-modules IAM modules, bucket and object ACL resources, buckets, BigQuery dataset access, service account keys, workload identity pool providers, Cloud Run's invoker check), IAM policy files in JSON or YAML as gcloud get-iam-policy writes them, Config Connector IAM resources, Cloud Build steps, GitHub Actions workflows, and gcloud and gsutil command lines in shell, PowerShell and batch scripts, Makefiles, Dockerfiles and CI YAML. It knows the member types (allUsers, allAuthenticatedUsers, domain:, principal:// and principalSet:// identifiers, default and Google-managed service accounts), sorts roles into basic, read or invoke, impersonation and write roles, tells project, folder and organization grants from grants on one resource, follows for_each role lists, and never calls Google Cloud or runs anything. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed.

What it checks

BLOCK (fix before shipping)

  • G01: a service account key (JSON with "type": "service_account" and a filled-in private_key) as a file or pasted into a .env value, CI file or Kubernetes Secret
  • G02: allUsers or allAuthenticatedUsers with more than public read or invoke: a write or admin role, a basic role, or any role on a project, folder or organization
  • G03: a Cloud Storage ACL that gives everyone WRITER or OWNER (gsutil acl ch -u AllUsers:W, publicReadWrite, --add-acl-grant with role=OWNER, WRITER:allUsers in Terraform)
  • G04: roles/owner, roles/editor, roles/admin or roles/writer for a whole domain, every identity in a workload or workforce identity pool, or every service account of a project, folder or organization

REVIEW (check before release)

  • G11: public read or invoke (viewer, reader or invoker roles for allUsers or allAuthenticatedUsers, public-read ACLs, --allow-unauthenticated, --no-invoker-iam-check, invoker_iam_disabled); right for a public site or API, so it is a review, not a block
  • G12: a basic role that can change things (roles/owner, roles/editor, roles/admin, roles/writer) for a user, group or service account
  • G13: authoritative IAM on a project, folder, organization or billing account (google_*_iam_policy or _binding there, the IAM module in authoritative mode, Config Connector IAMPolicy, gcloud set-iam-policy)
  • G14: service account keys created or used (google_service_account_key, IAMServiceAccountKey, gcloud iam service-accounts keys create or upload, activate-service-account --key-file, credentials_json in google-github-actions)
  • G15: service account user, token creator, workload identity user, key admin or OpenID token creator granted on a whole project, folder or organization
  • G16: a bucket that allows object ACLs (no uniform_bucket_level_access = true, ubla set off) or has public access prevention switched back to inherited
  • G17: the Compute Engine or App Engine default service account with Owner, Editor, Admin or Writer
  • G18: a role for every identity in a workload identity pool, or a GitHub Actions, gitlab.com or HCP Terraform provider without an attribute condition

What's included

  • The scanner (Python 3.9+, standard library only)
  • A rules guide with the reason, safer approach and official Google Cloud or Terraform documentation link for each rule
  • A risky and a safe example project (Terraform IAM, buckets and workload identity, a key file, a bootstrap script with gcloud and gsutil, a GitHub Actions workflow), and the real report the scanner produces on the risky one

Limits

It reads files as written. Values from variables, locals, .tfvars and other modules are not followed, and what is really applied in Google Cloud, organization policies and the permissions inside custom roles are not visible; role classes come from the role name. Public read and invoke are reported for review on purpose, also on the official public Cloud Run example, and every Terraform bucket without uniform bucket-level access gets G16. G01 also reports fake or test keys, because a scanner cannot tell them from live ones; .p12 keys, Terraform state and plan files are not read. NOT FLAGGED is not a guarantee.

Contents

One ZIP file with 22 files: SKILL.md, the scanner in scripts/ (9 Python files), references/rules.md (every rule with its reason and safer approach), and examples/ (12 example files plus report.md, the real scanner output on the risky example).

How to use: This is an agent skill: a folder with a SKILL.md file and Python scripts that an AI coding agent such as Claude Code, Cursor, or Codex CLI can run. Unzip it into your agent's skills folder (for Claude Code: ~/.claude/skills/), then ask your agent to check your project. The scripts also run on their own with Python 3.9 or newer, with nothing to install. They read your files only: no network access, and nothing is sent anywhere.

What you get

1 file · 52.79 KB

  • gcp-iam-policy-check-1.0.0.zipZIP · 52.79 KB
LicenseCommercial use allowed
Package checkPassed

Getly opened the uploaded files and found nothing that would stop them opening. It is not a virus scan or a quality rating.

Views38
PublishedNov 25, 2026
File size52.79 KB
File formatZIP
Versionv1.0

Tags

gcpiamterraformsecuritydevopsai agent skill
T
TAMAM

Frequently asked questions

Do I get access instantly?

Yes. This is a digital product - you can download it right after checkout, straight from your library.

Can I use it for commercial projects?

Yes. Commercial use is allowed: use it in your own business and in things you sell. You may not resell or redistribute the file itself.

What's your refund policy?

You can request a refund within 30 days. If something isn't right, request it from your order and the Getly team reviews it.

What file formats and sizes will I get?

You'll download 1 file - ZIP - 52.79 KB in total.

Do I get free updates?

Yes - when the seller ships a new version, you can re-download the latest files from your library at no extra cost. Check the changelog for recent updates.

Price

$5.00