root@sudosecurity:~/stackfile/lint$ cat lint.md
stackfile-lint
A Rust CLI that audits Docker Compose files for the security mistakes that get people breached — 19 rules, SARIF and GitHub output, baseline support, and a config file.
stackfile-lint reads a compose file and answers one question: where does this drift from a hardened baseline? Nineteen rules across five severities, each finding printed with the line, the reason it matters, and the fix.
What it catches
- High:
privileged: true, the Docker socket mounted, host namespaces shared (network_mode/pid/ipc/userns_mode/cgroup: host), confinement disabled (apparmor/seccomp/systempaths: unconfined,label:disable), dangerous capabilities (SYS_ADMIN, DAC_READ_SEARCH, …), secrets in environment variables, sensitive host paths mounted. - Medium: ports published on all interfaces,
no-new-privilegesmissing, capabilities not dropped, containers running as root, host devices passed through. - Low: unpinned images, writable root filesystems, no memory, CPU or process limits.
- Info: no healthcheck, logs not rotated, aliases worth a second look.
Runs the way CI runs
--formattext, json, github (inline PR annotations) or sarif (code scanning).--canonicalrunsdocker compose configfirst, so lints see what Docker sees..stackfile-lint.tomlsetsskip,fail_onand per-path skips;--baselinekeeps legacy files green while you fix them.- Exit codes stay honest: 0 clean, 1 findings at your threshold, 2 no file, 3 error — a broken config is never a silent pass.
$ stackfile-lint compose.ymlBuilt for WASM too. The lint library does no I/O — the same code compiles to WebAssembly, so a paste-a-file page on this site can lint your compose file without it ever leaving the browser.
compose.yml:12 [SFL001] api: privileged: true — privileged containers get every capability
compose.yml:31 [SFL007] db: ports 0.0.0.0:5432 — published on all interfaces