Skip to content

Chore: Modernise attestation and verify commands - #99

Merged
ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:docs/cosign-identity
Oct 9, 2026
Merged

ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:docs/cosign-identity

Conversation

@ModeSevenIndustrialSolutions

@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Two related changes that modernise this lane's attestation support,
one commit each:

  1. Docs(readme): Fix the artefact verify commands (Docs: Fix the cosign and attestation verify commands #98)
  2. Chore: Migrate attest-build-provenance to attest (Chore: Migrate from attest-build-provenance to attest #49)

1. Verify commands (#98)

The README's "Verifying Release Artefacts" section documented two
commands that cannot pass for a genuine release. This PR replaces them,
adds a short table showing which certificate field binds what, and
states that cosign v3 or later is required. It mirrors
lfreleng-actions/node-workflows#158, which fixes node-workflows#149.

  • cosign: the identity regexp ended in @refs/tags/<tag> (the
    project's tag), but the certificate SAN names the reusable workflow at
    the ref the caller pinned (usually a go-workflows commit SHA). The
    new command anchors the SAN to build-test-release.yaml@ and binds the
    project and tag through --certificate-github-workflow-repository,
    --certificate-github-workflow-ref and
    --certificate-github-workflow-trigger.
  • gh attestation verify: --repo alone expects a signer in the
    project repository, so it fails for attestations made inside a
    reusable workflow (gh attestation verify --help says the same). The
    new command adds --signer-workflow and --source-ref.
  • cosign version: cosign v2.2.4 cannot read the v0.3 bundle that
    cosign-installer v4 produces.
  • gh version: GitHub CLI v2.102.0 or later is required. Earlier
    releases matched --signer-workflow as a prefix
    (GHSA-wjmr-j3rp-mh2g)
    and --source-ref case-insensitively
    (GHSA-4mq3-hpgx-9cx8).
  • Optional revision pin: both commands accept any revision of the
    reusable workflow. The section explains how to pin the caller's SHA:
    --signer-digest <sha> for gh, --certificate-identity with the
    full …@<sha> SAN for cosign.
  • Caller fields, not checkout: Workflow Repository and Workflow Ref
    describe the calling run. The workflow's repository/ref inputs
    can build other source under the same values, so the section labels
    them as caller fields and says they identify the packaged source when
    both inputs stay empty, as in the examples.

One deviation from the issue's proposal: the gh command keeps
<binary> rather than checksums.txt. The attest job uses
subject-path: 'dist/*', the release binaries; checksums.txt has no
attestation of its own, so gh attestation verify checksums.txt would
find nothing. checksums.txt is covered by the cosign signature
instead, and the existing sha256sum --check step links the two.

2. Migrate to actions/attest (#49)

actions/attest-build-provenance v4 is a thin wrapper that forwards its
inputs to actions/attest, and GitHub directs new implementations to
actions/attest. With no predicate supplied it emits SLSA build
provenance by default, so the attest job swaps only the uses: line:

  • actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2,
    a commit SHA (not a tag object), the same pin node-workflows uses.
  • subject-path, the job permissions (id-token: write,
    attestations: write) and the egress allow-list are unchanged; the
    wrapper already called actions/attest, so the endpoints match.
  • The wrapper's one addition, NODE_OPTIONS=--max-http-header-size,
    matters only for push-to-registry, which this workflow does not use
    (see the correction comment on Chore: Migrate from attest-build-provenance to attest #49).

The same commit replaces two step comments in the workflow that
suggested verify commands (gh attestation verify without
--signer-workflow, cosign verify-blob without identity flags). Both
had the defect #98 describes, so they now point to the README section
instead of repeating a command that could drift.

With this change, go-workflows attests through exactly the action that
produced the node-workflows proxy bundle below, which narrows the gap
between that evidence and a go-workflows release.

Evidence

No go-workflows release bundle exists yet

The one caller of build-test-release.yaml, onap/multicloud-k8s, has
no releases and no release runs. No node-workflows Model A release
exists either. The go-workflows values below are therefore
inferred, not observed.

The proxy: a real node-workflows bundle from the same mechanism

node-workflows' merge.yaml signs with sigstore/cosign-installer
v4.1.2 and keyless cosign sign-blob --bundle, as this workflow does,
and attests with actions/attest v4.2.2, which this workflow now
calls directly (it previously reached it through
actions/attest-build-provenance v4.2.2). Both run in a job of
the reusable workflow. I verified against onap-ui-common-1.1.2.tgz
and its .sigstore.json from
onap/sdc-onap-ui-common run 37592010404.

Certificate fields (openssl x509 -inform DER -noout -text):

OID (1.3.6.1.4.1.57264.) Field Value
SAN Identity https://github.com/lfreleng-actions/node-workflows/.github/workflows/merge.yaml@e40013bb325b9913138522598331b74efc3f6256
1.2 / 1.20 Workflow Trigger / Build Trigger workflow_dispatch
1.5 Workflow Repository onap/sdc-onap-ui-common
1.6 / 1.14 Workflow Ref / Source Repository Ref refs/heads/master
1.9 Build Signer URI …/node-workflows/.github/workflows/merge.yaml@e40013bb…
1.12 Source Repository URI https://github.com/onap/sdc-onap-ui-common
1.18 Build Config URI https://github.com/onap/sdc-onap-ui-common/.github/workflows/gerrit-merge.yaml@refs/heads/master

Results (cosign v3.1.3, gh v2.102.0), with node-workflows merge.yaml as the signer

Command Result
Old cosign form: SAN regexp ending @refs/heads/master ❌ expected SAN value to match regex … got …merge.yaml@e40013bb…
New cosign form (anchored SAN + issuer + repository + ref) ✅ Verified OK
New form, wrong --certificate-github-workflow-repository ❌ rejected
New form, wrong --certificate-github-workflow-ref ❌ rejected
New form, --certificate-github-workflow-trigger push ❌ rejected (got "workflow_dispatch")
New form, SAN regexp for a different workflow file ❌ rejected
New form, tampered file ❌ invalid signature
New form, cosign v2.2.4 ❌ bundle does not contain cert for verification
Old gh attestation verify <file> --repo <owner>/<repo> ❌ Sigstore verification failed
+ --signer-workflow lfreleng-actions/node-workflows/.github/workflows/merge.yaml ✅ Verification succeeded!
+ --source-ref matching / wrong ✅ / ❌
Wrong --signer-workflow, or --repo of another repository ❌ rejected
gh --signer-digest e40013bb… / all-zero SHA ✅ / ❌ expected BuildSignerDigest …
cosign --certificate-identity …merge.yaml@e40013bb… / regexp ending @0000…$ ✅ / ❌ rejected

Inferred go-workflows values

Both examples/build-test-release/*.yaml callers trigger on push of
tags only, so a release certificate should carry SAN
…/go-workflows/.github/workflows/build-test-release.yaml@<pinned ref>,
Workflow Trigger push, and Workflow Ref / Source Repository Ref
refs/tags/<tag>. The first real release (for example
onap/multicloud-k8s) can confirm this by running the documented
commands against a binary, checksums.txt and
checksums.txt.sigstore.json, plus one negative run with a different
--certificate-github-workflow-repository.

Acceptance criterion status

#98 asks for the documented commands to verify a real go-workflows
release bundle and reject one from another repository or tag. That
holds for the shared signing mechanism, using the node-workflows
bundle above, but cannot yet hold for a go-workflows bundle because
none exists. This PR fixes guidance that is demonstrably wrong now,
rather than leaving it in place until a first release. If maintainers
prefer to keep #98 open until that confirmation, drop Closes in
favour of Refs before merging.

Validation

  • prek run --files README.md: all hooks pass (markdownlint,
    write-good, codespell, reuse; gitlint at commit)
  • markdown-table-fixer lint README.md: no issues
  • aislop-gate.sh upstream/main: clean
  • prek run --files .github/workflows/build-test-release.yaml: all
    hooks pass (yamllint, actionlint, zizmor, workflow validators)
  • zizmor --persona auditor .github/workflows/build-test-release.yaml:
    no findings

Closes #98
Closes #49

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions requested review from a team and a balanced review from Copilot October 9, 2026 12:07
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 9, 2026

This comment was marked as resolved.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 12:17

This comment was marked as outdated.

The release verification section documented two commands that cannot
pass for a genuine release.

The attest and sign jobs run inside the reusable workflow, so Fulcio
names that workflow, at the ref the caller pinned, in the certificate
SAN. The project's repository and tag sit only in the GitHub OIDC
extensions. The cosign regexp ended in @refs/tags/<tag> and so never
matched, and gh attestation verify with --repo alone expects a signer
in the project repository.

Evidence: no go-workflows release has run yet; onap/multicloud-k8s,
the one caller, has no releases. node-workflows' merge.yaml signs the
same way (cosign-installer v4.1.2, keyless cosign sign-blob) and
attests with actions/attest v4.2.2, which this workflow reaches
through actions/attest-build-provenance v4.2.2. Its bundle from
onap/sdc-onap-ui-common run 37592010404 carries:

  SAN                  .../workflows/merge.yaml@e40013bb...
  Workflow Repository  onap/sdc-onap-ui-common
  Workflow Ref         refs/heads/master
  Workflow Trigger     workflow_dispatch

Against that bundle the old cosign form failed, while the new form
verified and rejected a wrong repository, ref, trigger, workflow file
and a tampered file. gh attestation verify failed with --repo alone
and passed with --signer-workflow; a wrong --source-ref,
--signer-workflow or --repo was rejected. cosign v2.2.4 could not
read the v0.3 bundle, so the section now asks for cosign v3 or later.

It also asks for gh v2.102.0 or later: earlier releases matched
--signer-workflow as a prefix (GHSA-wjmr-j3rp-mh2g) and --source-ref
case-insensitively (GHSA-4mq3-hpgx-9cx8). The commands accept any
revision of the reusable workflow, so the section shows how to pin
one: gh --signer-digest <sha>, or cosign --certificate-identity with
the full SAN. Against the bundle, the pinned SHA verified and an
all-zero SHA was rejected by both tools.

The Workflow Repository and Ref extensions describe the calling run,
not the checkout: the workflow's repository and ref inputs can build
other source under the same values. The table labels them as caller
fields and the section says when they identify the packaged source.

The gh command keeps <binary> rather than checksums.txt: the attest
job's subject-path is dist/*, the binaries, so checksums.txt carries
no attestation of its own.

The go-workflows values (push trigger, refs/tags/<tag>) are inferred
from the shared signing mechanism and the tag-push callers in
examples/; the first release can confirm them with these commands.

Refs: lfreleng-actions/node-workflows#149

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 12:27

This comment was marked as outdated.

As of v4, actions/attest-build-provenance is a thin wrapper that
forwards its inputs to actions/attest, and GitHub directs new
implementations to actions/attest. With no predicate supplied,
actions/attest emits SLSA build provenance by default, so swapping the
uses: line is like-for-like: subject-path, the job permissions and the
egress allow-list stay as they were. The wrapper's one addition, a
larger NODE_OPTIONS header limit, matters only for push-to-registry,
which this workflow does not use.

The pin, 1e69f48 (v4.2.2), is a commit SHA and matches node-workflows.

The two step comments that suggested verify commands now point to the
README's verification section instead. Both commands lacked the
signer identity flags a reusable-workflow signature needs, so neither
could pass for a real release.

Closes lfreleng-actions#49

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions changed the title Docs(readme): Fix the artefact verify commands Chore: Modernise attestation and verify commands Oct 9, 2026
Copilot AI balanced review requested due to automatic review settings October 9, 2026 12:36
@github-actions github-actions Bot added the chore Code chores (dependency updates, etc) label Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The release-attestation path cannot be exercised in PR CI or confirmed against a real go-workflows release bundle.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 5731628 into lfreleng-actions:main Oct 9, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Code chores (dependency updates, etc) documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Fix the cosign and attestation verify commands Chore: Migrate from attest-build-provenance to attest

3 participants