Skip to content

C-WCOW: Enforce hashes on already mounted CIMs - #2556

Merged
anmaxvl merged 3 commits into
microsoft:mainfrom
MahatiC:enforce-hashes
Feb 4, 2026
Merged

C-WCOW: Enforce hashes on already mounted CIMs#2556
anmaxvl merged 3 commits into
microsoft:mainfrom
MahatiC:enforce-hashes

Conversation

@MahatiC

@MahatiC MahatiC commented Nov 10, 2025

Copy link
Copy Markdown
Member

Prior to this change, if you had two containers with the same image layers, the second container would not get captured in the SecurityPolicy metadata and hence would not enforce the policy. SecurityPolicy pkg captures container image layer hashes and associates them with the ContainerID during CIM mount operation. But because the CIMs are already mounted (for the previous container), this process would not occur for the second container with the same layers.

This change caches the image layer hashes for each container and SecurityPolicy instance will capture it in the metadata later on (during layer combining) if it wasn't already captured previously for this ContainerID and enforces policy.

@MahatiC
MahatiC marked this pull request as ready for review November 11, 2025 11:21
@MahatiC
MahatiC requested a review from a team as a code owner November 11, 2025 11:21
Comment thread internal/gcs-sidecar/handlers.go Outdated
Comment thread internal/gcs-sidecar/handlers.go Outdated
@MahatiC
MahatiC force-pushed the enforce-hashes branch 3 times, most recently from 3c87763 to 1758527 Compare January 16, 2026 17:00

@helsaawy helsaawy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits, but LGTM

Comment thread internal/gcs-sidecar/handlers.go Outdated
Comment thread internal/gcs-sidecar/host.go Outdated
@MahatiC
MahatiC force-pushed the enforce-hashes branch 5 times, most recently from 3df5e5b to 33dfbbd Compare January 29, 2026 17:45
@anmaxvl

anmaxvl commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

needs a rebase.

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
@anmaxvl
anmaxvl merged commit 9eea3de into microsoft:main Feb 4, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants