neelkanthk/laravel-surveillance
Monitor and control suspicious users in Laravel: track IPs and browser fingerprints, write surveillance logs, and block/allow access. Includes route middleware, CLI commands, and a fluent API; storage is extensible (MySQL by default).
Architecture Fit
The laravel-surveillance package is a security-focused middleware and surveillance tool designed to monitor and block malicious users/IPs/browser fingerprints in Laravel applications. It does not align with traditional Laravel surveillance (e.g., job monitoring, exception tracking) but instead serves as a security layer for detecting and mitigating threats. Its architecture is modular, leveraging:
Integration Feasibility
surveillance_managers, surveillance_logs), which may conflict with existing database schemas or migration strategies.Technical Risk
Key Questions
Stack Fit
Migration Path
composer require neelkanthk/laravel-surveillance
php artisan vendor:publish --provider="Neelkanth\Laravel\Surveillance\Providers\SurveillanceServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Neelkanth\Laravel\Surveillance\Providers\SurveillanceServiceProvider" --tag="config"
php artisan migrate
config/surveillance.php (e.g., fingerprint header key, storage overrides).surveillance_logs to prevent database bloat.surveillance middleware to high-risk routes (e.g., /login, /api/auth).Route::middleware(['surveillance'])->group(function () {
Route::post('/login', [AuthController::class, 'login']);
});
fingerprint).surveillance_logs for anomalies.Compatibility
Carbon usage).Sequencing
Maintenance
Support
Scaling
surveillance_logs (e.g., type, value, created_at).Failure Modes
| Failure Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Database corruption | Lost surveillance data | Regular backups + transaction safety |
| Misconfigured middleware | Legitimate users blocked | Test in staging; implement unblock workflow |
| PII compliance violation | Legal penalties | Legal review + anonymization where possible |
| Package abandonment | Unpatched vulnerabilities | Fork the repo + maintain internally |
| High traffic spikes | Database overload | Rate-limit log writes; archive old data |
| Browser fingerprinting failure | Reduced surveillance accuracy | Fallback to IP-based rules |
Ramp-Up
How can I help you explore Laravel packages today?