-
Notifications
You must be signed in to change notification settings - Fork 3.4k
ci,wireguard: introduce pod to pod v2 connectivity tests for Wireguard #37533
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
Conversation
a4fd55e
to
dffa5fd
Compare
dffa5fd
to
ff674fe
Compare
ff674fe
to
7aeea30
Compare
/ci-e2e-upgrade |
7aeea30
to
06d9908
Compare
06d9908
to
8709fc2
Compare
/test |
/ci-e2e-upgrade |
/test |
Cluster mesh conformance tests seem to be failing legitimately.
A bit odd, we resolve the hostNS container for the client like this:
In sysdumps I see the pod:
Is cilium-cli getting confused about what cluster to access the pod on? 🤔 edit: @giorio94 was quick in finding this issue: https://github.com/cilium/cilium/blob/ldelossa%2Fencrypted-overlay-connectivity-tests/cilium-cli/connectivity/tests/encryption_v2.go#L128 |
8709fc2
to
6c12fd2
Compare
/test |
6c12fd2
to
657bfba
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for my codeowners
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Louis, great work, thanks. As also discussed, the tests looks conceptually good for me, and the TCPDUMP filters seems to work smoothly also from local testing.
I just left a couple of nits and minor comments, let me know if anything's not clear 😃
b20e6c5
to
a5c0915
Compare
This commit introduces a new connectivity test for Wireguard pod-to-pod traffic. The test is ran on post v1.18 clusters only. These connectivity tests act as leak detection tests. encrypted overlay traffic performs encryption just before the packet is going to leave the host. Therefore these tests ensure we do not see client->server traffic (or its return traffic), unencrypted at the ultimate egress device before the traffic leaves the host toward the destination. The test works as follows: - Find a client pod and a server pod, each on separate nodes. - Find the client side's egress device toward the server. - Find the server side's egress device toward the client (return traffic). - Create the appropriate TCPDump filter for client->server traffic - Create the appropriate TCPDump filter for server->client return traffic - Start TCPDump sniffers on both nodes using the resolved TCPDump filters and egress devices. - Ensure that we never see plain-text client->server traffic on the client side and we never see plain-text server->client return traffic on the server side. To expand on the above - Resolving the correct TCPDump filters involves understanding what routing mode we are. When tunnel mode is use the test will create TCPDump filters which seek into the tunnel packets to find plain-text inner IP headers. - We filter for client->server traffic on the client node is encrypted and server->client return traffic on the server node is as well. We do not check if server->client return traffic on the CLIENT node is encrypted. This is because XFRM will recirculate decrypted packets on the interface they arrived on. If we filter for the return traffic we'd get false positives since TCPDump will confuse the decrypted traffic for a leak. This is why we test the return traffic is encrypted, server side. While the initial introduction to these tests target wireguard, we keep this invariant to easily support IPsec as well. - These tests also run when encryption is disabled on the cluster, switching the TCPDump instance to report an error if NO packets are detected. This is a sanity check ensuring the TCPDump filters would in-fact catch leaked traffic when encryption is enabled. There is more subtlety to this test that are drawn attention to by the comments and it is useful to read through these. This test will also be used for IPsec pod-to-pod traffic once VinE is properly implemented, unifying the testing approach for both Wireguard and IPsec. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
a5c0915
to
26bd50d
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments 💯
ci breakage: https://github.com/cilium/cilium/actions/runs/13320057239 Fixes: #37533 Signed-off-by: gray <gray.liang@isovalent.com>
ci breakage: https://github.com/cilium/cilium/actions/runs/13320057239 Fixes: #37533 Signed-off-by: gray <gray.liang@isovalent.com>
ci breakage: https://github.com/cilium/cilium/actions/runs/13320057239 Fixes: #37533 Signed-off-by: gray <gray.liang@isovalent.com>
ci breakage: https://github.com/cilium/cilium/actions/runs/13320057239 Fixes: #37533 Signed-off-by: gray <gray.liang@isovalent.com>
…aining Pod-to-pod-encryption-v2 was introduced by #37533. One the major changes of v2 is enabling sanity checks even for non-encryption cluster. This caused troubles because v2 tests didn't take cni-chaining mode, which is not compatible with encryption, into consideration. This patch disabled v2 test on aws-cni chaining to avoid ci breakage. Fixed: #37682 Signed-off-by: gray <gray.liang@isovalent.com>
…aining Pod-to-pod-encryption-v2 was introduced by #37533. One of the major v2 changes is enabling sanity checks even for non-encryption cluster. This caused troubles because v2 tests didn't take cni-chaining mode, which is not compatible with encryption, into consideration. This patch disabled v2 test on aws-cni chaining to avoid ci breakage. Fixed: #37682 Signed-off-by: gray <gray.liang@isovalent.com>
ci,wireguard: introduce pod to pod v2 connectivity tests for Wireguard
This commit introduces a new connectivity test for Wireguard pod-to-pod
traffic.
The test is ran on post v1.18 clusters only.
These connectivity tests act as leak detection tests.
encrypted overlay traffic performs encryption just before the packet is going to
leave the host.
Therefore these tests ensure we do not see client->server traffic (or
its return traffic), unencrypted at the ultimate egress device before the
traffic leaves the host toward the destination.
The test works as follows:
traffic).
traffic
filters and egress devices.
client side and we never see plain-text server->client return traffic
on the server side.
To expand on the above
routing mode we are. When tunnel mode is use the test will create
TCPDump filters which seek into the tunnel packets to find plain-text
inner IP headers.
server->client return traffic on the server node is as well. We do not
check if server->client return traffic on the CLIENT node is
encrypted. This is because XFRM will recirculate decrypted packets on
the interface they arrived on. If we filter for the return traffic
we'd get false positives since TCPDump will confuse the decrypted
traffic for a leak. This is why we test the return traffic is
encrypted, server side. While the initial introduction to these tests
target wireguard, we keep this invariant to easily support IPsec as
well.
switching the TCPDump instance to report an error if NO packets are
detected. This is a sanity check ensuring the TCPDump filters would
in-fact catch leaked traffic when encryption is enabled.
There is more subtlety to this test that are drawn attention to by the
comments and it is useful to read through these.
This test will also be used for IPsec pod-to-pod traffic once VinE is
properly implemented, unifying the testing approach for both Wireguard
and IPsec.