Hi Guys, and Ladies!

Does someone have done something like Graylog + Fail2ban for creating a 
centralized banning machine?

I thought it would be a very nice feature for someone with plugin skills, 
to make something like a server-plugin to feed fail2ban. And a small client 
which would feed IPtables and/or IPset on a list of clients.

I've done some work with bash scripts, which are a set of 2 scripts:

graylog2fail2ban.sh -> triggerd by cronjob to pull logs via API to fake 
logging for fail2ban
global_ip_ban.sh -> wich will get triggerd by fail2ban-ban-action to check 
the jail status to get the ips to ban, checks against a whitelist..., and 
finally triggers a clientscript on a list of server to ban the ips with 
IPset.

so my current flow looks something like this:


client 1-xx [syslog, ...] ----> graylog [processing,...] <---- 
graylog2fail2ban.sh [polling messages via API] <---- Fail2Ban [reading, and 
banning] ----> global_ip_ban.sh [reading jail status, filter on whitelist 
and triggers client] -----> global_ip_ban.sh client mode [sets ipset and 
iptables on client] -----^


I think it would be possible to build it better with python or directly a 
plugin for graylog. Maybe there would be a better "flow" to achieve this 
result.
My scripts need some work to add a "panic"-ban function to react fast on 
events wich wouldn't be recognized from fail2ban out of the box.


Some problems i've had during the development:

- API delivers only UTC time, which is a pain in the ass here in old 
Europe. So i have to start fail2ban with TZ=UTC ...
- Fail2ban-Filter doesn't work so good with fake logs, like these out of 
the API (Timestamp + message)
- Reaction Time is bound to the first pull-script. So high polling rates 
would end in a high amount of API-Calls and this in a high load on graylog.

I think someone would do it better, or have it done better than me. I 
doesn't want to make my scripts public bcs i am a very bad programmer and 
maybe its also a problem with the company policies...


I hope for some response.

Rene

-- 
You received this message because you are subscribed to the Google Groups 
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/graylog2/ac1736d7-c2b9-4f0f-8d3c-b2d50813a096%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to