Skip to content

allow published ports to be accessed by isolated networks - #1483

Merged
mheon merged 1 commit into
containers:mainfrom
Luap99:isolate-port
Jul 31, 2026
Merged

mheon merged 1 commit into
containers:mainfrom
Luap99:isolate-port

Conversation

@Luap99

@Luap99 Luap99 commented Jul 30, 2026

Copy link
Copy Markdown
Member

Currently the NETAVARK-ISOLATION-1 in FORWARDING drops all traffic from bridge A to B, however when bridge A reaches a port on the host that gets than forwarded to bridge B that also gets dropped. Isolate should only prevent direct connections. If the port is published on the host we should still allow that so services can be reached.

The main issue is that we need a way to accept only that traffic before it reaches the isolation chain. To do so we add a custom mark to the conntrack entry in the dnat hit. Knowing that mark we can then accept the traffic for these conntrack connections in forwarding before jumping into the isolation chains. So anything not going through the dnat rule will not be accepted.

Fixes: #709

@Luap99

Luap99 commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

/packit build

Comment thread src/firewall/nft.rs Resolved
@mheon

mheon commented Jul 30, 2026

Copy link
Copy Markdown
Member

LGTM

@Luap99
Luap99 force-pushed the isolate-port branch 2 times, most recently from 45824db to 20acfb2 Compare July 31, 2026 10:19
Currently the NETAVARK-ISOLATION-1 in FORWARDING drops all traffic from
bridge A to B, however when bridge A reaches a port on the host that
gets than forwarded to bridge B that also gets dropped. Isolate should
only prevent direct connections. If the port is published on the host we
should still allow that so services can be reached.

The main issue is that we need a way to accept only that traffic before
it reaches the isolation chain. To do so we add a custom mark to the
conntrack entry in the dnat hit. Knowing that mark we can then accept
the traffic for these conntrack connections in forwarding before jumping
into the isolation chains. So anything not going through the dnat rule
will not be accepted.

Fixes: containers#709

Signed-off-by: Paul Holzinger <[email protected]>
@Luap99
Luap99 force-pushed the isolate-port branch 5 times, most recently from 64f6718 to 4aecb51 Compare July 31, 2026 15:34
@Luap99

Luap99 commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

so I give up trying to enable sctp tests here as it is not directly related and turns out to be more than a simple package install #1484

I dropped the second commit, this should be good for merge I believe once CI passes.

@mheon
mheon merged commit a164cea into containers:main Jul 31, 2026
29 checks passed
@Luap99
Luap99 deleted the isolate-port branch July 31, 2026 16:36
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.

Bridge network isolation blocks access to other containers published ports

2 participants