Skip to content

Windows: fail fast in the agent action and add an sbom input to attest - #142

Merged
ronens88 merged 3 commits into
CycodeLabs:mainfrom
WaleedMahamid:fix/windows-attest-only-guard-and-sbom-input
Oct 28, 2026
Merged

ronens88 merged 3 commits into
CycodeLabs:mainfrom
WaleedMahamid:fix/windows-attest-only-guard-and-sbom-input

Conversation

@WaleedMahamid

@WaleedMahamid WaleedMahamid commented Oct 28, 2026 •

Copy link
Copy Markdown

Summary

Running cycodelabs/cimon-action on a windows-2022 runner fails with Error: unknown command "agent" for "cimon-attest", and nothing in the action or its docs explains how to get an SBOM for an application built on Windows. The Windows release of cimon is an attest-only build (a single cimon.exe, no agent command), and the agent that generates SBOMs automatically is eBPF-based and Linux-only.

Three commits:

1. fix: fail fast on non-Linux runners, document the Linux-only agent

  • src/main/index.js: throw an explanatory error before downloading anything when process.platform !== 'linux', pointing at cycodelabs/cimon-action/attest@v1. Goes through the existing catch so fail-on-error applies as for any other startup error (with the default false the step logs the error and continues).
  • src/post/index.js: skip the stop call on non-Linux runners instead of trying to run the Linux install script.
  • README.md: new Supported platforms table; action.yml description says Linux only.

2. feat(attest): sbom input to sign a tool-generated SBOM attestation

cimon v1.0.27 ships cimon attest sbom, which wraps an SBOM produced by another tool (CycloneDX JSON/XML, SPDX 2.x JSON/YAML/tag-value) in a signed in-toto attestation over the build artifacts. On Windows/macOS this is the only way to get an SBOM attestation.

  • New inputs sbom and signed-sbom-output (default sbom.intoto.jsonl.sig), new step output signed-sbom-path.
  • When sbom is set, runs cimon attest sbom after generate-and-sign over the same subjects with the same key / keyless / timestamp flags. Backend and signing flags are factored into backendArgs() / signingArgs() shared by both subcommands.
  • The signed SBOM is uploaded as a workflow artifact when report-artifact is on.
  • attest/README.md: new SBOM attestation section with a Windows example and the matching cimon attest verify --type sbom command; inputs/outputs tables updated.
  • verify-pr.yaml: the existing verify-attest-windows job now passes a minimal CycloneDX document through the new input.

3. Review follow-ups

  • The sbom path is checked only after the provenance run, so a wrong value for this optional input cannot block the provenance attestation.
  • README wording for the default fail-on-error: false; action.yml description under 125 characters; credentials added to the attest README examples.
  • Note for whichever of this PR and attest: add a kms input for KMS signing, and fix the dist rebuild push #135 merges second: --kms and the key-based timestamp condition belong in signingArgs() so the SBOM attestation is signed the same way.

Test plan

  • npm test (41 passing); all three dist/ bundles rebuilt with ncc
  • Main and post bundles run on macOS (non-Linux): guard message printed, post step skips
  • Attest bundle run against a stub cimon that logs argv: both invocations carry identical signing flags, signed-sbom-path output set, a missing SBOM path errors after the provenance invocation
  • verify-attest-windows CI job: real cimon attest sbom run on windows-latest with the repo secrets. This PR comes from a fork, so repo secrets are not available to its CI run; pushing the branch to this repo would let that job run end to end.

🤖 Generated with Claude Code

WaleedMahamid-Cycode and others added 2 commits October 28, 2026 14:47
The Cimon agent is built on eBPF and exists only for Linux. The Windows
and macOS releases of cimon are attest-only builds with no `agent`
command, so pointing this action at them (or letting it download the
Linux tarball on a Windows runner) ended in a confusing
`unknown command "agent" for "cimon-attest"` from the binary.

The main step now throws an explanatory error before downloading
anything when process.platform is not linux, honouring fail-on-error
like every other startup error. The post step skips its stop call on
non-Linux runners instead of trying to run the Linux install script.
The README gains a Supported platforms table pointing Windows and macOS
users at the attest sub-action, and the action description says the
same.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
On Windows and macOS there is no Cimon agent, so automatic SBOM
generation is not available. cimon v1.0.27 ships `cimon attest sbom`,
which wraps an SBOM produced by another tool (CycloneDX JSON/XML, SPDX
2.x JSON/YAML/tag-value) in a signed in-toto attestation over the build
artifacts. Expose it through the action:

- `sbom`: path to the SBOM file. When set, the action runs
  `cimon attest sbom` after the provenance run, over the same subjects
  and with the same key / keyless / KMS / timestamp settings.
- `signed-sbom-output`: output path (default sbom.intoto.jsonl.sig),
  also published as the `signed-sbom-path` step output and uploaded as
  a workflow artifact when report-artifact is on.

The backend and signing flags are factored into helpers shared by both
subcommands so the two attestations cannot drift apart. A bad `sbom`
path fails before the provenance run. The Windows verify-pr job now
exercises the input with a minimal CycloneDX document.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@WaleedMahamid

Copy link
Copy Markdown
Author

Pushed 8f394fd with a round of follow-ups:

  • The sbom path is now checked inside the SBOM block, after the provenance run. A wrong value for this optional input no longer blocks the provenance attestation; with the default fail-on-error: false the provenance still completes and only the SBOM step warns.
  • README wording for the non-Linux guard now says the step stops before installing anything and logs an explanatory error, failing only with fail-on-error: true.
  • action.yml description shortened to 116 characters for the Marketplace limit.
  • attest README: the SBOM, manual attest sbom and attest verify examples now include client-id / secret, with a note on the CIMON_CLIENT_ID / CIMON_SECRET env alternative. The KMS mention in the SBOM section is dropped; --kms is coming in attest: add a kms input for KMS signing, and fix the dist rebuild push #135, and whichever PR merges second should move it (and the key-based timestamp condition) into signingArgs() so both attestations are signed the same way.
  • attest/dist rebuilt; npm test passes (41).

Still open: the verify-attest-windows job needs repo secrets, which a fork PR does not get. Happy for a maintainer to push the branch into this repo so it can run end to end.

- Check the sbom path only after the provenance run, so a wrong value
  for this optional input can no longer block the provenance attestation
  (with the default fail-on-error: false it used to skip both and warn).
- README: say the step logs an explanatory error and fails only with
  fail-on-error: true.
- action.yml: shorten the Marketplace description to under 125 chars.
- attest/README: add client-id/secret to the sbom and verify examples
  and note the CIMON_CLIENT_ID/CIMON_SECRET env alternative; drop the
  KMS mention (the kms input lands separately in CycodeLabs#135).
- Rebuild attest/dist.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@WaleedMahamid
WaleedMahamid force-pushed the fix/windows-attest-only-guard-and-sbom-input branch from 8f394fd to 5a293f4 Compare October 28, 2026 16:56
@ronens88
ronens88 merged commit 732db7f into CycodeLabs:main Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants