Project

General

Profile

Actions

Feature #8019

open

Include `endswith` condition to the fast pattern in hyperscan integration

Added by Tarun Yadav 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Effort:
medium
Difficulty:
Label:

Description

Currently, the hyperscan integration in Suricata cannot apply the endswith condition to the fast pattern.

I tested with the following rule:

```
drop dns any any -> any any (msg:"block 1001721"; dns.query; content:".com"; endswith; fast_pattern; pcre:"/^([^.]+\.)*(abc\.com|def\.com|ghi\.com)$/"; sid:1001721; rev:1;)
```

The fast pattern only checks if dns.query contains ".com" rather than checking if it ends with ".com".

Additional info and steps to reproduce:
1. `multi_tld.pcap` was generated by sending a DNS and http request to all domains in unique_tld_domains.txt file.
2. We ran the Suricata profiling using multi_tld.pcap and sample.rules.
rule_perf.log shows that the rule was checked 56 times, which is equivalent to number of domain which have `.com` as substring (`grep "\.com" pcaps/scripts/unique_tld_domains.txt | wc -l`). I would expect the check time to be only 1 check, since there is only 1 domain that ends with `.com`


Files

rule_perf.log (595 Bytes) rule_perf.log Tarun Yadav, 10/24/2025 02:57 PM
sample.rules (172 Bytes) sample.rules Tarun Yadav, 10/24/2025 02:57 PM
unique_tld_domains.txt (13.9 KB) unique_tld_domains.txt Tarun Yadav, 10/24/2025 02:57 PM
multi_tld.pcap (19.5 MB) multi_tld.pcap Tarun Yadav, 10/24/2025 02:58 PM

No data to display

Actions

Also available in: Atom PDF