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

datapath: Cover subnet encryption in XFRM leak test #27212

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

pchaigno
Copy link
Member

@pchaigno pchaigno commented Aug 2, 2023

This commit complements 27a8fb1 ("datapath: Integration test for XFRM leaks on node churn"). In that previous commit, subnet encryption (the XFRM config used for ENI and Azure IPAM modes) was not covered. This commit covers it.

There are two pre-conditions to subnet encryption: nodes must have a list of pod subnets (cf. IPv{4,6}PodSubnets) and the encryption interface must exist and have an IP address. The test configures these two preconditions before running the usual checks for XFRM config leaks.

This commit complements 27a8fb1 ("datapath: Integration test for
XFRM leaks on node churn"). In that previous commit, subnet encryption
(the XFRM config used for ENI and Azure IPAM modes) was not covered.
This commit covers it.

There are two pre-conditions to subnet encryption: nodes must have a
list of pod subnets (cf. IPv{4,6}PodSubnets) and the encryption
interface must exist and have an IP address. The test configures these
two preconditions before running the usual checks for XFRM config leaks.

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
@pchaigno pchaigno added area/CI-improvement Topic or proposal to improve the Continuous Integration workflow area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. release-note/ci This PR makes changes to the CI. integration/cloud Related to integration with cloud environments such as AKS, EKS, GKE, etc. sig/ipam IP address management, including cloud IPAM labels Aug 2, 2023
@pchaigno pchaigno requested a review from a team as a code owner August 2, 2023 10:30
@pchaigno pchaigno linked an issue Aug 2, 2023 that may be closed by this pull request
Copy link
Member

@jschwinger233 jschwinger233 left a comment

Choose a reason for hiding this comment

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

I have to confess that I didn't know encryption interface before, but my initial understanding is:

  1. it's used for non-tunneling mode, replacing the cilium_vxlan.
  2. it's used for EKS because of its special IPAM mode: node IPs are within the pod CIDRs, so we don't need tunnels, but consequently we need to specify encryption interface.

In the test, encryption iface's address is 1.1.1.1, but pod subnet is 4.4.0.0/16. If my understanding is correct, maybe we should assign a IP address within the pod CIDR to encrption interface?

@pchaigno
Copy link
Member Author

pchaigno commented Aug 3, 2023

I have to confess that I didn't know encryption interface before, but my initial understanding is:

  1. it's used for non-tunneling mode, replacing the cilium_vxlan.
  2. it's used for EKS because of its special IPAM mode: node IPs are within the pod CIDRs, so we don't need tunnels, but consequently we need to specify encryption interface.

It's actually a bit simpler: it's just the native device from which encrypted traffic will leave. Typically some eth0 interface. On EKS and AKS, if option.Config.UseCiliumInternalIPForIPsec=false (default), we then use the IP address of that interface as the outer IP address for IPsec encapsulation.

In the test, encryption iface's address is 1.1.1.1, but pod subnet is 4.4.0.0/16. If my understanding is correct, maybe we should assign a IP address within the pod CIDR to encrption interface?

It is therefore expected that the IP address of that eth0 interface isn't part of the pod subnet.

@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 Aug 3, 2023
@pchaigno pchaigno merged commit 9207b78 into cilium:main Aug 3, 2023
60 checks passed
@pchaigno pchaigno deleted the test-cover-subnet-encryption branch August 3, 2023 13:47
@maintainer-s-little-helper maintainer-s-little-helper bot removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 3, 2023
@brb
Copy link
Member

brb commented Aug 4, 2023

@pchaigno I am a bit puzzled about this PR - did you intend to add a new test case, or to replace the existing one to cover the subnet encryption? AFAICS, the latter was done.

@pchaigno pchaigno added needs-backport/1.12 needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Dec 26, 2023
@pippolo84 pippolo84 mentioned this pull request Jan 2, 2024
8 tasks
@pippolo84 pippolo84 added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Jan 2, 2024
@pippolo84 pippolo84 mentioned this pull request Jan 2, 2024
5 tasks
@pippolo84 pippolo84 added backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. and removed needs-backport/1.13 labels Jan 2, 2024
@pippolo84 pippolo84 mentioned this pull request Jan 2, 2024
5 tasks
@github-actions github-actions bot added backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.12 The backport for Cilium 1.12.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. and removed backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. backport-pending/1.12 backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. labels Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI-improvement Topic or proposal to improve the Continuous Integration workflow area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. backport-done/1.12 The backport for Cilium 1.12.x for this PR is done. 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. integration/cloud Related to integration with cloud environments such as AKS, EKS, GKE, etc. release-note/ci This PR makes changes to the CI. sig/ipam IP address management, including cloud IPAM
Projects
No open projects
Status: Released
Status: Released
Status: Released
Development

Successfully merging this pull request may close these issues.

Unit tests for XFRM config removal
4 participants