Skip to content

feat(attest): Windows support — fetch zip from cimon-releases, ncc 0.38 upgrade#118

Merged
ronens88 merged 5 commits into
mainfrom
feat/attest-windows-support
May 16, 2026
Merged

feat(attest): Windows support — fetch zip from cimon-releases, ncc 0.38 upgrade#118
ronens88 merged 5 commits into
mainfrom
feat/attest-windows-support

Conversation

@ronens88
Copy link
Copy Markdown
Contributor

Summary

Adds Windows support to cimon-action/attest so customers can call the action from a windows-latest (or self-hosted Windows) runner.

On Windows the action now:

  • Resolves the latest tag from the cycodelabs/cimon-releases GitHub API,
  • Downloads cimon_windows_x86_64.zip directly from that release (the public release asset, no S3 dependency),
  • Extracts to $RUNNER_TEMP/cimon/,
  • Invokes cimon.exe instead of cimon.

Linux path is unchanged (still goes through install.sh on S3).

Also upgrades @vercel/ncc from 0.34.0 → 0.38.4. The old bundler emitted require() calls inside an ESM bundle, which Node 24 (runtime per the action.yml) rejects with ERR_AMBIGUOUS_MODULE_SYNTAX. ncc 0.38 uses createRequire from node:module instead.

Coordination with #114

#114 (DRAFT, feature/windows-ghes-attestation) is the same scope with more security hardening (per-job tmpdir isolation, install.ps1 from S3 with a unique subdirectory, README updates, CI workflow). However, install.ps1 is not yet published to S3 (https://cimon-releases.s3.amazonaws.com/install.ps1 returns 403), so #114 can't actually run end-to-end today.

This PR is a smaller, working alternative that downloads the release zip directly. Once install.ps1 is published, the two approaches should be merged — happy to rebase onto #114's branch if preferred.

Test

End-to-end verified on a real windows-latest run via cimon-demo-simple-app:

The demo workflow uses cycodelabs/cimon-action/attest@<this branch's SHA> and pin-down comments to switch back to @v1 once this lands.

Files

  • attest/index.js — adds installCimonWindows(), gates by process.platform.
  • attest/package.json / package-lock.json — adds @actions/http-client + @actions/tool-cache; upgrades @vercel/ncc.
  • attest/dist/index.js — regenerated from source.

🤖 Generated with Claude Code

ronens88 and others added 4 commits May 8, 2026 10:52
The v0 maintenance branch needs CI gating for backports like the
node24 bump (#116). Without this, PRs into release/v0 silently
skip the verify suite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Backport of #115 to the v0 line. GitHub forces Node 24 on runners
June 2 and removes Node 20 support September 16, after which the
action would fail to start on Node-20-pinned runtimes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When process.platform is win32 the action now fetches the
cimon_windows_x86_64.zip release asset from cycodelabs/cimon-releases
(rather than the Linux-only install.sh), extracts it to RUNNER_TEMP/cimon,
and invokes the resulting cimon.exe. Linux path is unchanged.

Adds @actions/tool-cache and @actions/http-client deps for cross-platform
download + zip extraction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9af4492c56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread attest/index.js Outdated
The Windows path called https://api.github.com/repos/cycodelabs/cimon-releases/releases/latest
unauthenticated, which uses GitHub's per-IP REST limit (60 req/h).
Busy self-hosted runner fleets behind one egress IP can blow through
that and fail before cimon.exe is downloaded.

The action already accepts github-token (defaults to github.token);
plumb it through to the latest-release lookup as Bearer auth and pass
it to tc.downloadTool so private mirrors work too. Warn if no token is
present.

Reported by review on PR #118.
@ronens88
Copy link
Copy Markdown
Contributor Author

Addressed the unauthenticated latest-release lookup in 19b0797:

  • installCimonWindows now plumbs the action's github-token through to both the /releases/latest API call (as Authorization: Bearer … + X-GitHub-Api-Version: 2022-11-28) and tc.downloadTool for the asset fetch.
  • Warns if no token is present (which would only happen if someone explicitly cleared github-token: '' — the default is ${{ github.token }}).

Demo re-pinned to the new SHA and re-run is in flight; will reply with the green link.

@ronens88
Copy link
Copy Markdown
Contributor Author

Green: https://github.com/CycodeLabsDemo/cimon-demo-simple-app/actions/runs/25846998945 — Cimon attest + verify both pass on windows-latest with the token-authenticated latest-release lookup.

@ronens88 ronens88 merged commit 3bd4d12 into main May 16, 2026
5 checks passed
@ronens88 ronens88 deleted the feat/attest-windows-support branch May 16, 2026 11:51
ronens88 added a commit that referenced this pull request May 16, 2026
#118 already shipped the cross-platform install path (release-zip from
cycodelabs/cimon-releases, ncc 0.38 upgrade), so this branch's earlier
install.ps1-based implementation is dropped. The remaining pieces from
this PR that #118 didn't cover are kept here:

1. Per-job install dir + wipe-before-install
   ($RUNNER_TEMP/cimon-<run_id>-<run_attempt>-<job>/)
   Closes the silent-reuse hole where a malicious earlier step on a
   self-hosted runner with persistent $RUNNER_TEMP could plant
   cimon[.exe] or install.sh at the action's expected path and the
   action would execute it without re-downloading. Applied uniformly
   to the Linux install.sh path and the Windows release-zip path.

