Project

General

Profile

Actions

Feature #8385

open
AA AA

datasets: add support for subdomain match

Feature #8385: datasets: add support for subdomain match

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

Status:
Resolved
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 (1 open0 closed)

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

Related issues 2 (1 open1 closed)

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

AA Updated by Antoine abf 5 months ago Actions #2

  • Related to Feature #6802: Support Domain rollup using existing dataset library added

AA Updated by Antoine abf 5 months ago Actions #3

  • Target version changed from 9.0.0 to 9.0.0-beta1

SB Updated by Shivani Bhardwaj 5 months ago Actions #5

  • Subject changed from Dataset Subdomain Match to datasets: add support for subdomain match
  • Status changed from New to In Review

PA Updated by Philippe Antoine 2 months ago Actions #6

  • Status changed from In Review to Resolved

PA Updated by Philippe Antoine 21 days ago Actions #7

  • Related to Feature #5681: datasets: add more transform layers to match on domains added

AA Updated by Antoine abf 6 days ago Actions #8

  • Label Needs backport to 8.0 added

OT Updated by OISF Ticketbot 6 days ago Actions #9

  • Subtask #8879 added

OT Updated by OISF Ticketbot 6 days ago Actions #10

  • Label deleted (Needs backport to 8.0)
Actions

Also available in: PDF Atom