agentleFS
ai-workspace-labai-workspace-lab/xworkspace-core-skills/skills/operations-management/secrets-identity-and-access-governance/SKILL.md

secrets-identity-and-access-governance

Skill8 starsChanged 5 months agoMITView on GitHub

Govern Vault policies and roles, OIDC workload identity, least privilege, secret ownership, rotation, audit, emergency revocation, and environment isolation. Use when creating or changing access, onboarding a pipeline or service, rotating credentials, reviewing permissions, or responding to a suspected secret exposure.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Treat identity policy as production code.

    line 8
  2. Distinctive:

    Prefer workload identity: GitHub Actions or GitLab CI OIDC → Vault → short-lived provider/service credential.

    line 16
  3. Distinctive:

    Keep environment paths and roles isolated.

    line 19
  4. Distinctive:

    Use an environment-first path layout so a CI identity can be restricted by a single prefix and a reviewer can identify the blast radius …

    line 29
  5. Distinctive:

    Treat policy/role changes as a two-part delivery: configuration change plus an authorization test from the intended workload identity.

    line 51
  6. Distinctive:

    Never log, commit, artifact, cache, or persist secret values.

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Secrets, Identity, and Access Governance

Treat identity policy as production code. Authentication, authorization, secret paths, and audit evidence must be reviewable, environment-scoped, and revocable.

Agent 团队的任务/run/会话索引与归档边界遵循Agent Team Harness;不得将凭据、令牌或秘密环境值写入任务评论、handoff、Drive 归档或 QMD 索引。

涉及系统、容器或数据库身份与权限的运维时,必须同时遵循系统与 DB 三权分立补充规范:管理不运行业务,业务独立读写并渐进 rootless,审计独立且强制只读;采用最小化渐进改造,不扩大既有操作授权。

1. Identity model

  • Prefer workload identity: GitHub Actions or GitLab CI OIDC → Vault → short-lived provider/service credential.
  • Bind roles to immutable, narrow claims: repository/project identity, approved workflow/pipeline path, protected ref/tag, environment, audience, and expiry. Do not use wildcards where a specific workflow or environment can be bound.
  • Separate human, CI, service, break-glass, and provider identities. Do not reuse a root token or a shared admin identity for routine deployment.
  • Keep environment paths and roles isolated. Derive the selected Vault path from a single approved runtime variable; do not scatter environment path literals or cross-environment fallback.

2. Secret lifecycle

For every secret record an owner, consumer, source, scope, rotation interval, last rotation, revocation method, dependency impact, and audit location. Prefer dynamic credentials; when static credentials are unavoidable, rotate them automatically or on a tested schedule.

Policies grant only the exact path/action needed. Separate read, write, administration, and recovery permissions. A pipeline that only reads deployment credentials must not list, write, or delete adjacent paths.

2.1 Vault KV v2 path contract

Use an environment-first path layout so a CI identity can be restricted by a single prefix and a reviewer can identify the blast radius from the path alone:

kv/<env>/platform/{oidc,jwt,cloudflare,gcp,observability,gitea}
kv/<env>/services/{xconnect,ai-workspace}
  • <env> is an explicit, allowlisted value such as uat or prod; a missing value is a preflight error. Do not create a kv/shared credential bucket or copy one environment's provider key into another path.
  • GitHub Actions authenticates with OIDC and receives read access only to the paths required by its environment and job. Terraform provisions projects, service accounts and workload identity bindings but never writes secret values to Git; Ansible writes or renders runtime configuration through Vault.
  • A new secret path requires an owner, consumer, rotation interval, policy rule, and redacted verification record. CI checks must reject cross-environment path references, wildcard reads broader than the job allowlist, and any secret value in YAML, Terraform variables, artifacts or logs.

3. Change and audit

Treat policy/role changes as a two-part delivery: configuration change plus an authorization test from the intended workload identity. Verify the allowed path works, adjacent paths fail, the wrong environment/ref/workflow fails, and audit logs contain the expected actor, role, path, and request ID.

Never log, commit, artifact, cache, or persist secret values. Redact diagnostics while retaining safe identifiers such as role name, path (when non-sensitive), request ID, and status code.

3.1 Release-route and Vault consistency

For every delivery path, compute the environment once and use that same value for the deployment route, GitHub Environment, Vault role suffix, KV path, artifact selection, and release tests. Review the complete tuple together:

event/ref -> environment -> artifact/tag -> route -> Vault role/KV path -> tests

Production credentials MUST be unreachable from main, pull-request refs, feature/bugfix branches, and daily-build-* / uat-daily-build-* tags. A production-capable path MUST be limited to refs/tags/v* or refs/heads/release/v*, with protected-ref and approval checks enforced by the workload identity. Test both the intended success path and the wrong-ref, wrong-environment, and adjacent-secret denial paths; a successful Vault login alone is not evidence that routing is correct.

4. Exposure and emergency access

On suspected exposure, contain first: revoke or disable the credential, identify consumers, rotate replacement values, validate recovery, then purge history when a value entered Git. A new commit deleting the value is insufficient.

Break-glass access must be separately owned, time-limited, fully audited, and tested. Its use opens an incident and requires post-use credential rotation and review.

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.