harryes/laravel-sentinellog
All-in-one Laravel security and auth logging package: tracks login/logout/failed attempts with device + geo detection, alerts, TOTP 2FA, session management, brute-force protection, geo-fencing, SSO, and new-location verify/deny flows.
auth facade), leveraging middleware (auth, throttle) and events (Attempting, Authenticated, Failed). This aligns well with Laravel’s security-first architecture, particularly for applications requiring audit trails, anomaly detection, or compliance (e.g., GDPR, SOC2).LoginAttempted, SessionHijacked) to trigger custom logic (e.g., Slack alerts, SIEM integration). This enables observability without tight coupling.config(), ServiceProvider, Middleware). No major framework modifications required.auth_logs, devices, geo_fences, sso_tokens). Migration-friendly but requires schema validation in CI/CD (e.g., Flyway/Liquibase).geoip2/geoip2 (requires MaxMind DB license for production).phpqrcode/phpqrcode (lightweight, no major risks).Notifiable trait (supports email, SMS via channels like nesbot/carbon for scheduling).| Risk Area | Mitigation Strategy |
|---|---|
| Performance Overhead | Log aggregation (e.g., Elasticsearch) recommended for high-traffic apps. |
| GeoIP Compliance | License costs for MaxMind DB; consider open-source alternatives (e.g., db-ip). |
| Session Hijacking | Requires secure cookie settings (SANCTUM/PASSPORT config) to prevent CSRF. |
| SSO Token Leaks | Enforce short-lived tokens (e.g., 15-minute TTL) and use Laravel Sanctum for revocation. |
| Migration Complexity | Test schema changes in staging; use Laravel Zero-Downtime Migrations for production. |
vechain/vechain) for auth_logs.config/sentinellog.php.tinker: AuthLog::latest()->take(5)->get().artisan sentinellog:test).192.168.1.1 → US).Laravel Breeze or Jetstream templates).Laravel Sanctum or Passport.Mail::fake()).config('session.lifetime')).| Component | Compatibility Notes |
|---|---|
| Laravel Versions | Tested on 10–13; backport to 9.x may require composer require adjustments. |
| PHP 8.2+ | Uses named arguments, enums, and attributes (no breaking changes). |
| Database | Supports MySQL, PostgreSQL, SQLite (test transactions for rollback). |
| Queue Workers | Async features (e.g., notifications) require queue:work (use supervisor for prod). |
| Caching | GeoIP data cached via cache()->remember() (TTL: 24h). |
--seed).SENTINELLOG_GEOIP_PATH and MAIL_* (if using notifications).php artisan sentinellog:install (if available in future versions).app/Http/Kernel.php:
'web' => [
\Harryes\SentinelLog\Http\Middleware\TrackLogin::class,
],
auth_logs, etc.) and remove middleware if integration fails.config(['sentinellog.enabled' => false]) to disable features temporarily.composer require harryes/laravel-sentinellog:^1.0 with update constraints.wget + chmod for MaxMind DB).google2fa secrets periodically (store in config or env).AuthLog::where('created_at', '<', now()->subDays(90))->delete()).php artisan sentinellog:test (simulate brute-force attacks).php artisan sentinellog:clear (purge logs for testing).storage/logs/laravel.log for SentinelLog entries (e.g., LoginAttempted).SENTINELLOG_GEOIP_PATH points to a valid .mmdb file.phpqrcode is installed (composer require phpqrcode/phpqrcode).SESSION_DRIVER=redis and SANCTUM_STATEFUL_DOMAINS are configured.DB::transaction() for bulk inserts (e.g., AuthLog::insert($events)).Cache::remember().failed_jobs table for stuck notifications.How can I help you explore Laravel packages today?