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:
Fred Gleason
2020-10-15 09:41:02 -04:00
parent f5905315eb
commit 4bc6a54052
8 changed files with 71 additions and 1 deletions

View File

@@ -365,15 +365,18 @@ bool MainObject::Authenticate()
QString passwd;
if(!webget_post->getValue("LOGIN_NAME",&name)) {
rda->logAuthenticationFailure(webget_post->clientAddress());
return false;
}
if(!webget_post->getValue("PASSWORD",&passwd)) {
rda->logAuthenticationFailure(webget_post->clientAddress(),name);
return false;
}
RDUser *user=new RDUser(name);
if((!user->exists())||
(!user->checkPassword(passwd,false))||
(!user->webgetLogin())) {
rda->logAuthenticationFailure(webget_post->clientAddress(),name);
return false;
}