Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.15: WG L7 #31266

Merged
merged 3 commits into from Mar 12, 2024
Merged

v1.15: WG L7 #31266

merged 3 commits into from Mar 12, 2024

Conversation

brb
Copy link
Member

@brb brb commented Mar 9, 2024

@brb brb added kind/backports This PR provides functionality previously merged into master. backport/1.15 This PR represents a backport for Cilium 1.15.x of a PR that was merged to main. labels Mar 9, 2024
@brb
Copy link
Member Author

brb commented Mar 9, 2024

/test-backport-1.15

2 similar comments
@brb
Copy link
Member Author

brb commented Mar 10, 2024

/test-backport-1.15

@ferozsalam
Copy link
Contributor

/test-backport-1.15

@brb
Copy link
Member Author

brb commented Mar 11, 2024

/test-backport-1.15

@brb
Copy link
Member Author

brb commented Mar 11, 2024

/test-backport-1.15

@thorn3r thorn3r added the release-blocker/1.15 This issue will prevent the release of the next version of Cilium. label Mar 11, 2024
@brb
Copy link
Member Author

brb commented Mar 11, 2024

/test-backport-1.15

1 similar comment
@brb
Copy link
Member Author

brb commented Mar 12, 2024

/test-backport-1.15

giorio94 and others added 2 commits March 12, 2024 12:57
[ upstream commit 1eb12e0 ]

Currently, we add the remote NodeInternalIPs to the list of allowed IPs
associated with a given WireGuard peer only in certain circumstances,
and more specifically when either tunneling or node to node encryption
are enabled. However, this logic doesn't practically buy us anything
in terms of additional security, but causes potential traffic disruption
in case users want to enable/disable node2node encryption in a running
cluster. Hence, let's just get rid of it, and unconditionally add
NodeInternalIPs to the list of allowed IPs.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
[ upstream commit 26f8349 ]

Marco reported that the following L7 proxy traffic is leaked (bypasses
the WireGuard encryption):

    1. WG: tunnel, L7 egress policy: forward traffic is leaked
    2. WG: tunnel, DNS: all DNS traffic is leaked
    3. WG: native routing, DNS: all DNS traffic is leaked

This was reported before the introduction of the --wireguard-encapsulate
[1].

The tunneling leak cases are obvious. The L7 proxy traffic got
encapsulated by the Cilium's tunneling device. This made it to bypass
the redirection to the Cilium's WireGuard device. However, [1] fixed
this behavior. For Cilium v1.15 (upcoming) nothing needs to be
configured. Meanwhile, for v1.14.4 users need to set
--wireguard-encapsulate=true.

The native routing case is more tricky. The L7 proxy taffic got a src IP
of a host instead of a client pod. So, the redirection was bypassed.
To fix this, we extended the redirection check to identify L7 proxy
traffic.

[1]: #28917

Reported-by: Marco Iorio <marco.iorio@isovalent.com>
Signed-off-by: Martynas Pumputis <m@lambda.lt>
[ upstream commit 96e01ad ]

Use marks set by the proxy instead of assuming that each pkt from
HOST_ID w/o MARK_MAGIC_HOST belongs to the proxy.

In addition, in the tunneling mode the mark might get reset before
entering wg_maybe_redirect_to_encrypt(), as the proxy packets are
instead routed to from_host@cilium_host. The latter calls
inherit_identity_from_host() which resets the mark. In this case, rely
on the TC index.

Suggested-by: Gray Lian <gray.liang@isovalent.com>
Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb
Copy link
Member Author

brb commented Mar 12, 2024

/ci-e2e

@brb
Copy link
Member Author

brb commented Mar 12, 2024

/test-backport-1.15

@brb brb marked this pull request as ready for review March 12, 2024 13:53
@brb brb requested a review from a team as a code owner March 12, 2024 13:53
@jrajahalme jrajahalme merged commit 1324446 into v1.15 Mar 12, 2024
226 checks passed
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 12, 2024
@jrajahalme jrajahalme deleted the pr/brb/wg-l7-v1.15 branch March 12, 2024 17:12
This was referenced Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.15 This PR represents a backport for Cilium 1.15.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-blocker/1.15 This issue will prevent the release of the next version of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants