Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Waf Laravel Package

tuijncode/laravel-waf

Laravel WAF middleware that helps protect your application from common web attacks by filtering and blocking suspicious requests before they reach your routes.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This package sits in the Laravel HTTP kernel as middleware with a signature pack, a waf_logs table, an exclusion table, and a cache-backed counter store. It is a perimeter-style request filter, not an application-layer authorization system — it complements Laravel's own validation, CSRF, and auth middleware rather than replacing them. For any Laravel service exposed to the public internet, that is a good fit: the middleware hooks into the request lifecycle where a TPM would want a cheap, uniform gate before controller code runs.

Integration feasibility. High. Installation is Composer + vendor:publish + migrate, with no external service dependency beyond the cache store the app already has. v1.3.0 materially improves feasibility in two ways: waf:doctor turns "did the install actually take effect?" from an ambiguous log-silence question into a deterministic, non-zero-exit check that can be wired into CI or a deploy step, and the new self-explaining schema-drift error converts a silent, per-request SQL failure into a once-hourly actionable message naming the exact publish/migrate commands. Both reduce the integration effort that normally lands on a platform engineer.

Technical risk. Moderate, concentrated in three areas:

  1. Exclusion semantics change (behavioral). match_label previously matched by substring; it now matches only on exact rule id, full description, or the full [942100] … signature. This is the highest-risk item in the release, and it cuts in the safe direction — previously over-broad exclusions will stop suppressing detections. But "safe direction" still means newly firing rules on production traffic. Any team that hand-inserted exclusion rows (rather than using acceptFromLog) must audit them before upgrade or accept a burst of new findings and, in blocking mode, new blocks. The removed three-character minimum guard is a related loosening worth noting in review.

  2. Cache driver dependency for stateful features. Flood counting, bans, and dedup all require a cache driver that actually supports atomic counters and TTLs. A file or array driver will pass a superficial smoke test and then behave incorrectly or inconsistently under load, particularly across multiple app nodes. waf:doctor now checks this, which is the right mitigation — but it must actually be run in each environment, not just locally.

  3. Schema drift on upgrade. By the package's own admission, the most common failure is upgrading without the accompanying migration, which silently discards every finding. This is a class of failure that only becomes visible when you need the logs, i.e. during an incident. Treat migrations as a mandatory, ordered deploy step.

The new null-byte rule (920270) is low risk and correctly scoped: it covers query, path, headers, and cookies but deliberately exempts raw request bodies, which avoids false positives on binary uploads. It will, however, generate findings on any client that legitimately encodes %00, so expect a small tail of noise.

Key questions. Which environments will run waf:doctor automatically, and will its non-zero exit actually block a deploy? Does the cache store support atomic increments and TTLs in every environment, including staging and any multi-node setup? How many exclusion rows exist that were hand-inserted rather than created via acceptFromLog, and who owns auditing them? Is the WAF currently in blocking or detection-only mode, and does that differ per environment? Who receives the fail2ban export, if anyone — is there an existing jail and a pipeline, or is this a capability we are adopting without an owner? What is the alerting path on the once-hourly schema-drift message — does it reach a human, or only a log file?

Integration Approach

Stack fit. Native Laravel: Composer package, artisan commands, config publishing, Eloquent-backed log and exclusion tables, middleware registered in the kernel. It imposes no new infrastructure. The one real prerequisite is a cache driver with counter semantics — in practice Redis or Memcached for anything beyond single-node local development.

Migration path. Standard package upgrade: bump the Composer constraint to v1.3.0, re-publish waf.php and waf-patterns.php, run php artisan migrate, clear config cache, then run waf:doctor. The ordering matters — publishing before migrating, or migrating without re-publishing the pattern pack, is exactly the drift scenario v1.3.0 was built to catch. The pattern-pack refresh is not optional: a stale published pack silently freezes out every signature added since, which means an upgraded install can be less protected than the version number suggests.

