Search by

jeffersongoncalves / filament-scanner-guard

jeffersongoncalves

Filament UI for jeffersongoncalves/laravel-scanner-guard: list, filter and unban vulnerability-scanner bans from your admin panel

Package info

github.com/jeffersongoncalves/filament-scanner-guard

pkg:composer/jeffersongoncalves/filament-scanner-guard

Statistics

Installs: 2 156

Dependents: 1

Suggesters: 0

Stars: 9

Open Issues: 0

3.33.0 2026-12-02 14:39 UTC

README

Filament Scanner Guard

Filament Scanner Guard

Buy Me A Coffee

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads License

Filament UI for jeffersongoncalves/laravel-scanner-guard: list, filter and unban vulnerability-scanner IPs directly from your admin panel. This plugin ships a read-only Resource over the scanner_guard_bans table, an active/expired filter, and unban / bulk unban actions.

Version Compatibility

Filament Branch Version
v3 1.x ^1.0
v4 2.x ^2.0
v5 3.x ^3.0

Note: every branch requires PHP 8.3+ and Laravel 12+ because the underlying jeffersongoncalves/laravel-scanner-guard (via jeffersongoncalves/laravel-visitor-fingerprint) only supports Laravel 12/13. Branch 1.x (Filament v3) is pinned to Laravel 12 in CI — Filament v3.3.x installs against Laravel 13 but breaks at runtime ($getRecordActions / SubNavigationPosition errors), a limitation of Filament v3 itself, not of this plugin.

Installation

You can install the package via composer:

composer require jeffersongoncalves/filament-scanner-guard

This plugin depends on jeffersongoncalves/laravel-scanner-guard, which owns the scanner_guard_bans table, config, middleware and export command. Follow its installation instructions first (publish config, run the migration, attach the scanner-guard middleware to your routes).

Usage

Register the plugin in your Panel Provider:

use JeffersonGoncalves\Filament\ScannerGuard\ScannerGuardPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            ScannerGuardPlugin::make(),
        ]);
}

This registers a Scanner Guard Bans resource (rows are written by the scanner-guard middleware, or by the Ban IP action), a Blocklist resource and a Metrics page, with:

  • Columns: ip_hash, ip and path (stored details only), reason (badge), matched_value, hit_count, offense (escalation only), source (central app only), banned_at, expires_at, is_active
  • A Status filter (active vs expired)
  • Search by IP: type a full IPv4/IPv6 address to find every ban of it (matched by its hash, so it works without stored details)
  • An Unban row action and an Unban selected bulk action — both delete the ban row (this is an audit-trail model, not a flag on an arbitrary model)
  • An Export header action and an Export bulk action (CSV, XLSX, PDF with preview) via jeffersongoncalves/filament-action-export — synchronous, no queue or migrations needed; matched_value is exported in full with spreadsheet formulas neutralised
  • A View page per ban and an Extend action (1 hour / 1 day / 1 week / 1 month, added to the current expiry)
  • A Purge expired header action that reconciles the daily stats (scanner-guard:aggregate-and-prune), then deletes every expired ban. Hide it with ->purgeExpiredBans(false) (also takes a closure) to keep expired bans until the scheduled prune
  • A Metrics page with total, active, expired, hit-count and recent-bans stats, plus charts: bans per day (last 14 days), bans by reason, bans by source (central app receiving forwarded bans) and top matched values. The charts are drawn with ApexCharts; the plugin registers FilamentApexChartsPlugin on the panel for you when it is not there yet

The bans-per-day chart and the recent-bans stat read scanner_guard_ban_daily_stats (counted at ban time by the core package), so purging or unbanning never erases past days. Publish and run the core's daily stats migration for them to have data.

Both share one navigation group, Scanner Guard by default — override it with ->navigationGroup(), and change the chart window with ->chartDays():

ScannerGuardPlugin::make()
    ->navigationGroup('Security')
    ->chartDays(30);

