Repository navigation
sidecar_traffic_routing: allowlist two Modal endpoints and block domain fronting - #1627
Closed
Lukas Bjarre (lbjarre) wants to merge 2 commits into
Closed
Lukas Bjarre (lbjarre) wants to merge 2 commits into
Lukas Bjarre (lbjarre) wants to merge 2 commits into
Conversation
…in fronting Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
Superseded by https://github.com/modal-labs/modal/pull/57976 — the monorepo is the copybara source of truth for //examples, so this change needs to land there. |
Lukas Bjarre (lbjarre)
deleted the
devin/1788959101-sidecar-domain-fronting
branch
September 25, 2026 13:48
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.
Reworks the Sidecar MITM proxy example so it demonstrates (and actually enforces) protection against domain fronting.
The previous GitHub-based filter was bypassable: it only inspected flows whose SNI was exactly
github.com, chose the upstream from that same SNI, and never bound SNI to the HTTPHostheader. From inside the Sandbox,curl -H 'Host: github.com' https://www.github.com/<forbidden>(or a trailing-dotgithub.com.) reached forbidden paths with a 200.Changes:
allowed,blocked) deployed from the script via aweb_app, following the pattern insidecar_secrets_injection.py. Both sit on Modal's sharedmodal.runingress, which routes purely onHost— a realistic fronting target (exfil/C2 shape) instead of awwwsubdomain.tls_clienthelloalso canonicalizes before selecting the upstream.curl https://<allowed> -H 'Host: <blocked>'), expected output:Verified end-to-end on Modal by Lukas Bjarre (@lbjarre) with an equivalent standalone draft (same addon logic, same three checks; all rows matched). This exact file passes ruff/py_compile but was not run on Modal from this session (no token secret available).
Type of Change
Monitoring Checklist
lambda-test: falseis provided in the example frontmatter and I have gotten approval from a maintainermodal run, or an alternativecmdis provided in the example frontmatter (e.g.cmd: ["modal", "serve"])cmdwith no arguments, or theargsare provided in the example frontmatterfastapito be installed locallyDocumentation Site Checklist
Content
modal-cdn.comBuild Stability
v1, not a dynamic tag likelatestpython_versionfor the base image, if it is usedmitmproxy==12.2.3,fastapi[standard]==0.139.2)version < 1are pinned to patch version,==0.y.zLink to Devin session: https://modal.devinenterprise.com/sessions/01490ac54e144afb9a5b2c18c4ed8c08
Open in Devin Desktop: https://modal.devinenterprise.com/desktop/session/01490ac54e144afb9a5b2c18c4ed8c08?variant=devin