swarm-bao: the responder may create the callout xkey; every token reads swarm/public/
The swarm-nats-auth role gains create+read on exactly the callout xkey's two leaves, and no update, so a stored pair is never replaced. swarm/public/ is readable by every token through bao's default policy. swarm-bao-public-read-policy reads that policy, replaces only its own marker-delimited block, and writes it back when it differs; it never writes a policy it read back empty. Writing `default` is a new grant on the granter's own policy, so on an existing store it lands only after the bootstrap-token step re-runs; until then the unit says so and exits 0, and swarm-bao-granter-role restarts it on success.
This commit is contained in:
parent
1e0b10bb7d
commit
bb571285fd
3 changed files with 258 additions and 28 deletions
|
|
@ -55,9 +55,9 @@ the unit's journal instead.
|
|||
|
||||
### Residual risk
|
||||
|
||||
The granter is root-equivalent. It may write any `swarm-*` policy with any
|
||||
content, and attach it to a role that accepts any certificate; no bao ACL can
|
||||
constrain what a policy says. What bounds it:
|
||||
The granter is root-equivalent. It may write any `swarm-*` policy, and bao's
|
||||
`default` policy, with any content, and attach a policy to a role that accepts
|
||||
any certificate; no bao ACL can constrain what a policy says. What bounds it:
|
||||
|
||||
- `nix/host-modules/swarm-bao.nix` renders every policy it writes, and
|
||||
module-eval pins each principal's grants. **Merging a change to that policy
|
||||
|
|
@ -76,6 +76,21 @@ constrain what a policy says. What bounds it:
|
|||
restarting `swarm-bao-pki` mints a new leaf, but doesn't invalidate the old
|
||||
one.
|
||||
|
||||
### What every token may read
|
||||
|
||||
Anything under `secret/swarm/public/` is readable by every token the store
|
||||
issues. `swarm-bao-public-read-policy` puts that one read into bao's `default`
|
||||
policy, which every token carries, between two marker lines. It reads the
|
||||
policy, replaces only its own block, and writes the result back when it
|
||||
differs, so the store's own stanzas stay as the store wrote them. It never
|
||||
writes a policy it read back empty. The callout xkey's public half lives
|
||||
there ([`secrets.md`](secrets.md#the-queues-callout-xkey)).
|
||||
|
||||
Writing `default` is a grant on the granter's own policy, so on a store
|
||||
whose granter predates it, the unit says so and exits 0 until the bootstrap
|
||||
step re-runs. Until then only principals whose policy names a `swarm/public/`
|
||||
path read it; the queue's responder is one, so the queue doesn't wait on this.
|
||||
|
||||
## Sealing
|
||||
|
||||
`services.hyperhive.deploy.bao.seal`:
|
||||
|
|
|
|||
Loading…
Reference in a new issue