feat(events): introduce dns_request_kernel event#4867
Open
AlonZivony wants to merge 1 commit intoaquasecurity:mainfrom
Open
feat(events): introduce dns_request_kernel event#4867AlonZivony wants to merge 1 commit intoaquasecurity:mainfrom
AlonZivony wants to merge 1 commit intoaquasecurity:mainfrom
Conversation
There was a problem hiding this comment.
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
Collaborator
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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