tests: Set default policy before running sealed secrets tests

The test `Cannot get CDH resource when deny-all policy is set`
completes with a KBS policy set to deny-all. This affects the
future TEE test (e.g. k8s-sealed-secrets.bats) which makes a
request against KBS.
This commit introduces kbs_set_default_policy() and puts it to
the setup() in k8s-sealed-secrets.bats.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
This commit is contained in:
Hyounggyu Choi 2025-03-24 18:27:36 +01:00
parent f6a1c6d0e0
commit 8088064b8b
2 changed files with 7 additions and 0 deletions

View File

@ -39,6 +39,11 @@ kbs_set_allow_all_resources() {
"${COCO_KBS_DIR}/sample_policies/allow_all.rego"
}
kbs_set_default_policy() {
kbs_set_resources_policy \
"${COCO_KBS_DIR}/src/policy_engine/opa/default_policy.rego"
}
# Set "deny all" policy to resources.
#
kbs_set_deny_all_resources() {

View File

@ -70,6 +70,8 @@ setup() {
if ! is_confidential_hardware; then
kbs_set_allow_all_resources
else
kbs_set_default_policy
fi
}