Skip to content

Bound Box PID count with --pids-limit=4096 - #165

Open
BrettKinny wants to merge 1 commit into
mainfrom
hardening/pids-limit
Open

Bound Box PID count with --pids-limit=4096#165
BrettKinny wants to merge 1 commit into
mainfrom
hardening/pids-limit

Conversation

@BrettKinny

Copy link
Copy Markdown
Collaborator

What

Adds --pids-limit=4096 to every Box creation path:

  • install.sh (Bash adapter)
  • install.ps1 (PowerShell adapter)
  • docker-compose.yml (pids_limit)
  • .github/workflows/e2e.yml rootless Podman gate

Why

A runaway Box process could previously fork-bomb the host by exhausting its process table. The Box already runs with --cap-drop=ALL and a tailored capability set; bounding PIDs closes the remaining cheap resource-exhaustion vector.

Capability audit (negative result)

The original plan also included reducing the capability set for rootless Podman. Empirically disproved: running the published image rootless (keep-id:uid=1000,gid=1000) with reduced caps shows that every one of CHOWN, DAC_OVERRIDE, FOWNER, SETUID, SETGID, and KILL is load-bearing for the passwordless-sudo APT provisioning contract (setup.sh --reconcile-boxsudo -n apt-get install). No capability reduction is possible without redesigning that operational control.

Verification

  • Rootless Podman end-to-end on this machine: provisioning (tmux), workspace ownership parity, Managed-home persistence across stop/start, pids.max = 4096 enforced.
  • All 19 tests/test-*.sh pass.
  • New assertions: test-lifecycle-install-state.sh (mock runtime records the flag), test-lifecycle-powershell.ps1 (source contract), test-e2e-evidence.sh (workflow gate).

A runaway Box process could previously fork-bomb the host by exhausting
its process table. All lifecycle adapters (Bash, PowerShell, Compose)
and the rootless Podman e2e gate now pass --pids-limit=4096.

The existing capability set was audited empirically against rootless
Podman (keep-id): every one of CHOWN, DAC_OVERRIDE, FOWNER, SETUID,
SETGID, and KILL is load-bearing for the passwordless-sudo APT
provisioning contract, so no capability reduction is possible without
redesigning that operational control.

Verified locally with rootless Podman: provisioning (tmux via
setup.sh --reconcile-box), workspace ownership parity, Managed-home
persistence across stop/start, and pids.max=4096 enforcement.
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