8000 use tcp_connect kprobe to get tcp handshake packets by roikol · Pull Request #861 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

use tcp_connect kprobe to get tcp handshake packets #861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

roikol
Copy link
Contributor
@roikol roikol commented Aug 2, 2021

using kprobe tcp_connect, in order to capture tcp SYN and SYN-ACK packets.

this internal kernel function is a good place to identify outgoing tcp connections:

  • this function is called both for ipv4 and ipv6.
  • this function is called after the kernel assigns a local port to the socket.
  • this function is called before the first SYN packet is sent.

we no longer have use of the tcp states TCP_SYN_SENT and TCP_ESTABLISHED in the inet_sock_set_state tracepoint - this is because these states were only used to capture outgoing tcp connections.
TCP_LISTEN is still needed because it is used to capture incoming tcp connections.

TCP_CLOSE is now used for both outgoing and incoming tcp connections, but we have to update sock_ctx_map in tcp_connect, so we can remove this network flow from network_map on TCP_CLOSE state.

@roikol roikol force-pushed the add_tcp_handshake_using_connect branch from 021c630 to e6cd85d Compare August 3, 2021 12:06
@yanivagman yanivagman merged commit fa7feae into aquasecurity:main Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0