8000 [RFE]: Postgresql backend filter · Issue #3864 · fail2ban/fail2ban · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[RFE]: Postgresql backend filter #3864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tuxmaster5000 opened this issue Oct 23, 2024 · 1 comment
Open

[RFE]: Postgresql backend filter #3864

tuxmaster5000 opened this issue Oct 23, 2024 · 1 comment

Comments

@tuxmaster5000
Copy link
tuxmaster5000 commented Oct 23, 2024

Feature request type

Until now fail2ban can only read the journal and classic log files.
But some systems logs the fail's into it's own databases.

Description

It would be very helpful if the jail filters could also be searched in SQL databases. This would solve the problem that some applications only log unauthorised access in internal SQL databases. I could imagine that a general database framework could be used to which the queries and the configuration are then transferred. The usual filter part would then contain the SQL query for the ban request, which then returns the IP and the timestamp as usual.

Considered alternatives

Not really possible if the data is only available in SQL databases.

Any additional information

The rolling file problem would also solve by this, when the provided data is stored in an SQL database.

@tuxmaster5000 tuxmaster5000 changed the title [RFE]: Pos [RFE]: Postgresql backend filter Oct 23, 2024
@sebres
Copy link
Contributor
sebres commented Oct 23, 2024

There is indeed no backend at the moment that would achieve this. However, just for the info, one could use proactive a client (or pickle-protocol) to notify fail2ban about failures, if service has a callback for failed authentication:

fail2ban-client set <JAIL> attempt <IP> [<failure1> ... <failureN>]

Also somewhere was a PoC implementing new command-backend (pipe), read log-data from a stream...
It'd look something like this:

backend = pipe[command='mysql ... -srN -e "select time, lid, ip, msg from log where id > <lastid>"', init-lastid=0, lastid=F-lid, interval=1s]
datepattern = ^%%Y-%%m-%%d %%H:%%M:%%S
prefregex = ^\t*<F-lid>\d+</F-lid>\t<ADDR>\t<F-CONTENT>.+</F-CONTENT>$

I will come back to this again later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0