-
Notifications
You must be signed in to change notification settings - Fork 4
/
ban4ipd.conf
143 lines (106 loc) · 4.13 KB
/
ban4ipd.conf
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
; ======================================================================
; BAN for ipables/ip6tables
; ======================================================================
;
; '#' is no use
;
[Default_Section]
; Sub config file in conf_dir/
conf_dir = "/etc/ban4ip"
; Log file name.
log_file = "/var/log/ban4ipd.log"
; DB file in db_dir/ (for SQLite3)
db_dir = "/var/lib/ban4ip"
; If you want to use other DB, you can change this parameter. :-)
;0) Default:SQLite3
;pdo_dsn_count = "sqlite:/var/lib/ban4ip/count.db"
;pdo_dsn_ban = "sqlite:/var/lib/ban4ip/ban.db"
;pdo_dsn_mailrate = "sqlite:/var/lib/ban4ip/mailrate.db"
;
;1) PostgreSQL
;pdo_dsn_count = "pgsql:host=localhost;port=5432;dbname=count_db;user=ban4ip;password=PASSWORD"
;pdo_dsn_ban = "pgsql:host=localhost;port=5432;dbname=ban_db;user=ban4ip;password=PASSWORD"
;pdo_dsn_mailrate = "pgsql:host=localhost;port=5432;dbname=mailrate_db;user=ban4ip;password=PASSWORD"
;
;2) MySQL
;pdo_dsn_count = "mysql:host=localhost;port=3306;dbname=count_db"
;pdo_dsn_ban = "mysql:host=localhost;port=3306;dbname=ban_db"
;pdo_dsn_mailrate = "mysql:host=localhost;port=3306;dbname=mailrate_db"
;pdo_dsn_username = "ban4ip"
;pdo_dsn_password = "PASSWORD"
;
; Recommended settings...
; "pdo_dsn_count" is shared amoung your local servers, with PostgreSQL or MySQL.
; Information Share Mode (0=OFF, 1=ON)
;iss_flag = 1
;
; Recommended settings...
; If you set "iss_flag = 1", then you have to setup "iss_*" and enabled.
; Get BAN Data from "iss_get_time" seconds ago.
;iss_get_time = 86400
; Get BAN Data up to "iss_get_limit" items.
;iss_get_limit = 10000
; Get BAN Data including my report. (0=NO, 1=YES : If you use the same ID on multiple servers, recommend "1")
;iss_get_myreport = 0
; Information Share Server (Your local ISS Server, or Public ISS Server https://ban4ip.net/. Public ISS Server is only "pgsql" with SSL(TLS).)
;iss_server = "asia.ban4ip.net"
;iss_server = "usa.ban4ip.net"
;iss_server = "eu.ban4ip.net"
;iss_username = "Your ISS UserID"
;iss_password = "Your ISS Password"
; DB timeout[ms]
db_timeout = 5000
; PID file name.
pid_file = "/var/run/ban4ipd.pid"
; Socket file name.
socket_file = "/var/run/ban4ipd.sock"
; Loop mode (0: Stop when logrotate, 1: re-open when logrotate)
loop_mode = 1
; UNBAN check cycle time. [second]
unbantime = 3
; iptables command
iptables = "/sbin/iptables"
; ip6tables command
ip6tables = "/sbin/ip6tables"
; Hostname lookup (0: none, 1: lookup)
hostname_lookup = 1
; Cleanup old count info (0=No Clean, or Older than nnnn[s])
maxfindtime = 604800
[Overwrite_Section]
; Find time [second]
findtime = 600
; BAN for Number of failed times.
maxretry = 5
; BAN time. [second]
bantime = 3600
; Mail from:
mail_from = "root@localhost"
; Mail to:
mail_to[] = "root@localhost"
; Mail title: (mail_title [target_service] Ban address from $_SERVER["HOSTNAME"])
mail_title = "[Ban4ip]"
; Mail Priority:
mail_priority = "X-Priority: 1"
; Mail send rate [mail per second. cf ... "300" is 1mail per 300sec]
mailratetime = 300
; Execute command befor BAN (<exec_befor_ban> --source <target_address> --proto <target_protcol> --dport <target_port> --jump <target_rule>)
;exec_befor_ban = ""
; Execute command after BAN (<exec_after_ban> --source <target_address> --proto <target_protcol> --dport <target_port> --jump <target_rule>)
;exec_after_ban = ""
; Execute command befor UNBAN (<exec_befor_unban> --source <target_address> --proto <target_protcol> --dport <target_port> --jump <target_rule>)
;exec_befor_unban = ""
; Execute command after UNBAN (<exec_after_unban> --source <target_address> --proto <target_protcol> --dport <target_port> --jump <target_rule>)
;exec_after_unban = ""
; Network Mask BAN, if you want. (for IPv4)
;ipv4_netmask = 28
; Network Mask BAN, if you want. (for IPv6)
;ipv6_netmask = 64
; White IP address list (Not BAN, IPv4/IPv6 address and Network Mixed OK!)
;safe_address[] = "192.168.0.1"
;safe_address[] = "192.168.11.0/24"
;safe_address[] = "fe80::1"
;safe_address[] = "fe80::/64"
; Target String type "IP" or "KEYWORD". (If it is not set, target_type is "IP".)
target_type = "IP"
; If database file damaged... (0: none, 1:delete & reboot=new db file)
damage_recover = 1