agentleFS
jpantsjohajpantsjoha/googlecloud-plugin/skills/iam/SKILL.md

iam

Skill4 starsChanged 4 months agoMITView on GitHub

Google Cloud IAM — identity, access management, service accounts, and policy authoring. Enforces least-privilege by default. Covers roles, conditions, service account patterns, Workload Identity Federation, and gcloud CLI. Never grants owner or editor roles. Use when the user mentions: iam policy, grant access, least privilege, IAM binding, who has access, iam conditions, gcloud iam. Use this to author or change IAM; use gcp-security instead to audit an existing posture against the security gate.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create SA key files when impersonation, an attached service account or Workload Identity Federation can do the job (see …

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

IAM — Identity and Access Management

Control who (identity) can do what (role) on which GCP resource. Always least-privilege.

Principles

  1. Least privilege — grant the minimum role needed. Prefer predefined roles over basic roles. Never grant roles/owner or roles/editor programmatically.
  2. Service accounts for workloads — not user accounts. Use Workload Identity to avoid SA key files.
  3. IAM Conditions — scope bindings by resource, time, or request attribute where possible.
  4. Audit regularly — gcloud projects get-iam-policy to review bindings; remove stale grants.

Core Patterns

Grant a predefined role

gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="serviceAccount:SA@PROJECT.iam.gserviceaccount.com" \
  --role="roles/run.invoker"

Create a service account

gcloud iam service-accounts create SA_NAME \
  --display-name="Description" \
  --project PROJECT_ID

List effective permissions on a resource

gcloud projects get-iam-policy PROJECT_ID \
  --flatten="bindings[].members" \
  --format="table(bindings.role,bindings.members)"

IAM Condition (time-bound access)

gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="user:USER@example.com" \
  --role="roles/viewer" \
  --condition="expression=request.time < timestamp('2026-12-31T00:00:00Z'),title=temp-access"

Never Do

  • Grant roles/owner or roles/editor to service accounts or automation
  • Create SA key files when impersonation, an attached service account or Workload Identity Federation can do the job (see shared/auth/README.md)
  • Share service account keys across environments

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.