colibri: gate autospawn on /var/db/colibri/.secured (honor colibri_daemon_require_secured) #183
Labels
No labels
first-proof blocker
hardening
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: clawdie/colibri#183
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
colibri: honor
colibri_daemon_require_secured— gate autospawn on.securedThe clawdie-iso first-boot password gate (clawdie-iso PR #139) writes
/var/db/colibri/.securedwhen the operator sets the root+operator passwords, and the operator image setscolibri_daemon_require_secured="YES"in rc.conf. This is the daemon-side consumer that makes "the agent will not start/register until secured" actually true.Part A — required interlock (
packaging/freebsd/colibri_daemon.in)colibri_daemon_prestart(), after the. provider.envsource block (lines ~99-103, which setsCOLIBRI_AUTOSPAWN=YES) so this override wins:Why this shape:
packaging/freebsd/port/.../colibri_daemon.in) on deployed hosts never sets it, so they're unaffected (default NO). An unconditional check would disable autospawn on every deployed host forever — that's the bug this avoids.. provider.env→ overrides theCOLIBRI_AUTOSPAWN=YESfrom provider.env.exportin prestart propagates to the daemon child (same mechanism as the existingCOLIBRI_DAEMON_DATA_DIRexports). Daemon honors it viaenv_truthy("COLIBRI_AUTOSPAWN")(crates/colibri-daemon/src/socket.rs:415).BEFORE: LOGIN, the daemon isREQUIRE: LOGIN, rc is synchronous — so on the boot where the operator sets the password,.securedalready exists when this prestart runs → autospawn proceeds the same boot. Reboot only matters if the password is set outside the gate.node_register⇒ mother never hears from an unsecured node.Part B — recommended UX: visible unsecured state
Without this, a skipped node shows a running daemon with no agent and no explanation ("broken or just unsecured?").
secured: boolto the daemon status response (true iff${data_dir}/.securedexists).[UNSECURED — set root password to activate agent]instead of a blank pane.colibri status: printNode: UNSECURED (set root password to activate agent)when false.Explicitly NOT doing (Option 3 / auto-wake poll)
Dropped. rc ordering already avoids the reboot it was meant to solve; not worth the scheduler poll + respawn-guard + mid-session marker race.
Test
A small shell test for the prestart logic, mirroring
clawdie-iso/tests/firstboot-rootpw-test.sh:require_secured=YES+ marker absent →AUTOSPAWN=NO; marker present → unchanged;require_secured=NO→ unchanged.Coupling
Ships with clawdie-iso #139 in the same 0.12 image. #139 already sets the knob and its skip message promises this behavior — Part A makes the promise true. Boot-test on osa together.