forked from NethServer/nethserver-fail2ban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createlinks
46 lines (39 loc) · 1.52 KB
/
createlinks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# actions to do
my $event = 'nethserver-fail2ban-update';
event_actions($event,
'initialize-default-databases' => '00');
templates2events("/etc/fail2ban/fail2ban.local", $event);
templates2events('/etc/fail2ban/action.d/sendmail-common.local', $event);
templates2events('/etc/sudoers', $event);
#Action to unbanIP
my $event = 'nethserver-fail2banUnBan-save';
event_actions($event,
'fail2ban-unban' => '10');
#Action for nethserver-fail2ban-save
my $event = 'nethserver-fail2ban-save';
event_actions($event,
'nethserver-fail2ban-unban-whitelist' => '10');
templates2events("/etc/fail2ban/fail2ban.local", $event);
templates2events('/etc/fail2ban/action.d/sendmail-common.local', $event);
#templates to expand
foreach my $event (qw ( nethserver-fail2ban-update
nethserver-fail2ban-save
nethserver-urbackup-save
nethserver-urbackup-update
)) {
templates2events('/etc/fail2ban/filter.d/urbackup-auth.conf', $event);
}
# services to launch on event
# /etc/fail2ban/jail.local is expanded by systemd before fail2ban restart
foreach my $event (qw ( runlevel-adjust
nethserver-fail2ban-save
nethserver-urbackup-save
nethserver-urbackup-update
)) {
event_services($event,
'fail2ban'=> 'restart');
}
my $event = 'trusted-networks-modify';
event_services($event, 'fail2ban' => 'restart');