Download the PHP package wallacemartinss/filament-security without Composer
On this page you can find all versions of the php package wallacemartinss/filament-security. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wallacemartinss/filament-security
More information about wallacemartinss/filament-security
Files in wallacemartinss/filament-security
Package filament-security
Short Description Security plugin for Filament v5 - Disposable email blocking, honeypot protection, and Cloudflare IP blocking
License MIT
Homepage https://github.com/wallacemartinss/filament-security
Informations about the package filament-security
Filament Security
Security plugin for Filament v5 with eight protection layers: disposable email blocking, DNS/MX verification, RDAP domain age check, single session enforcement, honeypot bot protection, Cloudflare IP blocking, malicious scan detection, and a security event dashboard with real-time analytics.
Screenshots
Email Validation
| DNS/MX Verification | Disposable Email Blocking |
|---|---|
Security Event Dashboard
| Stats, Tabs & Event Table | Charts & Top Offending IPs |
|---|---|
Version Compatibility
| Package Version | Filament | Livewire | Laravel | Branch |
|---|---|---|---|---|
| 2.x | v5 | v4 | 11 / 12 / 13 | main |
| 1.x | v4 | v3 | 11 / 12 / 13 | 1.x |
Requirements
- PHP 8.2+
- Laravel 11, 12 or 13
- Filament v5
Installation
Publish the config file:
If you enable the Event Log (Layer 8) or Cloudflare IP Blocking (Layer 6), publish and run the migrations:
Tailwind CSS (required for custom views)
If you use a custom Filament theme, add the plugin's source paths to your resources/css/filament/admin/theme.css so Tailwind can scan the plugin's views and classes:
Then rebuild your theme:
Register the plugin in your AdminPanelProvider (after ->registration()):
Layer 1: Disposable Email Blocking
Blocks registration with temporary/disposable email addresses. Ships with 192,000+ built-in domains (sourced from disposable/disposable-email-domains) and supports custom domains.
Covers all major disposable email providers including Mailinator, YOPmail, GuerrillaMail (all 11 variants), TempMail, ThrowAway, Burner Mail, and thousands more.
Filament Registration Integration
When disposableEmailProtection() is enabled, the plugin automatically replaces the default Filament registration page with a secured version that validates emails against the disposable domain list. No extra configuration needed.
The plugin only replaces the default Register::class. If you have a custom registration page, use the trait instead:
Usage as Validation Rule
Usage in Filament Forms
Programmatic Check
Managing Custom Domains
Configuration
Domain Sources (priority order)
| Source | Location | How to manage |
|---|---|---|
| Built-in | data/disposable-domains.json |
Shipped with package (192,000+ domains) |
| Custom file | storage/filament-security/custom-domains.txt |
php artisan filament-security:domain |
| Config | config/filament-security.php |
Edit config file |
| Whitelist | config/filament-security.php |
Edit config file (overrides all) |
Layer 2: DNS/MX Verification
Verifies that the email domain has valid mail infrastructure. Blocks domains that cannot receive email — domains with no MX records and no A/AAAA fallback, or domains with MX records pointing to suspicious targets (localhost, private IPs).
How it works
Enabled by default
DNS/MX verification is enabled by default. No extra setup required.
Usage as Validation Rule
Programmatic Check
Configuration
What is detected
| Condition | Result |
|---|---|
| No MX, no A, no AAAA records | Blocked |
MX pointing to localhost or private IP |
Blocked |
| Valid MX records | Allowed |
| No MX but has A/AAAA record | Allowed (RFC 5321) |
| DNS lookup fails | Allowed (fail-open) |
Layer 3: Domain Age Verification (RDAP)
Checks the domain registration age via RDAP (Registration Data Access Protocol). Blocks recently registered domains — a common pattern in spam, phishing, and fraud campaigns.
Disabled by default
This feature makes external HTTP calls to RDAP servers. Enable it via .env:
Usage as Validation Rule
Programmatic Check
Configuration
Failure behavior
| Scenario | block_on_failure=false (default) |
block_on_failure=true |
|---|---|---|
| RDAP server unreachable | Allow | Block |
| TLD not in IANA bootstrap | Allow | Block |
| No registration date in response | Allow | Block |
| Domain age >= min_days | Allow | Allow |
| Domain age < min_days | Block | Block |
Layer 4: Single Session Enforcement
Ensures only one active session per user. When a user logs in from a new browser or device, all previous sessions are immediately terminated. Works with database, Redis, and file session drivers.
How it works
Disabled by default
Session driver support
| Driver | Destruction method | Enforcement |
|---|---|---|
database |
Bulk DELETE by user_id |
Immediate |
redis |
Destroy session key via handler | Immediate + middleware fallback |
file |
Destroy session file via handler | Immediate + middleware fallback |
Programmatic Usage
Configuration
Layer 5: Honeypot Protection
Protects registration forms against bots using invisible honeypot fields. Powered by spatie/laravel-honeypot.
Two invisible fields are injected into the registration form:
- Empty field - Bots auto-fill all fields; if this field has a value, the submission is rejected
- Timestamp field - Tracks how fast the form was submitted; instant submissions are rejected
Enabled by default
Custom Registration Page
When spam is detected, the request is aborted with 403 Forbidden. A SpamDetectedEvent is also fired for logging or IP blocking (Layer 6).
Layer 6: Cloudflare IP Blocking
Automatically blocks suspicious IPs on Cloudflare WAF after repeated failed login attempts or bot detection via honeypot.
Real client IP resolved through: CF-Connecting-IP > X-Real-IP > X-Forwarded-For > REMOTE_ADDR
Setup
-
Add your Cloudflare credentials to
.env: -
Publish and run the migration:
- Enable in the plugin:
How to get your Cloudflare credentials
API Token
- Go to Cloudflare Dashboard > My Profile > API Tokens
- Click "Create Token" > "Create Custom Token"
- Permissions:
Zone>Firewall Services>Edit - Zone Resources:
Include>Specific zone> select your domain
Zone ID
- Go to Cloudflare Dashboard and select your domain
- On the Overview page, scroll down to the right sidebar > API section > copy Zone ID
Managing Blocked IPs
Programmatic Usage
Configuration
Layer 7: Malicious Scan Protection
Detects and blocks requests to known exploit paths, config files, web shells, and CMS admin pages. Returns 404 and logs the attempt as a security event.
What is detected
| Category | Examples |
|---|---|
| Config/env files | .env, .git, .htaccess, wp-config.php |
| Package files | composer.json, package.json, yarn.lock |
| Credentials | credentials.json, firebase.json, database.json |
| WordPress/CMS | wp-admin, wp-login, xmlrpc.php |
| Web shells | shell.php, cmd.php, c99, r57, webshell |
| Exploit paths | etc/passwd, proc/self, ../../.. |
| Admin panels | phpmyadmin, adminer, pgadmin, cPanel |
| Debug endpoints | phpinfo, _debug, _profiler, actuator |
Disabled by default
The middleware is automatically registered in the web middleware group when enabled.
Configuration
Layer 8: Security Event Dashboard
A complete Filament resource that records and visualizes all security events across every layer. Provides a real-time dashboard with stats, charts, and a threat intelligence table.
What is recorded
Every layer in the plugin automatically records events when the Event Log is enabled:
| Event Type | Source Layer | Trigger |
|---|---|---|
disposable_email |
Layer 1 | Disposable email blocked during registration |
dns_mx_suspicious |
Layer 2 | Domain with no valid mail servers |
domain_too_young |
Layer 3 | Domain registered too recently |
session_terminated |
Layer 4 | User session killed by newer login |
honeypot_triggered |
Layer 5 | Bot detected via honeypot |
login_lockout |
Layer 6 | Failed login attempt |
ip_blocked |
Layer 6 | IP blocked on Cloudflare |
ip_unblocked |
Layer 6 | IP unblocked via panel |
malicious_scan |
Layer 7 | Exploit path accessed |
Setup
-
Enable in
.env: -
Publish and run the migration:
- Enable in the plugin:
Dashboard features
The Security Events page includes:
Header Widgets (4 stat cards):
- Events Today (with trend vs yesterday + 7-day mini chart)
- IPs Blocked Today
- Top Threat (7 days)
- Unique IPs (7 days)
Tabs (filtered by category):
- Email — disposable emails, DNS/MX, domain age
- Bots & Scans — honeypot, malicious scans
- Session — terminated sessions
- Auth — login lockouts
- IP Management — blocked/unblocked IPs
Footer Widgets (3 charts):
- Threat Activity (14-day line chart by category)
- Events by Type (7-day doughnut chart)
- Top Offending IPs (table with top 10 attackers, event count, location, ban status)
Table features:
- Live polling every 30 seconds
- Dynamic columns per tab (email, path, user_agent, trigger info)
- Copyable IP badges
- Country flags with city/org tooltip
- Type filter (multi-select)
Actions:
- Backfill IP Locations — header action to enrich IPs without geolocation via IpInfo API
- Unban IP — row action to remove Cloudflare block directly from the table
Programmatic Usage
Configuration
IpInfo Integration (Optional)
Enrich security events with IP geolocation data (country, city, organization) from ipinfo.io. This is completely optional — if no token is provided, everything works without geolocation.
Setup
- Get a free API token at ipinfo.io/signup
- Add to
.env:
How it works
- When a security event is recorded, the IP is automatically enriched with country, city, and org data
- Results are cached for 24 hours per IP to minimize API calls
- The Backfill Locations action in the dashboard lets you retroactively enrich existing events
- If the token is not set, geolocation is silently skipped
Configuration
Environment Variables
Testing
Translations
The package includes translations in 15 languages: English, Brazilian Portuguese, German, Spanish, French, Italian, Japanese, Korean, Dutch, Polish, Russian, Turkish, Ukrainian, Arabic, and Chinese (Simplified).
To publish translations:
License
MIT License. See LICENSE for details.
All versions of filament-security with dependencies
filament/filament Version ^5.0
spatie/laravel-honeypot Version ^4.0
spatie/laravel-package-tools Version ^1.16