Stage jail spawn files under a daemon-owned path instead of root-owned /var/run #135
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#135
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?
Background
The jail-spawn
Permission deniedbug (truss analysis indocs/TRUSS-SPAWN-ANALYSIS.md, fixed by #131 + #134) had two causes. The second was that the daemon stages per-spawnlaunch.sh/env.shunder<jail_root>/var/run/colibri-stage/<stage_id>/, but/var/runis root-owned, so the daemon (running asclawdie) couldn't create the staging subdir.#134 worked around this by having
agent-jail-bootstrap.shpre-create/var/run/colibri-stageowned byclawdie(0700). That fixes it, but it leaves a structural smell: the daemon writes into a root-owned tree and depends on an external bootstrap step to carve out an owned subdir first.Proposal
Stage under a path the daemon owns outright, e.g.
/var/db/clawdie/stage(or anotherclawdie-owned location), instead of root-owned/var/run.Benefits:
/var/dbis persistent;/var/runis sometimes tmpfs/cleared on boot, which can make the bootstrap-created dir vanish.Where
crates/colibri-daemon/src/spawner.rs—STAGED_JAIL_RUN_DIRconstant (currently/var/run/colibri-stage) andprepare_spawn_commandstaging logic.install -d ... colibri-stageline inpackaging/freebsd/agent-jail-bootstrap.sh(#134) can likely be dropped.jexec'd, so the chosen dir must exist/be writable both on the host side (daemon writes) and reachable jail-side (launcher reads).Acceptance
clawdie-owned path without any pre-created dir from the bootstrap script.env.sh/launch.shsourced correctly).Priority
Low — current state (bootstrap pre-creates
0700clawdie-owned dir) works and is not world-writable. This is a structural cleanup, not a live bug.