feat: use mangle table for TCP reset when Istio is present#421
Merged
Conversation
d7bd53e to
80dd942
Compare
Detect Istio sidecar in the target network namespace during prepare phase and use the mangle table with PREROUTING chain instead of the filter table with INPUT chain. This ensures TCP reset rules match packets before Istio's nat DNAT rewrites the destination address.
80dd942 to
7d758c9
Compare
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Summary
mangletable withPREROUTING/OUTPUT/FORWARDchains instead offiltertable withINPUT/OUTPUT/FORWARDContext
Istio's sidecar injects iptables NAT rules that redirect traffic to Envoy before the filter table is reached. The mangle table runs before NAT, so packets still have their original addresses when our REJECT rules are evaluated.
Depends on steadybit/action-kit#409
Test plan
iptables -t mangle -L