Repository navigation
Commit 0148b41
committed
fix(network): order the CONNECT TLS-unavailable refusal after SSRF
Addresses the gator re-check on #2162.
Ordering: the pre-200 fail-closed refusal ran before SSRF/allowed_ips
validation, so during CA-init failure an internal-address CONNECT got a
503 tls_termination_unavailable instead of the normal 403 ssrf_denied,
weakening operator visibility in degraded state. The SSRF branches now
return validated addresses; the refusal runs after that validation (an
internal address has already been denied with 403) but still before the
upstream connect and before 200 Connection Established. effective_tls_skip
is still resolved up front since the refusal consumes it.
Tests: add connection-level regressions through the real
handle_tcp_connection, driving a CONNECT from a child /bin/bash copy so
the /proc process-identity binding resolves it against a permissive
policy (the hot-swap test's identity pattern). They assert the first
bytes are HTTP/1.1 503 for a terminating route with no TLS state, a 403
(not 503) for an internal address, and no refusal for a tls: skip route.
These are gated to Linux at runtime (evaluate_opa_tcp needs /proc); a
companion test verifies the OPA policy shape (glob allow, tls mode) on
every platform so the precondition is locked where /proc is unavailable.
rest.rs: tighten the fail-closed relay test to assert the forwarded
buffer is_empty() rather than merely lacking the placeholder/secret.
Signed-off-by: Tony Luo <[email protected]>1 parent e736ee9 commit 0148b41
2 files changed
Lines changed: 330 additions & 67 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4909 | 4909 | | |
4910 | 4910 | | |
4911 | 4911 | | |
4912 | | - | |
4913 | | - | |
4914 | | - | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
| 4915 | + | |
4915 | 4916 | | |
4916 | 4917 | | |
4917 | 4918 | | |
4918 | 4919 | | |
4919 | 4920 | | |
4920 | 4921 | | |
4921 | | - | |
4922 | 4922 | | |
4923 | | - | |
4924 | | - | |
4925 | | - | |
4926 | | - | |
4927 | | - | |
4928 | | - | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
4929 | 4926 | | |
4930 | 4927 | | |
4931 | 4928 | | |
| |||
0 commit comments