Repository navigation
Description
Summary
Transparent inbound interception (#330) is merged and its main path is verified end-to-end. Two code paths shipped unexercised — they are implemented and structurally verified, but no test or live run has driven traffic through them. Tracking them here rather than leaving them implicit in a closed issue.
Neither is a known defect. Both are "we have not observed this work," which is a different claim from "this works."
1. Ambient (HBONE) inbound — the higher-risk one
Ambient inbound never traverses PREROUTING: ztunnel terminates HBONE and re-originates a LOCAL connection, so it appears in nat OUTPUT. It is captured by a mark-based DNAT at the head of AB_REDIRECT, ahead of that chain's ztunnel-mark RETURN.
Verified: the rule is installed with the full mark 0x539 / ! --uid-owner / --dst-type LOCAL match, ordered before the DNAT and before the RETURN that would otherwise leak; all nine inbound exemptions are present on that hook too. test-enforce-redirect.sh asserts the ordering explicitly, and the rules were inspected live in a pod netns.
Not verified: that ztunnel's re-originated connection actually matches that tuple at runtime. That is reasoned from redirect mode's precedent (init-iptables.sh, "Rule 2"), not observed. The Kind cluster used for e2e runs only istiod — no ztunnel DaemonSet, no istio-cni — so there is no ambient data plane despite namespaces carrying istio.io/dataplane-mode=ambient. Counters confirm which path was exercised: AB_INBOUND REDIRECT took 4 packets, the ambient DNAT 0.
Why it matters: a PREROUTING-only implementation looks correct while waving every mesh-delivered request through unvalidated. That is precisely the failure this rule exists to prevent, so it deserves an observation rather than an argument.
- Run the transparent-inbound e2e in an ambient-enrolled namespace on a cluster with ztunnel deployed
- Confirm from rule counters that the ambient DNAT — not
AB_INBOUND— carried the traffic - Confirm the exemptions hold on that path (
:9091reachable, so probes do not gate)
2. Inbound mTLS through the transparent listener
The transparent listener reuses the reverse proxy's mTLS posture via WrapListener, so tlssniff handles permissive/strict identically for both inbound shapes. Startup logs confirm the wrap is active (Transparent inbound server listening ... mtls=true).
Not verified: no TLS client has been driven against :8083. Unit coverage exists for the wrap (TestWrapListener_NoMTLSIsPassthrough) and for tlssniff itself, but the combination of SO_ORIGINAL_DST recovery and a TLS handshake on the same connection is untested end-to-end — and that combination is the novel part, since the recovery happens on the raw conn before tlssniff peeks.
- e2e with a TLS client against a transparent-inbound agent — done as
strictthroughout
(permissive is already covered by the main module's plaintext 401, which is what makes
the strict rejection below meaningful as an A/B) - Same with
strict, asserting plaintext is rejected —http_code=000, vs 401 permissive - Beyond the original ask: a valid SVID completes the handshake and still gets 401
fromjwt-validation(test(e2e): cover inbound mTLS and the ambient/HBONE path in transparent inbound rossoctl#2404)
Not in scope
Intra-pod loopback is deliberately not captured — containers share a netns and are one entity to every network enforcement layer, so that traffic is inside the trust boundary. See #330.
Related
- Feat: Transparent inbound interception for the Go proxy (proxy-sidecar) — SO_ORIGINAL_DST, no Envoy #330 — the feature (closed)
- feat: Transparent inbound interception for proxy-sidecar (SO_ORIGINAL_DST) #776, feat: Add inboundInterception=transparent (drops port stealing) operator#511, test: Add transparent inbound interception E2E suite rossoctl#2393 — the implementation
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
huang195 commentedon Aug 20, 2026
mTLS half: done ✅
Verified end-to-end and encoded as e2e tests in rossoctl/rossoctl#2404
(
rossoctl/tests/e2e/transparent_inbound/test_transparent_inbound_mtls.py).Run on kind against operator + authbridge + proxy-init images built from merged
main, so the shipped code was under test — not a local branch build.
strict+ plaintexthttp_code=000tlssniffprovably engaged on the transparent listenerstrict+ TLS, no client certtlsv13 alert certificate requiredhttp: TLS handshake error ... client didn't provide a certificatestrict+ TLS, valid SVIDhttp_code=401pipeline: plugin rejected request plugin=jwt-validation status=401Sidecar attribution:
mTLS enabled mode=strict+Transparent inbound server listening addr=[::]:8083 mtls=true.SVID used:
spiffe://localtest.me/ns/team1/sa/ti-mtls.The 401 in the third row is the point — the full chain runs in one request
(REDIRECT →
SO_ORIGINAL_DST→tlssniff→tls.Serverclient-certverification →
jwt-validation), and it stops at 401 rather than 200 becauseauthentication of the transport is not authorization of the request. Row 2 is
its control, so the pass cannot be explained by lax verification.
The specific worry this closes:
SO_ORIGINAL_DSTrecovery happens on the rawconnection, before
tlssniffpeeks the first byte. If those interfered, thestartup logs would still have read
mtls=trueand looked fine. They don'tinterfere.
Suite: 13/13 passing, 0 skipped.
Ambient (HBONE) half: still open ⬜
Unchanged and still blocked on infrastructure. This cluster runs only
istiod—no ztunnel DaemonSet, no istio-cni,
PILOT_ENABLE_AMBIENTunset — despitenamespaces carrying
istio.io/dataplane-mode=ambient. Packet counters confirmnothing ambient ever ran:
AB_INBOUNDREDIRECT carried all traffic, the ambientDNAT in
AB_REDIRECTcounted 0.So the DNAT rule remains verified as installed and correctly ordered (ahead of
the ztunnel-mark
RETURN, which is load-bearing — see #330), but itsmark/dst-type matching is still only reasoned from redirect-mode precedent, never
traversed. Needs a cluster with a real ambient data plane.
Worth noting separately: that gap may itself be a deployment bug. The
namespace labels say ambient, the data plane is absent. If the platform is meant
to run ambient, that is its own issue; if it isn't, the labels are misleading.
Assisted-By: Claude Code
huang195 commentedon Aug 20, 2026
Correction on the mTLS half: verified locally, not covered by CI
Following up on my comment above, because it would have read as stronger than it is.
The three-case verification stands exactly as described — it was a real run against
images built from merged main, and the local suite is 13/13. What I should have
checked before posting: whether the encoded tests actually run on the shared Kind
e2e job.
They don't. All 13 skip there — including the 10 from rossoctl/rossoctl#2393.
On the CI run for #2404: three ~3-minute fixture stalls (exactly
READY_TIMEOUT),each followed by an instant batch of skips, because the per-agent Keycloak
client-credentials Secret is never created for the agents this suite deploys. This
is pre-existing — the suite has been inert in CI since it merged, not something
#2404 introduced — and it is the same intermittent Kind client registration that
e2e-kind.yamlalready works around with a wait loop pluscontinue-on-errorforthe token-exchange suite. Injected agents do start on that cluster (the separate
AuthBridge Weather E2E step), so it is not a sidecar problem.
So the accurate status of the mTLS half:
running merged-main images.
I have left the #780 boxes ticked, since what they asked for (verify these paths) is
genuinely done. But if the intent was a standing gate rather than a one-time
verification, that is not achieved yet, and the fix is either repairing Kind client
registration or setting
TI_STUB_CREDENTIALS=1in90-run-e2e-tests.sh— thelatter reverses the deliberate opt-in reasoning in the suite README, so it wants a
decision rather than a silent flip. Say which and I will do it.
#2404 also rewrites the skip message, which previously named only a missing
k8s.keycloak.orgCRD as the cause. That is real on community-provider installsbut is not what happens in CI, so it was pointing debuggers at the wrong thing.
Assisted-By: Claude Code
huang195 commentedon Aug 20, 2026
Correcting my correction above
My previous comment said the mTLS half was "verified locally, not covered by
CI", and blamed intermittent Keycloak client registration on Kind. The first part
was right about the state; the diagnosis was wrong. It is now fixed, and the suite
does gate.
Root cause was deterministic, not flaky. With SPIRE enabled, the operator's
ClientRegistration controller derives the Keycloak client ID from the Deployment
pod template's
serviceAccountNameand refuses ondefault:It requeues every 30s forever at
Infolevel, so the per-agent credentials Secretis never created and the injected pod never leaves
FailedMount. The e2e fixturesset no
serviceAccountName; the platform's own agent deploy scripts create adedicated SA for exactly this reason. One line in the fixture manifest fixes it.
rossoctl/rossoctl#2404 now runs 13 passed, 0 skipped, with no credential
stubbing — real controller-issued credentials. So the mTLS half is verified and
gated, and the ticked boxes are now backed by CI rather than a one-time manual run.
Also, a platform defect worth its own issue (not part of #780, I'll file it
unless someone objects): the AuthBridge webhook creates a per-agent ServiceAccount,
sets it on the pod, and pre-populates the annotation naming the credentials
Secret — but never touches the Deployment template the controller reads. The two
halves of one feature disagree; the pod is promised a Secret the controller has
already declined to create; nothing surfaces an error.
internal/clientreg'spackage doc states its purpose is keeping these two sides in lockstep — they agree
on the Secret name and disagree on the input. Any workload deployed as a plain
Deployment without an explicit dedicated SA hits this, silently and permanently.
Minor second finding: those webhook-created SAs have no
ownerReference, sonothing garbage-collects them.
Ambient/HBONE half is still open — unchanged, still needs a cluster with a real
ambient data plane.
Assisted-By: Claude Code
huang195 commentedon Aug 20, 2026
Correcting my comment above on the platform-defect aside — the mTLS findings in it stand, this
is only about the ServiceAccount tangent.
I wrote that "any workload deployed as a plain Deployment without an explicit dedicated SA hits
this, silently and permanently," and filed it as operator#513. That sentence is literally true
but gives the wrong impression of severity, and the issue generalized from a single caller —
mine. Every path that creates a workload for real already sets
serviceAccountName: thebackend's agent manifests (
agents_manifests.py:379,581,723,832), tools(
tools.py:1330,1492),simulation_manifests.py:253,agents_migration.py:487(whose commentsays exactly why), plus the
7x-deploy-*scripts. The only caller that lacked one was myhand-written e2e fixture.
Nothing regressed either: the
defaultrefusal has been in place since the commit thatintroduced that controller (
9637c03, 2026-03-26), andspire.enabledhas defaulted totruesince 2025-11-06.
operator#513 is closed with a retraction. The webhook/controller split is real but latent — a
trap for hand-written manifests, not an active bug. What I'd still call worth fixing there is
unrelated to the SA: client-ID resolution failures surface only as
logger.Infoplus a 30srequeue forever, with no Event or status condition, for every reason they can fail.
No change to the mTLS half or to the ambient/HBONE half, which is still open.
test(e2e): gate inbound validation on the ambient/HBONE path
huang195 commentedon Aug 20, 2026
Ambient / HBONE half verified end-to-end, and now gated
The three remaining boxes were open because no cluster in the loop had a ztunnel,
so the ambient DNAT was structurally unreachable rather than untested. That turned
out to be a config gate, not missing infrastructure:
charts/rossoctl-deps/templates/istio-operand.yamlwraps theIstio,IstioCNIand
ZTunneloperands in{{- if and .Values.components.istio.enabled .Values.openshift }},and
deployments/envs/dev_values*.yamlsetopenshift: false. Kind therefore hasno ambient data plane by construction, which is why the DNAT counter always read 0.
Installed one by hand on Kind (istiod 1.28.0
profile=ambientwithPILOT_ENABLE_AMBIENT=true, istio-cni, ztunnel) and ran a transparent-inboundagent in
team1with a probe inteam2, bothistio.io/dataplane-mode=ambient.Rules as programmed (agent pod netns,
10.244.0.99)Observed
team2AB_INBOUNDREDIRECT:9091RETURN[2:120][0:0][1:60]amb-780-agent.team1:8000(Service)[2:120]unchanged[1:60]+110.244.0.99:8000(direct pod dial)[2:120]unchanged[2:120]+110.244.0.99:9091/healthz[2:120]unchanged[2:120]unchanged[2:120]+1AB_INBOUNDneverfired for one. That is the box, and it is also the hazard this issue named — a
PREROUTING-only implementation would have waved all three through unvalidated.
--mark 0x539 -j RETURNstayed at[6:708]throughout, having taken6 outbound HBONE packets earlier. Live confirmation that
--dst-type LOCALonthe DNAT is load-bearing: ztunnel reuses
0x539for outbound.RETURN's own counter incremented on request 3. Same source, same mesh path,
different port, different rule. Probes do not gate. Pod stayed 2/2, 0 restarts.
Request 1 corroborated at three layers within the same millisecond:
Encoded as a gate
rossoctl/rossoctl#2404 gains
test_transparent_inbound_ambient.py(2 tests; suiteis now 15 passed / 0 skipped locally, up from 13). It asserts the delivery path
as well as the status — from ztunnel's access log — because both paths end in the
same 401, so without that it would silently become a duplicate of
test_direct_pod_dial_is_validatedthe moment ambient stopped being engaged.Negative control, since a test that cannot fail proves nothing. Deleting that
one DNAT rule from the live pod's netns makes the mesh-delivered request return
200 — the app answering it unvalidated — and the module fails naming that
cause, while the health-port test keeps passing. Recreating the pod reprograms the
rule from proxy-init and both pass again.
Rule ordering and packet counters are not asserted in the test: not reachable from
a test pod, and unnecessary — every way the rule can regress (deleted, ordered
after the mark RETURN, matching too narrowly) ends in that same 200.
Deliberately not
kind_only, unlike the rest of that suite, since ambientships on OpenShift only; it self-gates on a ready ztunnel (found by label across
namespaces — the chart uses
istio-ztunnel, a community install defaults toistio-system) plusdataplane-mode=ambienton both namespaces. Consequenceworth flagging: it becomes the first module in that suite to run on OpenShift, so
its first run there may surface pre-existing suite or platform issues rather than
ambient ones.
Caveat on the data plane used
Community Helm charts, with ztunnel in
istio-systemrather than the platform'sistio-ztunnel. The namespace does not enter the iptables tuple under test, andpilot.trustedZtunnelNamespaceonly governs which namespace istiod acceptsztunnel XDS from — but this is a hand-built ambient install, not the sail-operator
operands the platform ships. Confirming on OpenShift, where those operands are
what runs, is what the unmarked test now does automatically.
test(e2e): cover inbound mTLS through the transparent listener
test(e2e): gate inbound validation on the ambient/HBONE path
huang195 commentedon Aug 20, 2026
Closing: both paths are verified, and the e2e encoding merged as rossoctl/rossoctl#2404 (
4c50dcd1).What CI actually ran
From the
Deploy & Testjob on the merged head (Kind):test_hbone_delivered_request_is_validatedtest_health_port_exempt_on_the_hbone_pathtest_strict_rejects_plaintexttest_strict_terminates_tls_on_the_recovered_connectiontest_strict_completes_mtls_and_still_enforcesSo the ambient half is now a live CI gate, which is better than this issue asked for and better than I predicted.
Correction to my earlier comment
I claimed ambient could not run on Kind, because
charts/rossoctl-deps/templates/istio-operand.yamlgates theIstio/IstioCNI/ZTunneloperands on.Values.openshift. That is true of the operand path but wrong as a statement about Kind: the Kind installer installs the community ztunnel chart (ztunnel-1.28.0, helm releaseztunnelinistio-system) and there is already aTestIstioAmbient::test_ztunnel_releasecovering it.team1/team2are genuinely ambient-enrolled there, ztunnel logged the terminated-HBONE line for the agent pod, and the request was denied on that path. The module's docstring and README carry the same wrong claim and need a doc-only fix.The mTLS tests skip in CI
Not a feature failure, and not the code under test. Both mTLS skips — and
test_reverse_proxy_control_bypass_is_reachable, which predates this work — waited ~183s and then took_wait_ready's missing-credentials skip. The pattern: the session-scoped agent gets its per-agent Keycloak client-credentials Secret and its 9 tests pass; the additional deployments (the mTLS strict agent, the reverse-proxy control agent) do not get one inside the fixture timeout. rossoctl/rossoctl#2404 already improved this materially — before it, all 13 tests skipped in CI — but it did not close it.The mTLS assertions themselves are verified: run locally against images built from merged
main, all three cases including a valid SVID completing the handshake and still getting a 401. The evidence is in the comments above. What is missing is a permanent CI gate for them, which is a fixture/credential-timing problem rather than anything about inbound mTLS, so it belongs in its own issue rather than holding this one open.Residual work, tracked separately
NewInboundListener→WrapListenerwith mTLS on. Today a cortex regression fails only rossoctl's e2e, in a different repo.transparent_inbound/README.md.All six boxes are checked and neither path is unexercised any more, so this closes.