Security Hardening: Proaktive Kontosperren, Fail2Ban-Integration, SecurityLogger, Alerting und API-Schutz
This commit is contained in:
@@ -358,10 +358,18 @@ switch ($action) {
|
||||
Http::ok(['cleared' => true]);
|
||||
break;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
case 'unlock_user':
|
||||
$username = (string)(Http::str('username') ?? 'admin');
|
||||
$stmt = $db->prepare('UPDATE dc_users SET failed_login_count = 0, locked_until = NULL WHERE username = :u');
|
||||
$stmt->execute([':u' => $username]);
|
||||
Http::ok(['unlocked' => $username, 'affected' => $stmt->rowCount()]);
|
||||
break;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
default:
|
||||
Http::fail(400, 'unknown_action', sprintf('Unbekannte Aktion "%s".', $action), null, [
|
||||
'actions' => ['status', 'wipe', 'migrate', 'reset', 'workbench_token',
|
||||
'update_master_token', 'genkey', 'log', 'clearlog'],
|
||||
'update_master_token', 'genkey', 'log', 'clearlog', 'unlock_user'],
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user