-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new task to request signature of blobs
- Add request-signature-blob task to be able of using request-signature to sign a blob - Modify request-signature.py to sign container images and blobs depending of the arguments passed Signed-off-by: Ernesto González <[email protected]>
- Loading branch information
1 parent
7d3b5fc
commit d095d62
Showing
3 changed files
with
268 additions
and
18 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
ansible/roles/operator-pipeline/templates/openshift/tasks/request-signature-blob.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: request-signature-blob | ||
spec: | ||
params: | ||
- name: pipeline_image | ||
description: A docker image of operator-pipeline-images for the steps to run in. | ||
- name: blob | ||
description: Blob that needs to be signed. | ||
- name: requester | ||
description: Name of the user that requested the signing, for auditing purposes | ||
- name: sig_key_id | ||
description: The signing key id that the content is signed with | ||
default: "4096R/55A34A82 SHA-256" | ||
- name: sig_key_name | ||
description: The signing key name that the content is signed with | ||
default: containerisvsign | ||
- name: umb_ssl_secret_name | ||
description: Kubernetes secret name that contains the umb SSL files | ||
- name: umb_ssl_cert_secret_key | ||
description: The key within the Kubernetes secret that contains the umb SSL cert. | ||
- name: umb_ssl_key_secret_key | ||
description: The key within the Kubernetes secret that contains the umb SSL key. | ||
- name: umb_client_name | ||
description: Client name to connect to umb, usually a service account name | ||
default: operatorpipelines | ||
- name: umb_listen_topic | ||
description: umb topic to listen to for responses with signed content | ||
default: VirtualTopic.eng.robosignatory.isv.sign | ||
- name: umb_publish_topic | ||
description: umb topic to publish to for requesting signing | ||
default: VirtualTopic.eng.operatorpipelines.isv.sign | ||
- name: umb_url | ||
description: umb host to connect to for messaging | ||
default: umb.api.redhat.com | ||
results: | ||
- name: signed_payload | ||
volumes: | ||
- name: umb-ssl-volume | ||
secret: | ||
secretName: "$(params.umb_ssl_secret_name)" | ||
optional: false | ||
workspaces: | ||
- name: source | ||
steps: | ||
- name: request-signature-blob | ||
image: "$(params.pipeline_image)" | ||
env: | ||
- name: UMB_CERT_PATH | ||
value: /etc/umb-ssl-volume/$(params.umb_ssl_cert_secret_key) | ||
- name: UMB_KEY_PATH | ||
value: /etc/umb-ssl-volume/$(params.umb_ssl_key_secret_key) | ||
volumeMounts: | ||
- name: umb-ssl-volume | ||
readOnly: true | ||
mountPath: "/etc/umb-ssl-volume" | ||
script: | | ||
#! /usr/bin/env bash | ||
set -xe | ||
echo "Requesting signing from RADAS" | ||
request-signature \ | ||
--blob "$(params.blob)" \ | ||
--output signing_response.json \ | ||
--requester "$(params.requester)" \ | ||
--sig-key-id "$(params.sig_key_id)" \ | ||
--sig-key-name "$(params.sig_key_name)" \ | ||
--umb-client-name "$(params.umb_client_name)" \ | ||
--umb-listen-topic "$(params.umb_listen_topic)" \ | ||
--umb-publish-topic "$(params.umb_publish_topic)" \ | ||
--umb-url "$(params.umb_url)" \ | ||
--verbose | ||
SIG_DATA=$(cat signing_response.json) | ||
echo "Signed claims and their metadata: " | ||
echo -n $SIG_DATA | ||
jq -r '.[0].signed_payload' signing_response.json | tee $(results.signed_payload.path) | ||
workingDir: $(workspaces.source.path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters