ericrisco/rsc-harness / skills/gcp-essentials
gcp-essentials
VerifiedUse when running a small product on core Google Cloud via the gcloud CLI: a project, Cloud Run deploys, a locked-down Cloud Storage bucket, managed Cloud SQL, and least-privilege IAM wiring them together. NOT AWS (that is `aws-essentials`), NOT the CI pipeline that ships the image (that is `deployment`), NOT Postgres schema/query tuning (that is `postgresdb`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 14.6 KB |
| evals/README.md | markdown | 788 B |
| evals/cases.yaml | config | 2.5 KB |
| references/deploy-recipes.md | markdown | 2.7 KB |
| references/iam-and-auth.md | markdown | 3.7 KB |
| references/networking-and-sql.md | markdown | 3.2 KB |
| scripts/verify.shexecutable | script | 5.5 KB |
references/iam-and-auth.md
View on GitHub# IAM & auth
Depth for the IAM section of SKILL.md. Predefined roles, keyless CI, impersonation,
drift detection.
## Predefined roles for a typical product
Prefer these Google-maintained roles over primitives or custom roles. Bind them to the
service's dedicated SA at the narrowest resource scope the role supports.
| Need | Role | Scope it to |
|------|------|-------------|
| Connect to Cloud SQL from the workload | `roles/cloudsql.client` | project |
| Read/write objects in one bucket | `roles/storage.objectAdmin` | the bucket |
| Read object content only | `roles/storage.objectViewer` | the bucket |
| Read one secret's value | `roles/secretmanager.secretAccessor` | the secret |
| Invoke a private Cloud Run service | `roles/run.invoker` | the service |
| Push/pull container images | `roles/artifactregistry.writer` | the repo |
| Write logs/metrics from the app | usually implicit on Cloud Run runtime SA | — |
Bind at resource scope when possible — e.g. a secret, not the project:
```bash
gcloud secrets add-iam-policy-binding db-password \
--member="serviceAccount:api-sa@acme-prod.iam.gserviceaccount.com" \
--role="roles/secretmanager.secretAccessor"
```
## Workload Identity Federation for GitHub Actions (keyless)
No JSON key downloaded, ever. GitHub's OIDC token is exchanged for short-lived GCP
credentials.
```bash
# 1. A pool + an OIDC provider that trusts GitHub's issuer
gcloud iam workload-identity-pools create github \
--location=global --display-name="GitHub Actions"
gcloud iam workload-identity-pools providers create-oidc github-oidc \
--location=global --workload-identity-pool=github \
--display-name="GitHub OIDC" \
--issuer-uri="https://token.actions.githubusercontent.com" \
--attribute-mapping="google.subject=assertion.sub,attribute.repository=assertion.repository" \
--attribute-condition="assertion.repository=='acme/api'"
# 2. Let the deploy SA be impersonated only from that repo
PROJECT_NUM=$(gcloud projects describe acme-prod --format='value(projectNumber)')
gcloud iam service-accounts add-iam-policy-binding \
deployer@acme-prod.iam.gserviceaccount.com \
--role="roles/iam.workloadIdentityUser" \
--member="principalSet://iam.googleapis.com/projects/${PROJECT_NUM}/locations/global/workloadIdentityPools/github/attribute.repository/acme/api"
```
In the workflow, use `google-github-actions/auth` with the provider resource name and
`service_account` — never a `credentials_json` secret. The `attribute-condition`
pinning the exact repo is the security boundary; without it any repo could mint
credentials.
## Service account impersonation
Run a one-off command *as* a service account without holding its key. The caller needs
`roles/iam.serviceAccountTokenCreator` on the target SA.
```bash
gcloud storage ls gs://acme-prod-uploads \
--impersonate-service-account=api-sa@acme-prod.iam.gserviceaccount.com
```
Use this to test that an SA actually has the access you think it does — least surprise
before deploy.
## IAM Recommender (catch drift)
The Recommender flags roles a member has not used in 90 days, so you can prune
over-grants. Review it on a schedule.
```bash
gcloud recommender recommendations list \
--project=acme-prod --location=global \
--recommender=google.iam.policy.Recommender \
--format="table(content.overview)"
```
## IAM Conditions
Attach a condition to narrow a binding by time or resource attribute — e.g. access to
objects under one prefix only.
```bash
gcloud projects add-iam-policy-binding acme-prod \
--member="serviceAccount:api-sa@acme-prod.iam.gserviceaccount.com" \
--role="roles/storage.objectViewer" \
--condition='expression=resource.name.startsWith("projects/_/buckets/acme-prod-uploads/objects/public/"),title=public-prefix-only'
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |