Hey all,
To protect the web servers, I have built this simple system:
- Parse web server logs looking for specific patterns. Take note of requesting IP(s) that match those patterns
- Check these IPs against abuseipdb.com via API. If confidence of abuse is above 20%, add the IP to ipset list
- Distribute the ipset list to other servers (that do not have this system in place)
It is based on: GitHub - ShaneOss/AbuseIPDB-cPanel-CSF: Script to parse the IPs in the cPanel Apache error log. Checks them against AbuseIPDB and add to CSF deny list if certain criteria is met. configured for my needs.
This system works well for each one web server, but -as it is now- it is not efficient. All servers need to run the same checks (waste of resources). Plus, each server has its unique ipset. Moreover, I would like to collect possible abusive IPs from other services as well, like mail servers and create a much wider ipset list, for all servers to have.
To accomplish this, I suppose that I would need to collect all the suspicious IPs to a “central place”, run the checks there and then create one ipset list.
The version I am working on right now, is like this:
a) At the Source Servers
like web/mail servers, parse the logs to look for suspicious IPs and then use code like below to send data to the Data Collector Server
:
curl --data "param1=IP¶m2=Whatever" http://url/upload.php
b) At the Data Collector Server
I would run some code (upload.php) to write the collected IPs to a file, run checks and create the ipset list.
c) Place the list on a web accessible URL, so that the Source Servers
can download it and load it in their ipset.
What do you think? Overkill? Suggestions? What protection systems do you have in place?
P.S. This is not an actual support question, rather a discussion.