Commit Graph
215 Commits
Author SHA1 Message Date
Audiobuzz 545d459c3d tpm-enrol: allow enrolment under rd.dot1x=0 (test-mode) for bench testing
Removes the hard no-op on the test path so the enrolment flow can be exercised
on a host with a TPM + a reachable broker WITHOUT standing up 802.1X/MACsec/
RADIUS. Networking is now mode-aware: in test mode ip=dhcp already owns the NIC
(and wrote resolv.conf), so the hook uses the existing lease instead of running
its own nmcli DHCP — avoiding the dracut "address already assigned" race
(CLAUDE.md "don't double-configure the NIC in test mode"). Secure mode still does
the nm-unmanaged override for the pre-auth lease. rd.fleet.enrol=0 disables
enrolment in either mode; production intent stays secure-path-only.
2026-07-02 10:00:26 +00:00
Audiobuzz 6278f2847d tpm-enrol: pivot host enrolment to a Go binary, built out-of-VM
Replaces the shell/openssl-provider host enrolment (a35f2d6) with a static
Go + go-tpm binary, and moves BOTH host Go binaries out of the Packer VM.

fleet-enrol (files/enrol/, Go + go-tpm, no CGO):
  - talks to /dev/tpmrm0 DIRECTLY via transport.FromReadWriter(os.File) — no
    linuxtpm, so go-tpm is the only dep and there is NO tpm2-tools key-gen /
    openssl tpm2 provider / curl in the image (removes the biggest bench risk,
    the provider handle: key-ref).
  - ensures the ECDSA key @0x81010001, builds the CSR (crypto.Signer over the
    TPM key), POSTs CSR+context to the broker, shows the Plymouth fingerprint,
    polls /status, writes the leaf cert to NV 0x01800001.
  - tpmkey/ is an exported package so the TPM ceremony is tested against the
    go-tpm software simulator from a SEPARATE simtest/ module (CGO stays out of
    the shipped build). Transaction logic (mock broker) tested in-package.
  - deps pinned by go.sum (not vendored): the binary now builds on the CI
    runner, which has network — reproducible via pinned Go 1.26.4 + go.sum.

Out-of-VM build (decision): both fleet-enrol AND fleet-hostapi compile in the
CI "Build host Go binaries" step (Go 1.26.4, CGO off, -trimpath) and Packer
FILE-PROVISIONS the static binaries in. Dropped the in-VM `dnf install golang`
+ the 2d removal — the Rocky build image carries no Go toolchain / go-tpm tree.

Wiring:
  - tpm-enrol.sh: now a thin GATE (empty-NV check, pre-auth DHCP on en*,
    exec /usr/sbin/fleet-enrol, reboot-to-converge). module-setup.sh bundles the
    binary (asserted) + reverts the tpm2-openssl/curl installs.
  - diskless.pkr.hcl: file provisioners for both binaries; enrol installed to
    /usr/sbin before the initramfs build + fapolicyd-trusted; lsinitrd asserts
    fleet-enrol; dnf reverted to baseline (no tpm2-openssl/curl).
  - gitea-main-ci.yaml: Set up Go + build both binaries + run the simulator
    ceremony test, before packer validate.

