Advanced security monitoring and intrusion detection plugin for FilamentPHP
🛡️ Real-time Protection
🚨 Alert System
🔍 Forensic Tools
Install the package via Composer:
composer require mkwebdesign/filament-watchdog:^1.0
Publish the configuration file:
php artisan vendor:publish --tag=filament-watchdog-config
Optionally, publish the views (if you want to customize them):
php artisan vendor:publish --tag=filament-watchdog-views
Then run the auto-installer script from your Laravel root directory:
bash install-filament-watchdog.sh
And migrate the database:
php artisan migrate
After publishing the config file, you can customize the settings in config/filament-watchdog.php
:
return [ 'monitoring' => [ 'enabled' => true, 'scan_interval' => 'everyMinute', // How often to run scans ], 'alerts' => [ 'email' => [ 'enabled' => true, 'recipients' => ['admin@yoursite.com'], ], ], 'emergency' => [ 'auto_publish_views' => true, 'lockdown_enabled' => true, ], // ... more settings];
FilamentWatchdog requires the Laravel scheduler to run automated security scans. Add the standard Laravel cronjob to your server:
# Edit your crontabcrontab -e # Add this line (standard Laravel scheduler - runs every minute)* * * * * cd /path/to/your/laravel/project && php artisan schedule:run >> /dev/null 2>&1
Example with full path:
* * * * * php /home/username/domains/yoursite.com/public_html/artisan schedule:run >> /dev/null 2>&1
Note: This is the standard Laravel scheduler cronjob that should run every minute. FilamentWatchdog will automatically schedule its security scans within this framework.
Manual scan commands:
# Run file integrity scanphp artisan watchdog:scan-integrity # Run malware detection scanphp artisan watchdog:scan-malware # Create new file baselinephp artisan watchdog:create-baseline # Run complete security scanphp artisan watchdog:scan-all
Register the plugin in your AdminPanelProvider
:
use MKWebDesign\FilamentWatchdog\FilamentWatchdogPlugin; // Inside the panel() method:->plugin(FilamentWatchdogPlugin::make());
After installation, visit:
/admin/security/dashboard
to access the security monitoring interface.
If the configuration file doesn't appear in config/filament-watchdog.php
, try:
# Clear caches firstphp artisan config:clearphp artisan cache:clear # Then publish againphp artisan vendor:publish --tag=filament-watchdog-config --force # Verify the file existsls -la config/filament-watchdog.php
grep CRON /var/log/syslog
Make sure the web server user has write permissions to:
storage/app/
directorystorage/logs/
directorystorage/app/quarantine/
directoryNeed help? Feel free to:
Martin Knops | MKWebDesign
The MIT License (MIT). Please see License File for more information.
Made with ❤️ by MKWebDesign
I am Martin Knops, a freelance PHP developer and founder of MKWebDesign.nl. With years of experience in Laravel and FilamentPHP, I build custom solutions for clients with a strong focus on quality, security, and ease of use.
Feel free to reach out on GitHub if you have any questions or suggestions!