Skip to content

check-encryption-leak: don't skip plain-text TCP RST packets#41765

Merged
julianwiedmann merged 2 commits intomainfrom
pr/jwi/main/ipsec-bpftrace
Sep 25, 2025
Merged

check-encryption-leak: don't skip plain-text TCP RST packets#41765
julianwiedmann merged 2 commits intomainfrom
pr/jwi/main/ipsec-bpftrace

Conversation

@julianwiedmann
Copy link
Copy Markdown
Member

Starting from v1.18 the IPsec encryption policy is applied when egressing the native device. Therefore we should be able to catch stray TCP RSTs by the L7 proxy which didn't pass through cilium_host, and encrypt them as needed.

This effectively reverts
commit 09551d2 ("ci: skip plain-text TCP RST packets in bpftrace").

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 19, 2025
@julianwiedmann
Copy link
Copy Markdown
Member Author

/test

@julianwiedmann julianwiedmann added area/CI Continuous Integration testing issue or flake area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. release-note/ci This PR makes changes to the CI. feature/ipsec Relates to Cilium's IPsec feature labels Sep 19, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 19, 2025
@julianwiedmann julianwiedmann marked this pull request as ready for review September 19, 2025 11:12
@julianwiedmann julianwiedmann requested review from a team as code owners September 19, 2025 11:12
@julianwiedmann julianwiedmann added the dont-merge/preview-only Only for preview or testing, don't merge it. label Sep 19, 2025
@julianwiedmann
Copy link
Copy Markdown
Member Author

I'll give this a few rounds through CI once the e2e-upgrade workflow is healthy again, to ensure we don't re-introduce any flakes ...

@julianwiedmann julianwiedmann force-pushed the pr/jwi/main/ipsec-bpftrace branch from f34c28f to 61bc53b Compare September 19, 2025 14:44
@julianwiedmann
Copy link
Copy Markdown
Member Author

/test

Copy link
Copy Markdown
Contributor

@smagnani96 smagnani96 left a comment

Choose a reason for hiding this comment

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

This LGTM, just needs small changes in the code 👍🏼

Starting from v1.18 the IPsec encryption policy is applied when egressing
the native device. Therefore we should be able to catch stray TCP RSTs
by the L7 proxy which didn't pass through cilium_host, and encrypt them as
needed.

This effectively reverts
commit 09551d2 ("ci: skip plain-text TCP RST packets in bpftrace").

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
s/masquerated/masqueraded

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
@julianwiedmann
Copy link
Copy Markdown
Member Author

/test

Copy link
Copy Markdown
Contributor

@smagnani96 smagnani96 left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! LGTM.

@julianwiedmann julianwiedmann removed the dont-merge/preview-only Only for preview or testing, don't merge it. label Sep 25, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Sep 25, 2025
@julianwiedmann
Copy link
Copy Markdown
Member Author

Gave CI a bunch of spins, no flakes to be seen.

@julianwiedmann julianwiedmann added this pull request to the merge queue Sep 25, 2025
Merged via the queue into main with commit 0a3d635 Sep 25, 2025
552 of 553 checks passed
@julianwiedmann julianwiedmann deleted the pr/jwi/main/ipsec-bpftrace branch September 25, 2025 06:02
smagnani96 added a commit that referenced this pull request Dec 9, 2025
This substantially reverts #41765,
re-applying #36962 (modified code
for readability).

During our CLI tests, we observe some auto-generated TCP RST packets from
the kernel in response to TCP-FIN packets sent by, most likely,
some idle's timeout expiring. Envoy would generate TCP-FIN, but the
kernel replies with a RST, given there's not a socket anymore listening
to that port.

We thought that after VinE we were able to catch such packets in our
to-netdev program, but we kept observing them while adding unrelated
tests to our CLI suite (see https://github.com/cilium/cilium/actions/runs/19833684454).
Thus, we revert the latest change, and keep ignoring TCP RST packets.

Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
aanm pushed a commit that referenced this pull request Dec 15, 2025
This substantially reverts #41765,
re-applying #36962 (modified code
for readability).

During our CLI tests, we observe some auto-generated TCP RST packets from
the kernel in response to TCP-FIN packets sent by, most likely,
some idle's timeout expiring. Envoy would generate TCP-FIN, but the
kernel replies with a RST, given there's not a socket anymore listening
to that port.

We thought that after VinE we were able to catch such packets in our
to-netdev program, but we kept observing them while adding unrelated
tests to our CLI suite (see https://github.com/cilium/cilium/actions/runs/19833684454).
Thus, we revert the latest change, and keep ignoring TCP RST packets.

Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2025
This substantially reverts #41765,
re-applying #36962 (modified code
for readability).

During our CLI tests, we observe some auto-generated TCP RST packets from
the kernel in response to TCP-FIN packets sent by, most likely,
some idle's timeout expiring. Envoy would generate TCP-FIN, but the
kernel replies with a RST, given there's not a socket anymore listening
to that port.

We thought that after VinE we were able to catch such packets in our
to-netdev program, but we kept observing them while adding unrelated
tests to our CLI suite (see https://github.com/cilium/cilium/actions/runs/19833684454).
Thus, we revert the latest change, and keep ignoring TCP RST packets.

Signed-off-by: Simone Magnani <simone.magnani@isovalent.com>
@cilium-release-bot cilium-release-bot bot moved this to Released in cilium v1.19.0 Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/CI Continuous Integration testing issue or flake area/encryption Impacts encryption support such as IPSec, WireGuard, or kTLS. feature/ipsec Relates to Cilium's IPsec feature ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.

Projects

No open projects
Status: Released

Development

Successfully merging this pull request may close these issues.

4 participants