The store's read credential reads the identities and cannot change them (SL-29) #34

Merged
pit merged 2 commits from hermes/SL-29-a-read-only-key-reads-the-store-s-users into main 2026-11-11 11:49:56 +00:00
Member

Implements SL-29

Summary

The store half's plan refreshes the identities that half declares, and the admin API that answers is the provisioning key's — the same credential that can create and delete them. A pull request's plan gets a second key instead: one that reads the store's users, policies and service accounts and each bucket's configuration, and can change none of them.

silo/store/
├── provisioner-policy.json   # the apply: buckets and identity, read and write
└── store-read-policy.json    # the plan: the identities and the buckets, read only
key pair at reach
tofu-plan-state-silo (SL-28) secret/tofu-state/silo/plan reads prod/silo.tfstate; reads, writes and deletes the lock beside it
tofu-store-read (SL-29) secret/tofu-state/silo/read lists and reads users, policies and service accounts; reads each bucket's configuration; no object, no write

The mint is the Operator's act. This change is the policy file, and the row that says how to mint it, what the pair holds and where it goes: runbook 0003, section 7. It adds no entry to var.state_keys: that map carries the records' keys, and this one reads no record.

Evidence

  • Before: the only credential that answers the identity reads is silo/store/provisioner-policy.json — 50 actions, admin:CreateUser, admin:DeleteUser, admin:CreatePolicy, admin:DeletePolicy and s3:DeleteBucket among them.
    After: silo/store/store-read-policy.json — 15 actions, none of them a write, and no object-level action at all:
$ mise exec -- jq -r '[.Statement[].Action[]] as $a | "actions: \($a|length)", "write-like: \([$a[] | select(test(":(Create|Delete|Put|Update|Attach|Detach|Add|Remove|Enable|Disable|Set|Abort|Restore)"))] | join(", "))"' silo/store/store-read-policy.json
actions: 15
write-like: 
  • Every action is one the provisioning key already holds, so the file adds no vocabulary the store does not already answer to:
$ mise exec -- jq -n --slurpfile r silo/store/store-read-policy.json --slurpfile p silo/store/provisioner-policy.json '($p[0].Statement|map(.Action)|add) as $prov | ($r[0].Statement|map(.Action)|add) as $read | {read: ($read|length), missing_from_provisioner: [$read[] | select(. as $a | ($prov|index($a)) == null)]}'
{
  "read": 15,
  "missing_from_provisioner": []
}
  • mise exec -- make check on this branch — exit 0:
env-check: the pin and the map agree.
key-audit-test: every case passed
key-mint-test: every case passed
deploy tests: every case passed.
Success! The configuration is valid.
  • Not run here, and why. The mint, the pair at secret/tofu-state/silo/read and make key-audit need the store's root credential, which docs/agents/workflow.md section 3 keeps off an agent's floor; they run from main after the merge. The docs/store-layout.md row this ticket also asks for is infra-secrets' page — this change names the path and its consumer in runbook 0003, the README and GLOSSARY.md, and that page's row is that repository's to add.

Merge Danger

Door: two-way — a policy file and three pages. Nothing applies on merge, and no key exists until the Operator mints one.

Blast Radius: one credential's reach, once minted: it can read the store's identities and cannot change them.

