Download the PHP package filastudio/laravel-vigil without Composer
On this page you can find all versions of the php package filastudio/laravel-vigil. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download filastudio/laravel-vigil
More information about filastudio/laravel-vigil
Files in filastudio/laravel-vigil
Package laravel-vigil
Short Description A security audit package for Laravel applications with Filament v5 integration.
License MIT
Informations about the package laravel-vigil
Laravel Vigil
Security audit tool for Laravel. Scans your application's filesystem, PHP configuration, HTTP headers, and Composer dependencies for common vulnerabilities and misconfigurations. Ships with 15 checks out of the box, a scoring system, and an optional Filament v5 dashboard.
Features
- 15 built-in checks grouped into 5 categories (filesystem, configuration, HTTP headers, dependencies, extended)
- Filesystem scanning for malicious JS, dangerous uploads, wrong permissions, and exposed sensitive files
- Configuration audits covering PHP.ini,
.env, session, and CORS settings - HTTP header validation (HSTS, CSP, X-Frame-Options, etc.)
- Composer audit integration to flag vulnerable packages
- Hardcoded secret detection with smart
env()filtering to reduce false positives - Security score from 0 to 100 based on check results
- File integrity monitoring via SHA-256 baseline comparison
- Filament v5 dashboard (optional) with scan history, score widgets, and one-click scanning
- JSON and table output, CI/CD-friendly exit codes
- Extensible with custom checks via a simple interface
- PHP 8.2 enums for status, severity, and category values
Why this package
We kept running into the same issues across projects: .env files accessible via HTTP, debug mode left on in production, API keys committed to repos, malicious files sneaking into upload directories. Vigil automates the checks we were doing manually.
A few things we focused on:
- Low noise. Each check is tuned to avoid false positives. The secret scanner, for example, understands
env()calls and won't flag them. - Useful output. Failed checks include the exact file, line number, and a concrete fix suggestion.
- Reasonable performance. File scanning respects size limits so it won't choke on large codebases.
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
- Filament 5.x (optional, for the dashboard)
Installation
The service provider registers automatically.
Publish the config:
If you want scan history stored in the database:
This creates vigil_scans and vigil_check_results tables. Old records are cleaned up automatically based on the retention setting in config.
Run your first scan:
Configuration
The configuration file config/vigil.php allows you to enable/disable individual checks and customize behavior:
Usage
Artisan Commands
vigil:audit
Runs all enabled checks and prints results as a table:
Options:
--category=filesystem,configuration— filter by category--check=fs.public_folder,cfg.env— run specific checks only--fail-on=critical,high— exit with code 1 on matching severity (default:critical)--format=json— JSON output instead of table--output=/path/to/file.json— write JSON to file--detailed— show full messages, file paths, line numbers, and fix suggestions
Examples:
vigil:baseline
Generates SHA-256 hashes of files in public/ and storage/app/public/ for integrity monitoring:
Saves to storage/app/vigil_baseline.json. Once a baseline exists, enable the ext.file_integrity check in config to compare against it on subsequent scans.
vigil:list
Shows all 15 checks with their category, severity, and enabled/disabled status:
Detailed Output
The --detailed flag adds full context to each check result: untruncated messages, exact file paths with line numbers, and specific recommendations.
Useful for investigating failures, generating compliance reports, or just understanding what exactly triggered a check.
Programmatic Usage
You can also run scans from code:
Filament Integration
If you use Filament v5, Vigil ships with a dashboard page and widgets.
Register the plugin in your AdminPanelProvider:
The dashboard includes:
- Security score widget — 0-100 score, color-coded by severity
- Critical issues counter — number of failed critical checks
- Recent scans table — history with scores, timestamps, and issue counts
- Detailed results — click into any scan to see per-check results with messages and recommendations
- Run scan button — trigger scans from the browser without CLI access
Handy for tracking trends over time, sharing results with the team, or pulling up a quick overview during a meeting.
All Security Checks
| Check ID | Title | Category | Severity | Description |
|---|---|---|---|---|
fs.public_folder |
Public Folder Security | filesystem | high | Scans for unexpected files in public directory |
fs.malicious_js |
Malicious JavaScript Detection | filesystem | critical | Detects obfuscated/malicious JS patterns |
fs.storage_dangerous |
Dangerous Files in Storage | filesystem | critical | Finds executable files in public storage |
fs.permissions |
File Permissions Check | filesystem | high | Verifies Unix file permissions (Linux/Mac only) |
fs.sensitive_exposure |
Sensitive Files Exposure | filesystem | critical | Checks if .env, composer.json, .git are accessible via HTTP |
cfg.php_ini |
PHP Configuration Check | configuration | high | Validates PHP ini directives for security |
cfg.env |
Environment Configuration | configuration | critical | Checks APP_DEBUG, APP_KEY, APP_ENV settings |
cfg.session |
Session Configuration | configuration | medium | Validates session security settings |
cfg.cors |
CORS Configuration | configuration | high | Detects dangerous CORS misconfigurations |
http.headers |
Security Headers Check | http_headers | high | Ensures HSTS, CSP, X-Frame-Options, etc. are set |
dep.composer_audit |
Composer Dependencies Audit | dependencies | critical | Runs composer audit to find vulnerable packages |
ext.hardcoded_secrets |
Hardcoded Secrets Detection | extended | critical | Scans for hardcoded passwords, API keys, tokens |
ext.debug_routes |
Debug Routes Detection | extended | high | Finds debug endpoints (phpinfo, dd, dump) in routes |
ext.telescope_debugbar |
Telescope & Debugbar Check | extended | high | Ensures debug tools are secured in production |
ext.file_integrity |
File Integrity Check | extended | critical | Compares files against baseline to detect tampering |
Custom Checks
Implement the SecurityCheck interface:
Register it in a service provider:
After that, php artisan vigil:audit will include your check alongside the built-in ones.
CheckResult has four static constructors: passed(), failed(), warning(), skipped(). Use skipped() when a check doesn't apply to the current environment.
Enums
PHP 8.2 backed enums are available for type-safe values:
CheckStatus:Passed,Failed,Warning,SkippedSeverity:Critical,High,Medium,Low,InfoCategory:Filesystem,Configuration,HttpHeaders,Dependencies,Extended
Cleanup
Scan results accumulate in the database over time. The retention period is configurable:
To delete records older than the retention period:
Or schedule it:
CI/CD Integration
The --fail-on flag makes Vigil work as a pipeline gate. If any check with the specified severity fails, the command exits with code 1.
GitHub Actions example:
GitLab CI:
Jenkins:
You can adjust the threshold: --fail-on=critical for lenient, --fail-on=critical,high,medium for strict.
Development
Contributing
Pull requests are welcome.
License
MIT. See LICENSE.
All versions of laravel-vigil with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/console Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0