securitypolicy: honor LCOW AMD certificate annotation #2962
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.63) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 292 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.340
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #2962"
general
weight: 0.35
jterry75
Problem
SecurityOptions.WriteSecurityContextDiris shared by the LCOW guest and the WCOW GCS sidecar, but currently reads the host AMD certificate only fromannotations.WCOWHostAMDCertificate. A certificate supplied underannotations.LCOWHostAMDCertificateis silently omitted fromhost-amd-cert-base64. If the certificate is the only security-context input, no directory orUVM_SECURITY_CONTEXT_DIRenvironment variable is created.Change and compatibility
Read
LCOWHostAMDCertificatefirst and fall back toWCOWHostAMDCertificatewhen the LCOW value is missing or empty.This ports the downstream LCOW annotation fix with one deliberate upstream compatibility adjustment: retain the existing WCOW lookup as a fallback rather than removing it.
HostAMDCertificateis a deprecated alias ofLCOWHostAMDCertificate, not a separate annotation key, so no additional generic-key fallback is needed. When both keys are non-empty, LCOW takes precedence.The existing policy, UVM reference information, hash-envelope reference information, TCB/platform reference information, directory handling, and environment injection remain unchanged. No caller, annotation definition, dependency, or file-permission changes are included.
Regression coverage
A platform-neutral table-driven test covers LCOW, the deprecated generic alias, WCOW-only inputs, conflicting values, empty LCOW fallback, nil/empty annotations, and empty certificate values. Each case runs both with the certificate alone and alongside the other security-context inputs, checking exact file contents, directory creation/no-op behavior, and environment preservation.
Before the fix, the LCOW, generic-alias, and conflicting-value cases failed on both Windows and Linux. All 16 leaf cases pass after the fix.
Validation
Validated with Go 1.26.8 on Windows/amd64 and Linux/amd64:
go test -v ./pkg/securitypolicy -run '^TestWriteSecurityContextDirAMDCertificate$' -count=1go test -tags=rego -timeout=30m ./pkg/securitypolicy/...go build -tags=rego ./cmd/gcs-sidecargo build -tags=rego ./cmd/gcsgofmtandgit diff --checkNo live SEV-SNP workload or attestation end-to-end validation was performed for this upstream port. This PR is intentionally opened as a draft for review.