Skip to content

Conversation

@MahatiC
Copy link
Member

@MahatiC MahatiC commented Nov 10, 2025

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
@MahatiC MahatiC force-pushed the enforce-hashes branch 3 times, most recently from 3c87763 to 1758527 Compare January 16, 2026 17:00
Copy link
Contributor

@helsaawy helsaawy left a comment

Choose a reason for hiding this comment

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

nits, but LGTM

@MahatiC MahatiC force-pushed the enforce-hashes branch 5 times, most recently from 3df5e5b to 33dfbbd Compare January 29, 2026 17:45
@anmaxvl
Copy link
Contributor

anmaxvl commented Jan 30, 2026

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>
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.

4 participants