Skip to content

Conversation

@maheshbhatiya73
Copy link
Member

…racking

  • Added an eBPF program in Rust using aya to track SSH (port 22) connection attempts.

    • Attached as a kprobe to tcp_v4_connect.
    • Extracts PID and destination IPv4 from sockaddr.
    • Stores attempt counts in a BPF HashMap keyed by (PID, IP).
  • Implemented a Go userspace loader using cilium/ebpf:

    • Loads and attaches the compiled ssh_monitor.o.
    • Periodically reads from the ssh_attempts map and prints the PID/IP/Count.
    • Gracefully handles SIGINT/SIGTERM for clean shutdown.

Tested locally with loopback SSH connections. Working end-to-end integration between kernel-level probe and userland reporting.

…racking

- Added an eBPF program in Rust using aya to track SSH (port 22) connection attempts.
  - Attached as a kprobe to tcp_v4_connect.
  - Extracts PID and destination IPv4 from sockaddr.
  - Stores attempt counts in a BPF HashMap keyed by (PID, IP).

- Implemented a Go userspace loader using cilium/ebpf:
  - Loads and attaches the compiled ssh_monitor.o.
  - Periodically reads from the ssh_attempts map and prints the PID/IP/Count.
  - Gracefully handles SIGINT/SIGTERM for clean shutdown.

Tested locally with loopback SSH connections. Working end-to-end integration between kernel-level probe and userland reporting.
@maheshbhatiya73 maheshbhatiya73 merged commit 13d70df into main Jul 8, 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