Skip to content

Conversation

@maheshbhatiya73
Copy link
Member

@maheshbhatiya73 maheshbhatiya73 commented Jul 10, 2025

Implements a Rust-based eBPF probe using aya to trace IPv4 connect() syscalls via the sys_enter_connect tracepoint. The probe records:

  • PID of the process initiating the connection
  • Destination IP and port
  • Incremental connection count per PID-IP-port tuple

Key features:

  • Safe user-space pointer dereferencing using bpf_probe_read_user
  • Compact map key: [pid(4) | ip(4) | port(2) | padding(2)]
  • Two eBPF maps:
    • connect_attempts: count of per-connection attempts
    • total_triggers: global increment counter
  • Handles invalid addrlen, pointer, and non-IPv4 traffic gracefully
  • Logs each event via bpf_printk! for debugging

This version is stable and verified via trace_pipe.

…ions

Implements a Rust-based eBPF probe using aya to trace IPv4 connect() syscalls
via the `sys_enter_connect` tracepoint. The probe records:

- PID of the process initiating the connection
- Destination IP and port
- Incremental connection count per PID-IP-port tuple

Key features:
- Safe user-space pointer dereferencing using `bpf_probe_read_user`
- Compact map key: [pid(4) | ip(4) | port(2) | padding(2)]
- Two eBPF maps:
  - `connect_attempts`: count of per-connection attempts
  - `total_triggers`: global increment counter
- Handles invalid addrlen, pointer, and non-IPv4 traffic gracefully
- Logs each event via `bpf_printk!` for debugging

This version is stable and verified via `trace_pipe`.
@maheshbhatiya73 maheshbhatiya73 merged commit f3d484d into main Jul 10, 2025
1 check passed
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