xds: support client-IP authorization on UDP listeners - #9835
Closed
zhaohuabing wants to merge 1 commit into
Closed
Conversation
A UDP listener has no network filter chain, so the network RBAC filter used for TCPRoute authorization cannot be reused. Instead the authorization decision rides along with route selection in the matcher that udp_proxy already uses: a datagram whose source IP matches is routed to the cluster, and one that matches nothing is dropped by udp_proxy and counted as downstream_sess_no_route. Because a denial can only be expressed as the absence of a match, the ordered Allow/Deny rules are compiled into allow-only predicates. A Deny rule never becomes an entry of its own; it subtracts from the Allow rules that follow it and from a permissive default action. An allowlist therefore emits one entry per Allow rule with no on_no_match, and a denylist collapses to a single negated entry. Adds Authorization to ir.UDPRoute. Nothing populates it yet. Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com> Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9835 +/- ##
==========================================
- Coverage 76.36% 76.36% -0.01%
==========================================
Files 261 262 +1
Lines 44537 44600 +63
==========================================
+ Hits 34011 34057 +46
- Misses 8279 8293 +14
- Partials 2247 2250 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
IR and xDS support for client-IP CIDR authorization on UDP listeners, ahead of allowing
SecurityPolicyto targetUDPRoute(#9832). Nothing populatesir.UDPRoute.Authorizationyet — the gatewayapi translator follows in a separate PR.A UDP listener has no network filter chain, so the network RBAC filter used for TCPRoute authorization cannot be reused. The decision instead rides along with route selection in the
matcherthatudp_proxyalready uses: a datagram whose source IP matches routes to the cluster, and one that matches nothing is dropped and counted asdownstream_sess_no_route.Since a denial can only be expressed as the absence of a match, the ordered Allow/Deny rules are compiled into allow-only predicates — a Deny rule never becomes an entry of its own, it subtracts from the Allow rules that follow it and from a permissive default. An allowlist emits one entry per Allow rule with no
on_no_match; a denylist collapses to a single negated entry.Verified the generated config against Envoy directly, not just protobuf validation: all five shapes in the new golden (allowlist, denylist, mixed ordering, deny-all, allow-all) pass
envoy --mode validate, and a local Envoy with an echo backend confirmed the behavior — an in-range source is forwarded, an out-of-range source is dropped, a denylist hit is dropped, and the deny-all encoding (matcher: {}) drops rather than failing the listener.downstream_sess_no_routeincremented in each drop case.