machines/nix/systems/aarch64-linux/security.kaareskovgaard.net
Kaare Hoff Skovgaard 8c3d372586
Some checks failed
/ rust-packages (push) Successful in 36s
/ terraform-providers (push) Successful in 57s
/ dev-shell (push) Successful in 29s
/ check (push) Failing after 52s
/ systems (push) Failing after 1m38s
Support setting khs unix user password from vault
2025-07-19 22:04:04 +02:00
..
post Begin adding support for setting unix password for users 2025-07-19 21:47:52 +02:00
default.nix Support setting khs unix user password from vault 2025-07-19 22:04:04 +02:00
kanidm.nix Fix double usage of same secret file 2025-07-19 19:43:16 +02:00
openbao.nix Fix wrong config path 2025-07-15 08:16:39 +02:00
README.md Fix some notes 2025-07-17 01:28:58 +02:00

Before beginning

Enable bootstrapping of the instance, by setting config.khscodes."security.kaareskovgaard.net".bootstrap.enable = true in default.nix.

After creating the instance

Open https://secrets.kaareskovgaard.net and initialize OpenBAO. Remember to get some sort of auto unsealing set up afterwards, currently this is implemented with a cronjob on TrueNAS. Doing it this way allows various certificates to continue getting issued, even as OpenBAO gets sealed (due to auto updates).

After this, configure the OpenBAO instance with:

nix run '.#configure-instance' -- security.kaareskovgaard.net

In order for security.kaareskovgaard.net to authenticate itself with OpenBAO, the printed credentials needs to be passed to the server with (on the server):

sudo bao-import-secret <role-id> <wrapped-secret-id>

While still SSH'ed into the server, reset the user (khs) password for kanidm:

kanidm-reset-password <user>

Open https://login.kaareskovgaard.net - and log into the account, setting up the Yubikey (Passkey) auth, as well as Bitwarden based TOTP/password auth.

Disable bootstrapping

Now remove the previously enabled bootstrapping. Then update the instance

nix run '.#update-instance' -- security.kaareskovgaard.net

And reconfigure it:

nix run '.#configure-instance' -- security-kaareskovgaard.net

Then nix run '.#bitwarden-to-vault can transfer the needed Bitwarden secrets to vault, enabling other instances to not rely on Bitwarden.