Skip to content

feat: use mangle table for TCP reset when Istio is present#421

Merged
joshiste merged 1 commit intomainfrom
feat/istio-mangle-table-support
Apr 9, 2026
Merged

feat: use mangle table for TCP reset when Istio is present#421
joshiste merged 1 commit intomainfrom
feat/istio-mangle-table-support

Conversation

@joshiste
Copy link
Copy Markdown
Member

@joshiste joshiste commented Apr 8, 2026

Summary

  • Detect Istio sidecar in the target network namespace during TCP reset prepare phase
  • When Istio is detected, use mangle table with PREROUTING/OUTPUT/FORWARD chains instead of filter table with INPUT/OUTPUT/FORWARD
  • This ensures TCP reset rules match packets before Istio's nat DNAT rewrites the destination address

Context

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

  • Extension builds successfully
  • Existing tests pass
  • Integration test: deploy to Istio-enabled cluster, run TCP reset attack, verify rules in iptables -t mangle -L

@joshiste joshiste force-pushed the feat/istio-mangle-table-support branch 13 times, most recently from d7bd53e to 80dd942 Compare April 8, 2026 21:05
@joshiste joshiste enabled auto-merge April 8, 2026 21:07
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.
@joshiste joshiste force-pushed the feat/istio-mangle-table-support branch from 80dd942 to 7d758c9 Compare April 9, 2026 07:54
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

@joshiste joshiste merged commit 97f3ddb into main Apr 9, 2026
15 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant