15 Commits

Author SHA1 Message Date
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
Leo-Andres Hofmann
abffcc99ad Refactor "get_available_network_zones", move to network-functions.pl
This function nicely translates the ethernet/settings "CONFIG_TYPE"
into a list of available zones. Therefore it should be more accessible!

Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-25 19:32:38 +00:00
Stefan Schantl
e698090e7f IDS: Dynamically generate and import the HTTP ports.
With this commit suricata reads the HTTP port declarations from a newly
introduced external file
(/var/ipfire/suricata/suricata-http-ports.yaml).

This file dynamically will be generated. HTTP ports always are the
default port "80" and "81" for update Accelerator and HTTP access to the
WUI. In case the Web-proxy is used, the configured proxy port and/or Transparent
Proxy port also will be declared as a HTTP port and written to that file.

In case one of the proxy ports will be changed, the HTTP port file will
be re-generated and suricate restarted if launched. Also if an old
backup with snort will be restored the convert script handles the
generation of the HTTP ports file.

Finally the suricata-generate-http-ports-file as a tiny script which
simply generates the http ports file and needs to be launched during the
installation of a core update. (The script will no be required
anymore, so it could be deleted afterwards.)

Fixes #12308.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-06 14:04:00 +00:00
Stefan Schantl
cde7cab264 convert-snort: Check and convert snort user and group.
Fixes #12102.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-01-03 21:15:11 +00:00
Stefan Schantl
bb2696da35 convert-snort: Generate DNS servers file.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-13 19:14:03 +00:00
Stefan Schantl
f1add9a8dd convert-snort: Adjust code to use changed modify_sids_file function.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-05 12:42:00 +01:00
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
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
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
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
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
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