Skip to content

Commit dd2b968

Browse files
committed
feat: assayward release gate workflow + dogfood policy
1 parent 892203b commit dd2b968

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Assayward Release Gate
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
assayward-gate:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.23'
22+
23+
- name: Build
24+
run: make build
25+
26+
- name: Self-attest with forgeseal pipeline
27+
run: |
28+
./forgeseal pipeline \
29+
--dir . \
30+
--output-dir ./forgeseal-output \
31+
--sign \
32+
--attest \
33+
--keyed
34+
35+
- name: Compute artifact digest
36+
id: digest
37+
run: |
38+
DIGEST=$(sha256sum ./forgeseal 2>/dev/null || sha256sum ./bin/forgeseal 2>/dev/null || echo "sha256:unknown")
39+
echo "value=$DIGEST" >> "$GITHUB_OUTPUT"
40+
41+
- name: Obtain svidmint SVID
42+
id: svid
43+
if: vars.SVIDMINT_URL != ''
44+
run: |
45+
# Exchange GitHub OIDC token for a SPIFFE SVID from svidmint
46+
OIDC_TOKEN=$(curl -sSfL \
47+
-H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
48+
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=svidmint" | jq -r .value)
49+
50+
RESPONSE=$(curl -sSfL \
51+
-X POST "${{ vars.SVIDMINT_URL }}/v1/attest" \
52+
-H "Content-Type: application/json" \
53+
-d "{\"token\": \"${OIDC_TOKEN}\", \"audience\": \"${{ steps.digest.outputs.value }}\"}")
54+
55+
echo "svid=$(echo "$RESPONSE" | jq -r .svid)" >> "$GITHUB_OUTPUT"
56+
echo "bundle=$(echo "$RESPONSE" | jq -r .spiffe_bundle)" >> "$GITHUB_OUTPUT"
57+
env:
58+
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }}
59+
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ env.ACTIONS_ID_TOKEN_REQUEST_TOKEN }}
60+
61+
- name: Note SVID skipped
62+
if: vars.SVIDMINT_URL == ''
63+
run: echo "SVIDMINT_URL not configured; SVID identity step skipped"
64+
65+
- name: Assayward gate
66+
uses: sns45/assayward-action@v0.1
67+
with:
68+
forgeseal-output: ./forgeseal-output
69+
image: forgeseal-artifact@${{ steps.digest.outputs.value }}
70+
signature-ca: ./forgeseal-output/forgeseal-signing-ca.crt
71+
svid: ${{ steps.svid.outputs.svid }}
72+
spiffe-bundle: ${{ steps.svid.outputs.bundle }}
73+
policy-file: ./assayward-dogfood-policy.yaml

assayward-dogfood-policy.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Forgeseal dogfood release gate policy
2+
# Applied by sns45/assayward-action@v0.1 on every published release.
3+
4+
signature:
5+
required: true
6+
7+
keyless:
8+
identityPattern: "https://forgeseal.dev/*"
9+
10+
rekor:
11+
required: false
12+
13+
slsa:
14+
minLevel: 3
15+
allowedBuilders:
16+
- "https://forgeseal.dev/*"
17+
18+
vex:
19+
maxUnmitigatedSeverity: high
20+
21+
sbom:
22+
required: true
23+
24+
identity:
25+
required: true
26+
trustDomain: "spiffe://ci.svidmint.dev"
27+
idPattern: "spiffe://ci.svidmint.dev/github-actions/*"

0 commit comments

Comments
 (0)