Skip to content

xds: support client-IP authorization on UDP listeners - #9835

Closed
zhaohuabing wants to merge 1 commit into
envoyproxy:mainfrom
zhaohuabing:udp-authz-xds
Closed

xds: support client-IP authorization on UDP listeners#9835
zhaohuabing wants to merge 1 commit into
envoyproxy:mainfrom
zhaohuabing:udp-authz-xds

Conversation

@zhaohuabing

Copy link
Copy Markdown
Member

IR and xDS support for client-IP CIDR authorization on UDP listeners, ahead of allowing SecurityPolicy to target UDPRoute (#9832). Nothing populates ir.UDPRoute.Authorization yet — 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 matcher that udp_proxy already uses: a datagram whose source IP matches routes to the cluster, and one that matches nothing is dropped and counted as downstream_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_route incremented in each drop case.

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>
@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit b2db4c4
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a8d5ed28870c00008ed364d
😎 Deploy Preview https://deploy-preview-9835--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.52055% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.36%. Comparing base (61f6772) to head (b2db4c4).

Files with missing lines Patch % Lines
internal/xds/translator/authorization_udp.go 96.66% 1 Missing and 1 partial ⚠️
internal/xds/translator/listener.go 84.61% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant