]>
git.ipfire.org Git - ipfire-2.x.git/blob - config/suricata/convert-ids-modifysids-file
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2019 IPFire Development Team <info@ipfire.org> #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
24 require '/var/ipfire/general-functions.pl';
25 require "${General::swroot}/ids-functions.pl";
27 exit unless(-f
$IDS::ids_settings_file
and -f
$IDS::rules_settings_file
);
30 ## Step 1: Re-generate and write the file to modify the ruleset.
33 # Call subfunction and pass the desired IDS action.
34 &IDS
::write_modify_sids_file
();
36 # Set correct ownership.
37 &IDS
::set_ownership
("$IDS::modify_sids_file");
40 ## Step 2: Call oinkmaster to extract and setup the rules structures.
43 # Check if a rulestarball is present.
44 if (-f
$IDS::rulestarball
) {
45 # Launch oinkmaster by calling the subfunction.
48 # Set correct ownership for the rulesdir and files.
49 &IDS
::set_ownership
("$IDS::rulespath");
53 ## Step 3: Reload the IDS ruleset if running.
56 # Check if the IDS should be started.
57 if(&IDS
::ids_is_running
()) {
58 # Call suricatactrl and reload the rules.
59 &IDS
::call_suricatactrl
("reload");