Skip to content

feat(attest): platform-aware action for Windows / GHES [RC]#114

Merged
ronens88 merged 1 commit into
mainfrom
feature/windows-ghes-attestation
May 17, 2026
Merged

feat(attest): platform-aware action for Windows / GHES [RC]#114
ronens88 merged 1 commit into
mainfrom
feature/windows-ghes-attestation

Conversation

@ronens88
Copy link
Copy Markdown
Contributor

@ronens88 ronens88 commented May 1, 2026

Summary

Make the `./attest` action cross-platform so customers on Windows GHES self-hosted runners can use it. Companion to cimon#1452 — both branches together form the Digital Grid RC.

Changes

  • `attest/index.js` — branches on `process.platform`. Linux/macOS uses `install.sh` + `sh`; Windows uses `install.ps1` + `pwsh`. Paths use `$RUNNER_TEMP` (set by GHES on every platform) instead of hardcoded `/tmp`. Binary name flips to `cimon.exe` on Windows.
  • `attest/README.md` — proper readme covering cross-platform quickstart, GHES configuration, and signing options for USA data-residency customers (KMS / private Sigstore / keyed offline).
  • `verify-pr.yaml` — new `verify-attest-windows` job that runs `./attest` on `windows-latest` against a sample artifact with keyed signing. Validates platform branching and serves as a customer reference.
  • `build-attest-dist.yaml` — CI helper that auto-rebuilds `attest/dist/index.js` (the bundled distribution the runtime executes) when `attest/index.js` changes. Needed because changes to the unbundled source aren't picked up at runtime.

Notes

  • `attest/dist/index.js` is intentionally not regenerated in this commit — `build-attest-dist.yaml` will refresh it on PR push automatically. Alternately a release machine can run `npm ci && npm run dist/index.js` before tagging.
  • Companion install.ps1 lives in cimon repo at `scripts/install.ps1`.

Test plan

  • `build-attest-dist` workflow regenerates `attest/dist/index.js` on this PR
  • `verify-attest-windows` job passes on `windows-latest`
  • Existing `verify` (Linux) job still passes — platform branching shouldn't regress Linux
  • After both repos green: tag matching RC versions, ship to Digital Grid

🤖 Generated with Claude Code

ronens88 added a commit that referenced this pull request May 1, 2026
cycodelabs/cimon-action@v0 is the legacy line — frozen at f99ad55,
predates hardening (PR #104) and predates the platform-aware Windows
install added in PR #114. cycodelabs/cimon-action@v1 is the line that
follows main and will pick up the Windows changes once that PR merges
and v1 is force-updated.

Today attest@v0 and attest@v1 are byte-identical, but documenting
@v0 in customer-facing examples is a footgun: when our Windows
support lands and v1 advances, customers pinned to @v0 will silently
keep getting the Linux-only attest action.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ronens88 ronens88 force-pushed the feature/windows-ghes-attestation branch from 5d8259b to 7634224 Compare May 16, 2026 15:29
@ronens88 ronens88 marked this pull request as ready for review May 16, 2026 15:30
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: 7634224b43

ℹ️ 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 .github/workflows/build-attest-dist.yaml Outdated
#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 ronens88 force-pushed the feature/windows-ghes-attestation branch from 7634224 to cb16539 Compare May 16, 2026 16:47
@ronens88 ronens88 merged commit 5b283fa into main May 17, 2026
7 checks passed
@ronens88 ronens88 deleted the feature/windows-ghes-attestation branch May 17, 2026 06:55
ronens88 added a commit that referenced this pull request May 17, 2026
PR #114 scoped the action's install directory to
$RUNNER_TEMP/cimon-<run_id>-<run_attempt>-<job>/ as a security fix, but
the docs + customer-facing demo workflow still hardcode the pre-#114
path of $RUNNER_TEMP/cimon/. A naive `cimon.exe attest verify` step
following the action now fails with "cimon.exe not found".

Surface the install path three ways so workflows can pick whichever
fits their pattern without ever reconstructing the per-job tmpdir
layout:

  1. core.addPath(dir) — `cimon` / `cimon.exe` resolves on PATH for
     plain `run:` steps in the same job.
  2. CIMON_PATH env var — absolute path, for callers that bypass PATH
     (locked-down self-hosted runners).
  3. step output cimon-path — chains cleanly into other jobs via
     ${{ steps.<id>.outputs.cimon-path }}.

Applies to all three install branches (Windows release-zip, Linux
install.sh, and the release-path input override).

After this lands, the docs example collapses from

  $exe = Join-Path $env:RUNNER_TEMP 'cimon\cimon.exe'
  & $exe attest verify ...

to just

  cimon.exe attest verify ...

— which is also what every other Marketplace action does.

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