From 87617b200c592dfdb5e256e27ac13a8769555f16 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Thu, 10 Sep 2020 17:52:18 +0530 Subject: [PATCH] doc/datasets: add info about memcap and hashsize --- doc/userguide/rules/datasets.rst | 34 +++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/doc/userguide/rules/datasets.rst b/doc/userguide/rules/datasets.rst index 5157c093a7..b248fe3f91 100644 --- a/doc/userguide/rules/datasets.rst +++ b/doc/userguide/rules/datasets.rst @@ -39,6 +39,30 @@ Rules to go with the above: alert http any any -> any any (msg: "http user-agent test"; http.user_agent; dataset:set,ua-seen; sid:234; rev:1;) +It is also possible to optionally define global default memcap and hashsize. + +Example:: + + datasets: + defaults: + memcap: 100mb + hashsize: 2048 + ua-seen: + type: string + load: ua-seen.lst + +or define memcap and hashsize per dataset. + +Example:: + + datasets: + ua-seen: + type: string + load: ua-seen.lst + memcap: 10mb + hashsize: 1024 + + Rule keywords ------------- @@ -52,7 +76,7 @@ Syntax:: dataset:,,; dataset:, \ - [, type , save , load , state ]; + [, type , save , load , state , memcap , hashsize ]; type the data type: string, md5, sha256 @@ -63,6 +87,10 @@ state save advanced option to set the file name for saving the in-memory data when Suricata exits. +memcap + maximum memory limit for the respective dataset +hashsize + allowed size of the hash for the respective dataset .. note:: 'load' and 'state' or 'save' and 'state' cannot be mixed. @@ -74,11 +102,11 @@ Data Reputation allows matching data against a reputation list. Syntax:: datarep:,,, \ - [, load , type ]; + [, load , type , memcap , hashsize ]; Example rules could look like:: - alert dns any any -> any any (dns.query; to_md5; datarep:dns_md5, >, 200, load dns_md5.rep, type md5; sid:1;) + alert dns any any -> any any (dns.query; to_md5; datarep:dns_md5, >, 200, load dns_md5.rep, type md5, memcap 100mb, hashsize 2048; sid:1;) alert dns any any -> any any (dns.query; to_sha256; datarep:dns_sha256, >, 200, load dns_sha256.rep, type sha256; sid:2;) alert dns any any -> any any (dns.query; datarep:dns_string, >, 200, load dns_string.rep, type string; sid:3;) -- 2.47.2