janus deployment
This commit is contained in:
@@ -5,8 +5,8 @@ Generate passwords:
|
||||
mkdir -p /tmp/janus-step-ca-bootstrap && chmod 700 /tmp/janus-step-ca-bootstrap && cd /tmp/janus-step-ca-bootstrap && umask 077 && openssl rand -base64 48 > ca_password.txt && openssl rand -base64 48 > admin_jwk_password.txt
|
||||
```
|
||||
|
||||
Generate the Janus OpenSSH host key that Nix will materialize from SOPS at
|
||||
`/etc/ssh/ssh_host_ed25519_key`:
|
||||
Generate the Janus OpenSSH host key for reference (Janus now uses whatever key
|
||||
already exists on the target at `/etc/ssh/ssh_host_ed25519_key`):
|
||||
|
||||
```shell
|
||||
ssh-keygen -t ed25519 -N '' -C [email protected] -f /tmp/janus-step-ca-bootstrap/ssh_host_ed25519_key
|
||||
@@ -24,24 +24,9 @@ Insert generated runtime CA material into `modules/hosts/janus/secrets.yaml` und
|
||||
- `/tmp/janus-step-ca-bootstrap/step/secrets/ssh_host_ca_key` -> `ssh_host_ca_key`
|
||||
- `/tmp/janus-step-ca-bootstrap/step/secrets/ssh_user_ca_key` -> `ssh_user_ca_key`
|
||||
- `/tmp/janus-step-ca-bootstrap/step/config/ca.json` -> `admin_provisioner_encrypted_key` (copy `authority.provisioners[].encryptedKey` for the `admin` JWK provisioner)
|
||||
- `/tmp/janus-step-ca-bootstrap/ssh_host_ed25519_key` -> `ssh_host_ed25519_key`
|
||||
|
||||
If you are only validating wiring first, `admin_provisioner_encrypted_key` can be an encrypted placeholder and replaced later.
|
||||
|
||||
The checked-in `ssh_host_ed25519_key` value is also only an encrypted placeholder.
|
||||
Replace it before deploying Janus, otherwise OpenSSH and SSH host certificate
|
||||
issuance will fail because the materialized host key is not a valid private key.
|
||||
|
||||
For multiline secret values, avoid putting private key contents in shell history.
|
||||
One safe non-interactive pattern is to JSON-encode the file content and pass that
|
||||
temporary JSON file to `sops set --value-file`:
|
||||
|
||||
```shell
|
||||
jq -Rs . /tmp/janus-step-ca-bootstrap/ssh_host_ed25519_key > /tmp/janus-step-ca-bootstrap/ssh_host_ed25519_key.json
|
||||
sops --config .sops.yaml set --value-file modules/hosts/janus/secrets.yaml '["janus"]["ssh_host_ed25519_key"]' /tmp/janus-step-ca-bootstrap/ssh_host_ed25519_key.json
|
||||
rm -f /tmp/janus-step-ca-bootstrap/ssh_host_ed25519_key.json
|
||||
```
|
||||
|
||||
If rotating provisioner password, also set:
|
||||
|
||||
- `/tmp/janus-step-ca-bootstrap/admin_jwk_password.txt` -> `janus.admin_jwk` in `keys/secrets.yaml`
|
||||
@@ -49,7 +34,6 @@ If rotating provisioner password, also set:
|
||||
Secret source-of-truth after this split:
|
||||
|
||||
- `modules/hosts/janus/secrets.yaml`: Janus runtime CA secrets (`ca_password`, `intermediate_ca_key`, `ssh_host_ca_key`, `ssh_user_ca_key`, `admin_provisioner_encrypted_key`)
|
||||
- `modules/hosts/janus/secrets.yaml`: Janus OpenSSH host private key (`ssh_host_ed25519_key`) materialized to `/etc/ssh/ssh_host_ed25519_key`
|
||||
- `keys/secrets.yaml`: shared Janus provisioner secret (`janus.admin_jwk`) consumed by `step-ssh-host` across hosts
|
||||
|
||||
Then update public artifacts in repo from generated output:
|
||||
|
||||
Reference in New Issue
Block a user