|
|
|
@ -1,18 +1,18 @@ |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
use esmith::NetworksDB; |
|
|
|
|
my $n = esmith::NetworksDB->open_ro() || |
|
|
|
|
my $n = esmith::NetworksDB->open_ro() || |
|
|
|
|
die "Couldn't open networks DB\n"; |
|
|
|
|
|
|
|
|
|
my @ip = (127.0.0.1); |
|
|
|
|
my @ip = ("127.0.0.1"); |
|
|
|
|
|
|
|
|
|
# Add hosts which can access the server-manager to the whitelist |
|
|
|
|
push @ip, " $_" foreach (split /[,;], (${'httpd-admin'}{'ValidFrom'} || '')); |
|
|
|
|
push @ip, $_ foreach (split /[,;]/, (${'httpd-admin'}{'ValidFrom'} || '')); |
|
|
|
|
|
|
|
|
|
if (($fail2ban{FilterLocalNetworks} || 'disabled' eq 'enabled' ){ |
|
|
|
|
foreach my $network ($n->networks){ |
|
|
|
|
my $key = $network->key; |
|
|
|
|
my $mask = $network->prop('Mask); |
|
|
|
|
if (($fail2ban{FilterLocalNetworks} || 'disabled') eq 'enabled'){ |
|
|
|
|
foreach my $net ($n->networks){ |
|
|
|
|
my $key = $net->key; |
|
|
|
|
my $mask = $net->prop('Mask'); |
|
|
|
|
push @ip, "$key/$mask"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|