Log mislukte logins als LOGIN_FAILED (fail2ban/rapportage), logger-threshold naar 5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -329,3 +329,16 @@ if (!function_exists('get_password_requirements_nl')) {
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('sanitize_log_user')) {
|
||||
/**
|
||||
* Make a username safe for use in a log line (prevents log injection):
|
||||
* only [A-Za-z0-9_@.-+] is kept, everything else becomes "_", max 64 chars.
|
||||
*/
|
||||
function sanitize_log_user(string $user): string
|
||||
{
|
||||
$user = substr(preg_replace('/[^A-Za-z0-9_@.\-+]/', '_', $user), 0, 64);
|
||||
|
||||
return $user === '' ? '-' : $user;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user