Rootless bridge: preserve source IPs via pesto/pasta#28478
Conversation
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
1 similar comment
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
6fc22c5 to
662445d
Compare
292a7b8 to
9fc6f49
Compare
68bbedb to
f511d44
Compare
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
38607ae to
1e6774b
Compare
e2ae082 to
4a4fbf6
Compare
|
PTAL @Luap99 @containers/podman-maintainers I am not sure about the packit failure. cc @sbrivio-rh |
To me the Packit failure (https://dashboard.packit.dev/jobs/testing-farm/1544417 / https://artifacts.dev.testing-farm.io/177feab7-7054-4ff9-9cf3-2f9f3f9ac985/) looks like a failure of a relevant test. From the second link: ...or am I missing something obvious? Should I try to figure that out / help with debugging? In general, let me know if / how I can help here. |
It gets a |
Oops, so, yes, I missed something obvious. :) I introduced a new SELinux policy for pesto which explicitly allows |
Sorry for the delay. I actually couldn't spot anything wrong in the new profiles, and I'm fairly sure this is a SELinux issue (maybe a relabeling missing as the packages are installed on the CI system), but I looked at all the possible logs and I couldn't find audit logs (/var/log/audit/audit.log) or SELinux warnings anywhere. Would you have a way to check / extract / find them? I could just spot an out-of-memory message in the kernel log but I don't think it has anything to do with this issue. |
we will need to port containers/buildah#6850 here I think for the tmt jobs to capture these logs |
I created PR for that: #28737 |
|
@Luap99 @sbrivio-rh There seems to be an issue with SELinux. Based on these logs: https://artifacts.dev.testing-farm.io/2e1dcd26-d5e6-484d-854a-233494c648e2/work-local-rootlessa_2kq5lh/plans/system/local-rootless/data/logs/ cc @lsm5 |
Thanks! Probably my stuff then, I'll keep you posted. Do you need a workaround meanwhile (something subtler than |
Thanks, taking care of that. I am not sure if I need a workaround. |
Fix posted: https://archives.passt.top/passt-dev/20260519173634.3551297-1-sbrivio@redhat.com/ I plan to make a new release rather soon including that. There are already a couple of regressions we just fixed (not touching Podman) or we might be able to fix soon, so a new release in a couple of days makes sense anyway. |
| replace go.podman.io/common => github.com/containers/container-libs/common v0.67.2-0.20260518190429-32704ef88648 | ||
|
|
||
| replace go.podman.io/image/v5 => github.com/containers/container-libs/image/v5 v5.0.0-20260518190429-32704ef88648 | ||
|
|
||
| replace go.podman.io/storage => github.com/containers/container-libs/storage v0.0.0-20260518190429-32704ef88648 |
There was a problem hiding this comment.
Do not use replace, just go get go.podman.io/storage@main && go get go.podman.io/image/v5@main && go get go.podman.io/common@main && make vendor
also need to cleanup the commit description of the vendor commit
| # pesto binary (ships with passt) is needed for rootless_port_forwarder="pasta" | ||
| Recommends: passt >= 0^20260507.g1afd4ed |
There was a problem hiding this comment.
I think it would be best to set the dep where we require passt today https://github.com/containers/container-libs/blob/7e9ee2072844dda92ca80f5a4031f8358c5df2b7/common/rpm/containers-common.spec#L71
There was a problem hiding this comment.
Used command: go get go.podman.io/storage@main && go get go.podman.io/image/v5@main && go get go.podman.io/common@main && make vendor Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Add rootless_port_forwarder="pasta" option that uses pesto to update pasta's forwarding table via UNIX socket, preserving source IPs that rootlessport's userspace proxy masks. HostIP is stripped from port mappings in the netavark wrapper when pasta forwarding is active because pesto handles host-side binding while pasta's splice changes the destination IP that netavark DNAT expects. Pesto binds both 0.0.0.0 and [::] for dual-stack support. Fixes: https://redhat.atlassian.net/browse/RUN-2214 Fixes: containers#8193 Fixes: https://redhat.atlassian.net/browse/RUN-3587 Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
|
LGTM |
Require passta version:
This requires the
pestobinary, available sincepasst-0^20260507.g1afd4ed.Local Passt Setup + testing
TODO:
Add
rootless_port_forwarder="pasta"option incontainers.confthat switches rootless bridge port forwarding fromrootlessporttopasta, preserving source IPs. The default remainsrootlessport.Problem
When running rootless containers on a bridge network (
podman run -p 8080:80 --network mynet), the oldrootlessportuserspace TCP/UDP proxy destroyed source IP information. Every connection appeared to come from127.0.0.1inside the container, regardless of the actual client IP.Solution
Pesto is a client tool for
passtathat dynamically updates port forwarding rules via a UNIX domain socket. Instead of proxying traffic in userspace (which loses source IPs), pesto configurespastato forward at the kernel level using splice (localhost) or TAP (external traffic), preserving the original source IP.How it works
pastainstance runs in the rootless network namespace with a control socket (-c pasta.sock)pesto --addregisters ports in pasta's forwarding tablepesto --deleteremoves the container's ports, then netavark tears down bridge/DNATKey implementation details:
convertNetOpts): whenrootless_port_forwarder="pasta"is active, HostIP is stripped from port mappings before passing to netavark. Pesto handles host-side address binding; netavark's DNAT rules inside the rootless netns must not restrict on destination address since pasta's splice delivers traffic with a different destination than the user-specified HostIP0.0.0.0and[::]so IPv6 networks work out of the boxrootless_port_forwarderin[network]section ofcontainers.confselects betweenrootlessport(default) andpastaCurrent limitations
-p 127.0.0.1:8080:80and-p 127.0.0.2:8080:80on separate containers) does not work in pasta mode because HostIP stripping causes conflicting DNAT rules. This requires destination mapping support in pesto.Fixes: https://redhat.atlassian.net/browse/RUN-2214
Fixes: #8193
Fixes: https://redhat.atlassian.net/browse/RUN-3587
Depends on:
passt >= passt-0^20260507.g1afd4edDepends on: containers/container-libs#755
Depends on: #27828
Depends on: #28451
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?