Skip to content

feat: tmpfs noexec/nosuid/nodev + binds default :ro + init=true#3

Merged
oddur merged 1 commit intomainfrom
feat/v0.6.0-hardening-pack
Apr 26, 2026
Merged

feat: tmpfs noexec/nosuid/nodev + binds default :ro + init=true#3
oddur merged 1 commit intomainfrom
feat/v0.6.0-hardening-pack

Conversation

@oddur
Copy link
Copy Markdown
Owner

@oddur oddur commented Apr 26, 2026

v0.6.0 (tag pushed). Three more secure-by-default knobs. See commit message for full breakdown.

binds default :ro, init=true (tini)

Three more secure-by-default knobs on top of the v0.5.0 set:

1. **tmpfs auto-`noexec,nosuid,nodev`**: when a service declares
   `tmpfs:` mount points, those flags are appended to the operator's
   option string unless they explicitly opt in (`exec`, `suid`,
   `dev`). Closes the "drop a binary on writable scratch + exec it"
   escape chain.

2. **bind mounts default `:ro`**: a `binds:` entry without a mode
   suffix gets `:ro` automatically. Operator opts in to writable
   binds with explicit `:rw`. Removes the "I bind-mounted /etc/foo
   and the app started scribbling on the host" footgun.

3. **init=true** (new field, default true): docker's `--init` runs
   tini as PID 1 — proper zombie reaping + SIGTERM forwarding to
   children. Drains and healthcheck-gated rolling swaps actually
   finish on apps where the language runtime doesn't reap. Operator
   opts out via `init: false` for images that ship their own init
   (systemd-in-containers, s6-overlay, supervisord, etc.).

Spec_hash now includes the `init` flag, so existing containers
look drifted on first reconcile after upgrade — expected one-time
forced redeploy.

Tests: harden_tmpfs_options preserves operator-provided opts +
appends each missing negative independently; respects explicit
opt-out per-flag; idempotent. default_bind_to_ro appends :ro on
bare two-field binds, leaves three-field binds (with explicit mode
or SELinux flags) verbatim. RunOptions::default() produces a
HostConfig with init=true; init=false opt-out flows through.

README "Sane security defaults" table extended with the three new
rows + opt-outs.
@oddur oddur merged commit 4eb52d1 into main Apr 26, 2026
14 checks passed
@oddur oddur deleted the feat/v0.6.0-hardening-pack branch April 26, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant