mukul975/anthropic-cybersecurity-skills/auditing-gcp-iam-permissions
Claude Code and agent skill by mukul975/anthropic-cybersecurity-skills
- community
Checking that the SKILL.md file is still in the repository.
'Auditing Google Cloud Platform IAM permissions to identify overly permissive
Install
npx vskill@latest install mukul975/anthropic-cybersecurity-skills/auditing-gcp-iam-permissionsSKILL.md
The same SKILL.md was published earlier as mukul975/anthropic-cybersecurity-skills/auditing-gcp-iam-permissions.
Auditing GCP IAM Permissions
When to Use
- When performing security assessments of GCP organization or project IAM configurations
- When identifying service accounts with excessive permissions or unused access
- When compliance requirements mandate review of access controls and role assignments
- When investigating potential lateral movement through IAM misconfigurations
- When reducing the blast radius of compromised credentials by scoping down permissions
Do not use for VPC firewall rule auditing (use network security tools), for GKE RBAC auditing (use Kubernetes-specific RBAC tools), or for real-time threat detection on IAM actions (use SCC Event Threat Detection).
Prerequisites
- GCP organization or project with
roles/iam.securityReviewerandroles/cloudAsset.viewer - gcloud CLI authenticated with appropriate permissions
- Cloud Asset API enabled (
gcloud services enable cloudasset.googleapis.com) - IAM Recommender API enabled (
gcloud services enable recommender.googleapis.com) - Policy Analyzer API enabled (
gcloud services enable policyanalyzer.googleapis.com)
Workflow
Step 1: Enumerate IAM Bindings Across the Organization
List all IAM bindings at organization, folder, and project levels to understand the full access landscape.
Step 2: Audit Service Accounts and Their Keys
Identify service accounts with excessive permissions, user-managed keys, and unused accounts.
Step 3: Use IAM Recommender to Identify Excess Permissions
Leverage GCP's IAM Recommender to find roles that grant more access than actually used.
Step 4: Analyze Effective Permissions with Policy Analyzer
Use Policy Analyzer to determine effective access for specific principals or resources.
Step 5: Check for Domain-Wide Delegation and Impersonation Risks
Identify service accounts with domain-wide delegation and impersonation capabilities.
Step 6: Generate Audit Report and Apply Remediation
Compile findings and implement recommended permission reductions.
Key Concepts
| Term | Definition | |
|---|---|---|
| Primitive Role | Legacy GCP roles (Owner, Editor, Viewer) that grant broad permissions across all services, not recommended for production | |
| Predefined Role | GCP-managed role scoped to specific services and actions, providing more granular access than primitive roles | |
| IAM Recommender | GCP ML-based service that analyzes actual permission usage and suggests role reductions to achieve least privilege | |
| Policy Analyzer | Tool for analyzing effective IAM access across the organization hierarchy, answering who-can-access-what queries | |
| Service Account Key | User-managed credential for service account authentication, a security risk as keys can be exported and do not auto-expire | |
| Domain-Wide Delegation | Grants a service account the ability to impersonate any user in the Google Workspace domain, a significant privilege escalation risk |
Tools & Systems
- gcloud CLI: Primary tool for querying and managing GCP IAM policies, service accounts, and role bindings
- IAM Recommender: ML-based recommendation engine for reducing excessive permissions based on actual usage
- Policy Analyzer: Organization-wide effective access analysis tool for understanding who can access what
- Cloud Asset Inventory: Cross-project search for IAM policies and resource metadata
- ScoutSuite: Multi-cloud auditing tool with GCP IAM-specific checks for role assignments and service accounts
Common Scenarios
Scenario: Reducing Primitive Role Usage Across a GCP Organization
Context: An audit reveals that 60% of IAM bindings across the organization use primitive roles (Owner/Editor). The security team needs to migrate to predefined roles without disrupting developer workflows.
Approach:
- Run
gcloud asset search-all-iam-policiesto inventory all primitive role bindings - Use IAM Recommender to get ML-based suggestions for replacement predefined roles
- For each binding, use Policy Analyzer to understand what the principal actually accesses
- Create a mapping document: primitive role -> specific predefined roles needed
- Apply predefined roles alongside primitive roles for a testing period
- Monitor for access denied errors using Cloud Audit Logs
- Remove primitive roles after confirming no access issues over 2 weeks
Pitfalls: Primitive roles include permissions across all GCP services, so replacing them requires multiple predefined roles. The Recommender may suggest overly restrictive roles if the observation period does not capture all use cases. Custom roles can fill gaps where no predefined role matches the exact permission set needed.
Output Format
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/auditing-gcp-iam-permissions/SKILL.md
Popularity
- Repository stars
- 33,507
- Repository forks
- 4,067
- 7-day trend score
- 52
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mukul975/anthropic-cybersecurity-skills/auditing-gcp-iam-permissions)