Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a test to the cosigned e2e suite with multiple keys. #943

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/e2e_test_cosigned.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ spec:
- name: sample
image: $KO_DOCKER_REPO/sample
EOF

cat > cronjob.yaml <<EOF
apiVersion: batch/v1beta1
kind: CronJob
Expand All @@ -76,6 +77,19 @@ spec:
EOF
echo '::endgroup::'

cat > manykeys.pem <<EOF
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQaXTMA1eCVAGCTWxTe8ZQ0JVNSXV
A+6/ffM1bfNnq3AGkhGNfJTI3P0w1Y69gBTF/AfXhYuEc/SxmX0b3PwzWg==
-----END PUBLIC KEY-----
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE40I8/4Q4k7IhuJvesexymMH4mQa6
nD9c9iLu5S/Y5yjCDYtDTB7MzwTy+0RtIdIAv1ePBVGVQ/s7M2QDdrA8SQ==
-----END PUBLIC KEY-----
EOF

echo '::endgroup::'


echo '::group:: enable verification'
kubectl label namespace default --overwrite cosigned.sigstore.dev/include=true
Expand All @@ -98,7 +112,13 @@ echo '::group:: setup verification-key'
cosign generate-key-pair k8s://cosign-system/verification-key
echo '::endgroup::'

echo '::group:: setup multiple verification-keys'
cosign public-key --key k8s://cosign-system/verification-key >> manykeys.pem

# Save the old key
kubectl get secret -n cosign-system verification-key -o=json | jq -r '.data["cosign.key"]' | base64 --decode > cosign.key
kubectl delete secret -n cosign-system verification-key
kubectl create secret generic -n cosign-system verification-key --from-file=cosign.pub=manykeys.pem --from-literal=cosign.password=${COSIGN_PASSWORD} --from-file=cosign.key

echo '::group:: disable verification'
kubectl label namespace default --overwrite cosigned.sigstore.dev/include=false
Expand Down