Skip to content

Commit

Permalink
fix: add akv keys check on cosign-verifier (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin-li authored Apr 30, 2024
1 parent 0ac4223 commit a884308
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/ratify/templates/verifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
name: cosign
artifactTypes: application/vnd.dev.cosign.artifact.sig.v1+json
parameters:
{{- if gt (len .Values.cosignKeys) 0 }}
{{- if or (gt (len .Values.cosignKeys) 0) (and .Values.azurekeyvault.enabled (gt (len .Values.azurekeyvault.keys) 0)) }}
trustPolicies:
- name: default
version: 1.0.0
Expand Down
5 changes: 4 additions & 1 deletion test/bats/azure-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SLEEP_TIME=1
assert_success
run kubectl apply -f ./library/default/samples/constraint.yaml
assert_success

# verify that the image can be run with a root cert, root verification cert should have been configured on deployment
run kubectl run demo-leaf --namespace default --image=${TEST_REGISTRY}/notation:leafSigned
assert_success
Expand Down Expand Up @@ -112,6 +112,9 @@ SLEEP_TIME=1
run kubectl apply -f ./library/default/samples/constraint.yaml
assert_success
sleep 5
run kubectl apply -f ./test/bats/tests/config/config_v1beta1_verifier_cosign_akv.yaml
assert_success
sleep 5

run kubectl run cosign-demo --namespace default --image=${TEST_REGISTRY}/cosign:signed-key
assert_success
Expand Down
18 changes: 18 additions & 0 deletions test/bats/tests/config/config_v1beta1_verifier_cosign_akv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: config.ratify.deislabs.io/v1beta1
kind: Verifier
metadata:
name: verifier-cosign
annotations:
helm.sh/hook: pre-install,pre-upgrade
helm.sh/hook-weight: "5"
spec:
name: cosign
artifactTypes: application/vnd.dev.cosign.artifact.sig.v1+json
parameters:
trustPolicies:
- name: default
version: 1.0.0
scopes:
- "*"
keys:
- provider: gatekeeper-system/kmprovider-akv

0 comments on commit a884308

Please sign in to comment.