Skip to content

DNS threats

The functions of dns_finder.threats, taken from their docstrings.

dns_finder.threats

The unified DNS Threats feed: one query and one serializer, since Alert covers the three detection sources.

serialize_alert(alert, misp_uuid_map=None)

An Alert as an item of the unified feed, whatever its source.

Parameters:

Name Type Description Default
alert

Alert with dns_twisted, dns_monitored and keyword_monitored already select_related.

required
misp_uuid_map

Optional {domain_name: [uuid]}; without it each row asks MISP UUIDs by itself.

None

threats_queryset(params)

Alerts of the DNS Threats Monitored feed, all three detection sources, filtered and ordered as requested.

Parameters:

Name Type Description Default
params

Query-param-like mapping (request.query_params), all values optional: source, corporate_dns, corporate_keyword, fuzzer, provider, cname_target, status (one of Alert.STATUS_CHOICES, or open for pending / suspected / confirmed), search (domain name), period (today, 7d, 30d), ordering (created_at, status, source; - for descending).

required

serialize_threats(alerts)

Serialize a page of alerts. MISP UUIDs, Website Monitoring and Legitimate Domains membership are fetched in one query each for the whole page instead of once per row (N+1).