[client] Guard against container DNAT bypass of ACL rules in iptables#5697
[client] Guard against container DNAT bypass of ACL rules in iptables#5697
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cdfefba to
3eac55a
Compare
|
|
Thanks... This allowed me to spend my whole evening debugging why I can't access an internal service. |
|
Please open a GitHub issue. There's no point doing that in this PR |



Describe your changes
When container runtimes (Docker, Podman) publish ports, they DNAT traffic in nat PREROUTING, causing it to traverse the FORWARD chain instead of INPUT. If the container runtime starts after NetBird, its ACCEPT rules in filter FORWARD are inserted above NetBird's rules, bypassing ACL port restrictions.
--ctstate DNATto scope the guard to only DNAT'd traffic, leaving regular route-forwarded traffic unaffectedNative nftables is not affected since it uses separate tables with independent chain priorities.
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
No user-facing behavior change. The fix is internal to the iptables firewall manager.
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit
Release Notes