Add Security Monitoring System with Command, Model, and Service

- 🛡️ Introduce `SecurityMonitor` service for tampering and malicious activity detection.
- 🏷️ Add `SecurityAttempt` model and migration to log, categorize, and query security attempts.
- 🖥️ Create `SecurityAttemptsCommand` for filtering, statistics, and top IP analysis.
-  Add extensive tests to ensure the reliability of security monitoring and logging.
- 🔗 Integrate `SecurityMonitor` into the exception handling pipeline for real-time monitoring.
This commit is contained in:
HolgerHatGarKeineNode
2026-02-04 13:40:30 +01:00
parent 064ed68638
commit 5b814d631b
6 changed files with 664 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
<?php
use App\Services\SecurityMonitor;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
@@ -18,4 +19,8 @@ return Application::configure(basePath: dirname(__DIR__))
})
->withExceptions(function (Exceptions $exceptions) {
Integration::handles($exceptions);
$exceptions->report(function (Throwable $e) {
app(SecurityMonitor::class)->recordFromException($e);
});
})->create();