Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    GCP IAM Policy Security Audit

    by CashonlyTian

    1

    Stop granting excessive permissions before they are deployed.

    $7

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    GCP IAM Policy Security Audit

    GCP IAM Policy Security Audit

    Example session with this skill installed

    Run a security audit on the GCP IAM policies in the 'infrastructure/prod-iam' folder. The project is 'fintech-main-prod' and our domain is 'fintech.example'. Use accent color #0D9488.

    • Read your context and instructions
    • Compiled the gcp iam policy
    • Generated the document

    I have completed the security audit for project

    fintech-main-prod. The scan analyzed IAM bindings, service account keys, and custom roles found in the infrastructure/prod-iam directory.

    Score: 7/100
    Grade: F
    Risk Level: CRITICAL

    Found 48 findings.

    Audit Results

    Check CategoryScoreStatusKey Findings
    Primitive Roles0/15FAILFound 3 roles/owner bindings.
    Public Access15/15PASSNo public access detected.
    Impersonation0/10FAILserviceAccountTokenCreator granted to a group.
    Admin Roles5/10WARNsecurityAdmin role assigned to a dev user.
    SA Keys10/10PASSNo expired or committed keys found.
    External Members8/10WARN2 gmail.com addresses in Secret Manager roles.
    Custom Roles10/10PASSNo dangerous permissions in custom roles.
    Secret Manager10/10PASSAccess restricted to specific service accounts.
    IAM Conditions5/5PASSSensitive bindings use IAM conditions.
    Logging & Policy5/5PASSAudit logs and org policy constraints active.

    Top 3 Recommended Fixes:
    1.

    Remove Primitive Roles: Replace roles/owner for the 3 identified users with specific predefined roles like roles/compute.admin or roles/storage.admin.
    2.

    Restrict Impersonation: Scope the serviceAccountTokenCreator grant to specific service accounts rather than granting it at the project level to a group.
    3.

    Clean External Access: Remove the gmail.com accounts from the Secret Manager Secret Accessor role; move these users to the fintech.example organization.

    Files Generated:

    • Report: scan-report.md
    • Visual Scorecard: scan-2024-05-20.png

    Next steps

    • Review scan-report.md for the exact line numbers of the roles/owner violations.
    • Apply the least-privilege role changes in your Terraform files.
    • Re-run the audit to confirm the score increases above 80.

    Clean demo (demo-project-clean): Score: 100/100, Grade: A, 0 findings.

    scan-2024-05-20.png

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop granting excessive permissions before they are deployed. This skill audits GCP IAM policy documents, Terraform files, and service account keys to identify security gaps that lead to project takeover. It moves beyond basic linting by scoring your security posture across ten specific risk vectors, including impersonation chains and external member leaks.

    What it does

    • Primitive Role Detection Flags roles/owner and roles/editor bindings that violate least-privilege principles.
    • Impersonation Chain Analysis Identifies grants like serviceAccountTokenCreator that allow members to assume high-privilege service account roles.
    • External Member Auditing Detects gmail.com, free-mail, or non-org domain accounts with access to sensitive resources.
    • Custom Role Inspection Scans for dangerous permissions such as actAs, getAccessToken, and setIamPolicy within custom definitions.
    • Secret Manager Review Flags broad secretAccessor permissions granted to groups, public users, or impersonatable accounts.
    • Scorecard Generation Produces a shareable PNG scorecard and a prioritized Markdown report with a 0-100 security grade.

    How it works

    1. Prepare Data Use the provided scripts/gcp_fetch.py or gcloud commands to export IAM policies, service account keys, and org policies to a local folder.
    2. Execute Scan Run the audit against the local directory. The skill analyzes JSON and Terraform files without making network calls or accessing the GCP API.
    3. Review Report Inspect the generated scan-report.md for a ranked list of findings, starting with the highest risk items.
    4. Fix and Re-scan Apply recommended fixes to the policy files and re-run the scan to verify the new security grade.

    Frameworks & tools

    This skill works with GCP IAM JSON exports, Terraform (.tf) files containing IAM resources, and local Google Cloud CLI outputs. It utilizes a local Python-based scanning engine.

    Why this beats prompting it yourself

    Generic prompts often miss complex impersonation chains and don't provide a quantitative security score. This skill uses a structured 10-point rubric to ensure every audit is consistent, measurable, and free of sensitive data leaks through automatic masking.

    Use cases

    • Audit IAM bindings generated by other AI agents before applying them to production.
    • Perform security due diligence when onboarding a third-party or legacy GCP project.
    • Generate visual security scorecards for stakeholder reporting or compliance reviews.
    • Detect expired or committed service account keys hidden in project repositories.

    Known limitations

    Audits local files only and cannot detect manual changes made in the GCP Console not reflected in saved files. Does not resolve Terraform data sources or complex variables.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Audits saved files only, not live GCP state. Does not resolve Terraform variables or data sources. Requires org_domain input to flag non-public external domains. Files over 2MB are skipped.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    Software
    Python 3Pillow

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed4 days ago

    What's inside

    Frequently Asked Questions

    Unlike generic prompts, this skill uses a specialized scanning engine to map "impersonation chains," identifying when a low-privilege user has the rights to assume a high-privilege Service Account, which could lead to a full project takeover.

    The skill is designed to process local JSON exports from the gcloud CLI and standard Terraform (.tf) files, making it compatible with any AI agent that has file-system access and a Python execution environment.

    No, this skill operates entirely on local files to ensure your security data stays private; it does not require a direct connection to your GCP environment or the internet during the scanning process.

    The scorecard is a 0-100 rating based on ten specific risk vectors, such as the use of primitive roles, external domain leaks, and dangerous custom permissions, giving you a measurable benchmark for compliance.

    The audit detects 'roles/owner', 'roles/editor', and 'roles/viewer' bindings, flagging them as high-risk violations of the Principle of Least Privilege and recommending more granular, predefined roles.

    You receive the core scanning engine, a set of data preparation scripts for GCP, a sample report template, and documentation on how to interpret the 10-point risk rubric.

    New in LLM Ops