Record actions of both tables can be grouped in a dropdown and moved before the columns (Table::configureUsing() can't group them: it runs before the resource defines its actions). Defaults keep the table's behavior:

use Filament\Tables\Enums\RecordActionsPosition;

ScannerGuardPlugin::make()
    ->groupRecordActions()                                 // wrap in ActionGroup::make([...])
    ->recordActionsPosition(RecordActionsPosition::BeforeColumns); // null = table/global default

Reasons shown: scanner path, ASN blocklist, 404 flood (not_found_flood, core 1.4+), User-Agent (user_agent, core 1.6+) and manual (bans added from the panel).

Blocklist and manual bans (core 1.7+)

The scanner_guard_blocklist table belongs to the core. Publish and run its migration:

php artisan vendor:publish --tag="scanner-guard-migrations"
php artisan migrate

Upgrading from 1.4.0 / 2.4.0 / 3.4.0, which shipped this migration in the plugin? The core migration is a no-op when the table already exists, so your entries stay.

  • A Blocklist resource over the core's ScannerGuardBlocklistEntry: add, edit and remove permanent IP / CIDR entries and User-Agent patterns (fnmatch, case-insensitive), each with an optional note. The core applies them on top of scanner-guard.ip_blocklist and scanner-guard.user_agent_blocklist.patterns. A User-Agent pattern only acts the way user_agent_blocklist.action says (ban or reject).
  • Never block entries (core 2.3+): IPs and ranges no app, satellite or agent blocks or bans. Ranges wider than /8 (IPv4) or /16 (IPv6) are refused, as the core would drop them. A blocked range that contains the IP still reaches the denylist sinks whole: remove or split it.
  • A Ban IP header action on the bans list: bans a raw IP through the core, exactly like the middleware would (hashed row, raw IP cached for the denylist sinks, ban_duration).
  • Unban goes through the core's ScannerGuard::unban(), so the IP gets through right away instead of at the old expiry.

With denylist sinks configured (scanner-guard.sinks, laravel-scanner-guard 2.0), every blocklist change and every unban queues the core's SyncDenylist job, so the change reaches nginx, Cloudflare or Traefik within seconds.

The resource and the Metrics page are only registered with the core's database driver (scanner-guard.driver). The cache and http drivers keep no ban rows, so on those apps the plugin registers nothing — install it on the central app instead.

Escalating bans

When the core's scanner-guard.escalation ladder is set (core 1.5+, run its add_offense migration), the plugin also shows:

  • An Offense column (badge, sortable, toggleable) and entry on the View page — 1 is a first offense, higher means repeat
  • A Repeat offenders filter (offense > 1)
  • An Active repeat offenders stat on the Metrics page
  • The Extend action pre-selects the duration the IP's next offense would get, and lists every ladder step as an option

With escalation off (the default) none of this is shown.

Forwarded bans (central app)

When this app receives bans from satellites over the core's http driver (scanner-guard.http.server.enabled, core 2.0+, run its add_source migration), the plugin also shows:

  • A Source column (badge, searchable, sortable, toggleable) and entry on the View page — the satellite's http.source, or Local for bans made by this app
  • A Source filter listing every satellite seen, plus Local

Stored details (core 2.2+)

When the core's scanner-guard.store_details is on (SCANNER_GUARD_STORE_DETAILS=true, run its add_details migration first), the plugin also shows, in the table, on the View page and in exports:

  • An IP address column (toggleable, copyable) — a dash for bans made while it was off, or encrypted with a key missing from APP_PREVIOUS_KEYS
  • A Path column (searchable, toggleable) — the request path that triggered the ban, without its query string; exported in full with spreadsheet formulas neutralised
  • Log Lines on the View page — the log lines a scanner-guard-agent banned on, its IP replaced by <ip> (core 2.4+, run its add_evidence migration; shown only for bans that carry them)

With details off (the default) none of this is shown. Everyone who can open the bans resource sees the IPs, so restrict it with a policy on ScannerGuardBan if needed. Unbanning and Purge expired delete the rows, stored details included; their confirmation says so.

Agents (central app, core 2.1+)

When the central app also records heartbeats from scanner-guard-agent (core 2.1+, run its create_scanner_guard_agents migration), an Agents resource lists one row per source:

  • Columns: source, Status (Online / Offline — offline after ScannerGuardAgent::STALE_AFTER seconds without a heartbeat), version, os and addresses (agent 2.9.0+ with core 2.9.0, toggleable), rules, active_bans, started_at, last_seen_at
  • A Status filter (Online / Offline); the table refreshes every 30 seconds
  • Delete forgets a decommissioned agent — a live one reappears on its next heartbeat

Without http.server.enabled or the migration, the resource stays hidden.

A Set up an agent header action lists the steps to install and configure one, with copyable commands (this app's URL and your IP filled in). It can also show the secret, so nobody has to open the server's .env. That is off by default:

ScannerGuardPlugin::make()
    ->revealAgentSecret(fn (): bool => auth()->user()->is_admin); // your own check
  • The user types their password (5 attempts per minute), and each reveal is logged with the user and source, never the value. Accounts without a password (e.g. social login only) can't reveal it.
  • The secret is sent to the browser on request, never in the page or in the Livewire state. Copying needs https or localhost.
  • With http.secrets, pick the source. Otherwise it is the shared http.secret: whoever has it can forward bans as any server sharing it and sign denylist responses, so allow only people you would give the .env to.

Agent rules (central app, core 2.5+)

An Agent rules resource sets the threshold, window and ban steps of an agent rule once, for every server. Run the core's create_scanner_guard_agent_rules migration; with http.server.enabled the resource shows up.

  • Rule: the rule name in the agents' agent.yaml (suggested from the rules the agents report). Patterns and log sources stay on each server.
  • Threshold and Window (10m, 1h, 1d): that many matches within the window ban the IP.
  • Ban steps (1d, 7d, 30d): one duration per offense, the last one repeats.

The agents (2.5.0+) apply a change on their next pull, within a minute. Deleting the row puts the agents back on their own agent.yaml values. Out-of-range values are refused, as the core would leave them out: a threshold over 10000, a window over 30 days, a step over 365 days or more than 10 steps.

Agent events (central app, core 2.6+)

An Agent events resource lists what the agents' report rules saw (report: true), e.g. every accepted SSH login. Run the core's create_scanner_guard_agent_events migration; with http.server.enabled the resource shows up.

  • Columns: when, server (source), rule, the fields that tell events apart (user=deploy method=publickey key=SHA256:…), the IP (only with store_details), a New badge the first time the central app got that event and an Ignored badge when the IP is on an ignore list
  • Filters: server, rule, first seen, ignored; newest first
  • View shows the pattern, every field and the log line (only with store_details); Delete removes rows. Nothing is created or edited from the panel.

Optional nginx rules (central app, core 2.8+)

An Optional nginx rules resource turns on, for every server at once, the agent's nginx rules that ship off: cms (WordPress, Joomla and phpMyAdmin paths), rfi, encoded and empty-agent. Run the core's create_scanner_guard_agent_nginx_rules migration; with http.server.enabled the resource shows up.

  • Rule and what it blocks; On toggles it from the table
  • Except on: servers that keep it off, e.g. one running WordPress

Only the name reaches the agents (2.8.0+): the rules ship with the agent, which writes them, runs nginx -t and reloads within a pull. Check a rule against a server's logs first with scanner-guard-agent nginx-test -with cms /var/log/nginx/access.log.

Diagnoses (central app, core 2.8+)

When a client can't reach a site, Diagnose an IP (on the Diagnoses and Agents pages) asks the chosen servers, all the online ones by default, whether anything on them blocks the IP: every firewall, fail2ban, the agent's bans and nginx rules, whether its traffic arrives, the route to it, and optionally a packet capture of up to 120 seconds while the client tries. Run the core's create_scanner_guard_agent_diagnostics migration; with http.server.enabled the resource shows up.

Each agent (2.8.0+) answers within a pull; the list refreshes every 10 seconds and shows each server's status and verdict side by side (BLOCKED on this server by: fail2ban, or Nothing on this server blocks ...), so a server that blocks the client stands out from a network problem in between. View shows the full report. The IP and the report are stored encrypted and pruned after retention_days.

Agent updates, public IP, groups and tags (central app, core 2.13+)

Each needs its core migration; until then nothing shows.

  • Update agents (add_update_to_scanner_guard_agents_table, agents 2.14.0+): a header action on the Agents page asks the chosen servers to update to a release, the latest from GitHub filled in. Each agent installs it in its next pull (from the scanner-guard-agent GitHub releases, checksum checked, never a downgrade) and restarts; the Update column shows → 2.15.0 while it is on the way and Update failed, with the agent's error in the tooltip, when it couldn't.
  • Public IP (add_public_ip_to_scanner_guard_agents_table): where each agent's requests come from, its only public address behind a NAT. A column on the Agents page, and on the fleet map's cards when it isn't one of the server's own addresses.
  • Groups and tags (add_labels_to_scanner_guard_agents_table): Group and tags on each agent's row sets them (existing ones suggested); the Agents page groups by group and filters by group or tag, and the fleet map gets the same two filters (kept in the URL), naming the servers a filter leaves out that the shown ones depend on.

The Diagnoses view is now a page: the request on top, then one collapsed section per server with its status and verdict in the header, the report inside.

Fleet map (central app, core 2.12+)

With agents 2.13.0+ sending server snapshots, the Fleet map page ({panel path}/scanner-guard-map) draws the fleet from the core's inventory. Run its add_inventory_to_scanner_guard_agents and create_scanner_guard_inventory_tables migrations and keep a queue worker running; with http.server.enabled the page shows up.

  • Cards: servers, systems, exposed services (bound to every address outside 80/443) and severe findings (critical and high), in red when above zero.
  • Topology: servers in columns by role (app and legacy, workers, databases, then the external IPs they depend on), each card holding its services (●) and systems (◆), with an edge per dependency labeled kind :port · N (N: the systems behind it). A red border marks a critical finding, orange a high or medium one; a stale server (no snapshot for 3 intervals) is dimmed with the time of its last one. Click or tap a server for its metrics, collection time and findings. Below 720px the graph becomes stacked cards, each listing its → destinations.
  • Findings and Services tables, worst first, exposed binds highlighted.

It refreshes every 60 seconds and follows the panel's light and dark themes. Its stylesheet and script are Filament assets: php artisan filament:assets publishes them (Filament runs it on filament:upgrade).

  • Search: fades what doesn't match a server, site, service or port.
  • Providers: every Cloudflare address is one node. Group others the same way (a cloud, a client's range):
ScannerGuardPlugin::make()
    ->mapProviders(['AWS São Paulo' => ['18.228.0.0/16'], 'Client A' => ['198.51.100.0/24']]);
  • Noise: an editor's remote server listening only on the loopback (VS Code's code-<commit>, Cursor, Windsurf) is left out, it gets a new random port at every connection. ->hiddenServices([...]) changes the names (* wildcards); [] shows them all.

Muted findings, history and alerts (central app, core 2.17+)

Run the core's create_scanner_guard_finding_tables migration and:

  • Muted findings: a page to mute findings for one server or all (an ID with * wildcards), with a required reason, who muted it and an end (90 days by default, empty: until removed). The bell button next to each finding on the fleet map fills it in. Muted findings leave at once; when a mute ends they come back and alert again.
  • Resolved findings: the fleet map lists the ones gone in the last 30 days, with when they showed up and how long they lasted; each open finding shows since when.
  • Public IPs: Public IPs on each agent's row sets every public IP it answers on, over inventory.public_ips.
  • Alerts: set SCANNER_GUARD_FINDINGS_WEBHOOK to a Discord or Slack incoming webhook to get each critical or high finding a server didn't have.

Inventory changes (central app, core 2.23+)

Run the core's create_scanner_guard_agent_inventory_changes_table migration and an Inventory changes page lists, newest first, each service (version), site (stack) and site alias (www.shop.test, *.shop.test) of a server that was added, changed or removed, filterable by server and kind. It is the fleet's audit trail: read-only, nothing to edit or delete. With the add_aliases_to_scanner_guard_agent_systems_table migration and an agent that sends them, the fleet map also counts each site's other names (hover for the list).

Docker containers (central app, core 2.24+, agent 2.23.0+)

On a central app that receives snapshots (same setup as the fleet map), run the core's create_scanner_guard_agent_containers_table migration and a Containers page lists every Docker container of the fleet (running or stopped) with its server, image, version, state, status, published ports and compose project, filterable by server and state. A port published on 0.0.0.0 / [::] shows in red: docker bypasses ufw for it. Containers that show up, change image/version or go away also land in Inventory changes (kind Container). Read-only.

Public status page (central app)

A status page anyone can open without logging in, off by default:

ScannerGuardPlugin::make()
    ->publicStatusPage(); // {panel path}/scanner-guard-status

ScannerGuardPlugin::make()
    ->publicStatusPage(fn (): bool => app()->isProduction(), path: 'status');

It shows servers online, IPs blocked now (the largest active_bans an agent reports: they all pull the same list), attacks and bans in the last 24 hours, one card per agent (online / offline, version, last seen, active bans, attacks with an hourly bar per hour of the last 24 and its top rules) and the bans of the last 24 hours by reason. It never shows an IP, IP hash, user, key, event field or log line.

The numbers are cached for 60 seconds and the page refreshes every minute. Each section shows up once its core migration ran: agents (2.1+), attacks (create_scanner_guard_agent_metrics, 2.6+).

Using the actions standalone

If you'd rather wire the table yourself:

use JeffersonGoncalves\Filament\ScannerGuard\Actions\UnbanAction;
use JeffersonGoncalves\Filament\ScannerGuard\Actions\UnbanBulkAction;

$table
    ->recordActions([
        UnbanAction::make(),
    ])
    ->toolbarActions([
        UnbanBulkAction::make(),
    ]);

Development

# Run static analysis
composer analyse

# Run tests
composer test

# Format code
composer format

# Rebuild resources/dist/filament-scanner-guard.css from resources/css/index.css
pnpm install && pnpm run build

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.