swarm-bao: make the reader's identity declarable, not just the store's
`swarm-bao.nix` declared the store's half of the mTLS pair as options — `serverCertFile`, `serverKeyFile`, `clientCaFile` — and left the reader's half as a literal inside `glue-bao-tls.nix`, which only runs where `deploy.bao.enable` is set. A hive that did not host the store therefore could not read from it and could not be pointed at a certificate even when one had been placed by hand. Adds `clientCertFile`, `clientKeyFile` and `serverCaFile` beside their three server siblings, `mkDefault`ed by the glue to the leaf it already mints, and moves `glue-matrix-bao-token.nix` onto them. Its gate becomes "this host holds an identity" rather than "the store is a neighbour", and the unit ordering that names store-local units is now conditional -- `Requires=` on an absent unit fails the job. `serverCaFile` is separate from `clientCaFile` on purpose: one is the store choosing which readers to trust, the other a reader choosing which store to trust. Self-signing collapses them to one file, which is a property of that deployment and not of the pairing. Closes #3855.
This commit is contained in:
parent
d9937ee834
commit
694abf4439
6 changed files with 126 additions and 19 deletions
|
|
@ -67,11 +67,14 @@ Whether anything more is needed depends on
|
|||
The store serves TLS, and on a hive that deploys it you need do nothing: a
|
||||
first-boot unit mints a CA of the store's own plus the two leaves it signs —
|
||||
the store's server certificate and this host's client certificate — and points
|
||||
`deploy.bao.serverCertFile`, `.serverKeyFile` and `.clientCaFile` at them.
|
||||
`deploy.bao.serverCertFile`, `.serverKeyFile` and `.clientCaFile` at the store's
|
||||
half, `.clientCertFile`, `.clientKeyFile` and `.serverCaFile` at the reader's.
|
||||
|
||||
Those are `mkDefault`s, so naming your own paths wins. Do that when your
|
||||
certificates come from a real internal CA; the store has no opinion about
|
||||
which. ⚠️ Not the gateway's HTTPS certificates and not the hive CA — this is
|
||||
which. A hive that does **not** deploy the store names the reader's three
|
||||
itself: that leaf is issued out of band, and it is the one credential the store
|
||||
cannot hand you, being what opens it. ⚠️ Not the gateway's HTTPS certificates and not the hive CA — this is
|
||||
**mTLS between services and the store**, a separate trust domain, because a
|
||||
store that took its identity from an authority it will itself distribute could
|
||||
never come up before that authority.
|
||||
|
|
|
|||
|
|
@ -156,6 +156,10 @@ mints a CA that signs exactly two things, the store's server certificate and a
|
|||
reader's client certificate, and distributes nothing. A deployment with a real
|
||||
internal CA deletes that file and names its own paths in
|
||||
`deploy.bao.serverCertFile` / `clientCaFile`; the store itself has no opinion.
|
||||
A hive that reads from a store on **another** machine names the reader's half —
|
||||
`clientCertFile`, `clientKeyFile`, `serverCaFile` — and places that leaf by hand.
|
||||
It is the one credential that cannot come out of the store, being what opens it;
|
||||
everything else a hive needs does.
|
||||
|
||||
## The constraint that decides where the root lives
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue