@@ -93,57 +93,21 @@ jobs:
9393 with :
9494 name : lifecycle-acceptance
9595 path : fixture
96- - uses : sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3
9796 - name : Sign the fixture's lifecycle predicate
9897 id : attest
9998 uses : actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4
10099 with :
101- subject-path : fixture/lifecycle-sample.txt
100+ subject-checksums : fixture/lifecycle-subjects.sha256
102101 predicate-type : ${{ env.PREDICATE_TYPE }}
103102 predicate-path : fixture/predicate.json
104- - name : Test both verifiers against the signed fixture
105- working-directory : fixture
103+ - name : Stage the signature bundle
106104 env :
107- GH_TOKEN : ${{ github.token }}
108105 BUNDLE : ${{ steps.attest.outputs.bundle-path }}
109- ATTESTATION_URL : ${{ steps.attest.outputs.attestation-url }}
110- run : |
111- set -euo pipefail
112- cp -- "$BUNDLE" lifecycle.sigstore.json
113- signer="$GITHUB_REPOSITORY/.github/workflows/package-smoke.yml"
114- verify_gh() {
115- gh attestation verify "$1" --bundle lifecycle.sigstore.json --repo "$GITHUB_REPOSITORY" \
116- --signer-workflow "$2" --source-ref "$GITHUB_REF" --source-digest "$GITHUB_SHA" \
117- --predicate-type "$PREDICATE_TYPE" --deny-self-hosted-runners
118- }
119- verify_cosign() {
120- cosign verify-blob-attestation "$1" --bundle lifecycle.sigstore.json --check-claims=true \
121- --type "$PREDICATE_TYPE" --certificate-identity "https://github.com/$2@$GITHUB_REF" \
122- --certificate-oidc-issuer https://token.actions.githubusercontent.com
123- }
124- expect_rejection() {
125- if "$@"; then
126- echo "Expected rejection: $*" >&2
127- exit 1
128- fi
129- }
130- verify_gh lifecycle-sample.txt "$signer"
131- verify_cosign lifecycle-sample.txt "$signer"
132- cp lifecycle-sample.txt modified.txt
133- printf 'modified\n' >> modified.txt
134- expect_rejection verify_gh modified.txt "$signer"
135- expect_rejection verify_cosign modified.txt "$signer"
136- wrong_signer="$GITHUB_REPOSITORY/.github/workflows/release-attest.yml"
137- expect_rejection verify_gh lifecycle-sample.txt "$wrong_signer"
138- expect_rejection verify_cosign lifecycle-sample.txt "$wrong_signer"
139- printf 'Both verifiers accepted the fixture and rejected modified bytes and the wrong signer.\n\nAttestation: %s\n' \
140- "$ATTESTATION_URL" >> "$GITHUB_STEP_SUMMARY"
106+ run : cp -- "$BUNDLE" lifecycle.sigstore.json
141107 - uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
142108 with :
143109 name : lifecycle-acceptance-signed
144- path : |
145- fixture/lifecycle-sample.txt
146- fixture/lifecycle.sigstore.json
110+ path : lifecycle.sigstore.json
147111 if-no-files-found : error
148112
149113 gate-signed-lifecycle :
@@ -154,30 +118,98 @@ jobs:
154118 timeout-minutes : 5
155119 permissions :
156120 contents : read
121+ env :
122+ PREDICATE_TYPE : https://velella.sh/offing/attestation/v1/
157123 steps :
158124 - uses : actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
159125 with :
160126 node-version : ' 24'
161127 package-manager-cache : false
162128 - uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
163129 with :
164- name : lifecycle-gate-candidate
165- path : candidate
130+ name : lifecycle-acceptance
131+ path : fixture
166132 - uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
167133 with :
168134 name : lifecycle-acceptance-signed
169135 path : fixture
170136 - name : Install the exact packed candidate
171- working-directory : candidate /npm-install
137+ working-directory : fixture /npm-install
172138 run : npm ci --omit=dev --ignore-scripts --no-fund --no-audit
173139 - name : Fetch trust roots for offline verification
174140 working-directory : fixture
175141 run : gh attestation trusted-root > trusted_root.jsonl
142+ - uses : sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3
143+ - name : acc-lifecycle-attestation (clean consumer)
144+ working-directory : fixture
145+ env :
146+ GH_TOKEN : ${{ github.token }}
147+ run : |
148+ set -euo pipefail
149+ signer="$GITHUB_REPOSITORY/.github/workflows/package-smoke.yml"
150+ verify_gh() {
151+ gh attestation verify "$1" --bundle lifecycle.sigstore.json --repo "$GITHUB_REPOSITORY" \
152+ --signer-workflow "$2" --source-ref "$GITHUB_REF" --source-digest "$GITHUB_SHA" \
153+ --predicate-type "$PREDICATE_TYPE" --deny-self-hosted-runners
154+ }
155+ verify_cosign() {
156+ cosign verify-blob-attestation "$1" --bundle lifecycle.sigstore.json --check-claims=true \
157+ --type "$PREDICATE_TYPE" --certificate-identity "https://github.com/$2@$GITHUB_REF" \
158+ --certificate-oidc-issuer https://token.actions.githubusercontent.com
159+ }
160+ expect_rejection() {
161+ if "$@"; then
162+ echo "Expected rejection: $*" >&2
163+ exit 1
164+ fi
165+ }
166+ sha256sum offing-* velella-offing-*.tgz | cmp - lifecycle-subjects.sha256
167+ jq -er '.dsseEnvelope.payload' lifecycle.sigstore.json | base64 -d > lifecycle.intoto.json
168+ jq -e --slurpfile expected prepared.intoto.json '
169+ def ordered: .subject |= sort_by(.name);
170+ ordered == ($expected[0] | ordered)
171+ ' lifecycle.intoto.json > /dev/null
172+ tarballs=(velella-offing-*.tgz)
173+ tar -xzf "${tarballs[0]}" \
174+ package/docs/spec/lifecycle-attestation/conformance/check.mjs \
175+ package/docs/spec/lifecycle-attestation/example/verify.mjs
176+ verifier=package/docs/spec/lifecycle-attestation/example/verify.mjs
177+ node package/docs/spec/lifecycle-attestation/conformance/check.mjs lifecycle.intoto.json
178+ for subject in offing-* velella-offing-*.tgz; do
179+ verify_gh "$subject" "$signer"
180+ verify_cosign "$subject" "$signer"
181+ node "$verifier" lifecycle.intoto.json "$subject" > /dev/null
182+ done
183+ wrong_signer="$GITHUB_REPOSITORY/.github/workflows/release-attest.yml"
184+ expect_rejection verify_gh "${tarballs[0]}" "$wrong_signer"
185+ expect_rejection verify_cosign "${tarballs[0]}" "$wrong_signer"
186+ mkdir tampered
187+ tampered="tampered/${tarballs[0]}"
188+ cp -- "${tarballs[0]}" "$tampered"
189+ printf 'tampered' >> "$tampered"
190+ expect_rejection verify_gh "$tampered" "$signer"
191+ expect_rejection verify_cosign "$tampered" "$signer"
192+ expect_rejection node "$verifier" lifecycle.intoto.json "$tampered"
193+ for example in 2026-03-31:1 2026-04-01:0 2026-04-02:-1; do
194+ npm-install/node_modules/.bin/offing attest check lifecycle.sigstore.json \
195+ --subject "${tarballs[0]}" --today "${example%:*}" |
196+ grep -F -- '"pkg:docker/library/alpine@3.18"' |
197+ grep -F -- ": ${example#*:} days left"
198+ done
199+ {
200+ printf '### acc-lifecycle-attestation (clean consumer)\n\n'
201+ printf 'Signed subjects at %s\n\n' "$GITHUB_SHA"
202+ printf '```text\n'
203+ cat lifecycle-subjects.sha256
204+ printf '```\n\nBoth signature verifiers rejected the wrong signer and modified bytes. The installed CLI reproduced the documented day counts.\n'
205+ } >> "$GITHUB_STEP_SUMMARY"
176206 - name : Evaluate the signed predicate on either side of the deadline
177207 working-directory : fixture
178208 run : |
179209 set -euo pipefail
180- bin=../candidate/npm-install/node_modules/.bin/offing
210+ bin=npm-install/node_modules/.bin/offing
211+ tarballs=(velella-offing-*.tgz)
212+ tarball="${tarballs[0]}"
181213 signer="$GITHUB_REPOSITORY/.github/workflows/package-smoke.yml"
182214 export GH_CONFIG_DIR="$RUNNER_TEMP/offing-gate-gh"
183215 export OFFING_DATA_VERSION=bundled
@@ -187,10 +219,10 @@ jobs:
187219 --today "$2" --within-days 0 --no-data ignore --json
188220 }
189221
190- gate lifecycle-sample.txt 2026-03-31 |
222+ gate "$tarball" 2026-03-31 |
191223 jq -e '.asOf == "2026-03-31" and .decisions[0].input.kind == "attestation" and .decisions[0].verdict == "pass"'
192224 status=0
193- gate lifecycle-sample.txt 2026-04-01 > gate.json || status=$?
225+ gate "$tarball" 2026-04-01 > gate.json || status=$?
194226 test "$status" -eq 1
195227 jq -e '
196228 .asOf == "2026-04-01" and .decisions[0].verdict == "block" and
@@ -199,10 +231,8 @@ jobs:
199231 .deadline == "2026-04-01" and .daysLeft == 0 and .outcome == "block")
200232 ' gate.json
201233
202- cp lifecycle-sample.txt modified.txt
203- printf 'modified\n' >> modified.txt
204234 status=0
205- gate modified.txt 2026-04-01 > rejected.json 2> rejected.err || status=$?
235+ gate "tampered/$tarball" 2026-04-01 > rejected.json 2> rejected.err || status=$?
206236 test "$status" -eq 4
207237 jq -e '
208238 .schemaVersion == "offing.error.v1" and .error.reason == "invalid-input" and .error.exitCode == 4 and
@@ -211,7 +241,7 @@ jobs:
211241
212242 {
213243 printf '### acc-release-gate (signed lifecycle fixture)\n\n'
214- printf -- '- Candidate tarball SHA-256 %s\n' "$(sha256sum ../candidate/*.tgz | cut -d ' ' -f 1)"
244+ printf -- '- Candidate tarball SHA-256 %s\n' "$(sha256sum "$tarball" | cut -d ' ' -f 1)"
215245 printf -- '- Installed CLI %s at %s\n' "$("$bin" --version)" "$GITHUB_SHA"
216246 printf -- '- The verified predicate passed before the deadline, blocked on it, and refused modified bytes.\n'
217247 } >> "$GITHUB_STEP_SUMMARY"
@@ -817,39 +847,36 @@ jobs:
817847 printf -- '- Unsigned statement, packaged schema and template, and standalone conformance verified.\n'
818848 } >> "$GITHUB_STEP_SUMMARY"
819849
820- - name : Prepare a synthetic subject for live lifecycle signing
850+ - name : Stage the exact packed candidate and five synthetic binary subjects
821851 if : github.event_name == 'workflow_dispatch'
822852 working-directory : ${{ runner.temp }}
823853 run : |
824854 set -euo pipefail
825- mkdir lifecycle-acceptance
855+ mkdir -p lifecycle-acceptance/npm-install
856+ cp package-smoke/*.tgz lifecycle-acceptance/
857+ cp package-smoke/npm-install/{package.json,package-lock.json} lifecycle-acceptance/npm-install/
826858 cd lifecycle-acceptance
827- printf 'Offing lifecycle attestation test fixture\n' > lifecycle-sample.txt
859+ version="$("$RUNNER_TEMP/package-smoke/npm-install/node_modules/.bin/offing" --version)"
860+ for target in linux-x64 linux-arm64 darwin-x64 darwin-arm64 win32-x64.exe; do
861+ printf 'Offing lifecycle attestation synthetic %s binary\n' "$target" > "offing-$version-$target"
862+ done
863+ sha256sum offing-* velella-offing-*.tgz > lifecycle-subjects.sha256
828864 "$RUNNER_TEMP/package-smoke/npm-install/node_modules/.bin/offing" attest \
829- --subject lifecycle-sample.txt --sbom "$GITHUB_WORKSPACE/tests/fixtures/attestation/bom.cdx.json" \
830- --data-version bundled | jq -e '.predicate' > predicate.json
865+ --subject velella-offing-*.tgz --sbom "$GITHUB_WORKSPACE/tests/fixtures/attestation/bom.cdx.json" \
866+ --data-version bundled > draft.json
867+ jq -e '.predicate' draft.json > predicate.json
868+ jq -R -s --slurpfile draft draft.json '
869+ [split("\n")[] | select(length > 0) | split(" ") | {name: .[1], digest: {sha256: .[0]}}] as $subjects
870+ | $draft[0] | .subject = $subjects
871+ ' lifecycle-subjects.sha256 > prepared.intoto.json
872+ rm draft.json
831873 - uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
832874 if : github.event_name == 'workflow_dispatch'
833875 with :
834876 name : lifecycle-acceptance
835877 path : ${{ runner.temp }}/lifecycle-acceptance/
836878 if-no-files-found : error
837879
838- - name : Stage the exact packed candidate for signed gate acceptance
839- if : github.event_name == 'workflow_dispatch'
840- working-directory : ${{ runner.temp }}
841- run : |
842- set -euo pipefail
843- mkdir -p lifecycle-gate-candidate/npm-install
844- cp package-smoke/*.tgz lifecycle-gate-candidate/
845- cp package-smoke/npm-install/{package.json,package-lock.json} lifecycle-gate-candidate/npm-install/
846- - uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
847- if : github.event_name == 'workflow_dispatch'
848- with :
849- name : lifecycle-gate-candidate
850- path : ${{ runner.temp }}/lifecycle-gate-candidate/
851- if-no-files-found : error
852-
853880 - name : acc-release-gate (installed CLI and standalone fixtures)
854881 working-directory : ${{ runner.temp }}
855882 env :
0 commit comments