Commit Graph

12382 Commits

Author SHA1 Message Date
Stefan Schantl
6c9458342b IDS: Update language files
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-26 14:42:47 +02:00
Stefan Schantl
3aadbbca38 stage2: Rootfile update for update-ids-ruleset script
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-26 14:38:46 +02:00
Stefan Schantl
82979dec36 IDS: Introduce update-ids-ruleset
This script periodly will be called by fcron
and is responsible for downloading and altering
the ruleset, if autoupdate of the configured ruleset is
enabled.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-26 14:11:31 +02:00
Stefan Schantl
ed06bc811f ids-functions.pl: Add backend code to handle the "cron" function of suricatactrl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-26 14:09:53 +02:00
Stefan Schantl
6ce504a2f2 suricatactrl: Add "cron" command
This command allows to enable the automatic update
of the used IDS ruleset and to specify the update interval.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-26 13:54:14 +02:00
Stefan Schantl
dae534f2ca ids.cgi: Only write oinkmaster-modify-sids.conf if neccessary.
Only write to the file if the runmode of the IDS has been changed.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-26 13:02:28 +02:00
Stefan Schantl
5508f18c01 logs.cgi/log.dat: Fix pattern to display oinkmaster related messages
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-11 12:28:28 +02:00
Stefan Schantl
43ab7d9c30 ids.cgi: Set state of used rulefile to on if it contains rules
Only set the state of a used rulefile to "on" if it is present in
the %idsrules hash. This happens if it contains at least one rule.

This prevents from showing a rulefile in the ruleset section if, it
does not exist anymore or does not contains any rules at all.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-11 12:00:31 +02:00
Stefan Schantl
b7e2974394 ids.cgi: Introduce whitelisting of IP-addresses
If an IP-address has been added to the whitelist, any traffic from
this host will not longer inspected by suricata.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-11 11:58:11 +02:00
Stefan Schantl
6f3b3cd089 logs.cgi/ids.dat: Dont display/export empty events.
Check if the current processed event has at least datetime and a title.
Otherwise skip it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-06 14:04:17 +02:00
Stefan Schantl
63d911cdc5 logs.cgi/ids.dat: Ease list of reported events
Just ease the strict layout by adding a simple line break.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-06 13:22:18 +02:00
Stefan Schantl
f5ddcad1cc logs.cgi/ids.dat: Adjust code to show suricata events
As default show the events generated by suricata and if
for a certain selected date no suricata log is available
try to fall-back to read the events from the old snort
alert files (if available).

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2018-09-06 12:09:34 +02:00
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