Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jschwinger233
Copy link
Member

@jschwinger233 jschwinger233 commented May 23, 2024

This PR fixes unencrypted traffic among nodes when IPsec is used with L7 egress proxy.

This PR supersedes #31955 that didn't take cilium/proxy#742 into consideration.

(The last three patches are temporarily added to run leak detection in CI, they'll be dropped after approval. Leak detection will be added separately soon.)

Fixes: #31984

Fixes unencrypted traffic among nodes when IPsec is used with L7 egress proxy.

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 23, 2024
@jschwinger233
Copy link
Member Author

/ci-ipsec-upgrade

@jschwinger233
Copy link
Member Author

Maybe even the first 2 patches are also not needed? Will try later.

@jschwinger233
Copy link
Member Author

Rebase the latest main to include #32331, drop the f817fc1 to see if it's still needed.

No we still need that: https://github.com/cilium/cilium/actions/runs/9205906830/job/25322612955

I think this is because adding 0xb00 lookup 2005 still makes extra netfilter traversal, no matter what src IP proxy uses. f817fc1 is needed due to that additional netfilter traversal.

But I don't understand how #32331 passed ci-ipsec-e2e on kpr=true + bpf.masq=true. My understanding is, since proxy is always transparent, we always need netfilter to do masquerade for go-to-world traffic.

@jschwinger233 jschwinger233 force-pushed the pr/gray/main/egress-proxy-ipsec-fix3 branch 2 times, most recently from a0f49ac to aceca82 Compare May 24, 2024 02:55
@jschwinger233 jschwinger233 force-pushed the pr/gray/main/egress-proxy-ipsec-fix3 branch from aceca82 to c4d9fe5 Compare May 27, 2024 04:50
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label May 28, 2024
@jschwinger233 jschwinger233 force-pushed the pr/gray/main/egress-proxy-ipsec-fix3 branch from 71facda to 7807510 Compare May 28, 2024 09:18
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label May 28, 2024
@cilium cilium deleted a comment from maintainer-s-little-helper bot May 28, 2024
@jschwinger233 jschwinger233 force-pushed the pr/gray/main/egress-proxy-ipsec-fix3 branch 8 times, most recently from 3766731 to 6cb00de Compare May 29, 2024 07:44
@jschwinger233 jschwinger233 added area/proxy Impacts proxy components, including DNS, Kafka, Envoy and/or XDS servers. release-note/bug This PR fixes an issue in a previous release of Cilium. area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. feature/ipsec Relates to Cilium's IPsec feature labels May 30, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels May 30, 2024
@jschwinger233 jschwinger233 added area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. needs-backport/1.13 labels May 30, 2024
julianwiedmann added a commit to julianwiedmann/cilium that referenced this pull request Jun 5, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jun 5, 2024
@jschwinger233 jschwinger233 added the backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. label Jun 7, 2024
@julianwiedmann julianwiedmann added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. backport-pending/1.13 and removed needs-backport/1.14 labels Jun 7, 2024
julianwiedmann added a commit to julianwiedmann/cilium that referenced this pull request Jun 7, 2024
[ upstream commit 5f18d88 ]

This was addressed by cilium#32683.

Signed-off-by: Julian Wiedmann <[email protected]>
julianwiedmann added a commit to julianwiedmann/cilium that referenced this pull request Jun 7, 2024
[ upstream commit 5f18d88 ]

This was addressed by cilium#32683.

Signed-off-by: Julian Wiedmann <[email protected]>
julianwiedmann added a commit that referenced this pull request Jun 7, 2024
[ upstream commit 5f18d88 ]

This was addressed by #32683.

Signed-off-by: Julian Wiedmann <[email protected]>
julianwiedmann added a commit that referenced this pull request Jun 7, 2024
[ upstream commit 5f18d88 ]

This was addressed by #32683.

Signed-off-by: Julian Wiedmann <[email protected]>
jschwinger233 pushed a commit that referenced this pull request Jun 10, 2024
[ upstream commit: 5f18d88 ]

This was addressed by #32683.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: gray <[email protected]>
dylandreimerink pushed a commit that referenced this pull request Jun 11, 2024
[ upstream commit: 5f18d88 ]

This was addressed by #32683.

Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: gray <[email protected]>
@github-actions github-actions bot added backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. and removed backport-pending/1.13 labels Jun 11, 2024
jrajahalme added a commit to jrajahalme/cilium that referenced this pull request Jul 31, 2024
Allow Envoy listener chaining via the loopback device by not routing transparent proxy traffic
destined to the loopback device to the cilium_host device.

Fixes: cilium#32683, cilium/proxy#742

Signed-off-by: Jarno Rajahalme <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Aug 8, 2024
Allow Envoy listener chaining via the loopback device by not routing transparent proxy traffic
destined to the loopback device to the cilium_host device.

Fixes: #32683, cilium/proxy#742

Signed-off-by: Jarno Rajahalme <[email protected]>
ti-mo pushed a commit to ti-mo/cilium that referenced this pull request Aug 8, 2024
Allow Envoy listener chaining via the loopback device by not routing transparent proxy traffic
destined to the loopback device to the cilium_host device.

Fixes: cilium#32683, cilium/proxy#742

Signed-off-by: Jarno Rajahalme <[email protected]>
jschwinger233 pushed a commit that referenced this pull request Aug 12, 2024
[ upstream commit 4c9cf37 ]

Allow Envoy listener chaining via the loopback device by not routing transparent proxy traffic
destined to the loopback device to the cilium_host device.

Fixes: #32683, cilium/proxy#742

Signed-off-by: Jarno Rajahalme <[email protected]>
Signed-off-by: gray <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Aug 13, 2024
[ upstream commit 4c9cf37 ]

Allow Envoy listener chaining via the loopback device by not routing transparent proxy traffic
destined to the loopback device to the cilium_host device.

Fixes: #32683, cilium/proxy#742

Signed-off-by: Jarno Rajahalme <[email protected]>
Signed-off-by: gray <[email protected]>
Comment on lines +861 to +865

if (from_proxy &&
(!info || !identity_is_cluster(info->sec_identity)))
ctx->mark = MARK_MAGIC_PROXY_TO_WORLD;
#endif /* ENABLE_IPSEC && !TUNNEL_MODE */
Copy link
Member

Choose a reason for hiding this comment

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

@jschwinger233 coming back to this - I only now realized that #36329 also applies here, and the mark potentially gets scrubbed on the transfer between cilium_host and cilium_net. Which is why we're still setting use_meta=true in the set_ipsec_encrypt() call above.

So I suppose this mark works well as mechanism to skip the transparent-socket match in iptables - but we can't really trust yet that it also survives until cilium_net (or a subsequent to-netdev) would see it.

Copy link
Member Author

Choose a reason for hiding this comment

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

😨

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

Labels

area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. area/proxy Impacts proxy components, including DNS, Kafka, Envoy and/or XDS servers. backport/author The backport will be carried out by the author of the PR. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. feature/ipsec Relates to Cilium's IPsec feature release-note/bug This PR fixes an issue in a previous release of Cilium.

Projects

No open projects
Status: Backport done to v1.14
Status: Backport done to v1.15
Status: Released

Development

Successfully merging this pull request may close these issues.

Unencrypted traffic among nodes when IPsec is used with L7 egress proxy

5 participants