Skip to content

api: add sourceCIDRs field in SecurityPolicy for L4 IP filtering#8009

Merged
rudrakhp merged 4 commits intoenvoyproxy:mainfrom
zhaohuabing:api-l4-ip-filtering
Jan 25, 2026
Merged

api: add sourceCIDRs field in SecurityPolicy for L4 IP filtering#8009
rudrakhp merged 4 commits intoenvoyproxy:mainfrom
zhaohuabing:api-l4-ip-filtering

Conversation

@zhaohuabing
Copy link
Copy Markdown
Member

This PR extends the SecurityPolicy API to support L4 IP filtering by adding a new SourceCIDRs field to the Principal struct.

Currently, IP filtering in SecurityPolicy (using clientCIDRs) relies on L7 IP detection (e.g., X-Forwarded-For), which processes requests through the L7 filter chain before returning an RBAC error. As discussed in #7825, it is preferable to have a mechanism to drop connections early at the network level based on the direct peer IP.

By adding SourceCIDRs, we provide the API foundation to:

  • Filter based on the direct downstream IP address (L4 peer IP), bypassing L7 processing.
  • Enable future implementation of network RBAC filters to "drop" packets instead of returning L7 errors.

@zhaohuabing zhaohuabing requested a review from a team as a code owner January 21, 2026 05:10
@netlify
Copy link
Copy Markdown

netlify bot commented Jan 21, 2026

Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit fd24bec
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6975e0e9197c960008cb37ff

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
arkodg
arkodg previously approved these changes Jan 22, 2026
Copy link
Copy Markdown
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

zirain
zirain previously approved these changes Jan 22, 2026
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing zhaohuabing dismissed stale reviews from zirain and arkodg via 08709bd January 22, 2026 09:51
@zhaohuabing zhaohuabing requested review from arkodg and zirain January 22, 2026 09:51
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.67%. Comparing base (ced5d75) to head (fd24bec).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8009      +/-   ##
==========================================
- Coverage   73.69%   73.67%   -0.02%     
==========================================
  Files         237      237              
  Lines       35653    35653              
==========================================
- Hits        26274    26269       -5     
- Misses       7520     7524       +4     
- Partials     1859     1860       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@rudrakhp rudrakhp merged commit a97d57a into envoyproxy:main Jan 25, 2026
47 of 49 checks passed
SadmiB pushed a commit to SadmiB/gateway that referenced this pull request Jan 30, 2026
…oyproxy#8009)

* API for L4 IP filtering

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

* fix test

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

---------

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
Signed-off-by: Sadmi Bouhafs <sadmibouhafs@gmail.com>
zhaohuabing added a commit to zhaohuabing/gateway that referenced this pull request Mar 10, 2026
…ing (envoyproxy#8009)"

This reverts commit a97d57a.

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
zhaohuabing added a commit that referenced this pull request Mar 11, 2026
…ing" (#8471)

Revert "api: add sourceCIDRs field in SecurityPolicy for L4 IP filtering (#8009)"

This reverts commit a97d57a.

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
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.

5 participants