dedup dns children by (rdtype, child) not parent host - #3126
Merged
Conversation
emit_dns_children was keyed on (parent_host, rdtype, child_host), so the same out-of-scope nameserver was re-emitted once per in-scope parent that referenced it. With concentrated providers like Cloudflare or MarkMonitor this multiplied NS/SOA emissions by 1000x+ and flooded downstream module queues.
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary! 1 regression ⚠️
27 unchanged ✅🔍 Significant Changes (>10%)
🐍 Python Version 3.11.15 |
both tests relied on the (parent, rdtype, child) emit_dns_children dedup to produce duplicate DNS_NAME/IP_ADDRESS edges across parents. with the new (rdtype, child) dedup these collapse to a single emission.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3126 +/- ##
=====================================
- Coverage 90% 90% -0%
=====================================
Files 441 441
Lines 38841 38920 +79
=====================================
+ Hits 34762 34827 +65
- Misses 4079 4093 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Re-emit in-scope shared-infra child events as graph-important so neo4j/json keep every parent->child edge. Route graph-important events only to modules that consume them (preserve_graph or accept_dupes), so normal scan modules see no extra churn.
children_emitted is parent-less (#3126), so the in-scope re-emit also fired on same-host re-processing (SRV/wildcard chains), over-emitting graph-important events. Track (parent, rdtype, child) for in-scope edges so only genuinely new cross-parent edges re-emit.
asdf.blacklanternsecurity.com is in-scope shared infra (SRV target of two in-scope _ldap records); both cross-parent edges are now preserved, so it emits two DNS_NAME events instead of one.
emit_dns_children re-emits cross-parent edges for in-scope children as graph-important so neo4j/json keep every edge. Skip that when the child type is omitted: it would be dropped at output anyway, and flagging it breaks the rule that a graph-important event is never omitted. Also only compute the scope check and parent-aware edge hash for genuinely new children, so already-seen out-of-scope dups don't pay for a scope lookup on every occurrence.
ausmaster
self-requested a review
June 1, 2026 16:05
…-fidelity Preserve in-scope shared-infra graph edges
ausmaster
self-requested a review
June 1, 2026 16:38
ausmaster
approved these changes
Jun 1, 2026
Merged
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.
Summary
DNSResolve.emit_dns_childrendeduped its outgoing DNS_NAME events with the key(parent_host, rdtype, child_host). Including the parent host in the key meant the same out-of-scope NS/SOA/MX/CNAME value was re-emitted once per in-scope parent that referenced it.In a recent scan of ~100 corporate domains, this produced:
beth.ns.cloudflare.comalone was emitted 1,518 times. With Cloudflare and MarkMonitor concentrating many zones onto the same NS pair, the multiplier on consolidated providers is severe.The 16K duplicate distance-1 events all flowed into every scan module that watches
DNS_NAME(dnsbrute, dnscommonsrv, wayback, hunterio, sslcert, excavate, …). Each module had to pull them off its incoming queue, hash them for dedup, run scope andfilter_event, and then drop them — serializing queue throughput and slowing scans.Fix
Drop
event.hostfrom the dedup hash. The same (rdtype, child) pair across different parents is the same child event semantically.Adds
TestDNSResolveSharedNameserverDedupto catch regressions: three in-scope domains share an NS/SOA pair; the test asserts each shared nameserver hostname is emitted exactly once across all parents.