-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: adding SLSA provenance generation for build artifacts and cont…
…ainers (#370) Adding SLSA provenance generation for artifacts and containers built for ld-relay. Based off goreleaser's guidance for SLSA provenance generation with goreleaser: https://goreleaser.com/blog/slsa-generation-for-your-artifacts/#slsa-github-generator
- Loading branch information
1 parent
1e01383
commit 36cdd1b
Showing
3 changed files
with
98 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -22,6 +22,10 @@ jobs: | |
permissions: | ||
id-token: write # Needed to get Docker tokens during publishing. | ||
contents: write # Needed to upload release artifacts | ||
outputs: | ||
hashes: ${{ steps.publish.outputs.hashes }} | ||
image: ${{ steps.publish.outputs.image }} | ||
digest: ${{ steps.publish.outputs.digest }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -38,8 +42,37 @@ jobs: | |
aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
ssm_parameter_pairs: '/global/services/docker/public/username = DOCKER_USERNAME, /global/services/docker/public/token = DOCKER_TOKEN' | ||
- name: Publish Package | ||
id: publish | ||
uses: ./.github/actions/publish | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
dry-run: ${{ inputs.dry_run }} | ||
tag: ${{ inputs.tag }} | ||
|
||
release-relay-binary-provenance: | ||
needs: ['build-publish'] | ||
permissions: | ||
actions: read | ||
id-token: write | ||
contents: write | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
base64-subjects: "${{ needs.build-publish.outputs.hashes }}" | ||
upload-assets: ${{ !inputs.dry_run }} | ||
upload-tag-name: ${{ inputs.tag }} | ||
provenance-name: ${{ format('ld-relay-{0}_multiple_provenance.intoto.jsonl', inputs.tag) }} | ||
|
||
release-relay-image-provenance: | ||
needs: ['build-publish'] | ||
if: ${{ !inputs.dry_run }} | ||
permissions: | ||
actions: read | ||
id-token: write | ||
packages: write | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
image: ${{ needs.build-publish.outputs.image }} | ||
digest: ${{ needs.build-publish.outputs.digest }} | ||
registry-username: ${{ github.actor }} | ||
secrets: | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -24,7 +24,10 @@ jobs: | |
permissions: | ||
id-token: write # Needed to obtain Docker tokens | ||
contents: write # Needed to upload release artifacts | ||
|
||
outputs: | ||
hashes: ${{ steps.publish.outputs.hashes }} | ||
image: ${{ steps.publish.outputs.image }} | ||
digest: ${{ steps.publish.outputs.digest }} | ||
needs: [ release-please, go-versions ] | ||
if: ${{ needs.release-please.outputs.release_created == 'true' }} | ||
runs-on: ubuntu-latest | ||
|
@@ -47,7 +50,35 @@ jobs: | |
- uses: ./.github/actions/unit-tests | ||
|
||
- uses: ./.github/actions/publish | ||
id: publish | ||
with: | ||
dry-run: 'false' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ needs.release-please.outputs.tag_name }} | ||
|
||
release-relay-binary-provenance: | ||
needs: ['release-please', 'release-relay'] | ||
permissions: | ||
actions: read | ||
id-token: write | ||
contents: write | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
base64-subjects: "${{ needs.release-relay.outputs.hashes }}" | ||
upload-assets: true | ||
upload-tag-name: ${{ needs.release-please.outputs.tag_name }} | ||
provenance-name: ${{ format('ld-relay-{0}_multiple_provenance.intoto.jsonl', needs.release-please.outputs.tag_name) }} | ||
|
||
release-relay-image-provenance: | ||
needs: ['release-please', 'release-relay'] | ||
permissions: | ||
actions: read | ||
id-token: write | ||
packages: write | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
image: ${{ needs.release-relay.outputs.image }} | ||
digest: ${{ needs.release-relay.outputs.digest }} | ||
registry-username: ${{ github.actor }} | ||
secrets: | ||
registry-password: ${{ secrets.GITHUB_TOKEN }} |