users apply grants the incus socket but never the tier — it should call box grant #49
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:bootstrap
scope:coolify
scope:db
scope:docs
scope:drill
scope:installer
scope:labels
scope:platform
scope:runner
scope:users
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/rig#49
Loading…
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?
users applygrants the socket but never the tier — it should callbox grantThe gap
On a
host=yesbox, roleboxin the users file resolves to exactly oneaction (
commands/users-apply.sh:213):usermod -aG incus <user>. That is step 1 of the fivebox grantperforms(
box/host/grant-user.sh, summarised atbox/bin/box:530):incusgroup ← the only step rig doesuser-<uid>project by touching incus-user as themeth0from the project's default profile)and set
restricted.networks.access boxnet— only boxnetsnapshots,
box exportrides backups)box-netprofile into their projectrig never invokes
box grant— the phrase appears only in prose(
README.md:763,users-apply.sh:171), never as a call.What it costs
A manual second step, per user, per host, after every apply. The user's
first
box newfails closed atbox/bin/box:749:Good message, but the promise of
rig users apply— the users file is thefleet's source of truth, apply converges to it — is not kept for this role.
A window where the grant is worse than absent. rig adds the user to
incuswith no converged project. If they log in and touchincusbeforean admin runs
box grant, incus-user lazily creates their project pinned toincusbr-<uid>— whichbox/docs/plans/2026-07-18-restricted-tier.mdmeasures as worse than unhardened: NAT on v4 and v6, no ACL, no
dns.mode=none, no port isolation, no resolver pin.box grantconvergesan existing project, so the window closes when an admin arrives — but until
then that user holds a door box's contract explicitly forbids.
The README overstates what apply does. The role table at
README.md:749reads:|
box| Incus restricted tier, no sudo |incus|The group is the socket. The tier is the project convergence, which apply
does not touch.
Why calling
box grantis the right shapeusers-apply.sh:180dies with"install the box CLI and run
box setup-hostfirst" onhost=yeswith noincusgroup. Callingbox grantconsumes an interface rig alreadyrequires.
invocation. Deferring to box's own grant path respects that boundary
harder than reimplementing half of it does.
box grantis already script-callable. Documented idempotent (everystep converges, safe after upgrades); root-or-sudo, which apply already
is; every incus call
</dev/null-pinned so it cannot wedge interactively;and step 2 does the run-as-user touch via
runuser, so the user never hasto log in first. It also fails closed — the
backouttrap strips a groupmembership this run added if a later step trips.
Open decisions
1. Failure granularity.
box grantexits 1 on host-level facts (noboxnet,incus-user.socketunavailable) and per-user facts (projectcreation failed). Apply already has the precedent for the split: die on the
host-level precondition, as it does today at
users-apply.sh:180; warn andcontinue per user — "one box-role user somewhere in the fleet must not stop
apply everywhere VMs don't live."
2.
incus-adminmembers must still be converged.box granttodayrefuses them outright (
grant-user.sh:69, "they already have the admintier; there is nothing tighter to grant"). That conflates permission with
provisioning: an
incus-adminmember resolves totier=admin(
box/bin/box:30) and lands in the shared default project — they neverget their own
user-<uid>project, their ownbox-netprofile copy, or theper-project narrowing. Being able to do anything is not the same as being
set up. This has bitten us in practice. Blocked on a box-side change —
heavy-duty/box#99.
3. Runtime.
box grantper box-role user per apply run is several incuscalls plus a
timeout 60run-as-user touch. Convergent and bounded, butapply gets measurably slower on a host with many box-role users, and there
is no cheap "already converged?" probe short of doing the work.
Out of scope
The mirror-image bug on the revoke side — apply's bare
gpasswd -dbypassingbox revoke— is #50. Bootstrap taking the users file so this converges atbring-up is #51.