Skip to content

Conversation

@AlonZivony
Copy link
Contributor

1. Explain what the PR does

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.

2. Explain how to test it

3. Other comments

Copy link

Copilot AI left a 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_kernel event that hooks the udp_sendmsg kernel 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

@AlonZivony AlonZivony force-pushed the feature/event/dns-request-kernel branch from 8ccec5c to 3c9d4a5 Compare August 4, 2025 13:27
@AlonZivony AlonZivony marked this pull request as draft August 4, 2025 14:33
@AlonZivony AlonZivony force-pushed the feature/event/dns-request-kernel branch 2 times, most recently from 01f6233 to 0f49382 Compare August 5, 2025 07:43
@AlonZivony AlonZivony marked this pull request as ready for review August 5, 2025 07:44
@yanivagman
Copy link
Collaborator

Please rebase.
Some changes were made to the event documentation location and format that will require changes from your side

@AlonZivony AlonZivony force-pushed the feature/event/dns-request-kernel branch 2 times, most recently from 0f35bbf to 856544d Compare September 16, 2025 13:11
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.
@AlonZivony AlonZivony force-pushed the feature/event/dns-request-kernel branch from 856544d to a29e64c Compare September 16, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants