Repository navigation
fix: harden action inputs and downloads, document all inputs - #79
Merged
Merged
Conversation
- Validate environment, version, verbosity and identity up front. The environment and version feed the download URL, and the checksum comes from the same URL, so a crafted value could redirect both. - Restrict curl to HTTPS (including redirects) and TLS 1.2+. - invite-code path: mask the hand-fetched OIDC token, URL-encode the audience, fail on HTTP errors and a missing id-token permission. - Install the keyring package from its wheel only. - auth.yaml: drop allow-unsafe-pr-checkout; it is a no-op for the default checkout and only disables the guard if a PR ref is added. - Add rejection tests for the new validation. - README: document every input, required permissions, scenarios and security behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switch every `uses: ./` to `uses: $/`, as flagged by zizmor's self-repository audit. `$/` resolves to the exact commit that is running instead of whatever is on disk, so the checkout steps that only existed to support `./` are removed. That also takes actions/checkout out of the pull_request_target job in auth.yaml. actionlint 1.7.12 rejects `$/` (rhysd/actionlint#711), so ignore only that error until it ships support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carlos Panato <ctadeu@gmail.com>
cpanato
force-pushed
the
harden-inputs-and-readme
branch
from
November 3, 2026 14:47
9662306 to
78d0483
Compare
harden-runner v2.22.3 enforces egress on Windows, but its step returns about 4s before the agent redirects DNS and turns on the block-all filter. With the checkout step gone, the chainctl download now starts inside that gap: it resolves outside the proxy, gets no allow rule and is cut off, and retries reuse the cached DNS answer and stay blocked. Wait on Windows until DNS points at the agent's proxy, then clear the DNS cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carlos Panato <ctadeu@gmail.com>
The hash job finishes about 4s after harden-runner returns, so the Post step stops the Windows agent before it finishes starting. That can leave its egress filter on and the job never reports completion. Add the same wait used in the Basic Test job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carlos Panato <ctadeu@gmail.com>
The Windows agent points system DNS at 127.0.0.1 about a second before its proxy has upstream servers. Lookups in that gap fail and Windows caches the failure, which still produced the occasional "Could not resolve host" and left the hash job unable to report completion. Move the wait into a shared local action that waits until a lookup through the proxy succeeds, then clears the DNS cache to drop failures cached during the gap. Widen the actionlint ignore so it covers `$/` paths, not just the bare root reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carlos Panato <ctadeu@gmail.com>
The agent repoints adapters one at a time, so a normal lookup could succeed through an adapter still on the upstream resolver while the proxy itself had no upstreams yet. The wait then returned about 1.5s early and the download still hit "Could not resolve host". Send the probe straight to 127.0.0.1 so it only succeeds once the proxy works. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Carlos Panato <ctadeu@gmail.com>
jmeridth
approved these changes
Nov 3, 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.
Xref: https://linear.app/chainguard/issue/ACID-1907/new-setup-chainctl-release-supports-selecting-a-specific-version
Security fixes and improvements for the action, plus a README that covers every input.
Fixes
environmentandversiongo into the download URL, and the checksum comes from that same URL. A crafted value (e.g.environment: evil.example/x?) could point both at another host and still pass the check.verbositymust be 0-5.identitycan't contain whitespace or control characters, since it's echoed into::group::log commands.--proto '=https' --proto-redir '=https' --tlsv1.2, so a redirect can't drop to plain HTTP.invite-codepath: the OIDC token fetched by hand is now masked. The audience is URL-encoded, HTTP errors fail the step, and a missingid-token: writepermission gives a clear error.auth.yaml: removedallow-unsafe-pr-checkout: true. In checkout v7.0.1 the fork-PR guard is skipped for the default checkout (noref:), so the flag did nothing today. Its only effect was to leave the guard off if a PR ref is added to thispull_request_targetjob, which hasid-token: write.Improvements
--only-binary), so no sdist build code runs.uses: ./is nowuses: $/(zizmorself-repository).$/loads the action from the running commit, so the checkout steps that only existed for./are removed, including the one in thepull_request_targetjob. actionlint 1.7.12 does not support$/yet (Support the new$/self-repositoryuses:syntax rhysd/actionlint#711), so that single error is ignored..github/actions/wait-for-harden-runnerwaits on Windows until a lookup sent straight to the proxy succeeds, then clears the DNS cache. It does nothing on Linux/macOS. Remove it once harden-runner waits for its agent.environment,versionandverbosityvalues fail the action.Testing
actionlintpasses.zizmor --persona pedanticshows no new kinds of finding.dl.enforce.devchecksums with the new curl flags.Follow-ups (not in this PR)
auth.yamlfrompull_request_targettopull_requestwith a same-repo guard, so PRs actually test their own code. This changes the OIDC claims, so the Chainguard identity binding needs checking first.🤖 Generated with Claude Code