swarmctl bao init: save bao's raw output before parsing, and accept null key lists
This commit is contained in:
parent
479cdd6efb
commit
870a0a6697
1 changed files with 395 additions and 73 deletions
|
|
@ -96,9 +96,20 @@ swarmctl bao init
|
|||
```
|
||||
|
||||
It prints the unseal (or, under the default `pkcs11` seal, recovery) keys
|
||||
and the root token **once**, and stores none of them: not in a file, and the root token is
|
||||
never in a process's argument list (so not in `ps`). Record them off this host before you do
|
||||
anything else. It refuses an initialised store, and works
|
||||
and the root token **once**. Record them off this host before you do
|
||||
anything else.
|
||||
|
||||
Before it parses what `bao operator init` printed, it saves that raw output to
|
||||
`bao-init.json` in swarmctl's state directory: `$XDG_STATE_HOME/swarmctl`, else
|
||||
`~/.local/state/swarmctl` (`/root/.local/state/swarmctl` as root). The file is mode 0600
|
||||
in a 0700 directory. If the output isn't what swarmctl expects, it prints the
|
||||
raw output and the file's path, and exits non-zero. The store holds keys
|
||||
then, so keep the output and don't run `bao operator init` again. Once you
|
||||
have recorded the keys, delete the file with `shred -u`; until you do, a
|
||||
second `swarmctl bao init` refuses to run. The root token is never in a
|
||||
process's argument list (so not in `ps`).
|
||||
|
||||
`swarmctl bao init` refuses an initialised store, and works
|
||||
from any host that can reach the store and has `bao` on `PATH`; the
|
||||
wrapper installed on the store host already knows the store's address and CA, and
|
||||
presents a client certificate: the hive's own where a hive runs on that host, else
|
||||
|
|
|
|||
Loading…
Reference in a new issue