]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc/userguide: add ips chapter; add concept 13846/head
authorVictor Julien <vjulien@oisf.net>
Thu, 3 Jul 2025 13:31:51 +0000 (15:31 +0200)
committerVictor Julien <victor@inliniac.net>
Sun, 14 Sep 2025 08:43:18 +0000 (10:43 +0200)
Move setup guides into the new chapter as well.

Explain `stream.inline` logic.

Ticket: #5513.
Ticket: #6284.

13 files changed:
doc/userguide/Makefile.am
doc/userguide/firewall/firewall-design.rst
doc/userguide/index.rst
doc/userguide/ips/index.rst [new file with mode: 0644]
doc/userguide/ips/ips-concept.rst [new file with mode: 0644]
doc/userguide/ips/setting-up-ipsinline-for-linux.rst [moved from doc/userguide/setting-up-ipsinline-for-linux.rst with 100% similarity]
doc/userguide/ips/setting-up-ipsinline-for-linux/IPtables.png [moved from doc/userguide/setting-up-ipsinline-for-linux/IPtables.png with 100% similarity]
doc/userguide/ips/setting-up-ipsinline-for-linux/IPtables3.png [moved from doc/userguide/setting-up-ipsinline-for-linux/IPtables3.png with 100% similarity]
doc/userguide/ips/setting-up-ipsinline-for-linux/iptables1.png [moved from doc/userguide/setting-up-ipsinline-for-linux/iptables1.png with 100% similarity]
doc/userguide/ips/setting-up-ipsinline-for-linux/iptables2.png [moved from doc/userguide/setting-up-ipsinline-for-linux/iptables2.png with 100% similarity]
doc/userguide/ips/setting-up-ipsinline-for-linux/iptables4.png [moved from doc/userguide/setting-up-ipsinline-for-linux/iptables4.png with 100% similarity]
doc/userguide/ips/setting-up-ipsinline-for-linux/iptables_vnL.png [moved from doc/userguide/setting-up-ipsinline-for-linux/iptables_vnL.png with 100% similarity]
doc/userguide/ips/setting-up-ipsinline-for-windows.rst [moved from doc/userguide/setting-up-ipsinline-for-windows.rst with 100% similarity]

index dea2298959fa4b790df9b9a2d7be50566d0f55c0..052c6c520476f9ab16402906244e6f31440cb4d1 100644 (file)
@@ -18,6 +18,7 @@ EXTRA_DIST = \
        initscripts.rst \
        install.rst \
        install \
+       ips \
        licenses \
        lua \
        make-sense-alerts.rst \
@@ -32,9 +33,6 @@ EXTRA_DIST = \
        rule-management \
        rules \
        security.rst \
-       setting-up-ipsinline-for-linux \
-       setting-up-ipsinline-for-linux.rst \
-       setting-up-ipsinline-for-windows.rst \
        support-status.rst \
        unix-socket.rst \
        what-is-suricata.rst \
index bee7f4760ddd0d0edd03ef47344def44451057f4..228e13b7da211c8d287946c9998475c7703b02d6 100644 (file)
@@ -1,3 +1,5 @@
+.. _firewall mode design:
+
 Firewall Mode Design
 ********************
 
index 01d47bc7c980cf20c2c4722355ca75b41a683344..9ca58f56e21b6588c960be0b75a3c376201eb771 100644 (file)
@@ -21,8 +21,6 @@ This is the documentation for Suricata |version|.
    configuration/index.rst
    reputation/index.rst
    initscripts
-   setting-up-ipsinline-for-linux
-   setting-up-ipsinline-for-windows
    output/index.rst
    lua/index.rst
    file-extraction/file-extraction.rst
@@ -30,6 +28,7 @@ This is the documentation for Suricata |version|.
    capture-hardware/index.rst
    unix-socket.rst
    plugins/index.rst
+   ips/index.rst
    firewall/index.rst
    3rd-party-integration/index.rst
    manpages/index.rst
