Multi-user hosts: make box work in per-user Incus projects (restricted incus tier)
#72
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:cli
scope:drill
scope:host
scope:installer
scope:templates
scope:tiers
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/box#72
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?
Context
The dev-server will be shared by three operators, multiple boxes each. The identity model (heavy-duty/rig#24) deliberately keeps operators out of
incus-admin(host-root-equivalent skeleton key) and instead grants theboxrole = membership in theincusgroup, where Incus'sincus-userdaemon confines each member to their own Incus project: they see and manage only their own instances. This issue makes box work correctly in that world.Task 0 — verify the substrate (blocks everything)
Confirm on the M900s' Incus version (and in a rehearsal VM) that the restricted tier actually behaves as documented: a user in
incus(notincus-admin) gets a per-user project viaincus-user, cannot see other projects' instances, and can launch VMs. Record versions and any gaps in the plan doc. If the shipped Incus lacks a workingincus-user, this issue's design changes materially — verify before building.The audit: box's daemon-global assumptions
box today assumes full-socket access and daemon-global resources. Known project-sensitive surfaces (audit for completeness — this list is a starting point, not the spec):
profiles/box-net.yaml— thebox-netprofile is created once, daemon-wide, bysetup-host. Profiles are per-project in Incus: each user's project needs the profile present (copy at first use?box doctor --fix? project-creation hook?). Decide the owner and the convergence story.boxnetnetwork +box-isolateACL — networks and ACLs are daemon-global (visible across projects) but restricted users may lack rights to attach or modify them. Verify a restricted user can launch ontoboxnetwith the profile; setup (create/modify) stays admin-only viasetup-host.user.box=1has no owner identity; under projects that's fine (the project is the owner boundary), butbox list/resolve_boxmust scope to the caller's project and not error on cross-project name collisions (two users can both have a box namedwork).box expose— binds host loopback and edits ACL ingress + staticipv4.addresspins; restricted users may lack ACL/network edit rights. Decide: expose becomes admin-assisted, or the ACL carve-out mechanism is rethought for projects.setup-host/doctor/migrate-host— admin-tier commands; they should detect and say which tier the caller is in (incus-adminvs restricted) instead of failing opaquely.What changes (shape, refined by the audit)
incus-admin, today's behavior unchanged) and restricted (per-user project).box-netprofile (the one resource each project genuinely needs locally), owned by a convergent path (doctor --fixor firstbox new).box list/info/lifecycle verbs work identically inside a restricted project.incusgroup = normal operators (via heavy-duty/rig#24'sboxrole),incus-admin= break-glass; what each tier can and cannot do (exposecaveats included).Non-goals
Acceptance
setup-hosthas run: a user inincusonly canbox new/list/shell/snapshot/rmtheir own boxes; a second restricted user cannot see them; name collisions across users are fine.incus-adminuser sees today's behavior unchanged.box doctorreports the caller's tier and the project's health honestly.Companion: global install (linked below) · rig#24 (
boxrole definition) · rig#25 (machine classes)Companion global-install issue: https://github.com/heavy-duty/box/issues/71