diff --git a/pkg/securitypolicy/open_door.rego b/pkg/securitypolicy/open_door.rego index 7a786b912b..6353689836 100644 --- a/pkg/securitypolicy/open_door.rego +++ b/pkg/securitypolicy/open_door.rego @@ -29,5 +29,5 @@ mapped_directory_mount := {"allowed": true} mapped_directory_unmount := {"allowed": true} unmount_cims := {"allowed": true} log_provider := {"allowed": true} -load_transparency_trust_list := {"allowed": true} +load_transparency_trust_list := {"allowed": true, "allowed_ledgers": input.ledgers} host_network := {"allowed": true} diff --git a/pkg/securitypolicy/rego_utils_test.go b/pkg/securitypolicy/rego_utils_test.go index 7727ee481a..457b086ff3 100644 --- a/pkg/securitypolicy/rego_utils_test.go +++ b/pkg/securitypolicy/rego_utils_test.go @@ -125,8 +125,16 @@ func Test_RegoTemplates(t *testing.T) { } func verifyPolicyRules(apiVersion string, enforcementPoints map[string]interface{}, policyCode string) error { + // Some policy rules in the allow all policy, like + // load_transparency_trust_list, depends on input data. We create some + // fake input here so that these rules don't disappear. + input := map[string]interface{}{ + "ledgers": []string{}, + } + query := rego.New( rego.Query("data.policy"), + rego.Input(input), rego.Module("policy.rego", policyCode), rego.Module("framework.rego", FrameworkCode), )