Improve OIDC error diagnostics for CDN/WAF blocks#39
Merged
sverdlov93 merged 3 commits intomainfrom Apr 3, 2026
Merged
Conversation
When a CDN/WAF (e.g. CloudFront) blocks OIDC requests with a 403,
the response body is HTML — not JSON. Previously this was logged as
`body: {}` which gave no insight into the failure cause.
Now on OIDC failure:
- Detect non-JSON responses and log the raw (truncated) body
- Log the `server` / `x-cache` header to identify the blocking entity
- For 403 + non-JSON, print a hint about WAF IP allowlisting
Only oidc.ts needs this — post.ts (ci/end) uses the tenant URL from
a successful OIDC response and already has adequate error logging.
38a5512 to
84584a5
Compare
Frogbot v2.32.0 (PR jfrog/frogbot#1262) now verifies that the workflow file contains 'environment: frogbot' before running scan-pull-request. Without it, all PR scans fail immediately.
- frogbot.yml: split into two jobs so environment: frogbot only gates PR scans (push-to-main no longer requires reviewer approval) - unit-tests.yml: remove deprecated 'url' input (tenant resolved via OIDC) - release.yml: add explicit permissions block (contents: write) - deps: fix brace-expansion DoS vulnerability (npm audit fix) - deps: bump @typescript-eslint, eslint, @types/node to latest
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.
Overview
When a CDN/WAF (e.g. CloudFront) intercepts and blocks the OIDC authentication request with a 403, the response body is an HTML error page — not JSON. Previously,
fly-actionlogged this asOIDC failed 403, body: {}, which gave operators zero insight into why authentication failed. This made debugging WAF IP allowlist issues extremely painful.What changed
Improved the error handling in
authenticateOidc(the first and most critical HTTP call to Fly) to provide actionable diagnostics:Detect non-JSON responses — When
JSON.parsefails on the response body, the raw body (truncated to 500 chars) is logged instead of an empty{}. This surfaces the actual CloudFront/WAF HTML error page.Log the blocking entity — The
serverorx-cacheresponse header is logged on failure, making it immediately clear whether CloudFront, nginx, or the Fly service itself returned the error.Actionable hint for 403 + non-JSON — A specific error message suggests WAF IP allowlisting as the likely cause and points to the exact config location (
saas-infrastructure/AWS/CDN-DIRECT/override/) where IPs are managed.Why only oidc.ts?
fly-actionmakes two HTTP calls to Fly:/ci/start-oidcoidc.ts/ci/endpost.tstruncate(body)error logging, and never runs if OIDC failsContext
This fix was prompted by investigating a staging CI failure where
JFROG/ascii-frogrelease workflows failed withOIDC failed 403, body: {}. The root cause was a GHES self-hosted runner scale set (devf-dind-arm-scale-set-jlxw2) whose NAT IP wasn't in the staging WAF allowlist. The failure was deterministic per runner but invisible due to the unhelpful error message.Example: Before vs After
Before:
After: