Skip to content

ci: block fork runs from privileged enclave builds - #33

Merged
nickpell merged 2 commits into
mainfrom
nick/openarbiter-workflow-run-security
Sep 23, 2026
Merged

nickpell merged 2 commits into
mainfrom
nick/openarbiter-workflow-run-security

Conversation

@nickpell

@nickpell nickpell commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Require the triggering Go run's head repository to match this repository before Docker Build runs the enclave job. Fork PRs no longer build images; PRs from this repo and pushes to main retain their existing build and publication behavior.
  • Add the same repository check to Build EIF as defence in depth. Keep its main-branch, success, skip-marker, and manual-dispatch behavior.

Related security hardening: cloudx-io/openauction#73. The two changes can merge independently.

Notes for reviewers

#1 adopted openauction's CI structure. #21 preserved build-only PR validation while restricting publication. This change narrows that validation to branches in this repository because fork code must not run in the privileged workflow context.

The EIF condition checks the immediate upstream Docker run. The existing Docker-to-EIF publication and commit-metadata handoff is unchanged. This follows the scope documented in #21.

PR-triggered workflow_run jobs use the workflow definitions on main. CI before merge therefore does not exercise these new Docker and EIF guards; the first main push after merge must verify the full chain.

Pre-merge checklist

  • Workflow lint passes: mise run //:ratchet:lint and actionlint 1.7.12 on both changed workflows (shellcheck and pyflakes disabled; no run scripts changed).
  • Gate dry-run passes for 144 event combinations, covering same-repo and fork sources (including forks named main), missing source metadata, success/failure/cancellation/skips, branch filters, PCR skip markers, and supported dispatch paths.
  • Diff contains only the two workflow changes and related comments.
  • PR CI checks pass: Ratchet Lint, lint, and test on the current PR commit.

Post-deploy/apply verification

  • After merge, the next push to main completes Go successfully, then Docker Build publishes the image for the built commit. Evidence: Go and Docker Build succeeded for 2e1f7fd1ab3a9fd36b388b2dba9c33afb2a421d0. Docker logs confirm the 2e1f7fd1ab3a9fd36b388b2dba9c33afb2a421d0 image manifest was pushed.
  • Build EIF succeeds for that chain, publishes the EIF, and completes the PCR update job. Evidence: Build EIF completed both jobs successfully, published the EIF for 2e1f7fd1ab3a9fd36b388b2dba9c33afb2a421d0, and pushed PCR-update commit 0762c0e. All three committed PCR measurements match the EIF build log.
  • The follow-up [skip-build] Update PCR measurements commit appears on main with the expected validation/pcrs.json entry. Its Build EIF run is skipped. Evidence: PCR-update commit 0762c0e is on main and contains the matching measurements; its Go and Docker Build workflows succeeded, and Build EIF concluded skipped with both jobs skipped.

@nickpell nickpell added the security hardening Security boundary and workflow hardening label Sep 23, 2026
@nickpell
nickpell requested review from peterldowns and a balanced review from Copilot September 23, 2026 16:13
@nickpell
nickpell removed the request for review from peterldowns September 23, 2026 16:15

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.

Copilot review overview

🟡 Changes recommended

The critical EIF workflow guard can still permit privileged fork-triggered execution.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Restricts privileged Docker/EIF builds to same-repository runs and disables Go caching.

Changes:

  • Adds repository-origin guards to Docker and EIF jobs.
  • Disables setup-go caching in Docker builds.
File Review
.github/​workflows/​eif-build.yml Critical: The guard does not propagate the original Go run’s repository, allowing a skipped Docker job to trigger EIF.
.github/​workflows/​docker.yml Adds source-repository gating and disables Go caching.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/eif-build.yml

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.

Copilot review overview

🔵 Needs a closer look

The workflow guards cannot be exercised until after merge and require human verification.

Review effort: Balanced
Findings: None

Resolved since last review (1)

nickpell added a commit to cloudx-io/openauction that referenced this pull request Sep 23, 2026
## Summary

- Require the triggering Go run's head repository to match this
repository before Docker Build runs the enclave job. Fork PRs no longer
build images; PRs from this repo and pushes to main retain their
existing build and publication behavior. Docker workflow_dispatch
remains available.
- Add the same repository check to Build EIF as defence in depth. Keep
its main-branch, success, skip-marker, and manual-dispatch behavior.

Related security hardening: cloudx-io/openarbiter#33. The two changes
can merge independently.

## Notes for reviewers

Commit
[93b30e5](93b30e5)
intentionally added Docker validation after Go runs on all branches.
#61 kept PR builds while restricting publication.
This change narrows that validation to branches in this repository
because fork code must not run in the privileged workflow context.

The EIF condition checks the immediate upstream Docker run. The existing
Docker-to-EIF publication and commit-metadata handoff is unchanged. This
follows the scope documented in cloudx-io/openarbiter#21.

PR-triggered workflow_run jobs use the workflow definitions on main. CI
before merge therefore does not exercise these new Docker and EIF
guards; the first main push after merge must verify the full chain.

## Pre-merge checklist

- [x] Workflow lint passes: mise run //:ratchet:lint and actionlint
1.7.12 on both changed workflows (shellcheck and pyflakes disabled; no
run scripts changed).
- [x] Gate dry-run passes for 192 event combinations, covering same-repo
and fork sources (including forks named main), missing source metadata,
success/failure/cancellation/skips, branch filters, PCR skip markers,
and supported dispatch paths.
- [x] Diff contains only the two workflow changes and related comments.
- [x] PR CI checks pass: Ratchet Lint, lint, and test on the current PR
commit.

## Post-deploy/apply verification

- [ ] After merge, the next push to main completes Go successfully, then
Docker Build publishes the image for the built commit.
- [ ] Build EIF succeeds for that chain, publishes the EIF, and
completes the PCR update job.
- [ ] The follow-up `[skip-build] Update PCR measurements` commit
appears on main with the expected validation/pcrs.json entry. Its Build
EIF run is skipped.
@nickpell
nickpell merged commit 2e1f7fd into main Sep 23, 2026
4 checks passed
@nickpell
nickpell deleted the nick/openarbiter-workflow-run-security branch September 23, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security hardening Security boundary and workflow hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants