Project

General

Profile

Actions

Feature #8385

closed
AA AA

datasets: add support for subdomain match

Feature #8385: datasets: add support for subdomain match

Added by Antoine abf 6 months ago. Updated 28 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

Description

Problem
There is currently no way to use datasets to block a domain and all its subdomains. The existing domain; transform extracts the registrable domain (eTLD+1), which is useful for normalization but not for subdomain-level blocklists.

For example, adding mail.evil.com to a dataset and using domain; will never match. The transform reduces a query like sub.mail.evil.com to evil.com before the dataset lookup, and it would not match. Only base domains work with domain; which makes it impossible to maintain subdomain blocklists.

The dotprefix; content; endswith; pattern does handle subdomains correctly, but endswith cannot be combined with a dataset.

Proposal
Add a match subdomain option to the dataset keyword. When set, the lookup walks up the domain hierarchy checking each level against the dataset until a match is found.

Example rule:

reject dns any any -> any any (msg:"Blocked domain"; dns.query; dotprefix; dataset:isset,blocked-domains,type string,match subdomain,load blocked-domains.lst; sid:1; rev:1;)

With .mail.evil.com in the dataset, this matches mail.evil.com , sub.mail.evil.com , etc.

https://redmine.openinfosecfoundation.org/issues/6802 mentions something similar to this.


Subtasks 1 (0 open1 closed)

Feature #8879: datasets: add support for subdomain match (8.0.x backport)ClosedAntoine abfActions

Related issues 2 (0 open2 closed)

Related to Suricata - Feature #6802: Support Domain rollup using existing dataset libraryClosedOISF DevActions
Related to Suricata - Feature #5681: datasets: add more transform layers to match on domainsClosedCommunity TicketActions
Actions

Also available in: PDF Atom