Skip to content

Conversation

@maheshbhatiya73
Copy link
Member

Implements a new SSH fail monitor using a kprobe on all processes.

  • Hooks every kprobe entry point and filters based on comm == "sshd"
  • Emits timestamped events via RingBuf including PID, UID, comm, and time
  • Tracks per-UID failure count in a HashMap (UID -> attempt count)
  • Uses bpf_get_current_comm, bpf_get_current_pid_tgid, bpf_get_current_uid_gid, and bpf_ktime_get_ns
  • Adds bpf_printk debug output for each triggered event
  • Includes panic handler and GPL license section for kernel validation

Note: This method is generic and does not attach directly to pam_authenticate.
Future enhancement: Combine with uretprobe on PAM to capture return code and failure reason.

…ringbuf eventing

Implements a new SSH fail monitor using a kprobe on all processes.
- Hooks every `kprobe` entry point and filters based on `comm == "sshd"`
- Emits timestamped events via RingBuf including PID, UID, comm, and time
- Tracks per-UID failure count in a HashMap (UID -> attempt count)
- Uses `bpf_get_current_comm`, `bpf_get_current_pid_tgid`, `bpf_get_current_uid_gid`, and `bpf_ktime_get_ns`
- Adds bpf_printk debug output for each triggered event
- Includes panic handler and `GPL` license section for kernel validation

Note: This method is generic and does not attach directly to `pam_authenticate`.
Future enhancement: Combine with uretprobe on PAM to capture return code and failure reason.
@maheshbhatiya73 maheshbhatiya73 merged commit 040f47d 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