mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
2020-10-15 Fred Gleason <fredg@paravelsystems.com>
* Added a 'RDApplication::logAuthenticationFailure()' method. * Added a sample Fail2Ban jail filter for the WebAPI in 'conf/rivendell-webapi.conf'. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -312,6 +312,21 @@ void RDApplication::addTempFile(const QString &pathname)
|
||||
}
|
||||
|
||||
|
||||
void RDApplication::logAuthenticationFailure(const QHostAddress &orig_addr,
|
||||
const QString &login_name)
|
||||
{
|
||||
if(login_name.isEmpty()) {
|
||||
syslog(LOG_NOTICE,"failed WebAPI login from %s",
|
||||
orig_addr.toString().toUtf8().constData());
|
||||
}
|
||||
else {
|
||||
syslog(LOG_NOTICE,"failed WebAPI login from %s for user \"%s\"",
|
||||
orig_addr.toString().toUtf8().constData(),
|
||||
login_name.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDApplication::syslog(int priority,const char *fmt,...) const
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@@ -66,6 +66,8 @@ class RDApplication : public QObject
|
||||
bool dropTable(const QString &tbl_name);
|
||||
void addTempFile(const QString &pathname);
|
||||
void syslog(int priority,const char *fmt,...) const;
|
||||
void logAuthenticationFailure(const QHostAddress &orig_addr,
|
||||
const QString &login_name=QString());
|
||||
static void syslog(RDConfig *config,int priority,const char *fmt,...);
|
||||
|
||||
private slots:
|
||||
|
||||
Reference in New Issue
Block a user