Skip to content

docs(azure-naming): split key vaults by isolation class - #691

Merged
kyle-sexton merged 2 commits into
mainfrom
docs/key-vault-isolation-class
Oct 4, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
docs/key-vault-isolation-class

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: first step of a planned key vault split for cross-account page publishing; the plan lives in the claude-code-plugins working notes, not a tracker item.

Summary

The consumer-split rule named each key vault for the one identity that reads it. A vault shared by several readers with the same access, such as a host-credential vault every host uses, has no single consumer to name. This changes the rule to name a vault for the isolation class of the secrets it holds.

Fix

  • conventions/engineering/azure-naming.md: "The consumer-split rule" becomes "The isolation-class rule":
    • the vault token names the secrets' isolation class;
    • readers get roles per vault, which is per class;
    • a class splits when a reader needs only part of it;
    • existing vault names are read as class names;
    • secrets as a token stays banned.
  • The <consumer> token becomes <class>, and the key vault pattern becomes kv-melo-<class>-<env>.
  • New pattern row: service principal sp-<workload>-<env>, labeled judgment, because Microsoft's abbreviation list has no service principal entry. It has no melo token because display names need not be unique.
  • conventions/engineering/README.md: the index row now names the isolation-class rule.

Verification

  • grep -rn -e consumer-split -e '<consumer>' conventions/ prints nothing.
  • grep -n 'sp-<workload>-<env>' conventions/engineering/azure-naming.md finds one line (26).
  • No other file in this repository references kv-melo or the old rule.
  • Pre-commit: markdownlint, editorconfig, typos and gitleaks pass.

Related

  • Follow-up provisioning PR: ADR 0003 binds kv-melo-hosts-prod under this rule.
  • Follow-up dotfiles PR: vault-exec cloud mode reads the developer-key class.

🤖 Generated with Claude Code

Replace the consumer-split rule with an isolation-class rule: a vault's
token names the class of secrets it holds, readers get roles per class,
and a class splits when a reader needs only part of it. Existing vault
names are read as class names. Add an sp-<workload>-<env> row for
service principals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 4, 2026 17:44
@claude

claude Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 3m 53s —— View job


Code review complete

  • Gather context (diff, CLAUDE.md/REVIEW.md, changed files)
  • Understand the request (CI code-review lane per /review:code-review)
  • Review conventions/engineering/azure-naming.md
  • Review conventions/engineering/README.md
  • Post findings