TESTED here: transaction unit tests + the full TPM ceremony (key-gen -> persist
-> ECDSA sign -> CSR verify -> chunked NV write -> re-enrol) against the go-tpm
simulator. BENCH-VERIFY (real/swtpm, empty owner auth, pre-auth DHCP, Plymouth,
reboot-converge, prod HTTPS) tracked in docs/TODO.md #11.
2026-07-02 09:55:54 +00:00
Audiobuzz 8e1d40a30b tpm-enrol: inline empty-NV first-boot enrolment (host side, TODO #11)
Builds the host side of TPM identity enrolment — the "inline single-UKI"
vehicle from docs/tpm-enrolment-design.md. A production (secure) UKI now
auto-enrols a fresh host with no client cert, then reboots into the normal
secure path.

New dracut hook files/dracut/95dot1x-macsec/tpm-enrol.sh (initqueue/settled
prio 25, BEFORE dot1x-macsec-up at 30):
  - no-op when a cert is already present in NV 0x01800001 (normal boot) or
    under rd.dot1x=0 (test path has no trustworthy identity to enrol);
  - on EMPTY NV: generate the signing key in the TPM @0x81010001 (openssl tpm2
    provider builds the CSR; key never leaves the TPM), pre-auth DHCP on the
    PHYSICAL NIC (nmcli re-manages en*, overriding the secure-mode unmanaged
    drop-in), POST CSR+context to rd.fleet.enrol_url, show the broker
    fingerprint on Plymouth, poll /status, write the issued leaf cert (DER) to
    NV, and reboot to converge.
  - Empty-NV and the secure path are mutually exclusive, so this never reorders
    the load-bearing boot sequence (invariant #2).

Wiring:
  - module-setup.sh: require+install the tpm2 key-gen/NV tools, curl, awk, and
    the openssl tpm2 PROVIDER (ossl-modules/tpm2.so, asserted present — tpm2-tss
    alone can't sign with a handle: key); install the hook.
  - diskless.pkr.hcl: install tpm2-openssl + curl; assert hook/tools/provider in
    the initramfs (invariant #9). New enrol_url var threaded to extract-artifacts.
  - extract-artifacts.sh: bake rd.fleet.enrol_url into the cmdline.
  - fleet.script: enrol-active/enrol-wait/enrol-done banner; fingerprint on the
    message line (public — states only, invariant #1).

Shell JSON build/parse/cert-extract pipeline (no jq in the initramfs) verified
end-to-end against a live broker. BENCH-VERIFY list in docs/TODO.md #11 (tpm2
provider key-ref on real/swtpm, empty-NV detect, pre-auth DHCP override, Plymouth
render, NV write + reboot convergence, prod HTTPS).
2026-07-02 09:00:18 +00:00
Audiobuzz a370f80332 TODO #11: step signer re-verified on the serving host (720h claim, chain) 2026-07-02 08:45:30 +00:00
Audiobuzz b8f88091f1 bootstrap: connect to step-ca via localhost, not ca.fleet.lab
The `step` CLI ran against --ca-url https://ca.fleet.lab:8443, but that name is
only served by the fleet dnsmasq to booting clients — the serving host's own
resolver can't resolve it ("no such host on 127.0.0.53"), so provisioner list +
RADIUS cert issuance failed. Connect over CA_CONNECT (default localhost, which
the compose puts in the CA cert SAN); CA_DNS stays the cert/SAN + RADIUS CN name.
2026-07-02 08:41:03 +00:00
Audiobuzz 8376f9a92e enrol-broker: run in serving stack + fix step signer path end-to-end
Verifying the step signer against a real step-ca surfaced two real bugs the
mock signer had hidden, plus made the bench CA actually initialise:

- signer.go: move --not-after from `step ca token` (validity caps ~1h ->
  "token validity too long") to `step ca sign` (it is the CERT lifetime).
  Without this the step signer never issues a cert.
- dot1x-bench compose: DOCKER_STEPCA_INIT_PASSWORD_FILE pointed at a file that
  does not exist at first init (it is an INPUT path), so `step ca init` failed
  and never wrote secrets/password. Use DOCKER_STEPCA_INIT_PASSWORD (the value)
  which the entrypoint writes to secrets/password, where bootstrap + broker read.
- bootstrap.sh: self-heal the root-owned ./pki Docker auto-creates; detect the
  CA password at $STEPPATH/password or secrets/password (varies by image
  version); raise authority.claims.maxTLSCertDuration so 720h fleet certs are
  allowed (stock cap 24h, which also blocked bootstrap's own RADIUS cert); fix
  RADIUS cert paths to write via the /export mount (were host paths run inside
  the container, so they never resolved).

- serving stack: add the enrol-broker service (temporary home; nginx already
  proxies /enrol/) defaulting to the zero-dependency lab path (mock signer +
  insecure loopback admin), with ENROL_* knobs to switch to step + mTLS.
- verify-serving.sh: exercise request -> approve -> cert through the deployed
  nginx /enrol/ proxy.
- TODO #11: record the step-signer verification + the two fixes.

Step signer VERIFIED end-to-end against a real step-ca: issued cert chains to
the fleet root, EKU clientAuth, hostnqn derived from serial.
2026-07-02 08:35:35 +00:00
Audiobuzz 9e1dbd3ef7 initial tpm broker 2026-06-28 10:33:14 +00:00
Audiobuzz 3bcf16e384 Merge remote-tracking branch 'origin/main' into tpm-enroll 2026-06-28 18:32:39 +09:30
Audiobuzz 5232b36614 tpm design 2026-06-28 18:32:36 +09:30
audiobuzz 889db569e5 Merge pull request 'workstation-api' (#9) from workstation-api into main
Reviewed-on: https://git.bitasylum.org/audiobuzz/diskless-workstation/pulls/9
2026-06-28 08:45:20 +00:00
Audiobuzz bc14b8986d fixing final SPDK deployment 2026-06-28 08:44:49 +00:00
Audiobuzz 2cf7ad4ffb Apply chromium policy hardening 2026-06-28 03:18:54 +00:00
Audiobuzz ad6b7e3366 Add Host API and fix kiosk performance 2026-06-28 03:14:25 +00:00
Audiobuzz b5163f958e Fix upper case branch name bug 2026-06-28 02:19:36 +00:00
Audiobuzz b159bc678c Fix discovery duplicate 2026-06-28 02:11:08 +00:00
Audiobuzz 5e4ee87e88 Fix symnlinking of releases 2026-06-28 01:50:33 +00:00
Audiobuzz 02ffd7d885 Adding spdk loader 2026-06-27 10:44:42 +00:00
Audiobuzz e43112b0f1 Permanent SPDK trial 2026-06-27 19:29:19 +09:30
Audiobuzz ce5af959ad Add SIEM 2026-06-27 08:52:17 +00:00
audiobuzz 4d51fa97c2 Merge pull request 'kiosk-app-separate' (#8) from kiosk-app-separate into main
Reviewed-on: https://git.bitasylum.org/audiobuzz/diskless-workstation/pulls/8
2026-06-26 00:25:05 +00:00
Audiobuzz 184c7859cf exclude non-rootfs files from main gitea workflow 2026-06-26 00:06:49 +00:00
Audiobuzz 1612af3a23 Add kiosk-app as a submodule 2026-06-26 09:26:57 +09:30
Audiobuzz c02937f855 Remove kiosk-app (moving to submodule) 2026-06-26 09:26:37 +09:30
Audiobuzz 25d0cfff7c Prep kiosk-app for submodule split 2026-06-25 23:55:29 +00:00
Audiobuzz c3507cda6e Update SSP 2026-06-25 23:46:42 +00:00
Audiobuzz dea7ca451a Adding dot1x support 2026-06-22 20:50:48 +00:00
Audiobuzz 1f62e5ab17 Add multi branch handling 2026-06-21 09:18:22 +00:00
Audiobuzz 3226a44d5a Refactor dnsmasq to build as a container. Add signed iPXE image build 2026-06-21 09:11:23 +00:00
Audiobuzz 535793228e Merge remote-tracking branch 'origin/main' into pxe 2026-06-20 21:47:53 +09:30
Audiobuzz d2b2156a22 Fixed the secure boot enrollment script 2026-06-20 12:16:37 +00:00
audiobuzz fd80a081da Merge pull request 'Add secure boot helper' (#6) from secureboot into main
Reviewed-on: https://git.bitasylum.org/audiobuzz/diskless-workstation/pulls/6
2026-06-20 09:26:01 +00:00
Audiobuzz 33583bb4d8 Tidy up pxe flow 2026-06-20 09:19:01 +00:00
Audiobuzz fb69068980 Update pxe boot flow 2026-06-20 09:17:05 +00:00
audiobuzz 3120ee49c4 Merge pull request 'secureboot' (#5) from secureboot into main
Reviewed-on: https://git.bitasylum.org/audiobuzz/diskless-workstation/pulls/5
2026-06-20 09:14:10 +00:00
Audiobuzz e3978bb210 Add secure boot helper 2026-06-20 06:04:04 +00:00
Audiobuzz 417f36d1b7 Merge branch 'stig' into secureboot 2026-06-20 14:51:11 +09:30
Audiobuzz 9b0d4a61ea Change email notification to syslog 2026-06-20 14:50:40 +09:30
Audiobuzz 1887b6f0a2 Add sbsigntool to the build image 2026-06-20 03:32:56 +00:00
Audiobuzz 249aeea591 Update device type for packer vm 2026-06-20 01:31:36 +00:00
Audiobuzz 65768b759c Update core layout for packer vm 2026-06-20 01:29:40 +00:00
Audiobuzz ec92417312 Initial Secure boot setup 2026-06-20 00:40:59 +00:00
Audiobuzz b67a23e718 Tightening Stig hardening 2026-06-20 00:05:19 +00:00
audiobuzz b9258e7490 Merge pull request 'app' (#4) from app into main
Reviewed-on: https://git.bitasylum.org/audiobuzz/diskless-workstation/pulls/4
2026-06-19 23:52:58 +00:00
Audiobuzz 9f7d8d13f4 Fix kiosk startup 2026-06-19 11:58:41 +00:00
Audiobuzz 98c71474d3 Add fleet hostnaming 2026-06-19 09:59:49 +00:00
Audiobuzz 13ac648267 adding secure rsyslog exceptions 2026-06-19 05:01:32 +00:00
Audiobuzz 18b47ca5b0 re-enable stig 2026-06-19 04:22:03 +00:00
Audiobuzz 77416a8e37 Fix fapolicyd for kiosk 2026-06-19 04:21:15 +00:00
Audiobuzz c150dd6eba Point images at harbor 2026-06-19 04:00:47 +00:00
Audiobuzz 51d2385b21 disable stig for now 2026-06-19 02:45:39 +00:00