You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix public action lookups blocked by organization IP allowlists - #275
--verify on GitHub-hosted runners fails for public actions whose organization has an IP allow list (for example aquasecurity/setup-trivy): GitHub refuses the job token with an HTTP 403 or a GraphQL FORBIDDEN item, so the pin is reported as inaccessible.
Those explicit denials now take the existing anonymous public-repository fallback, for REST and GraphQL. Per-alias GraphQL evidence is kept, so unaffected private actions in the same batch stay authenticated. The github.com public client of a *.ghe.com run retries such a denial once without its token.
Repository identity, commit/ref, ancestry and action-content checks are unchanged. A repository the anonymous read can't see (private, or a missing ref only an authenticated read could answer) keeps the original denial and fails closed.
Only a 403, or a FORBIDDEN item whose own message names the IP allow list, qualifies. Bare messages, ordinary forbidden responses and rate-limit responses do not. SAML/SSO handling is unchanged.
An outage or rate limit in the fallback (probe, metadata or read) is reported as retryable, with its reset time, rather than as a final denial. IP-policy diagnostics stay distinct from SAML/SSO and never suggest a token: for a rate-limited fallback they say to wait for the reset or run from an allow-listed address.
Validation (current head):
make fmt-check, go vet ./... (also with GOOS=windows) and make test (race) pass locally on macOS. Command tests run --verify under an IP allow list: success from anonymous reads with the lockfile unchanged, fail-closed with IP guidance for a private repository, and a rate-limited fallback. make test-stub was not run on this revision.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Anonymous fallback rate-limit failures lose diagnostic context, causing --verify to omit the rate-limit explanation and commit/action resolution to drop the originating IP-policy cause.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
IP-policy fallback can fail on null GraphQL aliases, while anonymous rate-limit errors lose diagnostic context or receive incomplete recovery guidance.
No open issues 🎉
3 previously missed issues
In code that hasn't changed since last review
Preserve batch IP-policy errors for null aliases
internal/ghapi/graphql_parity.go:204
A batch-level IP-policy FORBIDDEN error without a path is discarded when an alias is present as null, so the public lookup fails instead of reaching REST fallback. Preserve batchErr for null as well as missing aliases, including after splitting to a single input. Same issue in internal/ghapi/graphql_action_files.go:295.
Preserve anonymous rate-limit context in CompareRefs errors
internal/ghapi/repos.go:430
If an IP-policy denial is followed by a rate-limited anonymous organization probe, CompareRefs returns the original 403 and loses the reason fallback was skipped. Wrap the error with c.ssoErr(owner, err), as the other REST paths do, so ancestry diagnostics retain the anonymous rate-limit context.
Add retry guidance for rate-limited IP-policy fallbacks
internal/pipeline/parity.go:711
When an IP-policy fallback is rate-limited, this only recommends using an IP address on the organization's allowlist. For a third-party public action on a hosted runner, waiting for the anonymous limit to reset may be the only available remedy. Give SSORateLimitedError its own reset/retry guidance and update the exact-string expectation in TestParityFinding_RateLimitedIPAllowListFallback.
Keep a pathless GraphQL IP-policy denial when its alias comes back null,
so the public fallback still runs. Carry the anonymous rate-limit context
through CompareRefs, and tell the user to wait for the anonymous limit to
reset when an IP-policy fallback is rate-limited. Pass the held-pins
argument main added to parityFinding in the new parity test.
@nodeselector could you take a look when you have time? This fixes #274.
It is rebased on main, the review findings are addressed, and it is verified on GitHub-hosted runners with the exact reproduction from the issue: v0.4.1 fails and this branch passes on 3 of 3 runners (run).
The workflows on this fork PR need approval to run. If the diff is too large to review at once, I can split it: the REST 403 fallback first, the GraphQL per-alias handling second.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
IP-policy fallback defects can block accessible public actions and misclassify transient or rate-limit failures as non-retryable, discarding retry metadata.
- Report a transient failure of the fallback's metadata or probe read
instead of the final IP allow list denial, so the check stays retryable.
- Keep the rate-limited anonymous response (status, reset headers) in the
error for IP-policy fallbacks, and treat those as unanswered with
IP-specific retry advice. SAML handling is unchanged.
- Retry a github.com public client's IP-policy 403 without credentials.
- Treat an anonymous compare 404/422 as a cached false verdict.
- Probe the repository when the requested owner is not an organization,
so a repository transferred into an IP-restricted organization falls back.
- Report probe outages (repository probe 5xx, organization probe transport
failures) instead of the final IP allow list denial.
- Send eligibility probes without credentials, and tag errors from a
credential-free retry as anonymous, keeping the IP policy on a rate limit.
- Name no organization in IP allow list guidance: after a transfer the
requested owner is not the one whose allow list refused the token.
- Move IP-policy retry advice into Finding.MarkRetryable and RetryAdvice so
every retryable check and the terminal summary agree.
…sitory
Address review of the fallback paths:
- After an IP allow list denial, treat an anonymous 404/422 as a verdict on
the ref or commit only when the repository's anonymous metadata is
readable. For a private repository the denial stands, instead of a
not-found error or a cached "not an ancestor" verdict.
- Clear stale rate-limit and outage markers before each eligibility probe,
always record the policy that sent a lookup to the fallback, and treat a
rate-limited credential-free retry as IP policy.
- Give resolver failures and the rate-limit headline IP-specific wording.
- Reset all fallback caches in tests, cover the REST list paths, and fix the
cancellation test.
A final IP allow list refusal is GitHub's answer, like a 404: only
inconclusive lookups fail the host check. Also cover public repositories
whose missing ref or commit is still a verdict after the fallback.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The IP-policy fallback incorrectly treats authenticated or cached repository metadata as proof of anonymous readability, allowing anonymous 404/422 responses to produce false missing-ref or ancestry verdicts.
…tadata
Metadata from an authenticated read, or from the cache of one, doesn't show
that the anonymous reads that follow can see the repository. After an IP
allow list denial, take the fallback only when the repository was read
without credentials, and propagate an outage or rate limit of that read.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Mutable owner-wide state can misclassify concurrent IP fallback failures and lose probe errors, while command tests are missing for verification success and anonymous-metadata 404 failure.
Owner-wide maps (anonIPBlocked, anonRateLimited, anonProbeFailed) let a
concurrent lookup of the same owner overwrite or clear the evidence of an
in-flight one, mislabeling an IP-policy rate limit as SSO or dropping a
probe outage. Carry which policy refused the token on the lookup's
context, and return probe rate limits and outages to the lookup that made
the probe, so policyFailure reports them. Only definitive answers stay in
anonProbeCache.
Add command tests for --verify under an IP allow list: success from
anonymous reads with an unchanged lockfile, fail-closed with IP guidance
when the repository isn't public, and a rate-limited fallback.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The REST fallback can reuse a SAML-wrapped rate-limit error for an IP-policy denial, causing the pipeline to report an SSO failure instead of a retryable IP-policy limit.
A rate limit hit by a SAML-refused read is reported as SAML's. Returning it
for a lookup that an IP allow list sent to the fallback turned a retryable
IP-policy limit into an SSO failure.
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
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.
Fixes #274.
--verifyon GitHub-hosted runners fails for public actions whose organization has an IP allow list (for exampleaquasecurity/setup-trivy): GitHub refuses the job token with an HTTP 403 or a GraphQLFORBIDDENitem, so the pin is reported as inaccessible.*.ghe.comrun retries such a denial once without its token.FORBIDDENitem whose own message names the IP allow list, qualifies. Bare messages, ordinary forbidden responses and rate-limit responses do not. SAML/SSO handling is unchanged.Validation (current head):
make fmt-check,go vet ./...(also withGOOS=windows) andmake test(race) pass locally on macOS. Command tests run--verifyunder an IP allow list: success from anonymous reads with the lockfile unchanged, fail-closed with IP guidance for a private repository, and a rate-limited fallback.make test-stubwas not run on this revision.799cf0dpasses--verify. It has not been re-run on the current head.P.S. This PR was prepared with LLM assistance.