Cwcow policy changes - #2842
Draft
takuro-sato wants to merge 54 commits into
Draft
Conversation
Capture and apply envToKeep from policy enforcement in createContainer, external exec, and in-container exec. Previously the filtered env list was discarded. Add ociEnvToProcessParamEnv and rewriteExecRequest helpers with tests. Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Add EnforceMappedDirectoryMountPolicy/UnmountPolicy to enforce VSMB directory shares for confidential Windows containers. Writable mapped directories are denied; duplicates at the same container path are prevented. Also add path pattern validation for MappedVirtualDisk and MappedVirtualDiskForContainerScratch to ensure SCSI mounts only target c:\mounts\scsi\m<N>. Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
This reverts commit 5c658a5. Signed-off-by: Takuro Sato <takurosato@microsoft.com>
…ess" This reverts commit 8a9015b. Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
…licy Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
This reverts commit 96a404f.
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
registry_changes now narrows data.metadata.matches to the container(s) that authorize the kept subset of requested values, mirroring the environment-variable dropping pattern, and returns that subset (registry_changes_to_keep) so the host-side enforcer applies only the sanctioned values. Because both registry_changes and create_container are filters over data.metadata.matches, the decision composes regardless of which runs first. EnforceRegistryChangesPolicy now returns the policy-kept registry changes; the gcs-sidecar rebuilds the forwarded RegistryChanges as the pre-approved defaults plus the kept non-default values before forwarding to the inbox GCS. Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
…n modifysettings request Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
…work pass-through Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Reject host-supplied container IDs that aren't a containerd-style identifier (alphanumeric segments joined by single ./_/-) before recording or forwarding them, as defense-in-depth against the ID being joined into a filesystem path downstream. Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Track container termination from the guest container-exit notification and refuse a CWCOWCombinedLayers Remove whose root is still used by a running container (cf. LCOW Host.IsOverlayInUse). Signed-off-by: Takuro Sato <takurosato@microsoft.com>
…ed container) Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Watch the inbox GCS response for CWCOWCombinedLayers and MappedDirectory mount/unmount requests. If the inbox reports a failure, mark the UVM inconsistent so all further container creation/deletion and mount/unmount are refused (cf. LCOW setUVMInconsistent). Why fail closed instead of reverting the policy state: the sidecar forwards these operations to the inbox GCS rather than performing them itself, so it cannot observe or cleanly undo their effects. A real revert would need synchronous request/response correlation plus careful undo of the staged rego metadata and sidecar caches. Failing closed is simpler and safe: we never continue on policy state that may be out of sync with what is actually mounted. Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
Signed-off-by: Takuro Sato <takurosato@microsoft.com>
The container scratch disk is added via MappedVirtualDiskForContainerScratch but removed as a plain MappedVirtualDisk; forward the Remove (a harmless detach) so teardown completes, while still rejecting a raw Add. Restores the mount -> unmount -> re-mount lifecycle for the same container root. Signed-off-by: Takuro Sato <takurosato@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Misc changes