CSF Global Deny Lists - Not Properly Removing IP (IPSet Issue)
Posted: 06 Jan 2016, 23:59
Hoping someone can help point me in the right direction...
I've developed a solution to generate a global list for both allowing IP's & denying IP's. Populating the csf.gdeny works perfectly, every seven (7) minutes the server calls for the file reads it and blacklists the IP's.
Unfortunately, the server does not seem to be releasing IP's that have been removed from the list. csf.gdeny no longer has the IP blocked however doing a "csf -g" commands shows its blacklisted.
Server Configuration:
CentOS: v6.7 x86_64bit
cPanel: v11.52.2 (build 1)
IPTables: v1.4.7
IPSet: v6.11, protocol version: 6
CSF: v8.08 (cPanel)
How I've determined this issue ..
Initial Server Load:
As you can see the IP is not found in any of the reports.... So now we enable the blacklisting of the IP on the global deny list file.
Global Deny IP Address:
So the IP has properly been blocked and is set correctly in IPSet, and read correctly from CSF... Now to remove the IP Address from the Global Deny List...
Removal of IP Address:
So it seems, well CSF properly fetchs the Global Deny file & writes it to its temporary csf.gdeny file it doesn't properly flush & configure IPSet. Only way to fully release the IP in question (and to be clear it could be any IP) is to restart CSF ("csf -r").
Looking for solution to fix this problem.
I've developed a solution to generate a global list for both allowing IP's & denying IP's. Populating the csf.gdeny works perfectly, every seven (7) minutes the server calls for the file reads it and blacklists the IP's.
Unfortunately, the server does not seem to be releasing IP's that have been removed from the list. csf.gdeny no longer has the IP blocked however doing a "csf -g" commands shows its blacklisted.
Server Configuration:
CentOS: v6.7 x86_64bit
cPanel: v11.52.2 (build 1)
IPTables: v1.4.7
IPSet: v6.11, protocol version: 6
CSF: v8.08 (cPanel)
How I've determined this issue ..
Initial Server Load:
Code: Select all
root@server [/var/lib/csf]# cat csf.gdeny | wc -l
1199
Code: Select all
root@server [/var/lib/csf]# grep 174.1.144.2 csf.gdeny
root@server [/var/lib/csf]#
Code: Select all
root@server [/var/lib/csf]# csf -g 174.1.144.2
Chain num pkts bytes target prot opt in out source destination
No matches found for 174.1.144.2 in iptables
IPSET: No matches found for 174.1.144.2
Code: Select all
root@server [/var/lib/csf]# ipset -test chain_GDENY 174.1.144.2
174.1.144.2 is NOT in set chain_GDENY.
Global Deny IP Address:
Code: Select all
root@server [/var/lib/csf]# cat csf.gdeny | wc -l
1200
Code: Select all
root@server [/var/lib/csf]# grep 174.1.144.2 csf.gdeny
174.1.144.2
root@server [/var/lib/csf]#
Code: Select all
root@server [/var/lib/csf]# csf -g 174.1.144.2
Chain num pkts bytes target prot opt in out source destination
No matches found for 174.1.144.2 in iptables
IPSET: Set:chain_GDENY Match:174.1.144.2 Setting:GLOBAL_DENY
Code: Select all
root@server [/var/lib/csf]# ipset -test chain_GDENY 174.1.144.2
174.1.144.2 is in set chain_GDENY.
Removal of IP Address:
Code: Select all
root@server [/var/lib/csf]# cat csf.gdeny | wc -l
1199
Code: Select all
root@server [/var/lib/csf]# grep 174.1.144.2 csf.gdeny
root@server [/var/lib/csf]#
Code: Select all
root@server [/var/lib/csf]# csf -g 174.1.144.2
Chain num pkts bytes target prot opt in out source destination
No matches found for 174.1.144.2 in iptables
IPSET: Set:chain_GDENY Match:174.1.144.2 Setting:GLOBAL_DENY
Code: Select all
root@server [/var/lib/csf]# ipset -test chain_GDENY 174.1.144.2
174.1.144.2 is in set chain_GDENY.
Looking for solution to fix this problem.