diff --git a/doc/userguide/ips/index.rst b/doc/userguide/ips/index.rst
new file mode 100644 (file)
index 0000000..18062ad
--- /dev/null
@@ -0,0 +1,9 @@
+IPS Mode
+========
+
+.. toctree::
+
+   ips-concept
+   setting-up-ipsinline-for-linux
+   setting-up-ipsinline-for-windows
+
diff --git a/doc/userguide/ips/ips-concept.rst b/doc/userguide/ips/ips-concept.rst
new file mode 100644 (file)
index 0000000..8633143
--- /dev/null
@@ -0,0 +1,92 @@
+IPS Concept
+===========
+
+Intrusion Prevention System mode, or IPS mode, is the Suricata mode that makes it act as a
+traffic filter.
+
+By default it will allow all traffic, and will use ``drop`` or ``reject`` rules to block
+unwanted traffic.
+
+It is generally used ``inline``, where threat detection rules are used to drop known bad traffic.
+
+The ``inline`` operations are either on layer 2 (bridge, for example using AF_PACKET or DPDK)
+or on layer 3 (routing, for example in NFQueue or IPFW).
+
+
+Differences from the passive IDS mode
+-------------------------------------
+
+TCP stream engine
+^^^^^^^^^^^^^^^^^
+
+Where in IDS mode TCP traffic is only inspected after the acknowledgement (ACK) for it has
+been received, in IPS mode the default behavior is different: new data is inspected
+immediately, together with previous data where possible.
+The inspection happens in a sliding window. This behavior is controlled by the
+``stream.inline`` setting.
+
+In case of overlapping data, the first data Suricata receives is accepted. Follow-up data
+that overlaps with this is then checked against the first data. If it is different, the
+traffic on the wire is rewritten to match the first data.
+
+The sliding window inspection can be visualized as such::
+
+    Packet 1: [hdr][segment data 1     ]
+    Segments: [segment data 1     ]
+    Window:   [ inspection window ]
+
+    Packet 2: [hdr][segment data 2]
+    Segments: [segment data 1     ][segment data 2]
+    Window:   [ inspection window                 ]
+
+    Packet 3: [hdr][segment data 3]
+    Segments: [segment data 1     ][segment data 2][segment data 3]
+    Window:            [ inspection window                        ]
+
+    Packet 4: [hdr][segment data 4]
+    Segments: [segment data 2][segment data 3][segment data 4]
+    Window:            [ inspection window                   ]
+
+Each segment's data is inspected together with the other available data. One consequence
+of this is that there can be significant rescanning of data, which has a performance impact.
+
+http body inspection
+^^^^^^^^^^^^^^^^^^^^
+
+Similar to the sliding window approach in the TCP stream engine, the HTTP body
+inspection will happen in a sliding manner by default. In IDS mode body data is
+buffered to the configured settings before inspection.
+
+::
+
+    app-layer:
+      protocols:
+        http:
+          libhtp:
+             default-config:
+               # auto will use http-body-inline mode in IPS mode, yes or no set it statically
+               http-body-inline: auto
+
+
+file.data
+^^^^^^^^^
+
+For HTTP, the ``file.data`` logic is the same as the body inspection above.
+
+Exception Policies
+------------------
+
+By default, when IPS mode is enabled, the exception policies are set to block (``drop``).
+This is to make sure rules cannot be bypassed due to Suricata reaching an error state in
+parsing, reaching internal resource limits and other exception conditions.
+
+See :ref:`Exception Policies documentation <exception policies>`.
+
+Differences from Firewall Mode
+------------------------------
+
+The main difference is that unlike IPS mode, Firewall Mode has a default ``drop`` policy.
+This means that a ruleset must be created to allow traffic to be accepted, instead of
+accepting traffic by default and filtering out unwanted traffic.
+
+See :ref:`Firewall Mode Design <firewall mode design>`.