Skip to content

Commit c68941d

Browse files
authored
HACK: Sign with witness (#12)
Here's a fairly hacky way to get the VSA signed by Sigstore during the workflow. This (ab)uses testifysec/witness-run-action to get witness installed so that it can then sign an arbitrary blob with witness's Sigstore support. The result is a signed VSA that attests to this workflows determination of the SLSA Source Level (for whatever good that is). In the future: We still want to store this attestation someplace reasonable. We might want to pivot to gitsign once we're able to sign stuff with it. We'd definitely want to remove the hack... Thanks to @jkjell for telling me how to get this working. :)
1 parent 81f80f0 commit c68941d

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.github/workflows/create_slsa_source_vsa.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
create_vsa:
88
permissions:
99
contents: read
10+
id-token: write
1011
runs-on: ubuntu-latest
1112
steps:
1213
- name: vsa

.github/workflows/local_attest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ jobs:
88
check-change:
99
permissions:
1010
contents: read
11+
id-token: write
1112
# TODO: Can we make this work for forks too?
1213
uses: slsa-framework/slsa-source-poc/.github/workflows/create_slsa_source_vsa.yml@main

actions/vsa_creator/action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,28 @@ runs:
2222
shell: bash
2323
- id: summary
2424
run: |
25+
echo "## Unsigned VSA" >> $GITHUB_STEP_SUMMARY
2526
cat ${{ github.workspace }}/metadata/unsigned_vsa.json >> $GITHUB_STEP_SUMMARY
2627
shell: bash
28+
- id: install_witness
29+
# This is a bit of a hack, running witness happens to also install it.
30+
# We don't care much about what it does here, we just want the side-effect of witness being installed.
31+
# If this works well we might lodge some feature requests?
32+
uses: testifysec/witness-run-action@reusable-workflow
33+
with:
34+
command: /bin/sh -c "echo \"hello from slsa-source-poc\""
35+
step: "install_witness"
36+
- id: sign_vsa
37+
# Use witness to sign that VSA...
38+
run: |
39+
witness sign -f ${{ github.workspace }}/metadata/unsigned_vsa.json -t "application/vnd.in-toto+json" -o ${{ github.workspace }}/metadata/signed_vsa.json \
40+
--signer-fulcio-url https://fulcio.sigstore.dev \
41+
--signer-fulcio-oidc-client-id sigstore \
42+
--signer-fulcio-oidc-issuer https://oauth2.sigstore.dev/auth \
43+
--timestamp-servers https://freetsa.org/tsr
44+
echo "## Signed VSA" >> $GITHUB_STEP_SUMMARY
45+
cat ${{ github.workspace }}/metadata/signed_vsa.json >> $GITHUB_STEP_SUMMARY
46+
shell: bash
2747
- uses: actions/upload-artifact@v4
2848
if: always()
2949
with:

0 commit comments

Comments
 (0)