[Osquery_manager] DNS artifact saved queries #17007
Open
+133
−7
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.
DNS Artifact
The Windows DNS artifact provides comprehensive visibility into DNS resolution activity for threat hunting, C2 detection, and incident response. This artifact includes two complementary queries: a DNS cache snapshot for quick domain enumeration, and a detailed event log query with full process context when DNS Client logging is enabled.
Core Forensic Artifacts Coverage
Queries by Platform
🪟 Windows - DNS Cache Snapshot
Description
Enumerates the Windows DNS resolver cache to identify recently queried domains. Useful for threat hunting suspicious domain lookups, C2 beacon detection, and incident response. Cache entries expire based on TTL (max 24 hours by default). Filters out reverse lookups and local service noise.
Detection Focus:
Result
Query results show cached DNS entries with domain names and record types. Results are filtered to exclude reverse lookups, Active Directory service records, and local names to reduce noise.
Platform
windowsInterval
900seconds (15 minutes)Query ID
dns_cache_snapshot_windows_elasticECS Field Mappings
event.category→["network"](static)event.action→"osquery.dns_cache"(static)dns.question.name→query_namedns.question.type→query_typetags→["osquery", "network", "dns", "windows", "threat_hunting"](static)SQL Query
🪟 Windows - DNS Event Log with Process Context
Description
Queries the Windows DNS Client Operational event log for DNS query completion events (Event ID 3008). Provides full DNS query details including query name, record type, resolved answer, and process context with hashes when the originating process is still running.
PREREQUISITE: DNS Client Operational logging must be enabled via:
wevtutil sl Microsoft-Windows-DNS-Client/Operational /e:trueDetection Focus:
Result
Query results show DNS query events with full details including the queried domain, record type, resolved answer (IP addresses), and process context (name, path, command line, hashes) when the originating process is still running at query time.
Platform
windowsInterval
900seconds (15 minutes)Query ID
dns_event_log_windows_elasticECS Field Mappings
event.category→["network"](static)event.action→"osquery.dns_event_log"(static)dns.question.name→query_namedns.question.type→query_typedns.answers.data→answerprocess.pid→pidprocess.name→process_nameprocess.executable→process_pathprocess.command_line→process_cmdlineprocess.hash.md5→md5process.hash.sha256→sha256tags→["osquery", "network", "dns", "windows", "event_log", "requires_config"](static)SQL Query
Comparison with between the queries
*Process context available only when the originating process is still running at query time.