Commit Graph

58 Commits

Author SHA1 Message Date
Stefan Schantl
25d424387e convert-snort: Fix ownership of the generated homenet file.
Fixes #12059.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-23 20:54:54 +01:00
Michael Tremer
5061292091 suricata: EXTERNAL_NET should equal any
This enables that we scan servers in ORANGE for clients in
GREEN which absolutely makes sense.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-23 20:45:42 +01:00
Stefan Schantl
6e7c8a3303 suricata: Disable stats.log
This log is mainly needed for debugging the IPS. It writes some stats
every couple of seconds and will create some load on SD cards and other
cheap storage that we do not need.

Fixes #12056.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-20 14:09:21 +01:00
Michael Tremer
64aed99df6 suricata: Change runmode to workers
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-17 19:15:29 +01:00
Michael Tremer
dccbdf5b97 suricata: Take as much off of the CPU as possible
https://suricata.readthedocs.io/en/suricata-4.1.3/performance/high-performance-config.html

This will compile the ruleset as efficient as possible and
allows the IPS to run faster on smaller systems.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-12 17:59:21 +01:00
Stefan Schantl
ee82349a0e convert-snort: Re-order steps at end of script
This will ensure that the whole IDS is configured property, if
no or an empty snort config file is present.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-08 21:15:35 +01:00
Stefan Schantl
e4bc9b8b6f convert-snort: Fix logic for detecting enough free disk space.
The subfunction only will return something if the check fails - so the logic
of the if statement was wrong set and the downloader only was called if
this check failed and to less diskspace would be available.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-08 21:15:35 +01:00
Michael Tremer
f903d3a6f0 suricata: Disable CPU affinity
Benchmarks have shown, that this is making the IPS slower
across various hardware

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-04 22:02:53 +01:00
Michael Tremer
35cdc506b0 suricata: Enable CPU affinity
This will tie the detection threads to a certain CPU and
slightly increases throughput on my system.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-03-26 21:58:01 +00:00
Michael Tremer
38081b8be1 suricata: Run as non-root user
This patch does not have any effect (yet) and is untested
because suricata needs to be built against libcap-ng which
is currently not being packaged for IPFire.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-10 18:02:39 +01:00
Stefan Schantl
2bec60c347 suricata: Update to 4.1.3
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-10 17:34:03 +01:00
Michael Tremer
26c758cf48 suricata: Drop parsers I have never heard of
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-03 10:55:31 +01:00
Michael Tremer
8efbd71caa suricata: Configure HTTP decoder
This will now scan all request and response bodies where possible
and use up to 256MB of RAM

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-03 10:55:31 +01:00
Michael Tremer
96495c9aa2 Revert "Suricata: detect DNS events on port 853, too"
This reverts commit ad99f959e2.

It does not make any sense to try to decode the TLS connection
with the DNS decoder.

Therefore should 853 (TCP only) be added to the TLS decoder.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-03 10:55:30 +01:00
Michael Tremer
5d04cfe7d5 suricata: Use highest bit to mark packets
We are using the netfilter MARK in IPsec & QoS and this
is causing conflicts.

Therefore, we use the highest bit in the IPS chain now
and clear it afterwards because we do not really care about
this after the packets have been passed through suricata.

Then, no other application has to worry about suricata.

Fixes: #12010
Signed-off-by: Arne Fitzenreiter <arne.fitzenreiter@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:48 +01:00
Michael Tremer
c9ee3592f0 suricata: Fix syntax error
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:47 +01:00
Michael Tremer
99d75ac72e suricata: Start capture first and then load rules
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:47 +01:00
Michael Tremer
890f1bf295 suricata: Disable decoding for Teredo
This decoder is not very accurate and Teredo has been
disabled in Windows by default. Nobody will use this.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:47 +01:00
Michael Tremer
0b340f0938 suricata: Increase memory size for the stream engine
This change also ensures that suricata has a decent number
of streams preallocated to be able to handle any bursts in traffic.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:47 +01:00
Michael Tremer
ab1444b4f4 suricata: Log to syslog like a normal process
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:47 +01:00
Michael Tremer
47cb057145 suricata: Use up to 256MB of RAM for the flow cache
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:47 +01:00
Michael Tremer
7eed864c93 suricata: Use 64MB of RAM for defragmentation
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:46 +01:00
Michael Tremer
83b576c892 suricata: Use the correct path for the magic database
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:46 +01:00
Michael Tremer
682f1fdaca suricata: We do not use any IP reputation lists
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:46 +01:00
Michael Tremer
cf976e93c4 suricata: Allow 32MB of RAM for DNS decoding
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:29 +01:00
Michael Tremer
fe5bd1862f suricata: Drop sections that require Rust
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:55:26 +01:00
Michael Tremer
bc2cb52953 suricata: Drop some commented stuff from configuration
The file is really large and we should not carry anything we will
never use.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:55:26 +01:00
Michael Tremer
75fba6cd24 suricata: Drop profiling section from configuration
This is not compiled in as it slows down detection and is
only really useful for debugging

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:55:26 +01:00
Michael Tremer
5196d8ddbb suricata: Set detection profile to high
This will merge rules more aggressively so that the engine
is only processing those that can actually match.

Memory is cheap. People with little memory should not run
suricata anyways.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:55:25 +01:00
Michael Tremer
9f726f8f53 suricata: Set default packet size to 1514
We usually use a MTU of 1500 + Ethernet header

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:55:25 +01:00
Michael Tremer
16446608cb suricata: Set max-pending-packets to 1024
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:55:25 +01:00
Peter Müller
1f3c61b66c Suricata: detect TLS traffic on port 444, too
This is the default port for IPFire's administrative web interface
and should be monitored by Suricata, too.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
c: Stefan Schantl <stefan.schantl@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:53:04 +01:00
Stefan Schantl
cc636c4741 convert-snort: Try to download ruleset if none is present.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-22 10:04:27 +01:00
Stefan Schantl
5d7d8749dc convert-snort: Set correct ownership after modify_sids_file has been generated.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-18 13:33:41 +01:00
Stefan Schantl
20b4c4d863 suricata: Swith to "16" as repeat-mark and repeat-mask.
Marks "1-3" are used for marking source-natted packets on the
interfaces and 4 up to 6 for TOS and QOS. The mark "32" is used by IPsec.

See commit: f5ad510e3c

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-18 10:02:29 +01:00
Stefan Schantl
78690361ab convert-snort: Always create directory and filelayout
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-14 12:37:13 +01:00
Stefan Schantl
b09c13f1b6 convert-snort: Call subfunction to change ownership of rulestarball
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-14 12:15:41 +01:00
Stefan Schantl
4434236e00 ruleset-sources: Update sourcefire rulesets to latest snapshot version
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-08 09:55:46 +01:00
Peter Müller
ad99f959e2 Suricata: detect DNS events on port 853, too
As DNS over TLS popularity is increasing, port 853 becomes
more interesting for an attacker as a bypass method. Enabling
this port for DNS monitoring makes sense in order to avoid
unusual activity (non-DNS traffic) as well as "normal" DNS
attacks.

Partially fixes #11808

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Cc: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-07 21:26:50 +01:00
Peter Müller
8723bb91ae Suricata: enable full detection for missing protocols
These are IMAP and MSN, which can be safely enabled.

Partially fixes #11808

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Cc: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-07 21:26:46 +01:00
Peter Müller
05a635ec04 Suricata: detect TLS traffic on IMAPS/POP3S/SSMTP ports as, well
Partially fixes #11808

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Cc: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-07 21:26:43 +01:00
Stefan Schantl
067e1847dc suricata.yaml: Add port 222 to list of SSH Ports
The SSH-server listened on port "222" as default on IPFire in the past.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-01 14:34:25 +01:00
Peter Müller
8059239661 Suricata: drop unused cuda HW acceleration
As stated in https://bugzilla.ipfire.org/show_bug.cgi?id=11808#c5 ,
Cuda hardware acceleration is unused and so the configuration file
section can be removed.

This partially addresses #11808.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Cc: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-01-29 14:07:43 +01:00
Stefan Schantl
36e69d34b1 convert-snort: Use set_ownership() from ids-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-01-29 09:05:29 +01:00
Stefan Schantl
4fbd88bfad ruleset-sources: Add Emerging-Threads Pro ruleset
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-01-29 09:01:20 +01:00
Stefan Schantl
5b0b4182a8 convert-snort: Settings converter from snort to suricata
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-01-22 15:36:00 +01:00
Stefan Schantl
f5ad510e3c suricata: Use "2" as repeat-mark and repeat-mask.
The previous used "1" was already used to mark source-natted
packets.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-12-17 15:04:48 +01:00
Stefan Schantl
fd72c85eb8 Enable threshold file in suricata.yaml
Enable and specify the path to the threshold-file in the suricata.yaml,
otherwise the programm is trying to read it from a build-in default
location and prints the following error message:

Error opening file: "/etc/suricata//threshold.config": No such file or directory

Fixes #11837.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-30 15:12:29 +02:00
Stefan Schantl
21cab141ec suricata: Rule files are now located in /var/lib/suricata
Place the rulefiles from now in "/var/lib/suricata".

Fixes #11834

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-29 12:37:44 +02:00
Stefan Schantl
335114b207 suricata.yaml: Start moving to IPFire specific configuration
Remove a lot of stuff and options which are deactivated during compiling,
unsupported by the plattform or not used in IPFire.

Add an advice to the full documented suricata-example.yaml file which also
is shipped by IPFire.

More work needs to be done.

See #11808

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 13:41:38 +02:00