libnetwork/d/overlay: support encryption on any port#45636
Merged
corhere merged 1 commit intomoby:masterfrom May 26, 2023
Merged
libnetwork/d/overlay: support encryption on any port#45636corhere merged 1 commit intomoby:masterfrom
corhere merged 1 commit intomoby:masterfrom
Conversation
While the VXLAN interface and the iptables rules to mark outgoing VXLAN packets for encryption are configured to use the Swarm data path port, the XFRM policies for actually applying the encryption are hardcoded to match packets with destination port 4789/udp. Consequently, encrypted overlay networks do not pass traffic when the Swarm is configured with any other data path port: encryption is not applied to the outgoing VXLAN packets and the destination host drops the received cleartext packets. Use the configured data path port instead of hardcoding port 4789 in the XFRM policies. Signed-off-by: Cory Snider <csnider@mirantis.com>
neersighted
approved these changes
May 26, 2023
Contributor
Author
|
The CI failure is unrelated. It's a windows-2022+c8d integration test, and we don't support encrypted overlay networks on Windows. |
This was referenced May 26, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
While the VXLAN interface and the iptables rules to mark outgoing VXLAN packets for encryption are configured to use the Swarm data path port, the XFRM policies for actually applying the encryption are hardcoded to match packets with destination port 4789/udp. Consequently, encrypted overlay networks do not pass traffic when the Swarm is configured with any other data path port: encryption is not applied to the outgoing VXLAN packets and the destination host drops the received cleartext packets. Use the configured data path port instead of hardcoding port 4789 in the XFRM policies.
We are not considering this to be a security issue as affected overlay networks are functionally non-operational. The only traffic which would be visible on the host network in cleartext would be simplex transmissions (ICMP echo requests, DNS queries, TCP SYN, etc.) shouting into the void, which the addressed recipient would never receive and thus never reply to.
- How I did it
Trivially.
- How to verify it
Initialize a swarm with a
--data-path-portother than 4789. Create an encrypted overlay network, run containers on different nodes attached to the network, and verify that the containers can communicate with each other.Run tcpdump on one of the nodes with the filter
udp port $DATA_PATH_PORT or espand verify that only IPSec ESP traffic is observed when the aforementioned containers are communicating, and not any cleartext UDP traffic.- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)