Fix: Apply one harden-runner step per job - #7
Merged
askb merged 1 commit intoJul 31, 2026
Merged
Conversation
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
July 31, 2026 10:28
View session
There was a problem hiding this comment.
Pull request overview
Updates this repository’s GitHub Actions workflows to fix a runner-hardening bug caused by the “dual harden-runner step” pattern (where both steps’ pre phases can run even when a step is conditionally skipped). The change ensures each affected job uses a single step-security/harden-runner step with the egress policy computed inline, and bumps the shared allow-list pins to .github v0.12.1.
Changes:
- Replace per-job dual harden-runner (block/audit) steps with a single harden-runner step using a computed
egress-policy. - Ensure the allow-list load step is unconditional in affected reusable workflows.
- Bump allow-list pins to commit
60d8d710...(annotated tag v0.12.1) across live workflow references.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/build-test.yaml | Switch to a single harden-runner step per job and bump default allow-list pin to v0.12.1 commit. |
| .github/workflows/build-test-release.yaml | Same harden-runner single-step fix across release workflow jobs; bump allow-list pin. |
| .github/workflows/merge.yaml | Same harden-runner single-step fix across merge workflow jobs; bump allow-list pin. |
| .github/workflows/tag-push.yaml | Bump harden-runner allow-list config pin to v0.12.1 commit for both jobs. |
| .github/workflows/release-drafter.yaml | Bump harden-runner allow-list config pin to v0.12.1 commit. |
| .github/workflows/clear-action-cache.yaml | Bump harden-runner allow-list config pin to v0.12.1 commit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Each job selected between a block-configured and an audit-configured harden-runner step using a step-level 'if:'. That does not work. harden-runner declares a 'pre' entry point and no 'pre-if', so its pre-phase runs whatever the step condition says, and the pre-phase is where the agent engages the network policy. Both steps engaged, the block-configured one ran first and won, so harden_runner_egress: audit silently did nothing. This template instantiation inherited the broken pattern before the fix propagated through the workflow family. Collapse each job to a single harden-runner step with the policy computed inline, matching java-workflows, node-workflows, python-workflows and go-workflows. Also bump every .github allow-list pin to v0.12.2: the reusable workflow defaults (from v0.4.1) and the tag-push, release-drafter and clear-action-cache internal workflows (from v0.1.1). The new pin adds the Gerrit SSH, JVM/Gradle, Nexus 3 Docker registry port, Yarn, nodejs.org and Sonatype IQ egress endpoints; the Docker registry endpoints matter directly for this repository's build lanes. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
ModeSevenIndustrialSolutions
force-pushed
the
ci/harden-runner-single-step
branch
from
July 31, 2026 10:32
865d8d9 to
f389da9
Compare
Copilot started reviewing on behalf of
ModeSevenIndustrialSolutions
July 31, 2026 10:32
View session
askb
approved these changes
Jul 31, 2026
askb
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Apply one harden-runner step per job
This template instantiation inherited the broken dual-step harden-runner pattern from before the fix propagated through the workflow family.
The bug
Each job selected between a block-configured and an audit-configured
step-security/harden-runnerstep via a step-levelif:. harden-runner declares apreentry point and nopre-if, so its pre-phase (where the network policy engages) runs regardless of the condition — both steps engaged, block ran first and won, andharden_runner_egress: 'audit'silently did nothing.The fix
Single harden-runner step per job with the policy computed inline:
Matching
java-workflows,node-workflows#24,python-workflows#37andgo-workflows#25. No build-variant blocks exist here yet — thebuild_permit_egress_traffichatch arrives with the Docker verify-lane implementation.Allow-list pin bump →
.githubv0.12.2 (latest)All 7 live pins: reusable-workflow defaults (3, from v0.4.1) and
tag-push×2 /release-drafter/clear-action-cache(from v0.1.1). Relative to the old pins, v0.12.2 brings the Gerrit SSH, JVM/Gradle, Nexus 3 Docker registry ports (10001–10004), Yarn,nodejs.organd Sonatype IQ endpoints — the Docker registry endpoints matter directly for this repository's build lanes. Pinned to the commit the annotated tag resolves to (bf6642f…), not the tag object.Validation
Harden runner (block)/(audit)or literalegress-policy: 'block'|'audit'; computed policy counts 6 / 9 / 6actionlintpasses on all workflowsGroundwork for the Docker verify lane (design brief: #6, tracking: lfreleng-actions/.github#142).