Grant NAS sandbox dataset access via DEFAULT idmap plus per-dataset ACLs
Date: 2026-06-27 Status: Accepted Decision: hl-3ek7 Deciders: sean
Context
Section titled “Context”The NAS sandbox needs read-write access to specific data datasets for space curation. Spike testing proved TrueNAS 26 container.* LXC has no privileged/no-shift mode: idmap.type accepts only DEFAULT or ISOLATED, and omitting it defaults to DEFAULT. Under DEFAULT, container-root maps to host UID 2147000001, which cannot write 0:0-owned dataset trees (/mnt/main, /mnt/apps roots) without an explicit grant.
Decision
Section titled “Decision”Run the sandbox with idmap: {type: DEFAULT} (unprivileged, UID-shifted) and grant read-write to specific curation datasets via per-dataset ACLs for the mapped UID 2147000001 — “specific access to the data shares”, not root-to-everything. The grant is acltype-aware: setfacl for POSIX1E datasets, midclt filesystem.setacl (USER ACE, FULL_CONTROL, INHERIT) for NFSv4 datasets.
Rationale
Section titled “Rationale”- A privileged container is not available through
container.*— forced by the API, then embraced as the secure default. - ACL-scoped access matches the original intent (“specific access to the data shares”) and minimizes blast radius.
- A dataset survey found ~87 POSIX1E / 15 NFSv4; the high-value curation targets (multimedia, software, time-machine) are NFSv4, so both grant mechanisms are required. Both were proven end-to-end by spike.
Alternatives Considered
Section titled “Alternatives Considered”- DEFAULT idmap + per-dataset ACLs (chosen): secure, supported, proven; bounded write reach.
- Privileged /
idmap=Nonecontainer (rejected — impossible): no such mode exists incontainer.*. chownof existing trees to the mapped UID (rejected): rewrites real data ownership; ACLs are non-destructive.- Host-level / root Docker-app curation (deferred): more capable for unrestricted writes, but defeats the interactive-sandbox goal; revisit only if ACL scoping proves insufficient.
Consequences
Section titled “Consequences”- Positive: secure-by-default; no privileged container; non-destructive grants; works for both ACL types.
- Negative: curation is bounded to ACL-prepared datasets (not “anything”); the ACL-granting task must branch on
acltype. - Neutral: the mapped UID
2147000001is the DEFAULT-namespace base — assumed stable across recreation; the plan re-confirms it from/proc/<pid>/uid_mapafter creating the real container.