mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
ids.cgi: Check if the selected ruleset requires an oinkcode
Fixes #11983 Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -296,18 +296,32 @@ if(-f $IDS::used_rulefiles_file) {
|
|||||||
# Save ruleset configuration.
|
# Save ruleset configuration.
|
||||||
if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
|
if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
|
||||||
my %oldsettings;
|
my %oldsettings;
|
||||||
|
my %rulesetsources;
|
||||||
|
|
||||||
# Read-in current (old) IDS settings.
|
# Read-in current (old) IDS settings.
|
||||||
&General::readhash("$IDS::rules_settings_file", \%oldsettings);
|
&General::readhash("$IDS::rules_settings_file", \%oldsettings);
|
||||||
|
|
||||||
|
# Get all available ruleset locations.
|
||||||
|
&General::readhash("$IDS::rulesetsourcesfile", \%rulesetsources);
|
||||||
|
|
||||||
# Prevent form name from been stored in conf file.
|
# Prevent form name from been stored in conf file.
|
||||||
delete $cgiparams{'RULESET'};
|
delete $cgiparams{'RULESET'};
|
||||||
|
|
||||||
# Check if an oinkcode has been provided.
|
# Grab the URL based on the choosen vendor.
|
||||||
if ($cgiparams{'OINKCODE'}) {
|
my $url = $rulesetsources{$cgiparams{'RULES'}};
|
||||||
# Check if the oinkcode contains unallowed chars.
|
|
||||||
unless ($cgiparams{'OINKCODE'} =~ /^[a-z0-9]+$/) {
|
# Check if the choosen vendor (URL) requires an subscription/oinkcode.
|
||||||
$errormessage = $Lang::tr{'invalid input for oink code'};
|
if ($url =~ /\<oinkcode\>/ ) {
|
||||||
|
# Check if an subscription/oinkcode has been provided.
|
||||||
|
if ($cgiparams{'OINKCODE'}) {
|
||||||
|
# Check if the oinkcode contains unallowed chars.
|
||||||
|
unless ($cgiparams{'OINKCODE'} =~ /^[a-z0-9]+$/) {
|
||||||
|
$errormessage = $Lang::tr{'invalid input for oink code'};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# Print an error message, that an subsription/oinkcode is required for this
|
||||||
|
# vendor.
|
||||||
|
$errormessage = $Lang::tr{'ids oinkcode required'};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1336,6 +1336,7 @@
|
|||||||
'ids monitor traffic only' => 'Netzwerk-Pakete nur überpfrüfen',
|
'ids monitor traffic only' => 'Netzwerk-Pakete nur überpfrüfen',
|
||||||
'ids no network zone' => 'Mindestends eine Netzwerk-Zone muss überwacht werden!',
|
'ids no network zone' => 'Mindestends eine Netzwerk-Zone muss überwacht werden!',
|
||||||
'ids no ruleset available' => 'Kein Regelset verfügbar, bitte downloaden Sie eines!',
|
'ids no ruleset available' => 'Kein Regelset verfügbar, bitte downloaden Sie eines!',
|
||||||
|
'ids oinkcode required' => 'Für das ausgewählte Regelset wird eine Subscription oder ein Oinkcode benötigt',
|
||||||
'ids ruleset settings' => 'Regelset-Einstellungen',
|
'ids ruleset settings' => 'Regelset-Einstellungen',
|
||||||
'ids preprocessor' => 'IDS-Präprozessor',
|
'ids preprocessor' => 'IDS-Präprozessor',
|
||||||
'ids rules license' => 'Um Sourcefire VRT Zertifizierte Regeln zu nutzen, müssen Sie sich unter',
|
'ids rules license' => 'Um Sourcefire VRT Zertifizierte Regeln zu nutzen, müssen Sie sich unter',
|
||||||
|
|||||||
@@ -1368,6 +1368,7 @@
|
|||||||
'ids monitor traffic only' => 'Monitor traffic only',
|
'ids monitor traffic only' => 'Monitor traffic only',
|
||||||
'ids no network zone' => 'At least one network zone has to be monitored!',
|
'ids no network zone' => 'At least one network zone has to be monitored!',
|
||||||
'ids no ruleset available' => 'No ruleset available, please download one!',
|
'ids no ruleset available' => 'No ruleset available, please download one!',
|
||||||
|
'ids oinkcode required' => 'The selected ruleset requires a subscription or an oinkcode',
|
||||||
'ids ruleset settings' => 'Ruleset settings',
|
'ids ruleset settings' => 'Ruleset settings',
|
||||||
'ids preprocessor' => 'IDS preprocessor',
|
'ids preprocessor' => 'IDS preprocessor',
|
||||||
'ids rules license' => 'To utilize Sourcefire VRT Certified Rules, you need to register on',
|
'ids rules license' => 'To utilize Sourcefire VRT Certified Rules, you need to register on',
|
||||||
|
|||||||
Reference in New Issue
Block a user