-
Notifications
You must be signed in to change notification settings - Fork 472
feat(events): introduce dns_request_kernel event #4867
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
base: main
Are you sure you want to change the base?
feat(events): introduce dns_request_kernel event #4867
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new kernel-level DNS monitoring event dns_request_kernel that captures DNS queries directly at the kernel level using a kprobe on udp_sendmsg, providing a more reliable and efficient alternative to network packet-based DNS monitoring.
- Adds
dns_request_kernelevent that hooks theudp_sendmsgkernel function to capture UDP DNS requests on port 53 - Implements support for both iovec and ubuf message formats with DNS payload parsing
- Includes comprehensive testing infrastructure with C test clients and end-to-end test signatures
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/ebpf/c/tracee.bpf.c | Implements the core kprobe hook for udp_sendmsg with DNS filtering and payload extraction |
| pkg/events/derive/net_kernel.go | Adds DNS message parsing logic to extract hostname and query type from captured payloads |
| pkg/events/core.go | Defines the new DnsRequestKernelBase and DnsRequestKernel event definitions |
| tests/e2e-inst-signatures/scripts/dns_client/ | Test clients for validating DNS request capture functionality |
| docs/docs/events/builtin/network/dns_request_kernel.md | Comprehensive documentation for the new event |
8ccec5c to
3c9d4a5
Compare
01f6233 to
0f49382
Compare
|
Please rebase. |
0f35bbf to
856544d
Compare
Added a new event `dns_request_kernel` to capture DNS queries as a normal kprobe event, providing a reliable and efficient alternative to network packet-based monitoring. The downside is that it captures only UDP requests, missing more sophisticated implementations using TCP and HTTP.
856544d to
a29e64c
Compare
1. Explain what the PR does
Added a new event
dns_request_kernelto capture DNS queries as a normal kprobe event, providing a reliable and efficient alternative to network packet-based monitoring. The downside is that it captures only UDP requests, missing more sophisticated implementations using TCP and HTTP.2. Explain how to test it
3. Other comments