Commit Graph

12185 Commits

Author SHA1 Message Date
Stefan Schantl
00a031145e suricata: Give 644 permissions to the suricata pidfile
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-17 08:24:19 +02:00
Stefan Schantl
04b5c77a45 ruleset-sources: Move to suricata optimized ruleset when using emerginthreads.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-17 07:36:54 +02:00
Stefan Schantl
3c2c54831f suricata: Add code to create iptables rules to the initscript
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-16 18:51:13 +02:00
Stefan Schantl
7c82ee6165 firewall: Add chains for IPS (suricata)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-16 18:50:39 +02:00
Stefan Schantl
cc60d3dfd3 suricata: Fix include of used rulefiles yaml
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-12 18:40:31 +02:00
Stefan Schantl
4230305558 suricata: Use HOME_NET declaration from external file
Use the gernerated HOME_NET details from
/var/ipfire/suricata/suricata-homenet.yaml which will be
generated by the WUI.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-12 07:05:24 +02:00
Stefan Schantl
6187da5055 IDS: Add reload option to initscript
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-11 22:28:07 +02:00
Stefan Schantl
e2e7880dc7 ids.cgi: Add code to start/stop/reload the IDS when neccessary
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-11 22:11:18 +02:00
Stefan Schantl
5240a80987 ids-functions.pl: Add function to call suricatactrl binary
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-11 22:10:29 +02:00
Stefan Schantl
8d2f6b0b59 ids.cgi: Dynamically generate the HOME_NET details for suricata.
Introduce generate_home_net_file() which uses the current network
config to obtain the network address and subnetmask for each
available network zone, generate and write these HOME_NET information
into a yaml compatible file which can be included into the suricata
configuration file.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-09 15:33:25 +02:00
Stefan Schantl
e0bfd338ee ids.cgi: Rename form name from SNORT to IDS
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-05 19:42:33 +02:00
Stefan Schantl
8766096429 ids.cgi: Display if the IDS is running
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-05 14:24:20 +02:00
Stefan Schantl
796eea2154 ids-functions.pl: Add function to check if the IDS is running
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-05 14:23:45 +02:00
Stefan Schantl
1286e0d41e ids.cgi: Rework section to configure the IDS
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-05 12:57:44 +02:00
Stefan Schantl
1cae702c22 ids-functions.pl: Add function to get the available network zones
The get_available_network_zones() function uses the /var/ipfire/ethernet/settings
file and translates the configured mode into an array, which contains the names
of the configured network zones.

The array will be returned and easily can be used to loop over this list of
available network zones and perform any kind of actions in other scripts.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-05 10:33:46 +02:00
Stefan Schantl
ab114c276b ids.cgi: Call suricatactrl for restarting the IDS
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-03 13:51:59 +02:00
Stefan Schantl
06b569a442 oinkmaster: Install config file to /var/ipfire/suricata
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-03 13:48:46 +02:00
Stefan Schantl
d33874f496 daq: Drop package
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-03 10:20:18 +02:00
Stefan Schantl
843a8c570c snort: Drop package
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-03 10:19:35 +02:00
Stefan Schantl
914cca3d8e initscripts: Link against suricata initscript in runlevels and red.up hook
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-03 10:02:34 +02:00
Stefan Schantl
74b7d695c6 misc-progs: Rename snortctrl to suricatactrl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-03 09:50:31 +02:00
Stefan Schantl
ef640882ab make.sh: Add ids-ruleset-source
I accidently forgot to commit this file in 1d9b879140

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 19:58:41 +02:00
Stefan Schantl
d72b3e64c2 suricata: Introduce basic initscript
Add a very basic initscript, which currently allows to start/stop/restart suricata and
check if the daemon is running.

The script will detect when starting suricata how many CPU cores are present on the system and
will launch suricata in inline mode (NFQUEUE) and listen to as much queues as CPU cores are
detected.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 19:54:22 +02:00
Stefan Schantl
101d3ece24 ids-ruleset-sources: Update download URL for snort rules
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 19:33:37 +02:00
Stefan Schantl
bce84f3975 ids-functions.pl: Rename ruleset-sources.list to ruleset-sources
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 19:31:52 +02:00
Stefan Schantl
1d9b879140 ids-ruleset-sources: New package
Move the file which contains the download URL's for the IDS rulesets
into an own common package. This will allow us in future to easily ship
a changed file with a core update.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 19:29:36 +02:00
Stefan Schantl
72b2109c72 configroot: Move from snort to suricata
Create /var/ipfire/suricata and /var/ipfire/suricata/settings instead of
/var/ipfire/snort and /var/ipfire/snort/settings.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 15:47:31 +02:00
Stefan Schantl
4c6d6c1ee3 suricata: Install very basic config file
This config file is mostly based on the example configuration shipped
by the suricata project and needs to be enhanched.

See #11808.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 09:10:25 +02:00
Stefan Schantl
101c888174 ids.cgi: Generate suricata compatiple used-rulefiles file
* Rename filename to suricata-used-rulefiles.yaml
 * Adjust file generation as a yaml file to be compatible with suricata
 * Adjust code to correctly read-in and parse the changed file

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-02 09:07:12 +02:00
Stefan Schantl
164eab6627 ids-functions.pl: Move path details from snort to suricata
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-30 21:36:07 +02:00
Stefan Schantl
a8b8c9e5b2 Merge branch 'next-new-ids.cgi' into next-suricata-and-cgi 2018-07-30 21:33:25 +02:00
Stefan Schantl
67752a9510 suricata: New package
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-30 21:31:15 +02:00
Stefan Schantl
3498300d87 libhtp: New package
This is build and runtime dependency for suricata.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-29 09:45:05 +02:00
Stefan Schantl
91cc908f84 yaml: New package
This is a build and runtime dependency for suricata.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-29 09:44:52 +02:00
Stefan Schantl
434001d0a0 IDS: Rework error and log handling in ids-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-28 16:34:50 +02:00
Stefan Schantl
02844177af IDS: Introduce settingsdir variable
The $settingsdir variable is declared in the ids-functions.pl and used to to
store the path where the various files which contains the settings for the IDS and
oinkmaster is located.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-27 07:58:23 +02:00
Stefan Schantl
298ef5bafa IDS: Move rulepath declaration to ids-functions.pl
This will help if the path ever changed. Also remove hard coded rulepath
from oinkmaster call.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 15:56:47 +02:00
Stefan Schantl
9d18656ba7 ids.cgi: Rename snortrules hash to idsrules.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 15:51:15 +02:00
Stefan Schantl
fdfd8913ab ids.cgi: Drop code which is detecting if oinkmaster is running
This code is not longer required and therefore can be dropped.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:59:44 +02:00
Stefan Schantl
27760092c0 ids.cgi: Reimplement function to lock page and show working notice
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:59:31 +02:00
Stefan Schantl
eb5592c1ce ids-functions.pl: Also log errors to syslog
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:59:15 +02:00
Stefan Schantl
0e40e1e772 ids-functions.pl: Use pure perl to log oinkmaster result to syslog
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:58:54 +02:00
Stefan Schantl
7791079275 ids-functions.pl: Make variables globally accessible
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:58:39 +02:00
Stefan Schantl
3983aebdec ids.cgi: Rework CGI logic to download a new ruleset
* Drop function to show a notice about snort is working.
* Introduce the log_error function which is responsible for log any
  error messages. Currently it writes it to a tempory file, which will
  be read by the WUI, the message will be displayed and the temporary file
  will be released again.
* Introduce a tiny function to easily perform a reload of the generated
  webpage.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:58:01 +02:00
Stefan Schantl
a69b96d200 ids.cgi: Use tarball information from ids-functions.pl
Directly use the value from the ids-functions.pl for the
location and filename of the tarball which includes the snort ruleset.

This will save to declare this information twice and prevents from any
failures if the location of filname every changes.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:57:23 +02:00
Stefan Schantl
ad1d8a8acc ids.cgi: Drop dirty hook for updating the ruleset
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:57:00 +02:00
Stefan Schantl
25f5cb0d4b ids.cgi: Move function to call oinkmaster to ids-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:56:45 +02:00
Stefan Schantl
eea2670b39 ids.cgi: Move downloader code to ids-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:56:28 +02:00
Stefan Schantl
59052432f4 ids.cgi: Use ids-functions.pl for checking available discspace
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:56:03 +02:00
Stefan Schantl
8dcebe5342 IDS: Introduce ids-functions.pl.
This library will contain a set of functions used by the IDS CGI script
and the planned update script for auto-updating the snort ruleset.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-07-26 11:54:25 +02:00