2. Hardened build-attest-dist.yaml
   - npm ci --ignore-scripts so a PR adding a malicious dependency
     can't run a postinstall hook under contents:write before the
     auto-commit lands.
   - The auto-commit step refuses to commit unless the only changed
     file is exactly attest/dist/index.js — anything else fails the
     workflow loudly instead of silently landing under
     github-actions[bot].

3. verify-attest-windows CI job in verify-pr.yaml
   Exercises ./attest end-to-end on windows-latest with keyed
   signing. No longer gated by continue-on-error: the comment about
   install.ps1 missing from S3 is obsolete now that #118 fetches
   cimon_windows_x86_64.zip directly from the GitHub release.

4. attest/README.md
   Cross-platform quickstart, GHES support notes, signing-path
   guidance for air-gapped / data-residency customers.

5. attest/action.yml
   Name + description disambiguated from the top-level hardening
   action ("Cimon by Cycode (Attest)" + cross-platform mention).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ronens88 added a commit that referenced this pull request May 16, 2026
#118 already shipped the cross-platform install path (release-zip from
cycodelabs/cimon-releases, ncc 0.38 upgrade), so this branch's earlier
install.ps1-based implementation is dropped. The remaining pieces from
this PR that #118 didn't cover are kept here:

1. Per-job install dir + wipe-before-install
   ($RUNNER_TEMP/cimon-<run_id>-<run_attempt>-<job>/)
   Closes the silent-reuse hole where a malicious earlier step on a
   self-hosted runner with persistent $RUNNER_TEMP could plant
   cimon[.exe] or install.sh at the action's expected path and the
   action would execute it without re-downloading. Applied uniformly
   to the Linux install.sh path and the Windows release-zip path.

2. Hardened build-attest-dist.yaml
   - npm ci --ignore-scripts so a PR adding a malicious dependency
     can't run a postinstall hook under contents:write before the
     auto-commit lands.
   - Single-file commit guard: the step refuses to act unless the
     only changed file is exactly attest/dist/index.js. Anything else
     fails the workflow loudly instead of silently landing under
     github-actions[bot].
   - Fork-safe checkout: pin to pull_request.head.sha and set
     repository to pull_request.head.repo.full_name. Without these,
     actions/checkout would try to resolve github.head_ref in the
     base repo, which does not contain the forks branch, and the
     rebuild job would fail before it could run at all.
   - Auto-commit gated to same-repo PRs. On fork PRs the base-repo
     GITHUB_TOKEN is read-only and cannot push to the fork anyway,
     so the step fails with a clear rebuild-locally instruction
     instead of attempting a 403ing push.

3. verify-attest-windows CI job in verify-pr.yaml
   Exercises ./attest end-to-end on windows-latest with keyed
   signing. No longer gated by continue-on-error: the comment about
   install.ps1 missing from S3 is obsolete now that #118 fetches
   cimon_windows_x86_64.zip directly from the GitHub release.

4. attest/README.md
   Cross-platform quickstart, GHES support notes, signing-path
   guidance for air-gapped / data-residency customers.

5. attest/action.yml
   Name + description disambiguated from the top-level hardening
   action ("Cimon by Cycode (Attest)" + cross-platform mention).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ronens88 added a commit that referenced this pull request May 17, 2026
)

#118 already shipped the cross-platform install path (release-zip from
cycodelabs/cimon-releases, ncc 0.38 upgrade), so this branch's earlier
install.ps1-based implementation is dropped. The remaining pieces from
this PR that #118 didn't cover are kept here:

1. Per-job install dir + wipe-before-install
   ($RUNNER_TEMP/cimon-<run_id>-<run_attempt>-<job>/)
   Closes the silent-reuse hole where a malicious earlier step on a
   self-hosted runner with persistent $RUNNER_TEMP could plant
   cimon[.exe] or install.sh at the action's expected path and the
   action would execute it without re-downloading. Applied uniformly
   to the Linux install.sh path and the Windows release-zip path.

2. Hardened build-attest-dist.yaml
   - npm ci --ignore-scripts so a PR adding a malicious dependency
     can't run a postinstall hook under contents:write before the
     auto-commit lands.
   - Single-file commit guard: the step refuses to act unless the
     only changed file is exactly attest/dist/index.js. Anything else
     fails the workflow loudly instead of silently landing under
     github-actions[bot].
   - Fork-safe checkout: pin to pull_request.head.sha and set
     repository to pull_request.head.repo.full_name. Without these,
     actions/checkout would try to resolve github.head_ref in the
     base repo, which does not contain the forks branch, and the
     rebuild job would fail before it could run at all.
   - Auto-commit gated to same-repo PRs. On fork PRs the base-repo
     GITHUB_TOKEN is read-only and cannot push to the fork anyway,
     so the step fails with a clear rebuild-locally instruction
     instead of attempting a 403ing push.

3. verify-attest-windows CI job in verify-pr.yaml
   Exercises ./attest end-to-end on windows-latest with keyed
   signing. No longer gated by continue-on-error: the comment about
   install.ps1 missing from S3 is obsolete now that #118 fetches
   cimon_windows_x86_64.zip directly from the GitHub release.

4. attest/README.md
   Cross-platform quickstart, GHES support notes, signing-path
   guidance for air-gapped / data-residency customers.

5. attest/action.yml
   Name + description disambiguated from the top-level hardening
   action ("Cimon by Cycode (Attest)" + cross-platform mention).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants