-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marcela Melara <[email protected]>
- Loading branch information
1 parent
b08b909
commit cd38563
Showing
3 changed files
with
86 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "in-toto Sigstore signer" | ||
description: "Generates a signed in-toto Attestation using cosign, and uploads it to the public Rekor log" | ||
inputs: | ||
save-signed: | ||
description: "Flag indicating whether to save the signed attestation as a local artifact (using actions/upload-artifact). Default is `save-signed=true`." | ||
required: false | ||
default: 'true' | ||
statement-file: | ||
description: "The name of the unsigned in-toto Statement file." | ||
required: true | ||
statement-path: | ||
description: "The path to the statement-file. Defaults to GITHUB_WORKSPACE." | ||
required: false | ||
default: "$GITHUB_WORKSPACE" | ||
signed-name: | ||
description: "The name of the DSSE formatted signed in-toto Attestation file." | ||
required: true | ||
path: | ||
description: "The directory to place the signed in-toto Attestation." | ||
required: false | ||
default: "$GITHUB_WORKSPACE/attestations" | ||
|
||
outputs: | ||
attestation-name: | ||
description: "Filename of the generated signed in-toto Attestation" | ||
value: ${{ steps.sign.outputs.attestation-name }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Sign and upload in-toto Statement | ||
id: sign | ||
shell: bash | ||
run: | | ||
mkdir -p ${{ inputs.path }} | ||
scai-gen sigstore -o ${{ inputs.path}}/${{ inputs.signed-name }} ${{ inputs.statement-path }}/${{ inputs.statement-name }} | ||
echo "attestation-name=${{ inputs.path }}/${{ inputs.signed-name }}" >> "$GITHUB_OUTPUT" | ||
- name: Save the signed in-toto Attestation | ||
if: ${{ inputs.save-signed == 'true' }} | ||
id: upload-signed | ||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | ||
with: | ||
name: ${{ steps.sign.inputs.signed-name }} | ||
path: ${{ steps.sign.outputs.attestation-name }} | ||
retention-days: 15 |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Test Sigstore integration | ||
on: | ||
# Want to trigger these tests whenever the Sigstore command | ||
# is modified and PR is closed because of OIDC token access | ||
pull_request: | ||
paths: | ||
- "scai-gen/cmd/sigstore.go" | ||
types: | ||
- closed | ||
|
||
jobs: | ||
sigstore: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
id-token: write # Needed for signing | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe | ||
with: | ||
go-version: 1.20.x | ||
|
||
- name: Checkout updated scai-gen CLI tools | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Setup Env | ||
run: | | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Install scai-gen CLI tools | ||
shell: bash | ||
run: | | ||
go install ./scai-gen | ||
- name: Sign and upload SCAI report (Sigstore) | ||
id: sign-report | ||
shell: bash | ||
uses: marcelamelara/scai-demos/.github/actions/scai-gen-sigstore@add-scai-reusable-workflows | ||
with: | ||
statement-file: examples/sbom+slsa/metadata/evidence-collection.scai.json | ||
signed-name: evidence-collection.scai.sig.json |