-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28a6ff8
commit f5ed37a
Showing
1 changed file
with
20 additions
and
23 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -314,6 +314,7 @@ jobs: | |
|
||
- name: "Build Operator Image" | ||
uses: docker/build-push-action@v3 | ||
id: build_push | ||
with: | ||
context: . | ||
file: "./ci.Dockerfile" | ||
|
@@ -323,20 +324,16 @@ jobs: | |
tags: "${{ env.OPERATOR_IMAGE_REPOSITORY }}:latest-${{ steps.setup-build-step.outputs.platform_os }}-${{ steps.setup-build-step.outputs.platform_arch }},${{ env.OPERATOR_IMAGE_REPOSITORY }}:${{ env.OPERATOR_VERSION }}-${{ steps.setup-build-step.outputs.platform_os }}-${{ steps.setup-build-step.outputs.platform_arch }}" | ||
|
||
- name: Cosign login and initialize | ||
env: | ||
image_registry: ${{ env.OPERATOR_IMAGE_REGISTRY }} | ||
run: | | ||
echo "${{ secrets.REGISTRY_PASSWORD }}" | cosign login --username ${{ secrets.REGISTRY_USERNAME }} --password-stdin ${image_registry%%/*} | ||
echo "${{ secrets.REGISTRY_PASSWORD }}" | cosign login --username ${{ secrets.REGISTRY_USERNAME }} --password-stdin ${OPERATOR_IMAGE_REGISTRY%%/*} | ||
cosign initialize | ||
- name: Sign Operator Image | ||
id: sign_operator | ||
env: | ||
IMAGE_URI: ${{ env.OPERATOR_IMAGE_REPOSITORY }}:latest-${{ steps.setup-build-step.outputs.platform_os }}-${{ steps.setup-build-step.outputs.platform_arch }} | ||
IMAGE_URI: ${{ env.OPERATOR_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
run: | | ||
signed_image_digest=$(cosign triangulate --type=digest ${{ env.IMAGE_URI }}) | ||
echo "signed_image_digest=${signed_image_digest}" >> $GITHUB_OUTPUT | ||
cosign sign --yes ${signed_image_digest} | ||
cosign sign --yes ${IMAGE_URI} | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
|
@@ -345,7 +342,7 @@ jobs: | |
TRIVY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | ||
with: | ||
scan-type: image | ||
image-ref: ${{ steps.sign_operator.outputs.signed_image_digest }} | ||
image-ref: ${{ env.OPERATOR_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
format: "cosign-vuln" | ||
output: "cosign-vuln.json" | ||
|
||
|
@@ -356,14 +353,16 @@ jobs: | |
TRIVY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | ||
with: | ||
scan-type: image | ||
image-ref: ${{ steps.sign_operator.outputs.signed_image_digest }} | ||
image-ref: ${{ env.OPERATOR_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
format: "cyclonedx" | ||
output: "cyclonedx-sbom.json" | ||
|
||
- name: Attach attestations for Operator Image | ||
env: | ||
IMAGE_URI: ${{ env.OPERATOR_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
run: | | ||
cosign attest --yes --type vuln --predicate cosign-vuln.json ${{ steps.sign_operator.outputs.signed_image_digest }} | ||
cosign attest --yes --type cyclonedx --predicate cyclonedx-sbom.json ${{ steps.sign_operator.outputs.signed_image_digest }} | ||
cosign attest --yes --type vuln --predicate cosign-vuln.json ${IMAGE_URI} | ||
cosign attest --yes --type cyclonedx --predicate cyclonedx-sbom.json ${IMAGE_URI} | ||
- name: Prepare Distribution Artifacts | ||
shell: bash | ||
|
@@ -518,6 +517,7 @@ jobs: | |
|
||
- name: "Build Bundle Image" | ||
uses: docker/build-push-action@v3 | ||
id: build_push | ||
with: | ||
context: . | ||
file: ./bundle.Dockerfile | ||
|
@@ -527,20 +527,16 @@ jobs: | |
tags: "${{ env.BUNDLE_IMAGE_REPOSITORY }}:latest-${{ steps.setup-build-step.outputs.platform_os }}-${{ steps.setup-build-step.outputs.platform_arch }},${{ env.BUNDLE_IMAGE_REPOSITORY }}:${{ env.BUNDLE_VERSION }}-${{ steps.setup-build-step.outputs.platform_os }}-${{ steps.setup-build-step.outputs.platform_arch }}" | ||
|
||
- name: Cosign login and initialize | ||
env: | ||
image_registry: ${{ env.BUNDLE_IMAGE_REGISTRY }} | ||
run: | | ||
echo "${{ secrets.REGISTRY_PASSWORD }}" | cosign login --username ${{ secrets.REGISTRY_USERNAME }} --password-stdin ${image_registry%%/*} | ||
echo "${{ secrets.REGISTRY_PASSWORD }}" | cosign login --username ${{ secrets.REGISTRY_USERNAME }} --password-stdin ${BUNDLE_IMAGE_REGISTRY%%/*} | ||
cosign initialize | ||
- name: Sign Bundle Image | ||
id: sign_bundle | ||
env: | ||
IMAGE_URI: ${{ env.BUNDLE_IMAGE_REPOSITORY }}:latest-${{ steps.setup-build-step.outputs.platform_os }}-${{ steps.setup-build-step.outputs.platform_arch }} | ||
IMAGE_URI: ${{ env.BUNDLE_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
run: | | ||
signed_image_digest=$(cosign triangulate --type=digest ${{ env.IMAGE_URI }}) | ||
echo "signed_image_digest=${signed_image_digest}" >> $GITHUB_OUTPUT | ||
cosign sign --yes ${signed_image_digest} | ||
cosign sign --yes ${IMAGE_URI} | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
|
@@ -549,26 +545,27 @@ jobs: | |
TRIVY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | ||
with: | ||
scan-type: image | ||
image-ref: ${{ steps.sign_bundle.outputs.signed_image_digest }} | ||
image-ref: ${{ env.BUNDLE_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
format: "cosign-vuln" | ||
output: "cosign-vuln.json" | ||
|
||
|
||
- name: Run Trivy SBOM generator | ||
uses: aquasecurity/[email protected] | ||
env: | ||
TRIVY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} | ||
TRIVY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | ||
with: | ||
scan-type: image | ||
image-ref: ${{ steps.sign_bundle.outputs.signed_image_digest }} | ||
image-ref: ${{ env.BUNDLE_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
format: "cyclonedx" | ||
output: "cyclonedx-sbom.json" | ||
|
||
- name: Attach attestations for Bundle Image | ||
env: | ||
IMAGE_URI: ${{ env.BUNDLE_IMAGE_REPOSITORY }}@${{ steps.build_push.outputs.digest }} | ||
run: | | ||
cosign attest --yes --type vuln --predicate cosign-vuln.json ${{ steps.sign_bundle.outputs.signed_image_digest }} | ||
cosign attest --yes --type cyclonedx --predicate cyclonedx-sbom.json ${{ steps.sign_bundle.outputs.signed_image_digest }} | ||
cosign attest --yes --type vuln --predicate cosign-vuln.json ${IMAGE_URI} | ||
cosign attest --yes --type cyclonedx --predicate cyclonedx-sbom.json ${IMAGE_URI} | ||
- name: Prepare Distribution Artifacts | ||
shell: bash | ||
|