Implements [SL-29](https://vikunja.thepit.space/tasks/338) ## Summary The store half's plan refreshes the identities that half declares, and the admin API that answers is the provisioning key's — the same credential that can create and delete them. A pull request's plan gets a second key instead: one that reads the store's users, policies and service accounts and each bucket's configuration, and can change none of them. ```text silo/store/ ├── provisioner-policy.json # the apply: buckets and identity, read and write └── store-read-policy.json # the plan: the identities and the buckets, read only ``` | key | pair at | reach | | --- | --- | --- | | `tofu-plan-state-silo` (SL-28) | `secret/tofu-state/silo/plan` | reads `prod/silo.tfstate`; reads, writes and deletes the lock beside it | | `tofu-store-read` (SL-29) | `secret/tofu-state/silo/read` | lists and reads users, policies and service accounts; reads each bucket's configuration; no object, no write | The mint is the Operator's act. This change is the policy file, and the row that says how to mint it, what the pair holds and where it goes: [runbook 0003](https://forgejo.thepit.space/olympus/infra-silo/src/branch/hermes/SL-29-a-read-only-key-reads-the-store-s-users/docs/runbooks/0003-the-state-in-the-store.md), section 7. It adds no entry to `var.state_keys`: that map carries the records' keys, and this one reads no record. ## Evidence - **Before:** the only credential that answers the identity reads is `silo/store/provisioner-policy.json` — 50 actions, `admin:CreateUser`, `admin:DeleteUser`, `admin:CreatePolicy`, `admin:DeletePolicy` and `s3:DeleteBucket` among them. **After:** `silo/store/store-read-policy.json` — 15 actions, none of them a write, and no object-level action at all: ```text $ mise exec -- jq -r '[.Statement[].Action[]] as $a | "actions: \($a|length)", "write-like: \([$a[] | select(test(":(Create|Delete|Put|Update|Attach|Detach|Add|Remove|Enable|Disable|Set|Abort|Restore)"))] | join(", "))"' silo/store/store-read-policy.json actions: 15 write-like: ``` - **Every action is one the provisioning key already holds**, so the file adds no vocabulary the store does not already answer to: ```text $ mise exec -- jq -n --slurpfile r silo/store/store-read-policy.json --slurpfile p silo/store/provisioner-policy.json '($p[0].Statement|map(.Action)|add) as $prov | ($r[0].Statement|map(.Action)|add) as $read | {read: ($read|length), missing_from_provisioner: [$read[] | select(. as $a | ($prov|index($a)) == null)]}' { "read": 15, "missing_from_provisioner": [] } ``` - **`mise exec -- make check`** on this branch — exit 0: ```text env-check: the pin and the map agree. key-audit-test: every case passed key-mint-test: every case passed deploy tests: every case passed. Success! The configuration is valid. ``` - **Not run here, and why.** The mint, the pair at `secret/tofu-state/silo/read` and `make key-audit` need the store's root credential, which [`docs/agents/workflow.md`](https://forgejo.thepit.space/olympus/infra-silo/src/branch/main/docs/agents/workflow.md) section 3 keeps off an agent's floor; they run from `main` after the merge. The `docs/store-layout.md` row this ticket also asks for is `infra-secrets`' page — this change names the path and its consumer in runbook 0003, the README and `GLOSSARY.md`, and that page's row is that repository's to add. ## Merge Danger **Door:** two-way — a policy file and three pages. Nothing applies on merge, and no key exists until the Operator mints one. **Blast Radius:** one credential's reach, once minted: it can read the store's identities and cannot change them.
The store half's plan refreshes what that half declares, and its identity
resources answer only to the admin API. A pull request's plan may read them;
it may not be able to change them, and the provisioning key the apply uses is
exactly the credential that can. So the plan gets a second key, minted by hand
against a policy file of its own: every action the provisioning key holds that
reads, and none that writes, creates, deletes or attaches.

The pair belongs at `secret/tofu-state/silo/read` under the two names the
provider reads the store half with, which is what the plan check will hold as a
repository secret. The runbook row says how it is minted and where it goes, the
glossary names it, and the count of declared state keys does not change: this
one is not a record's key and is not declared.
ticket-dispatch: state the read credential's reach, not a subtraction (SL-29)
All checks were successful
pr-checks / check (pull_request) Successful in 25s
c88c6e60d9
The policy file is not "the provisioning key's reads": it withholds that key's
object reads and its group and quota reads, because a plan needs none of them
and `s3:GetObject` on the prefix would read every Stack's record. So the runbook
says what the file grants — users, policies, service accounts, each bucket's
configuration, no object — and what it does not: a write of any kind.
Member

Review started (round 1/5) on c88c6e60d9 — reading the diff now.

**Review started** (round 1/5) on c88c6e60d95c6ff2ebcdd94c81cfbf3dac380c71 — reading the diff now.
bot-minos approved these changes 2026-11-10 22:30:55 +00:00
bot-minos left a comment

olympus/infra-silo · PR #34 · head c88c6e6 · round 1/5 · verdict: APPROVE

Recommendation: merge

Standards

No documented-standard breach found. Checked against AGENTS.md §Secrets, §Privacy, §Code comments and §Docs (relative links, glossary-is-definitions-only, one directory per section), docs/agents/workflow.md §3, and ADRs 0003, 0005, 0008 and 0009. The new file carries no secret and no address; the glossary entry has the shape the repo's existing credential entries already use, so §Docs' "definitions only" is not breached by naming the policy file and the pair's path.

  • ADVISORY — the change adds a credential and leaves the prose counts that enumerate credentials stale. README.md:137-140 says "Two of those credentials … are minted once, by hand … Both need the root credential, once each"; README.md:145 then adds a third hand mint ("key is minted by hand as tofu-store-read"), and docs/runbooks/0003-the-state-in-the-store.md:348 says that key is minted "as the root user". GLOSSARY.md:190-191 says the application credential is "the only one of the three that is the store's own rather than the infrastructure's", while GLOSSARY.md:179 makes a fourth credential entry above it. One defect, two sites; the clearing change is "Three …" / "Three need the root credential" at README:137-140 and "of the four" at GLOSSARY:190-191.

Baseline smells: none charged. The action list repeats part of provisioner-policy.json, but a credential's policy file has to be the whole of its reach on its own; that repetition is the repo's design, not Duplicated Code to extract.

Spec

Spec: SL-29, "A read-only key reads the store's users and policies", fetched live (project 7, index 29); its acceptance criteria are the contract.

  • Bullet 1 met — the store half's plan reads users, policies and service accounts with no right to change them. silo/store/store-read-policy.json:6-21: 15 actions, every one a Get*/List*, all 15 present in provisioner-policy.json, one resource (arn:aws:s3:::*), no object-level action. The reads the provider actually issues on refresh are each covered: ListServiceAccounts for the service account (resource_minio_service_account.go:374), GetUserInfo for the user and the user-policy attachment (admin:GetUser and admin:ListUserPolicies both held), InfoCannedPolicy for the policy (admin:GetPolicy), BucketExists + GetBucketTagging and GetBucketVersioning for the bucket and its versioning (s3:ListBucket, s3:GetBucketTagging, s3:GetBucketVersioning).
  • Bullet 2 met — a policy file in this repository, and a pair path of its own under secret/tofu-state/silo/: docs/runbooks/0003-the-state-in-the-store.md:340-341 names tofu-store-read and secret/tofu-state/silo/read with the provider's two names, and :352-355 gives the mint.
  • AC2 is structurally met — scripts/key-audit.sh:136-137 takes scope from the mint's name (tofu*) and :171-176 compares each key's stored policy with every silo/store/*-policy.json; the new file is inside that glob and tofu-store-read is a tofu… name, so the minted key will be audited against this file. var.state_keys is correctly untouched: the audit enumerates the store, not the map, and the map is the records' keys.
  • AC3 not met — ADVISORY. docs/store-layout.md is not this repository's page: it is olympus/infra-secrets's, and at that repository's main its secret/tofu-state/ tables carry secret/tofu-state/silo/{apply,plan} and no read row, with the path count closing at 83 and no entry for it. The body defers the row to infra-secrets but names no ticket that carries it, and neither SL-30 (the repository secrets) nor SL-31 (the plan check) does (both fetched live). Clearing change: name the infra-secrets ticket that carries the row in the PR body, or land the row there — the acceptance criterion needs a home before the Operator mints the key.

Named, not charged

  • The mint, the pair at secret/tofu-state/silo/read, and make key-audit are the Operator's acts after the merge; docs/agents/workflow.md §3 keeps the root credential off an agent's floor. The author's evidence table says the same, and it is honest.
  • AC1's live refusals (create/delete user or policy answering Access Denied) follow from the action list — no write verb is granted — but were not driven against the store.
  • s3:ListBucket lets the key enumerate object names, not read objects; this repo already treats a listing as not a read (docs/runbooks/0003-the-state-in-the-store.md:365-367), so it is not charged against "reads no record".

Verified

  • Head: refs/pull/34/head = c88c6e60d95c6ff2ebcdd94c81cfbf3dac380c71 = the dispatch's SHA; base 7f205442a94242d1a196468006d372485b7418dd; diff 4 files, +71/−2, matching list_pull_request_files.
  • mise exec -- make check at the head: exit 0 — env-check: the pin and the map agree., key-audit-test: every case passed, key-mint-test: every case passed, deploy tests: every case passed., Success! The configuration is valid.
  • The body's two jq assertions re-run at the head: actions: 15, write-like: empty, {"read": 15, "missing_from_provisioner": []}.
  • Provider read paths read from aminueza/terraform-provider-minio at tag v3.45.0, the version silo/.terraform.lock.hcl pins.
  • key-audit.sh's scope and matching read at the head; scripts/lib/state-key-path.sh needs no read shape because tofu-store-read is not a var.state_keys entry.
  • docs/store-layout.md at olympus/infra-secrets:main read through the forge API; SL-29, SL-30 and SL-31 fetched live from the tracker.

Could not verify

  • The mint, the stored policy's canonical equality with the file, and make key-audit's 0 failing line: these need the store's root credential and a key that does not exist yet.
  • AC1 against the live store (create/delete refused), for the same reason.
  • That the store returns the two-statement document verbatim. The audit's canonicaliser tolerates statement order and string-versus-list spelling, but a server-side merge of the two statements would red it; only the post-mint audit can settle that.

Summary

  • Standards: 1 advisory (stale credential counts, two sites), 0 blockers. Worst: the stale counts — prose the change itself falsifies.
  • Spec: 1 advisory (AC3's docs/store-layout.md row lives in another repository and no ticket carries it), 0 blockers. Worst: that untracked acceptance criterion — a promise without a home, not a defect in the artifact.

Two advisories, no blockers: merging is recommended, and both travel as advice.

<!-- minos review-loop: repo=olympus/infra-silo pr=34 head=c88c6e60d95c6ff2ebcdd94c81cfbf3dac380c71 round=1/5 axes=standards,spec --> **olympus/infra-silo · PR #34 · head `c88c6e6` · round 1/5 · verdict: APPROVE** Recommendation: merge ## Standards No documented-standard breach found. Checked against `AGENTS.md` §Secrets, §Privacy, §Code comments and §Docs (relative links, glossary-is-definitions-only, one directory per section), `docs/agents/workflow.md` §3, and ADRs 0003, 0005, 0008 and 0009. The new file carries no secret and no address; the glossary entry has the shape the repo's existing credential entries already use, so §Docs' "definitions only" is not breached by naming the policy file and the pair's path. - **ADVISORY — the change adds a credential and leaves the prose counts that enumerate credentials stale.** `README.md:137-140` says "Two of those credentials … are minted once, by hand … Both need the root credential, once each"; `README.md:145` then adds a third hand mint ("key is minted by hand as `tofu-store-read`"), and `docs/runbooks/0003-the-state-in-the-store.md:348` says that key is minted "as the root user". `GLOSSARY.md:190-191` says the application credential is "the only one of the three that is the store's own rather than the infrastructure's", while `GLOSSARY.md:179` makes a fourth credential entry above it. One defect, two sites; the clearing change is "Three …" / "Three need the root credential" at README:137-140 and "of the four" at GLOSSARY:190-191. Baseline smells: none charged. The action list repeats part of `provisioner-policy.json`, but a credential's policy file has to be the whole of its reach on its own; that repetition is the repo's design, not Duplicated Code to extract. ## Spec Spec: **SL-29**, "A read-only key reads the store's users and policies", fetched live (project 7, index 29); its acceptance criteria are the contract. - **Bullet 1 met** — the store half's plan reads users, policies and service accounts with no right to change them. `silo/store/store-read-policy.json:6-21`: 15 actions, every one a `Get*`/`List*`, all 15 present in `provisioner-policy.json`, one resource (`arn:aws:s3:::*`), no object-level action. The reads the provider actually issues on refresh are each covered: `ListServiceAccounts` for the service account (`resource_minio_service_account.go:374`), `GetUserInfo` for the user and the user-policy attachment (`admin:GetUser` and `admin:ListUserPolicies` both held), `InfoCannedPolicy` for the policy (`admin:GetPolicy`), `BucketExists` + `GetBucketTagging` and `GetBucketVersioning` for the bucket and its versioning (`s3:ListBucket`, `s3:GetBucketTagging`, `s3:GetBucketVersioning`). - **Bullet 2 met** — a policy file in this repository, and a pair path of its own under `secret/tofu-state/silo/`: `docs/runbooks/0003-the-state-in-the-store.md:340-341` names `tofu-store-read` and `secret/tofu-state/silo/read` with the provider's two names, and `:352-355` gives the mint. - **AC2 is structurally met** — `scripts/key-audit.sh:136-137` takes scope from the mint's name (`tofu*`) and `:171-176` compares each key's stored policy with every `silo/store/*-policy.json`; the new file is inside that glob and `tofu-store-read` is a `tofu…` name, so the minted key will be audited against this file. `var.state_keys` is correctly untouched: the audit enumerates the store, not the map, and the map is the records' keys. - **AC3 not met** — **ADVISORY.** `docs/store-layout.md` is not this repository's page: it is `olympus/infra-secrets`'s, and at that repository's `main` its `secret/tofu-state/` tables carry `secret/tofu-state/silo/{apply,plan}` and no `read` row, with the path count closing at 83 and no entry for it. The body defers the row to infra-secrets but names no ticket that carries it, and neither SL-30 (the repository secrets) nor SL-31 (the plan check) does (both fetched live). Clearing change: name the infra-secrets ticket that carries the row in the PR body, or land the row there — the acceptance criterion needs a home before the Operator mints the key. ## Named, not charged - The mint, the pair at `secret/tofu-state/silo/read`, and `make key-audit` are the Operator's acts after the merge; `docs/agents/workflow.md` §3 keeps the root credential off an agent's floor. The author's evidence table says the same, and it is honest. - AC1's live refusals (create/delete user or policy answering Access Denied) follow from the action list — no write verb is granted — but were not driven against the store. - `s3:ListBucket` lets the key enumerate object names, not read objects; this repo already treats a listing as not a read (`docs/runbooks/0003-the-state-in-the-store.md:365-367`), so it is not charged against "reads no record". ## Verified - Head: `refs/pull/34/head` = `c88c6e60d95c6ff2ebcdd94c81cfbf3dac380c71` = the dispatch's SHA; base `7f205442a94242d1a196468006d372485b7418dd`; diff 4 files, +71/−2, matching `list_pull_request_files`. - `mise exec -- make check` at the head: **exit 0** — `env-check: the pin and the map agree.`, `key-audit-test: every case passed`, `key-mint-test: every case passed`, `deploy tests: every case passed.`, `Success! The configuration is valid.` - The body's two jq assertions re-run at the head: `actions: 15`, `write-like:` empty, `{"read": 15, "missing_from_provisioner": []}`. - Provider read paths read from `aminueza/terraform-provider-minio` at tag `v3.45.0`, the version `silo/.terraform.lock.hcl` pins. - `key-audit.sh`'s scope and matching read at the head; `scripts/lib/state-key-path.sh` needs no `read` shape because `tofu-store-read` is not a `var.state_keys` entry. - `docs/store-layout.md` at `olympus/infra-secrets:main` read through the forge API; SL-29, SL-30 and SL-31 fetched live from the tracker. ## Could not verify - The mint, the stored policy's canonical equality with the file, and `make key-audit`'s `0 failing` line: these need the store's root credential and a key that does not exist yet. - AC1 against the live store (create/delete refused), for the same reason. - That the store returns the two-statement document verbatim. The audit's canonicaliser tolerates statement order and string-versus-list spelling, but a server-side merge of the two statements would red it; only the post-mint audit can settle that. ## Summary - **Standards:** 1 advisory (stale credential counts, two sites), 0 blockers. Worst: the stale counts — prose the change itself falsifies. - **Spec:** 1 advisory (AC3's `docs/store-layout.md` row lives in another repository and no ticket carries it), 0 blockers. Worst: that untracked acceptance criterion — a promise without a home, not a defect in the artifact. Two advisories, no blockers: merging is recommended, and both travel as advice.
pit merged commit 6b4509447a into main 2026-11-11 11:49:56 +00:00
pit deleted branch hermes/SL-29-a-read-only-key-reads-the-store-s-users 2026-11-11 11:49:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/infra-silo!34
No description provided.