The exclusion audit is the one step that is not mechanical. Before deploying to production, enumerate existing match_label values, confirm which were created via acceptFromLog (unaffected) and which were hand-inserted with partial labels (affected), and decide per row whether to tighten to an exact rule id, expand to an explicit list of ids, or remove. Do this against a staging replay of production traffic if possible, since the failure mode is new blocks, not new errors.

Compatibility. No PHP or Laravel version constraints are indicated in the notes as changing. The behavioral change to exclusion matching is not a code-level break — existing rows remain valid, they simply match differently — but it is a semantic break for anyone relying on the old substring behavior, and should be treated as such in release communication. The removal of the three-character minimum guard is only reachable by exact-match rules now and is effectively inert.

Sequencing. Recommended order for a production rollout:

  1. Upgrade and migrate in staging, re-publish config and patterns, run waf:doctor to green.
  2. Audit and rewrite hand-inserted exclusions in staging; replay or shadow production traffic to observe newly firing rules.
  3. Run in detection-only mode in production for a defined observation window; triage the new findings, particularly the null-byte rule and any rule previously masked by a broad exclusion.
  4. Promote to blocking mode once the finding volume is understood.
  5. Wire waf:doctor into the deploy pipeline as a gate, and only then evaluate waf:export --format=fail2ban if there is a fail2ban consumer to receive it.

Operational Impact

Maintenance. Low and mostly automated. Signature and pattern updates arrive with package releases; the recurring human task is keeping the published pattern pack in step with the installed version, which waf:doctor now surfaces as a named failure. The exclusion table is the piece that accrues entropy — every exclusion is a permanently disabled detection, and there is no built-in expiry or review cadence. A TPM should establish one (quarterly review of exclusion rows, with an owner) or the exclusion list will quietly become the largest hole in the deployment.

Support. v1.3.0 substantially improves the support story. Prior to this release, the dominant support scenario was "the log is empty, therefore we are fine," which is unfalsifiable and unhelpful. waf:doctor converts that into a named check with a fix command, and the hourly schema-drift message converts a raw SQL error into an instruction. Both reduce escalation to the maintainer and make first-line support tractable for a platform team. The fail2ban export includes a shell-safety restriction on the jail name, which is a small but telling detail — the output is designed to be piped into a shell, and that boundary was considered.

Scaling. Stateless per-request signature matching scales horizontally with the app tier, no special handling. The stateful features — flood counting, bans, dedup — inherit the scaling properties of the cache backend; on a shared Redis this is fine, on per-node file cache it degrades into per-node bans and inconsistent dedup. Multi-node deployments must confirm a shared cache before enabling blocking on flood rules. Log volume is the other scaling axis: a WAF that suddenly starts logging correctly after a schema fix can produce a large write burst, and there is no mention of sampling or retention controls. Worth a capacity check on waf_logs before enabling in a high-traffic environment.

Failure modes. The release is essentially a catalogue of the ways this package fails silently, which is a useful inversion:

  • Enabled nowhere. Middleware not wired to any route or the global stack — doctor checks for genuine wiring, not mere installation.
  • Enabled but discarding everything. Missing column in waf_logs — every finding dropped, log reads as "no attacks." Now caught pre-deploy and self-explained hourly at runtime.
  • Enabled but blind to new attacks. Stale published pattern pack — silently freezes out all newer signatures. Now checked.
  • Enabled but stateless. Cache driver cannot support counting/banning — checks pass, protection is partial. Now checked.
  • Over-suppressed. A hand-inserted SQL or 942 exclusion disabled whole rule families. Fixed by exact matching, at the cost of a one-time re-enable shock.

The residual failure mode after v1.3.0 is a doctor check that is never run in the environment where it matters, and the schema-drift message that no one reads. Both are process problems, not package problems — which is the right place for them to land, but it means the value of this release is contingent on actually wiring the command into a pipeline and routing the hourly message to a human.

Ramp-up. Low for the mechanical work; a competent Laravel engineer can complete install-to-green in an afternoon. The judgment-requiring work is the exclusion audit and the detection-to-blocking promotion, both of which need someone who understands the application's traffic and can distinguish a true positive from a client sending unusual-but-legal requests. Budget a defined observation window rather than a same-day flip to blocking.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib