Skip to content

Commit e62eb00

Browse files
committed
doc/userguide: add ips chapter; add concept
Move setup guides into the new chapter as well. Explain `stream.inline` logic. Ticket: OISF#5513. Ticket: OISF#6284.
1 parent 9146fc8 commit e62eb00

13 files changed

Lines changed: 105 additions & 5 deletions

doc/userguide/Makefile.am

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ EXTRA_DIST = \
1818
initscripts.rst \
1919
install.rst \
2020
install \
21+
ips \
2122
licenses \
2223
lua \
2324
make-sense-alerts.rst \
@@ -32,9 +33,6 @@ EXTRA_DIST = \
3233
rule-management \
3334
rules \
3435
security.rst \
35-
setting-up-ipsinline-for-linux \
36-
setting-up-ipsinline-for-linux.rst \
37-
setting-up-ipsinline-for-windows.rst \
3836
support-status.rst \
3937
unix-socket.rst \
4038
what-is-suricata.rst \

doc/userguide/firewall/firewall-design.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _firewall mode design:
2+
13
Firewall Mode Design
24
********************
35

doc/userguide/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ This is the documentation for Suricata |version|.
2121
configuration/index.rst
2222
reputation/index.rst
2323
initscripts
24-
setting-up-ipsinline-for-linux
25-
setting-up-ipsinline-for-windows
2624
output/index.rst
2725
lua/index.rst
2826
file-extraction/file-extraction.rst
2927
public-data-sets
3028
capture-hardware/index.rst
3129
unix-socket.rst
3230
plugins/index.rst
31+
ips/index.rst
3332
firewall/index.rst
3433
3rd-party-integration/index.rst
3534
manpages/index.rst

doc/userguide/ips/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
IPS Mode
2+
========
3+
4+
.. toctree::
5+
6+
ips-concept
7+
setting-up-ipsinline-for-linux
8+
setting-up-ipsinline-for-windows
9+

doc/userguide/ips/ips-concept.rst

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
IPS Concept
2+
===========
3+
4+
Intrusion Prevention System mode, or IPS mode, is the Suricata mode that makes it act as a
5+
traffic filter.
6+
7+
By default it will allow all traffic, and will use ``drop`` or ``reject`` rules to block
8+
unwanted traffic.
9+
10+
It is generally used ``inline``, where threat detection rules are used to drop known bad traffic.
11+
12+
The ``inline`` operations are either on layer 2 (bridge, for example using AF_PACKET or DPDK)
13+
or on layer 3 (routing, for example in NFQueue or IPFW).
14+
15+
16+
Differences from the passive IDS mode
17+
-------------------------------------
18+
19+
TCP stream engine
20+
^^^^^^^^^^^^^^^^^
21+
22+
Where in IDS mode TCP traffic is only inspected after the acknowledgement (ACK) for it has
23+
been received, in IPS mode the default behavior is different: new data is inspected
24+
immediately, together with previous data where possible.
25+
The inspection happens in a sliding window. This behavior is controlled by the
26+
``stream.inline`` setting.
27+
28+
In case of overlapping data, the first data Suricata receives is accepted. Follow-up data
29+
that overlaps with this is then checked against the first data. If it is different, the
30+
traffic on the wire is rewritten to match the first data.
31+
32+
The sliding window inspection can be visualized as such::
33+
34+
Packet 1: [hdr][segment data 1 ]
35+
Segments: [segment data 1 ]
36+
Window: [ inspection window ]
37+
38+
Packet 2: [hdr][segment data 2]
39+
Segments: [segment data 1 ][segment data 2]
40+
Window: [ inspection window ]
41+
42+
Packet 3: [hdr][segment data 3]
43+
Segments: [segment data 1 ][segment data 2][segment data 3]
44+
Window: [ inspection window ]
45+
46+
Packet 4: [hdr][segment data 4]
47+
Segments: [segment data 2][segment data 3][segment data 4]
48+
Window: [ inspection window ]
49+
50+
Each segment's data is inspected together with the other available data. One consequence
51+
of this is that there can be significant rescanning of data, which has a performance impact.
52+
53+
http body inspection
54+
^^^^^^^^^^^^^^^^^^^^
55+
56+
Similar to the sliding window approach in the TCP stream engine, the HTTP body
57+
inspection will happen in a sliding manner by default. In IDS mode body data is
58+
buffered to the configured settings before inspection.
59+
60+
::
61+
62+
app-layer:
63+
protocols:
64+
http:
65+
libhtp:
66+
default-config:
67+
# auto will use http-body-inline mode in IPS mode, yes or no set it statically
68+
http-body-inline: auto
69+
70+
71+
file.data
72+
^^^^^^^^^
73+
74+
For HTTP, the ``file.data`` logic is the same as the body inspection above.
75+
76+
Exception Policies
77+
------------------
78+
79+
By default, when IPS mode is enabled, the exception policies are set to block (``drop``).
80+
This is to make sure rules cannot be bypassed due to Suricata reaching an error state in
81+
parsing, reaching internal resource limits and other exception conditions.
82+
83+
See :ref:`Exception Policies documentation <exception policies>`.
84+
85+
Differences from Firewall Mode
86+
------------------------------
87+
88+
The main difference is that unlike IPS mode, Firewall Mode has a default ``drop`` policy.
89+
This means that a ruleset must be created to allow traffic to be accepted, instead of
90+
accepting traffic by default and filtering out unwanted traffic.
91+
92+
See :ref:`Firewall Mode Design <firewall mode design>`.
File renamed without changes.

doc/userguide/setting-up-ipsinline-for-linux/IPtables.png renamed to doc/userguide/ips/setting-up-ipsinline-for-linux/IPtables.png

File renamed without changes.

doc/userguide/setting-up-ipsinline-for-linux/IPtables3.png renamed to doc/userguide/ips/setting-up-ipsinline-for-linux/IPtables3.png

File renamed without changes.

doc/userguide/setting-up-ipsinline-for-linux/iptables1.png renamed to doc/userguide/ips/setting-up-ipsinline-for-linux/iptables1.png

File renamed without changes.

doc/userguide/setting-up-ipsinline-for-linux/iptables2.png renamed to doc/userguide/ips/setting-up-ipsinline-for-linux/iptables2.png

File renamed without changes.

0 commit comments

Comments
 (0)