]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc: add bsize keyword examples
authorjason taylor <jtfas90@gmail.com>
Mon, 25 Jul 2022 23:22:00 +0000 (23:22 +0000)
committerVictor Julien <vjulien@oisf.net>
Thu, 28 Jul 2022 14:40:01 +0000 (16:40 +0200)
Signed-off-by: jason taylor <jtfas90@gmail.com>
doc/userguide/rules/payload-keywords.rst

index 422ea44c8b4735d2495d36573c133e0eb3e56dac..13dfde95ccdf3707601f314f85b7123b9cd449ee 100644 (file)
@@ -273,17 +273,28 @@ You can also use the negation (!) before isdataat.
 bsize
 -----
 
-With the bsize keyword, you can match on the length of the buffer. This adds precision to the content match, previously this could have been done with isdataat.
+With the bsize keyword, you can match on the length of a buffer. This adds precision to the content match, previously this could have been done with isdataat.
 
 Format::
 
   bsize:<number>;
 
-Example of bsize in a rule:
+Examples of bsize values:
 
 .. container:: example-rule
 
-   alert dns any any -> any any (msg:"test bsize rule"; dns.query; content:"google.com"; bsize:10; sid:123; rev:1;)
+   alert dns any any -> any any (msg:"bsize exact buffer size"; dns.query; content:"google.com"; bsize:10; sid:1; rev:1;)
+
+   alert dns any any -> any any (msg:"bsize less than value"; dns.query; content:"google.com"; bsize:<25; sid:2; rev:1;)
+
+   alert dns any any -> any any (msg:"bsize buffer less than or equal value"; dns.query; content:"google.com"; bsize:<=20; sid:3; rev:1;)
+
+   alert dns any any -> any any (msg:"bsize buffer greater than value"; dns.query; content:"google.com"; bsize:>8; sid:4; rev:1;)
+
+   alert dns any any -> any any (msg:"bsize buffer greater than or equal value"; dns.query; content:"google.com"; bsize:>=8; sid:5; rev:1;)
+
+   alert dns any any -> any any (msg:"bsize buffer range value"; dns.query; content:"google.com"; bsize:8<>20; sid:6; rev:1;)
+
 
 dsize
 -----