Serve the framed Prometheus and Alertmanager pages from the app subdomain - #148
Merged
Merged
Conversation
…main The framed pages share a controller with the proxies, so the proxy's Fetch-Metadata gate ran on them and refused Sec-Fetch-Site: same-site. That is how a browser reports a navigation from the app subdomain to a site subdomain, and the header links there from every app page: Upright::Current.site falls back to the host's own site, so on the app subdomain the Prometheus link points at that site's /framed/prometheus. The result was a 403 on /framed/prometheus and /framed/alertmanager. The pages forward nothing; the gate now applies to the proxy action only.
lewispb
force-pushed
the
framed-pages-outside-proxy-gate
branch
from
September 7, 2026 08:14
2ac5bd7 to
120aa42
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped callback change preserves proxy protections and has appropriate regression coverage.
Pull request overview
Scopes Fetch-Metadata protection to upstream proxy requests while allowing authenticated framed admin pages after same-site redirects.
Changes:
- Exempts framed
showactions from the proxy gate. - Adds regression tests and documents the fix.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
File summaries
| File | Description |
|---|---|
app/controllers/concerns/upright/proxy_authentication.rb |
Exempts framed pages from Fetch-Metadata filtering. |
test/integration/prometheus_proxy_controller_test.rb |
Covers framed-page access and proxy rejection. |
test/integration/alertmanager_proxy_controller_test.rb |
Covers framed-page access and proxy rejection. |
CHANGELOG.md |
Documents the resolved 403 behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
https://ams.37upright-staging.com/framed/prometheusand the same page in development return 403 on a plain visit.Cause. The framed pages are the
showaction of the proxy controllers, soUpright::ProxyAuthentication's Fetch-Metadata gate runs on them, and it refusesSec-Fetch-Site: same-site. That is how a browser reports a navigation fromapp.<host>toams.<host>, and the header makes exactly that navigation:Upright::Current.sitefalls back to the host's own site, so on the app subdomain the "Prometheus" link points atams.<host>/framed/prometheus. The sign-in redirect back from the app subdomain fails the same way, as does a request with no Fetch-Metadata headers at all.Fix. The gate applies to the
proxyaction only. The framed page forwards nothing to an upstream; it renders an iframe and stays on the ordinary session path. The proxy behind the iframe is unchanged and is still refused for same-site requests.Tests. For each page: served to a session arriving same-site, still redirects to sign-in without a session, and the proxy path itself is still refused same-site.
Independent of #147, which does not touch this behaviour.