[Web] Add fail2ban logging to passwordless autodiscover endpoint

This commit is contained in:
FreddleSpl0it 2026-03-03 13:24:44 +01:00
parent 2e8897c2cf
commit af61e2d303
No known key found for this signature in database
GPG Key ID: 00E14E7634F4BEC5

View File

@ -83,6 +83,8 @@ if(!$data) {
);
$redis->lPush('AUTODISCOVER_LOG', $json);
$redis->lTrim('AUTODISCOVER_LOG', 0, 100);
$redis->publish("F2B_CHANNEL", "Autodiscover: Invalid request by " . $_SERVER['REMOTE_ADDR']);
error_log("Autodiscover: Invalid request by " . $_SERVER['REMOTE_ADDR']);
}
catch (RedisException $e) {
$_SESSION['return'][] = array(
@ -121,6 +123,8 @@ try {
);
$redis->lPush('AUTODISCOVER_LOG', $json);
$redis->lTrim('AUTODISCOVER_LOG', 0, 100);
$redis->publish("F2B_CHANNEL", "Autodiscover: Malformed XML by " . $_SERVER['REMOTE_ADDR']);
error_log("Autodiscover: Malformed XML by " . $_SERVER['REMOTE_ADDR']);
}
catch (RedisException $e) {
// Silently fail
@ -179,6 +183,8 @@ if (empty($MailboxData)) {
);
$redis->lPush('AUTODISCOVER_LOG', $json);
$redis->lTrim('AUTODISCOVER_LOG', 0, 100);
$redis->publish("F2B_CHANNEL", "Autodiscover: Invalid mailbox attempt by " . $_SERVER['REMOTE_ADDR']);
error_log("Autodiscover: Invalid mailbox attempt by " . $_SERVER['REMOTE_ADDR']);
}
catch (RedisException $e) {
// Silently fail