No blocking or high-signal findings. This is a documentation-only rename/restructure (consumer-split → isolation-class rule, <consumer> → <class>, plus a new service-principal pattern row) and it holds together:

  • The ## Tokens and ## Patterns by resource type tables stay consistent with the renamed rule and the new sp-<workload>-<env> row's judgment rationale (no melo token, no CAF abbreviation entry) (azure-naming.md#L37-L42).
  • The new isolation-class bullets (azure-naming.md#L131-L138) are internally consistent: "move the part that reader may not see into a vault of its own" correctly leaves the restricted reader's vault containing only what it may see.
  • conventions/engineering/README.md's index row was updated in parallel and still names the current section headers (isolation-class, nonsecret-placement, fleet).
  • Verified the PR's own verification claims rather than just trusting them: grep -rn -e consumer-split -e '<consumer>' across the repo is empty, and kv-melo now appears only in azure-naming.md itself — no other normative doc (e.g. secrets-lifecycle.md, which uses "consumer" in an unrelated, generic sense) assumes the old consumer-named-vault concept, so the cross-doc reconciliation this repo's governance process calls for holds.
  • No security- or CI-workflow-relevant surface is touched, so the security lane's scope and the Actions-dependency check in REVIEW.md don't apply here.

@claude

claude Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 32s —— View job


Security review — /review:security-review

Scope: conventions/engineering/azure-naming.md and conventions/engineering/README.md — a documentation-only change renaming the "consumer-split rule" to the "isolation-class rule" for Azure key vault naming, adding a service-principal naming row, and updating the index.

Instruction-surface check: This diff replaces a standing rule ("The consumer-split rule" → "The isolation-class rule") in a conventions file, so I checked it against the instruction-exception-register lens. docs/conventions/instruction-exception-register/README.md is not present in this checkout, so the protected-class list itself was not consulted — falling back to recognition-by-consequence as the skill instructs.

By consequence, the rename does not weaken the security boundary it documents:

  • The quoted Microsoft access-boundary guidance (separate vaults by what secrets a reader should access) is preserved verbatim.
  • The new rule adds explicit, stricter normative bullets not present before: "a reader is granted a vault only when it may read every secret in it" and "a class splits when a reader needs part of it: move the part that reader may not see into a vault of its own" (azure-naming.md#L129-L138).
  • The ban on secrets as a bare token is carried forward unchanged.
  • No access-control code, pipeline, or policy file is touched — this is naming-convention prose only, with no mechanism elsewhere in the repo that depended on the old "consumer" wording.

No other security-relevant surface: no secrets, credentials, injection vectors, or GitHub Actions config are touched by this diff (git diff origin/main...HEAD confirms only the two docs files, 28/-11 lines).

Result: no security findings. This is a documentation/naming-convention PR with no exploitable logic, authorization, or trust-boundary change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T17:46:56.439969Z 0e0d5f5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e0d5f5509

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread conventions/engineering/azure-naming.md Resolved
@claude

claude Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 8s —— View job


Security review — /review:security-review

  • Gather context (diff vs origin/main, both changed files read in full)
  • Classify request: CI security-review lane, re-run for new HEAD c5606ad
  • Check skip gate
  • Review new commit (c5606ad) under the instruction-surface-deletion lens
  • Report findings

Scope: this re-run covers the new commit on top of the already-reviewed 0e0d5f5 — docs(azure-naming): note service principal names can be renamed, touching only conventions/engineering/azure-naming.md. conventions/engineering/README.md is unchanged since the last pass.

What changed: a new paragraph in the "Name permanence" section states that a service principal's display name can be changed in place (unlike resource groups, key vaults, storage accounts, and blob containers), while its application ID and object ID never change, and that callers and role assignments bind to those IDs rather than to the name (azure-naming.md#L115-L119). This directly addresses the Codex P2 comment on the prior commit, which flagged that adding the sp-<workload>-<env> pattern row made the old blanket "only a subscription display name can be changed in place" claim inaccurate for service principals.

Instruction-surface check: this edit adds a normative clarification rather than deleting, narrowing, or softening one — it doesn't touch the isolation-class rule reviewed in the prior pass, and it strengthens the reader's understanding of the security-relevant distinction (name vs. stable ID) rather than weakening it. The clarification is also consistent with how Azure RBAC actually works: role assignments and trust bind to the service principal's object ID, not its display name, so documenting that the display name is renameable introduces no new risk of a reader assuming name-based trust.

No other security-relevant surface is touched: no secrets, credentials, access-control code, or GitHub Actions config in this diff.

Result: no security findings, consistent with the prior review of this PR.

@claude

claude Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 28s —— View job


Code review complete

  • Gather context (diff, AGENTS.md/REVIEW.md, changed files)
  • Understand the request (CI code-review lane per /review:code-review)
  • Review conventions/engineering/azure-naming.md
  • Review conventions/engineering/README.md
  • Post findings

No blocking or high-signal findings. This is a documentation-only rename/restructure (consumer-split → isolation-class rule) plus a new service-principal naming row, reviewed at the current head (c5606ad).

  • The isolation-class bullets (azure-naming.md#L122-L146) are internally consistent: readers get roles per vault/class, a class splits off the part a reader may not see, same-class readers share a vault, and an existing vault's token is read retroactively as its class name.
  • The second commit already resolved the one substantive issue Codex flagged in the first-commit review (service-principal display names are renameable, unlike the other types in "Name permanence"): the addition at azure-naming.md#L115-L118 correctly states the display name can change while application ID/object ID stay fixed, matching the Graph API behavior Codex cited.
  • Independently verified the PR's own verification claims rather than trusting them: grep -rn -e consumer-split -e '<consumer>' across the repo is empty, kv-melo now appears only in azure-naming.md itself, and no other file in the repo references azure-naming.md by path — so there's no cross-doc reconciliation this change misses.
  • conventions/engineering/README.md's index row was updated in parallel and matches the renamed section.

Security-relevant aspects (whether the rename weakens the access-boundary guidance) were already covered by the security lane in an earlier comment on this PR; this pass stayed in the code-review lane's scope (correctness, consistency, documentation).

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

claude-security-review has reviewed this pull request through c5606ad; a later push is reviewed from there.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

claude-review has reviewed this pull request through c5606ad; a later push is reviewed from there.

@kyle-sexton
kyle-sexton merged commit f0c0ebb into main Oct 4, 2026
50 checks passed
@kyle-sexton
kyle-sexton deleted the docs/key-vault-isolation-class branch October 4, 2026 19:19
kyle-sexton added a commit that referenced this pull request Oct 4, 2026
…ons (#694)

No related issue: part of the key vault split for cross-account page
publishing; follows #691 and
melodic-software/provisioning#697.

## Summary

Cloud sessions can now read Key Vault secrets. A cloud environment on
Pro or Max can hold an OAuth 2.0 client credentials API credential for
`*.vault.azure.net`, which Anthropic's agent proxy uses to add the
bearer token outside the sandbox. A live probe on 2026-10-04 confirmed
that a plain `curl` from a session reads a secret with no token in the
VM. This adds a small cloud `vault-exec` that the shared setup script
installs, using the same argv contract as the workstation resolver, so
`mcp-launcher` and other callers work unchanged in cloud sessions.

## Fix

- New `components/cloud-environment/vault-exec`: `vault-exec
[--optional] --env NAME=secret -- cmd`.
- Each secret is one `curl` GET, and `python3` reads the value from a
pipe. The command then runs via `exec` with the variables set.
- Exit codes: 1 on a failed read without `--optional`, 2 on bad usage.
These match the workstation resolver.
- No secret value ever appears in a command's arguments, on stdout or
stderr, or in a log, and the caller's stdin is never read.
- The default vault is `kv-melo-devtools-prod`, the only vault the cloud
identity can read; `VAULT_EXEC_VAULT` overrides it.
- `setup.sh` fetches the script from this repository's raw URL, the same
way it fetches the plugin catalog and permission floor. It checks the
file with `bash -n` and a marker line, then installs it to
`~/.local/bin/vault-exec`. A `vault-exec` already there without the
marker is left alone. The step is best-effort, and `SCRIPT_VERSION` is
now `2026-10-04.1`.
- README: new "Key Vault resolver" section. Secrets can't be read at
setup-script time, because the proxy attaches credentials only after
Claude Code starts.
- `mcp-launcher` README: the cloud sentence now covers the installed
resolver.
- CI: the `cloud-environment` job also runs `vault-exec.test.sh`.

## Verification

- `vault-exec.test.sh`: 41 assertions against a stubbed `curl`. They
cover success, a 403 or 404 with and without `--optional`, the vault
override, stdin and exit-code pass-through, the secret staying out of
`curl`'s arguments and out of the output, and nine bad-usage cases.
- `setup.test.sh`: 84 assertions, including the new install cases (fresh
install, replacing our older copy, refusing a copy that isn't ours,
refusing a fetched file without the marker).
- shellcheck and shfmt are clean. Pre-commit (editorconfig, typos,
markdownlint, gitleaks, shellcheck) passes.
- Exit codes checked against the workstation resolver's usage text: 1
for an unresolved secret, 2 for a usage error or no `--env`.
- Live: the 2026-10-04 probe read a 32-character dummy secret with HTTP
200 through the proxy credential.

## Related

- #691: the isolation-class vault rule.
- melodic-software/provisioning#697: the host-credential vault and the
`sp-cloudagent-prod` rotation runbook.
- Environments pick this up on their next cache rebuild. A trivial edit
to the setup script field forces one.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant