Commit Graph

12370 Commits

Author SHA1 Message Date
Stefan Schantl
80bcd4dd1a ids.cgi: Hide rules config section if no rules a present
Do not show the rules config section anymore if there is not
ruleset available.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-30 18:18:26 +02: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
762a33f17c suricata: Add files to be backuped
Now all oinkmaster related config files and suricata
related yaml files in "/var/ipfire/suricata/" will be
included into the backups.

Also the entire ruleset is part of the backup, so after a
backup has been restored, the IDS can be used in the same way
as before.

Fixes #11835.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-30 14:13:37 +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
d2e6bf6e5f suricata: Do not ship an example configuration file
Stop shipping a full example configuration file for suricata.

Fixes #11836.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-29 12:27:12 +02:00
Stefan Schantl
00512a5ac8 ids.cgi: Create file for used rulefiles on first execution if not present
Create this file on first execution of the script if it does not exist yet.
This will allow suricata to imediately be started. Otherwise the ruleset has
to be downloaded and configured before this file has been created and suricata
could be launched.

Fixes #11833.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-29 11:50:59 +02:00
Stefan Schantl
004b13b7e8 ids.cgi: Fix get_memory_usage()
Change the get_memory_usage() function to grab and return the
memory usage of the entire process, containing all sub-processes and
threads.

Fixes #11821

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-29 10:55:32 +02:00
Stefan Schantl
be52c68a2d ids-functions.pl: Early abort downloadruleset() if no ruleset is configured
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-27 15:11:28 +02:00
Stefan Schantl
e568796bb0 ids-functions.pl: Also check and fix the permissions of rulespath
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-25 15:48:58 +02:00
Stefan Schantl
4892f82ca1 suricata: Fix rootfile
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-25 15:22:53 +02:00
Stefan Schantl
baeae34658 lfs/suricata: Move classification and reference config to /etc/suricata/rules
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 15:15:09 +02:00
Stefan Schantl
330759d88a ids-functions.pl: Add priviate function _check_rulesdir_permissions()
This function checks if all files located in /etc/suricata/rules are
writable by the effective user and group (nobody:nobody) and if not
calls suricatactl to fix it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 14:55:40 +02:00
Stefan Schantl
68123effb8 suricatactrl: Add fix-rules-dir command
This command is used to set the ownership and permissions
back to nobody:nobdoy which is used by the WUI to write the
ruleset.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 14:54:34 +02:00
Stefan Schantl
9074853d8d suricatactrl: Add reload command
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 14:27:01 +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
Stefan Schantl
af5e823247 suricata.yaml: Adjust classification and reference config location
Both files are included in the various rulesets, therefore use them
from the rules folder.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 10:54:07 +02:00
Stefan Schantl
13d077fdf2 suricata.yaml: Fix include statement for homenet file
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 10:28:42 +02:00
Stefan Schantl
5f63067385 suricata: Fix initscript when using a single core machine
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 10:04:33 +02:00
Stefan Schantl
01ba4be48d ids.cgi: Create oinkmaster related files at first call
With this commit, the CGI file will create the oinkmaster related
files during first run if they does not exist.

Fixes #11822.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 07:39:04 +02:00
Stefan Schantl
308ba5e74c ids-functions.pl: Add function to create empty files
This generic function can be used to create any kind of emtpy files -
it just requires the full path and filename to work.

If the specified file exists at calltime, the function will abort
to prevent from overwriting existing files and content.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-24 07:37:10 +02:00
Stefan Schantl
cb52183c6a Fix merge conflicts during merge of next and the suricata branch 2018-08-23 10:34:17 +02:00
Stefan Schantl
7fe5bc8261 Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next 2018-08-23 10:32:21 +02:00
Michael Tremer
702f0ba835 core124: Ship updated firewall.cgi
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:46:53 +01:00
Alexander Marx
d303638793 BUG11805: Firewall rule with source orange and target firewall-interface-orange not possible
Now its possible to create a rule with orange source and target orange interface of the firewall.

Fixes: #11805

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:46:10 +01:00
Michael Tremer
7141cb1ee4 core124: Fix typo in rootfile
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:17:15 +01:00
Michael Tremer
8e11e1e869 core124: Ship updated AWS setup scripts
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:06:53 +01:00
Michael Tremer
84cd9b9162 Drop the network-trigger script
This is done at boot time and doesn't normally need to be done again.

On AWS or in the setup, renaming any network interfaces is being
handled automatically.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:05:43 +01:00
Michael Tremer
f3d59d2c94 firstsetup: There is no need to restart udev here
All network interfaces are renamed accordingly in setup

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:02:43 +01:00
Michael Tremer
c5465a9453 aws: Let udev rename all network interfaces
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-22 14:00:39 +01:00
Stefan Schantl
c5486ccb97 oinkmaster: Ship IPFire specific config file
Ship an IPFire specific configuration file for oinkmaster.

This allows oinkmaster to do all the great rule modifications which
have been introduced by the new ids.cgi file.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-22 10:37:44 +02:00
Stefan Schantl
d221283622 ids.cgi: Rework handling of enabled/disabled sids
Now the enabled or disabled sids are stored in a single
hash instead of two arrays, which easily can be modified.

When saving the ruleset, the new read_enabled_disabled_sids() function
will be used to read-in the current (old) saved enabled or disabled sids
and add them to the new hash structure.

After adding or modifiying sids to the hash, the entries will be written
to the corresponding files.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-22 08:39:57 +02:00
Stefan Schantl
a5d617520b ids.cgi: Add function to read the enabled/disabled sid files
This function is used to read-in the files for enabled or disabled sid
files and stores the sid and their state into a temporary hash which will
be returned by the function.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-22 08:38:16 +02:00
Matthias Fischer
caf5dcb1e7 nano: Update to 2.9.8
For details see:
https://www.nano-editor.org/news.php

Best,
Matthias

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-21 19:50:02 +01:00
Stefan Schantl
5a28e721e0 ids.cgi: Fix check if the IDS is running
The correct function name is ids_is_running()!

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-21 19:18:01 +02:00
Michael Tremer
0ff9099443 core124: Ship updated backup include/exclude files
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-21 15:06:22 +01:00
Michael Tremer
f868ccb763 backup: Add root's SSH keys and settings
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-21 15:05:40 +01:00
Michael Tremer
9b0618c09f backup: Add custom squid configuration files
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-21 15:05:13 +01:00
Michael Tremer
7486e30eeb backup: Order incldue/exclude alphabetically
Nothing has been added or removed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-21 11:32:04 +01:00
Arne Fitzenreiter
3b81e38a08 gcc: x86_64 add libspp to rootfile
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2018-08-20 17:38:31 +02:00
Stefan Schantl
bbb6efae56 ids.cgi: Add backend code to handle switch between IDS and IPS mode
This commit adds the required backend code to allow switching
between IDS and IPS mode of suricata.

Technically the behaviour of suricata is specified by the rules -
each of them can contain the action "alert" or "drop" (There are
more actions supported but these two are currently the important one)

When running in IDS mode, the ruleset does not need to be touched,
because the default action is "alert". When switching to IPS mode,
the CGI writes a single line to "oinkmaster-modify-sids.conf" which
is included by oinkmaster and modify the action for each single rule
from alert to drop.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-18 15:10:44 +02:00
Stefan Schantl
a4ccfcbbc6 ids.cgi: Allow to switch between IDS/IPS mode
Add the option to select the runmode for suricata, wheater it
should run in intrusion detection mode or intrusion prevention mode.

If the option has not configured yet, it defaults to IPS mode.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-18 10:16:12 +02:00
Stefan Schantl
d9711d91ef ids-functions.pl: Display error if oinkmaster cannot be executed
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-18 10:01:14 +02:00
Stefan Schantl
88daf7eb3a ids-functions.pl: Log correct error message if download fails
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-17 08:49:06 +02:00
Stefan Schantl
55658ee381 suricata: Fix detection of enabled IDS on zone in initscript
I accidently commited the wrong file in the previous commit.
This is the fixed and working version.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-08-17 08:45:47 +02:00
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
Matthias Fischer
943cfcc311 bind: Update to 9.11.4-P1
Fixes CVE-2018-5740 and CVE-2018-5738.

For details see:
http://ftp.isc.org/isc/bind9/9.11.4-P1/RELEASE-NOTES-bind-9.11.4-P1.html

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-16 20:11:39 +01:00
Michael Tremer
c6b97a0681 core124: Ship updated pciutils
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-16 18:55:49 +01:00
Peter Müller
70e4a5b276 pciutils: update to 3.5.6
The third version of this patch superseds the first and
second one which were broken due to bugs in the MUAs GPG
implementation.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-16 18:55:13 +01:00
Michael Tremer
c708276290 core124: Ship updated ids.cgi
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-08-16 18:54:41 +01:00