]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc: update file.data keyword documentation
authorjason taylor <jtfas90@gmail.com>
Thu, 16 Nov 2023 13:49:50 +0000 (13:49 +0000)
committerVictor Julien <victor@inliniac.net>
Fri, 24 Nov 2023 19:06:04 +0000 (20:06 +0100)
Signed-off-by: jason taylor <jtfas90@gmail.com>
doc/userguide/rules/file-keywords.rst
doc/userguide/rules/http-keywords.rst
src/detect-file-data.c

index 2992992c72d3d621cc51ce767fdc81dfa1936f55..92f432ba8fcb4d7aaffab9f96d5c2e3d9291cd23 100644 (file)
@@ -5,6 +5,27 @@ Suricata comes with several rule keywords to match on various file
 properties. They depend on properly configured
 :doc:`../file-extraction/file-extraction`.
 
+file.data
+---------
+
+The ``file.data`` sticky buffer matches on contents of files that are 
+seen in flows that Suricata evaluates. The various payload keywords can
+be used (e.g. ``startswith``, ``nocase`` and ``bsize``) with ``file.data``.
+
+Example::
+
+  alert smtp any any -> any any (msg:"smtp app layer file.data example"; \
+ file.data; content:"example file content"; sid:1; rev:1)
+
+  alert http any any -> any any (msg:"http app layer file.data example"; \
+ file.data; content:"example file content"; sid:2; rev:1)
+  alert tcp any any -> any any (msg:"tcp file.data example"; \
+ file.data; content:"example file content"; sid:4; rev:1)
+
+**Note** file_data is the legacy notation but can still be used.
+
+
 file.name
 ---------
 
index 85a32258514022c1d6a70f46ede68dda313eff0e..d5534a877626ef858f6451866e75b7e170a26db4 100644 (file)
@@ -786,4 +786,5 @@ Notes
    than 1k, 'content:!"<html"; depth:1024;' can only match if the
    pattern '<html' is absent from the first inspected chunk.
 
--  ``file_data`` can also be used with SMTP
+
+-  Refer to :doc:`file-keywords` for additional information.
index b326e0c92f1bfcf850e979451bf34f7bd4d1e4bd..6491a0e5b8cb378d8ca8483c8747484d71765478 100644 (file)
@@ -88,7 +88,7 @@ void DetectFiledataRegister(void)
     sigmatch_table[DETECT_FILE_DATA].name = "file.data";
     sigmatch_table[DETECT_FILE_DATA].alias = "file_data";
     sigmatch_table[DETECT_FILE_DATA].desc = "make content keywords match on file data";
-    sigmatch_table[DETECT_FILE_DATA].url = "/rules/http-keywords.html#file-data";
+    sigmatch_table[DETECT_FILE_DATA].url = "/rules/file-keywords.html#file-data";
     sigmatch_table[DETECT_FILE_DATA].Setup = DetectFiledataSetup;
 #ifdef UNITTESTS
     sigmatch_table[DETECT_FILE_DATA].RegisterTests = DetectFiledataRegisterTests;