Permission denied and read-only mounts
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Treat the worksheet as evidence to analyze, not a script to paste. Before any authorized observation confirm the actual endpoint, object identity, time window and output budget. Do not repair, restart or delete resources during this offline exercise.
Synthetic workload evidence:A: CLI cannot access daemon socketB: container UID 10001, GID 10001; writable mount; owner 10002:10002; mode 0750; no ACLC: container UID owns directory; bind mount declared read-only; app attempts writeD: mode appears sufficient; security policy audit indicates denialStaged checks for approved target:docker inspect --format '{{.Config.User}}' bm-triagedocker inspect --format '{{json .Mounts}}' bm-triageIn A, follow daemon access diagnosis; Docker socket authority is privileged, not a file-sharing workaround. In B, assuming a direct UID mapping and ordinary Linux permission checks, 0750 grants write only to the owner, so UID 10001 cannot create files in the directory. Check effective IDs, supplementary groups, user namespace mapping, parent directories and ACLs before making a narrow owner-approved change. Config.User is configured identity, not proof of the effective identity of every process. C is a mount policy conflict: keep the config read-only and direct writes to a dedicated writable data location. D needs policy-specific review by the security owner; do not disable AppArmor or SELinux. Mount metadata can reveal private host paths; redact. Verify the app can perform precisely the required operation while unrelated paths stay protected. Keep previous permissions/config recorded for rollback. For B the owner is 10002 and mode 0750 grants no write permission to group or others. The conclusion assumes ordinary discretionary access checks without overriding capabilities or additional ACLs. Verify the actual mount and process identity; do not test by weakening host protections.
Common mistake
chmod 777, running as root and privileged mode are not appropriate universal permission fixes.
Manual practice
For each case identify the controlling boundary and a narrowly scoped remediation proposal. For B explain the assumptions about UID mapping and mode bits.
Worksheet: lab-fixtures/docker-troubleshooting/07-permissions/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Permission denied and read-only mounts — Knowledge check
Interpret synthetic incident evidence and choose safe diagnostic actions.
A read-only mount prevents a write even when UID owns the directory. What is the correct design?
Directory mode 0750 gives write permission to whom under ordinary mode checks?
What does Config.User establish?