]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc/userguide: document include files
authorJason Ish <jason.ish@oisf.net>
Wed, 24 May 2023 19:18:21 +0000 (13:18 -0600)
committerVictor Julien <vjulien@oisf.net>
Wed, 31 May 2023 05:57:26 +0000 (07:57 +0200)
Document how to use include files, plus add a deprecation notice on
the use of multiple "include" statements.

doc/userguide/configuration/includes.rst [new file with mode: 0644]
doc/userguide/configuration/index.rst
doc/userguide/upgrade.rst

diff --git a/doc/userguide/configuration/includes.rst b/doc/userguide/configuration/includes.rst
new file mode 100644 (file)
index 0000000..2fc6290
--- /dev/null
@@ -0,0 +1,56 @@
+.. _includes:
+
+Includes
+========
+
+A Suricata configuration file (typically
+``/etc/suricata/suricata.yaml``) may include other files allowing a
+configuration file to be broken into multiple files. The *special*
+field name ``include`` is used to include one or more files.
+
+The contents of the *include* file are inlined at the level of the
+``include`` statement. *Include* fields may also be included at any
+level within a mapping.
+
+Including a Single File
+-----------------------
+
+::
+
+    include: filename.yaml
+
+Including Multiple Files
+------------------------
+
+::
+
+    include:
+      - filename1.yaml
+      - filename2.yaml
+
+Include Inside a Mapping
+------------------------
+
+::
+
+    vars:
+      address-groups:
+        include: address-groups.yaml
+
+where ``address-groups.yaml`` contains::
+    
+    %YAML 1.1
+    ---
+    HOME_NET: "[192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]"
+
+is the equivalent of::
+
+    vars:
+      address-groups:
+        HOME_NET: "[192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]"
+
+.. note:: Suricata versions less than 7 required multiple ``include``
+    statements to be specified to include more than one file. While
+    Suricata 7.0 still supports this it will issue a deprecation
+    warning. Suricata 8.0 will not allow multiple ``include``
+    statements at the same level as this is not allowed by YAML.
index a32a83bf6eca17d8141e8bd0619e2ec3723081f2..8a90cec474a8ad61bb8dabf2b5df6f428c4c527c 100644 (file)
@@ -11,3 +11,4 @@ Configuration
    dropping-privileges
    landlock
    systemd-notify
+   includes
index 9cd66b2ab13c075792af88066312f9fa53f40e86..0dd7223dfca3a67eaf40c94641f491840d09a4c4 100644 (file)
@@ -61,6 +61,12 @@ Logging changes
   in the values ``proto`` in ``eve.json`` log entries and other logs containing protocol names and values.
   See https://redmine.openinfosecfoundation.org/issues/4267 for more information.
 
+Deprecations
+~~~~~~~~~~~~
+- Multiple "include" fields in the configuration file will now issue a
+  warning and in Suricata 8.0 will not be supported. See
+  :ref:`includes` for documentation on including multiple files.
+
 Other changes
 ~~~~~~~~~~~~~
 - NSS is no longer required. File hashing and JA3 can now be used without the NSS compile time dependency.