Skip to content

always set SecurityPolicyEnabled when policy is present#2748

Open
anmaxvl wants to merge 1 commit into
microsoft:mainfrom
anmaxvl:fix-lcow-policy-plumbing
Open

always set SecurityPolicyEnabled when policy is present#2748
anmaxvl wants to merge 1 commit into
microsoft:mainfrom
anmaxvl:fix-lcow-policy-plumbing

Conversation

@anmaxvl
Copy link
Copy Markdown
Contributor

@anmaxvl anmaxvl commented May 21, 2026

Previously, SecurityPolicyEnabled was only set for LCOW when no-security-hardware was false, which meant the security policy was never plumbed to the GCS in the no-hardware dev path. This differed from the WCOW path which always sets SecurityPolicyEnabled when a policy is present.

Move SecurityPolicyEnabled assignment out of the !noSecurityHardware block so it is set whenever a security policy string is present. Gate the SNP-specific HCS document (makeLCOWSecurityDoc) on GuestStateFilePath instead, since that is only set when real SNP hardware is available.

Add AI generated unit tests.

Previously, SecurityPolicyEnabled was only set for LCOW when
no-security-hardware was false, which meant the security policy was
never plumbed to the GCS in the no-hardware dev path. This differed
from the WCOW path which always sets SecurityPolicyEnabled when a
policy is present.

Move SecurityPolicyEnabled assignment out of the !noSecurityHardware
block so it is set whenever a security policy string is present. Gate
the SNP-specific HCS document (makeLCOWSecurityDoc) on GuestStateFilePath
instead, since that is only set when real SNP hardware is available.

Add AI generated unit tests.

Signed-off-by: Maksim An <maksiman@microsoft.com>
@anmaxvl anmaxvl requested a review from a team as a code owner May 21, 2026 18:21
@rawahars
Copy link
Copy Markdown
Contributor

@anmaxvl Can you please make the verify and behaviour and make the changes in V2 shim as well-

noSecurityHardware := oci.ParseAnnotationsBool(ctx, annotations, shimannotations.NoSecurityHardware, false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants