Commit Graph

144 Commits

Author SHA1 Message Date
Peter Müller
464b2117ea suricata.yaml: Fix Landlock path settings
Suricata will complain if it cannot read its own configuration file,
hence read-only access to /etc/suricata must be allowed. Since the list
applies to directories, rather than files, restricting read access to
only /usr/share/misc/magic.mgc is not possible; reading /usr/share/misc
must be allowed instead.

Fixes: #13645
Tested-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-04-29 12:45:19 +00:00
Peter Müller
3358151c85 Revert "suricata: Disable Landlock support"
This reverts commit b7da97fd59.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-04-29 12:45:05 +00:00
Michael Tremer
76ba16aef0 suricata: Change midstream policy to "pass-flow"
Pass packet isn't allowed here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-09 10:51:18 +01:00
Michael Tremer
b7da97fd59 suricata: Disable Landlock support
See #13645 for details.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-08 16:01:20 +00:00
Michael Tremer
b4847c387a suricata: Update require paths for Landlock
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-08 16:00:41 +00:00
Michael Tremer
763c7f67fa suricata: Enable midstream scanning
We require this because Suricata might be restarted due to development
or rule refreshment purposes. We should then try to resume any
decoders/app-layers wherever possible.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-08 14:57:49 +00:00
Stefan Schantl
76a4518091 suricata: Set midstream-policy to pass-packet
Set this value to the same as the exception-policy to keep in sync and
hopefully have the same behaviour. In case this option is not set an
ugly message about a not correctly set value will be logged to syslog
during startup.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-08 14:57:09 +00:00
Stefan Schantl
64e057aaa5 suricata: Enable landlock security feature
This will limit the suricata process to only read and write to a certain
files/directories.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-08 14:57:09 +00:00
Stefan Schantl
4d24d99461 suricata: Set exception-policy to pass-packet
This simply will skip processing a packet that caused an exception and will
allow Suricata to process all following packets of a flow.

Reference: #13638

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-08 14:57:09 +00:00
Stefan Schantl
a4ade63ef1 suricata: Update suricata.yaml
Updata the configuration file for suricata 7.

This includes:
* Default values for newly introduced features and parsers
* Enable recently added protocol parsers for HTTP2, QUIC, Telnet and Torrent
* Update of URL for documentation
* Fixes of various typos and other clarifications

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-08 14:57:09 +00:00
Michael Tremer
69031f7674 suricata: Disable fail-open on NFQUEUE
This change causes that if suricata crashes, the NFQUEUE will no longer
fall into a mode where ALL packets are being accepted. This used the be
the case before which opened the entire firewall.

If suricata randomly crashes, we will fall back to the "bypass" mode
where packets will bypass suricata, but nothing else.

Fixes: #13642
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-04-05 12:48:16 +01:00
Stefan Schantl
563e4a4298 ruleset-sources: Restore generic details about recently dropped providers
At least these informations are required to display something usefull
on the webgui, even if a provider has been dropped.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-03-22 15:18:41 +00:00
Adolf Belka
90e40b1948 ruleset-sources: removal of PT Attack & Secureworks + addition of ThreatFox
- The PT Attack ruleset has not been updated since 2021 and made read-only in 2022
   The PT Attack website no longer has any reference to Suricata Rulesets. The PT Attack
   ruleset is being removed.
- The Secureworks three rulesets are no longer available. The website path gives a 404
   error. No mention of Suricata rulesets in the Secureworks website. The Secureworks three
   rulesets are being removed.
- ThreatFox ruleset has been added to the list. Both a plain and archive version of the
   rules are available but the plain version is being regularly updated while the archive
   version was last updated 5 days ago. So this patch has implemented the plain version.
- All above was discussed in the January Developers Conference call.
- Tested out on my vm testbed. I had PT Attack selected as one of the providers. As
   mentioned by Stefan removing PT Attack means it is not available in the list of
   providers but the provider stays in the providers table but with the line shown in red.
   I will update the wiki to mention the red highlight and what it means.

Suggested-by: Stefan Schantl <stefan.schantl@ipfire.org>
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-02-16 12:29:15 +00:00
Stefan Schantl
422fce9cb0 ruleset-sources: Adjust download URL for snort community ruleset
Fixes: #13203

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-08-02 09:10:00 +00:00
Matthias Fischer
e79c4372ce suricata 6.0.8 - suggested change in 'suricata.yaml': set app-layer mqtt: enabled: yes
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-10-03 16:51:38 +00:00
Stefan Schantl
b77b41a579 ruleset-sources: Update download URL for Talos rulesets.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-23 13:24:10 +00:00
Stefan Schantl
91a8664b66 Revert "ruleset-sources: Remove support for PT Attack Team Detection rules."
The ruleset provider has recovered his github presence.

This reverts commit c8adaee195.
2022-04-25 21:15:23 +02:00
Stefan Schantl
249d796b4b convert-ids-backend-files: Wait until suricata has stopped sucessfully.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-25 20:12:19 +02:00
Stefan Schantl
adce5b1c8f convert-ids-backend-files: Stop and start suricata during runtime.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-22 13:31:51 +02:00
Stefan Schantl
615fd78f92 convert-ids-backend-files: Set correct ownership for suricata used
rulefiles file.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-22 09:13:41 +02:00
Stefan Schantl
c8adaee195 ruleset-sources: Remove support for PT Attack Team Detection rules.
All of a sudden this ruleset provider has dissapeared from Github.

I was not able to find any further details or web page or the ruleset
anymore.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-22 05:47:21 +02:00
Stefan Schantl
f7eedacb43 convert-ids-backend-files: Restart suricata if the IDS is running.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 15:51:06 +02:00
Stefan Schantl
b75baeff28 suricata: Do not longer install YAML file for default rules.
This file got obsolete, because it's content will be generated
dynamically by the backend code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 14:42:22 +02:00
Stefan Schantl
2e558477da convert-ids-backend-files: Convert MONITOR_TRAFFIC_ONLY settings.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-16 14:39:09 +02:00
Stefan Schantl
c2eac6fcd4 convert-ids-backend-files: Move already downloaded files to new
location.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-15 05:52:01 +02:00
Stefan Schantl
c215cfd887 convert-ids-backend-files: Remove old backend related files.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-15 05:13:23 +02:00
Stefan Schantl
70b1672d94 convert-ids-backend-files: Remove converted files.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-15 05:12:56 +02:00
Stefan Schantl
9f7702544a convert-ids-backend-files: Regenerate ruleset and used rulesets file.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-15 05:10:45 +02:00
Stefan Schantl
c00609ce56 convert-ids-backend-files: Successor of the
convert-ids-modifications-files converter.

This converter also will convert the used rulesfiles file for the
providers.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-14 06:18:56 +02:00
Stefan Schantl
8d6714edc8 ids-functions.pl: Change backend to use one file to load the used
rulefiles.

Suricata seems to struggle when using multiple and/or nested includes in
the same config section. This results in a only partially loaded
confguration where not all rulefiles are loaded and used.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-04-09 14:10:13 +02:00
Stefan Schantl
8114440752 convert-ids-modification-files: New converter.
This converter is responsible to convert the old oinkmaster modification
files into the new files and format.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-03-26 12:12:55 +01:00
Matthias Fischer
34a7a97dcd ids: Fixed typo in ruleset-sources
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-14 15:15:57 +00:00
Arne Fitzenreiter
6e2c8f4818 suricata: drop unsupported JA3 rule provider
our current suricata version not support JA3 based rules so
this drop the providers from the list.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2022-02-26 14:19:45 +00:00
Stefan Schantl
9b53f65107 convert-ids-multiple-providers: Set correct ownership for default rules
file.

Otherwise the file would belong to root and is not write-able by the
WUI.

Fixes #12759.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-01-08 16:16:47 +01:00
Stefan Schantl
9cfcc7e546 convert-ids-multiple-providers: Do not try to set ownership for file
which is not longer used.

Fixes #12758.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-01-08 16:00:28 +01:00
Stefan Schantl
acbbcde422 ruleset-sources: Update download URL for Talos rulesets.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-01-02 10:34:44 +01:00
Stefan Schantl
636a79650b suricata.yaml: Set collection of stat to off.
Suricata will print a warning on startup if the collection of stats
is enabled but no stats logger, which will print them out is enabled.

Acctually we do not use any stats so this safely can be disabled.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 15:55:45 +01:00
Stefan Schantl
ec03b64e9f suricata.yaml: Set default log level to Info.
This will prevent suricata from displaying a warning on startup and
anyway would be the log level which suricata switches in such a case.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 15:53:55 +01:00
Stefan Schantl
ee87c2e33a suricata.yaml: Add config options for modbus, dnp3 and enip protocols.
All of them are disabled by default, but may be needed in some
environments and so easily can be enabled there.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 15:51:58 +01:00
Michael Tremer
5a3e97b8d3 suricata: Load *.config files from default location
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-12-19 13:31:13 +01:00
Stefan Schantl
302420ad4a convert-ids-multiple-providers: Fix setting ownership for the main
oinkmaster provider includes file.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
a2964e14f8 convert-ids-multiple-providers: Proper open the oinkmaster providers
sids file for writing.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
c0727f8b45 convert-ids-multiple-providers: Fix typo which tried to load the wrong
lib.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
cd13dbc544 convert-ids-multiple-providers: Remove old used rulefiles file.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
f901c7401c convert-ids-multiple-providers: Always remove old enabled / disabled
sids files.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
17b9a1581c convert-ids-multiple-providers: Restart suricata afterwards.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
77b373d620 IDS: Add convert-ids-multiple-provider script.
This converter does all the magic to convert any suricata
based IPFire version to work with the new multiple providers
IDS.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
58d368d11c convert-snort: Adjust converter to work with new IDS.
Only in case if somebody tries to import such an old backup.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
1aa3dbf56d ruleset-sources: Update download URL for Talos rulesets.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00
Stefan Schantl
6cbed0c213 ruleset-sources: Add additional providers.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2021-12-19 13:23:44 +01:00