Skip to content

open_door.rego: Fix load_transparency_trust_list - #2993

Open
Tingmao Wang (micromaomao) wants to merge 1 commit into
microsoft:mainfrom
micromaomao:allow-all-load-ttl
Open

Tingmao Wang (micromaomao) wants to merge 1 commit into
microsoft:mainfrom
micromaomao:allow-all-load-ttl

Conversation

@micromaomao

@micromaomao Tingmao Wang (micromaomao) commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

It is missing the allowed_ledgers output, which makes this allow all policy not actually work.

PS C:\Users\azureuser\wcow_ping> azcrictl inject-fragment (azcrictl pods -q --name wcow) 'acidevacr.azurecr.io/internal/aci/aci-cc-ttl:transparent-fragment-signing-0-20260615.1'
time="2026-11-19T15:03:24Z" level=fatal msg="injecting policy fragment: rpc error: code = Unknown desc = failed to inject fragment: guest modify: guest RPC failure: error loading transparency trust list: unable to get allowed_ledgers from load_transparency_trust_list result: unable to find value for key 'allowed_ledgers'"

verifyPolicyRules in the test code checks that each enforcement point is present in the allow all policy. Since the load_transparency_trust_list rule depends on input.ledgers, we pass in a fake input. The same logic can be applied later if we have more enforcement points with the output being unavoidably dependent on input.

It is missing the allowed_ledgers output, which makes this allow all
policy not actually work.

verifyPolicyRules in the test code checks that each enforcement point is
present in the allow all policy.  Since the load_transparency_trust_list
rule depends on input.ledgers, we pass in a fake input.  The same logic
can be applied later if we have more enforcement points with the output
being unavoidably dependent on input.

Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The tests do not verify that a non-empty transparency trust list stores every offered ledger key.

1 open issue
What changed in this PR

Fixes transparency trust list loading in the allow-all Rego policy by returning the ledger list required by the security policy enforcer.

Changes:

  • Returns all supplied ledgers through allowed_ledgers.
  • Provides fake ledger input during template validation so the input-dependent rule remains visible.
File Description
pkg/​securitypolicy/​rego_utils_test.go Supplies empty ledger input when checking policy enforcement points.
pkg/​securitypolicy/​open_door.rego Adds allowed_ledgers to the transparency trust list result.

Review effort: Balanced

unmount_cims := {"allowed": true}
log_provider := {"allowed": true}
load_transparency_trust_list := {"allowed": true}
load_transparency_trust_list := {"allowed": true, "allowed_ledgers": input.ledgers}
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