Repository navigation
What's Changed
Fixes
- Containers now run under Pod Security's
baselineandrestrictedlevels. This covers clusters that enforce a level by default, such as Talos (baseline), and Portainer's Pod Security Standards policy.NET_RAWis no longer added to the pod. Docker grants it by default, so adding it changes nothing, butbaselinerefuses a pod that adds it. Portainer's create form added it to every container. It is still added if it was dropped first (--cap-drop ALL --cap-add NET_RAW). Docker's other default capabilities are added as before.- Every pod, including a Swarm service's, uses the runtime's default seccomp profile (
RuntimeDefault), as Docker applies its own default profile.--security-opt seccomp=unconfinedstill turns it off. - A numeric user other than root (
-u 1000) also setsrunAsNonRoot, whichrestrictedrequires. - Containers created by 1.3.0 are updated in place. On start, d2k updates the pods of stopped containers. A running container is updated the next time it starts, so it isn't restarted. A Swarm service is updated the next time
docker stack deployruns.
- A container the namespace's Pod Security level refuses is refused when it's created, in Docker terms.
- d2k checks each container with a server-side dry run before it creates anything. A refused container gets a
403that names the Docker flag and the compose key to change, followed by Kubernetes' reason. Previously the container was created and then never started. - A container created before the level was raised is refused in the same way when it starts, and is left stopped.
- Under a level that only warns (
pod-security.kubernetes.io/warn), the container is still created, anddocker runanddocker composeshow the warning. - Refusals from other admission policies (Kyverno, Gatekeeper, ValidatingAdmissionPolicy) are passed through as Kubernetes words them.
- A refused container no longer leaves behind the named volumes it would have created.
- d2k checks each container with a server-side dry run before it creates anything. A refused container gets a
docker inforeports the namespace's Pod Security level.- Security Options lists
name=seccomp,profile=builtinandname=pod-security,profile=<level>. - Under
baselineorrestricted, a warning says what the level refuses and which Docker settings comply. - d2k also logs the level at start-up. It rechecks the level at most a minute after the namespace's labels change.
- Security Options lists
Chore
- Go upgraded from 1.26.10 to 1.26.11.
- Docs: the README has a new Pod Security section with a table of each level and a compose example for
restricted. Installing by hand now starts withkubectl apply --dry-run=server, to check that the cluster accepts d2k's own pod. - Tests: added
test/e2e/pod-security.sh, which runs d2k underbaselineandrestricted.
Full Changelog: 1.3.0...1.3.1