Repository navigation
Conversation
Introduce networking.cozystack.io/allowICMP. When set to "true" on a service in port-filter mode (wholeIP: "false"), ICMP traffic toward the backend pod IP is accepted instead of being dropped by the per-port filter. Without this opt-in, port-filter mode silently drops all ICMP, which breaks ping, PMTU discovery (ICMP "fragmentation needed") and ICMP unreachable signalling. Implementation: - New nft set icmp_allowed_pods (key: ipv4 pod IP). - New rule in port_filter, between the ct established,related accept and the per-port drop: ip daddr @icmp_allowed_pods meta l4proto icmp accept. - New ProxyProcessor methods EnsureICMPAllow / DeleteICMPAllow / CleanupICMPAllow, mirroring the port-filter API. - Controller refactored to consolidate port-filter + ICMP-allow handling into reconcilePortFilter / clearPortFilter helpers. Co-Authored-By: Claude <[email protected]> Signed-off-by: Andrei Kvapil <[email protected]>
6 tasks done
Author
|
Retargeting to cozystack:main now that cozystack#11 has merged. Continuing in cozystack/cozy-proxy. |
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.
Stacked on top of cozystack#11 to address review feedback: in port-filter mode the current PR drops all ICMP toward the backend pod IP, which breaks
ping, PMTU discovery, and ICMP unreachable signalling. This adds an opt-in annotation to accept ICMP for services that need it.Summary
networking.cozystack.io/allowICMP: "true"(default false). Only meaningful in port-filter mode (wholeIP: "false").icmp_allowed_podsand a rule inport_filterplaced between thect established,related acceptand the per-port drop:ip daddr @icmp_allowed_pods meta l4proto icmp accept.ProxyProcessormethodsEnsureICMPAllow/DeleteICMPAllow/CleanupICMPAllow, mirroring the port-filter API shape.reconcilePortFilter/clearPortFilterhelpers — fewer scattered if/else blocks for both port-filter and ICMP state.allowICMPpredicate.Why per-pod set, not per-rule
Same reason as
filtered_pods/allowed_ports: the chain runs at priorityfilter(0), afteringress_dnathas rewritten daddr from LB IP to pod IP. Keying on pod IP keeps the chain rule count constant and the per-service state in nft sets, which is consistent with the rest of this PR's design.Test plan
wholeIP: "false"+allowICMP: "true": ping VM works, port filter still in effect for TCP/UDPwholeIP: "false"withoutallowICMP: ICMP dropped (current PR behavior preserved as default)wholeIP: "true": passthrough, ICMP works (port_filter chain doesn't apply to non-filtered pods)allowICMPtrue→false: pod removed fromicmp_allowed_podsicmp_allowed_podsentry