Skip to content

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

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

nickpell merged 2 commits into
mainfrom
nick/openauction-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. 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 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

  • 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 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.
  • 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 44684d4192229e7d776e61bde27e7bec109e8859. Docker logs confirm the 44684d4192229e7d776e61bde27e7bec109e8859-arm64 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 44684d4192229e7d776e61bde27e7bec109e8859, and pushed PCR-update commit 72345ab. 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 72345ab 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

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 privileged workflow changes require post-merge validation on the default branch.

Review effort: Balanced
Findings: None

What changed in this PR

Hardens privileged Docker and EIF workflows against fork-triggered runs while preserving trusted and manual builds.

Changes:

  • Adds same-repository gating to Docker and EIF jobs.
  • Disables Go caching in the privileged Docker job.
File Description
.github/​workflows/​eif-build.yml Adds defense-in-depth repository validation.
.github/​workflows/​docker.yml Adds repository-origin 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.

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

🟢 Approval recommended

No unresolved issues were identified in the reviewed workflow changes.

Review effort: Balanced
Findings: None

@nickpell
nickpell merged commit 44684d4 into main Sep 23, 2026
4 checks passed
@nickpell
nickpell deleted the nick/openauction-workflow-run-security branch September 23, 2026 17:02
nickpell added a commit to cloudx-io/openarbiter 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.
- 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

- [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 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.
- [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.
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