Skip to content

whim v0.3.0 — opt-in privileged shells via AWS additionalOsCapabilities

Choose a tag to compare

@udgover udgover released this 03 Jul 08:58
· 15 commits to main since this release
v0.3.0
84540c3

A whim shell is root, but under a restricted Linux capability set — so mount, network namespaces, unshare, and eBPF are all denied (EPERM) even as uid 0. This release adds an opt-in way to lift that: AWS Lambda MicroVM "operating system capabilities."

whim --privileged                 # throwaway shell that can mount, netns, run eBPF
whim run --privileged -- mount -t tmpfs none /mnt   # one-shot privileged command
whim build ./app --name whim-app --privileged       # bake ALL capabilities into a custom image

What's new

  • --privileged grants the image AWS's additionalOsCapabilities: ["ALL"] (the only value AWS supports today), lifting the effective capability set to everything — mount, network namespaces, unshare, eBPF, nested containers.
  • whim --privileged / whim run --privileged launch the well-known whim-privileged image, auto-built on first use (~2-3 min, like
    whim init) and cached alongside your other images. It ships the tooling to use the caps — util-linux, iproute, e2fsprogs — since capabilities unlock syscalls, not binaries. Mutually exclusive with --image.
  • whim build --privileged bakes ALL capabilities into a custom image instead, fixed at build time and inherited by every VM launched from it.
  • Capability-aware image reuse. A privileged build never silently reuses an unprivileged image or vice versa — reuseImage compares an existing image version's capabilities (via a new GetMicrovmImageVersion call) against the request and refuses a mismatch (ErrCapabilityMismatch). whim --privileged likewise verifies a cached ARN is actually privileged before reusing it.

Hardening in this release

  • Image specs are fully validated (required fields, capabilities, egress) before any destructive AWS action — an invalid spec never costs you your existing image on a forced rebuild's delete step.
  • Privileged auto-build is bounded by a timeout and streams progress to stderr, so whim run's stdout stays limited to remote output.
  • whim image rm now prunes the deleted image's cached config entry.

Validated live

An ["ALL"] image reaches CREATED/ACTIVE; a privileged shell performs mount/netns/unshare while an identical unprivileged shell is correctly denied; and a non-privileged build over an already-privileged image is refused.

Isolation note

Elevated capabilities are opt-in — default images stay minimal-capability and privilege is never granted implicitly — and apply within the VM's isolation boundary: per AWS, they do not affect the host or other MicroVMs.

Compatibility

Purely additive — every existing command and default image behavior is unchanged.

Install

go install github.com/udgover/whim/cmd/whim@v0.3.0