You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix pause container of a privileged pod unable to start due to /sys mount option mismatch (#2760)
* Fix pause container of a privileged pod unable to start due to /sys mount option mismatch
Starting with v2, containerd mounts /sys as rw on the sandbox container when the
pod is privileged (1fc497218 "Fix privileged container sysfs can't be rw because
pod is ro by default") instead of ro. This means that the mount list for a
privileged pause container no longer matches with just data.defaultMounts and
will need a special case for sysfs. Alternative options were also considered -
see the comment in framework.rego.
This change in GCS is necessary even though this can be fixed via a policy
change, because we need to maintain compatibility with existing policies.
This PR converts EnforceCreateContainerPolicy in the LCOW GCS to
EnforceCreateContainerPolicyV2, in order to use the CreateContainerOptions
struct to pass an additional bool indicating whether the current container is a
sandbox container.
This does not allow additional capabilities etc for the sandbox container, only
that sysfs can now be rw.
* Add tests for sandbox sysfs special-case
* framework.rego: Don't require candidate_containers[_].allow_elevated for sysfs rw special case
* Add tests to check that sysfs rw special case is applied even when no container in the policy is elevated
Assisted-by: GitHub Copilot:claude-opus-4.7
Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>
0 commit comments