PHPackages                             edoardoagnelli1357/laravel-firewall - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. edoardoagnelli1357/laravel-firewall

ActiveLibrary[Security](/categories/security)

edoardoagnelli1357/laravel-firewall
===================================

Web Application Firewall (WAF) package for Laravel

v3.3.0(5mo ago)01MITPHPPHP ^8.0

Since Nov 26Pushed 4mo agoCompare

[ Source](https://github.com/edoardoagnelli1357/laravel-firewall)[ Packagist](https://packagist.org/packages/edoardoagnelli1357/laravel-firewall)[ RSS](/packages/edoardoagnelli1357-laravel-firewall/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

Web Application Firewall (WAF) package for Laravel
==================================================

[](#web-application-firewall-waf-package-for-laravel)

[![Downloads](https://camo.githubusercontent.com/ea9f0138b225e3723b6dbb2887ea57c1d61f3dce101aed929eda6256b39ffdb4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b61756e74696e672f6c61726176656c2d6669726577616c6c)](https://camo.githubusercontent.com/ea9f0138b225e3723b6dbb2887ea57c1d61f3dce101aed929eda6256b39ffdb4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b61756e74696e672f6c61726176656c2d6669726577616c6c)[![Tests](https://camo.githubusercontent.com/cbc90ae70acaea8cdb59519c87777ef18a0565fb6c9d0fdf5c98c6932b8ef486/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b61756e74696e672f6c61726176656c2d6669726577616c6c2f74657374732e796d6c3f6c6162656c3d7465737473)](https://camo.githubusercontent.com/cbc90ae70acaea8cdb59519c87777ef18a0565fb6c9d0fdf5c98c6932b8ef486/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b61756e74696e672f6c61726176656c2d6669726577616c6c2f74657374732e796d6c3f6c6162656c3d7465737473)[![StyleCI](https://camo.githubusercontent.com/cfd7c06967d33db2f9b076f855751b2b6f9aabd2a67201bafc219affcd99cc20/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3139373234323339322f736869656c643f7374796c653d666c6174266272616e63683d6d6173746572)](https://styleci.io/repos/197242392)[![License](https://camo.githubusercontent.com/e0f44a697f1e32d00a4e7d47333cc06dcdd5475ab12b45ff94fdc58184884ead/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b61756e74696e672f6c61726176656c2d6669726577616c6c)](LICENSE.md)

This package intends to protect your Laravel app from different type of attacks such as XSS, SQLi, RFI, LFI, User Agent, and a lot more. It will also block repeated attacks and send notification via email and/or slack when attack is detected. Furthermore, it will log failed logins and block the IP after a number of attempts.

Note: Some middleware classes (i.e. Xss) are empty as the `Middleware` abstract class that they extend does all of the job, dynamically. In short, they all works ;)

Getting Started
---------------

[](#getting-started)

### 1. Install

[](#1-install)

Run the following command:

```
composer require akaunting/laravel-firewall
```

### 2. Publish

[](#2-publish)

Publish configuration, language, and migrations

```
php artisan vendor:publish --tag=firewall
```

### 3. Database

[](#3-database)

Create db tables

```
php artisan migrate
```

### 4. Configure

[](#4-configure)

You can change the firewall settings of your app from `config/firewall.php` file

Usage
-----

[](#usage)

Middlewares are already defined so should just add them to routes. The `firewall.all` middleware applies all the middlewares available in the `all_middleware` array of config file.

```
Route::group(['middleware' => 'firewall.all'], function () {
    Route::get('/', 'HomeController@index');
});
```

You can apply each middleware per route. For example, you can allow only whitelisted IPs to access admin:

```
Route::group(['middleware' => 'firewall.whitelist'], function () {
    Route::get('/admin', 'AdminController@index');
});
```

Or you can get notified when anyone NOT in `whitelist` access admin, by adding it to the `inspections` config:

```
Route::group(['middleware' => 'firewall.url'], function () {
    Route::get('/admin', 'AdminController@index');
});
```

Available middlewares applicable to routes:

```
firewall.all

firewall.agent
firewall.bot
firewall.geo
firewall.ip
firewall.lfi
firewall.php
firewall.referrer
firewall.rfi
firewall.session
firewall.sqli
firewall.swear
firewall.url
firewall.whitelist
firewall.xss
```

You may also define `routes` for each middleware in `config/firewall.php` and apply that middleware or `firewall.all` at the top of all routes.

Notifications
-------------

[](#notifications)

Firewall will send a notification as soon as an attack has been detected. Emails entered in `notifications.email.to` config must be valid Laravel users in order to send notifications. Check out the Notifications documentation of Laravel for further information.

Changelog
---------

[](#changelog)

Please see [Releases](../../releases) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Pull requests are more than welcome. You must follow the PSR coding standards.

Security
--------

[](#security)

Please review [our security policy](https://github.com/akaunting/laravel-firewall/security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Denis Duliçi](https://github.com/denisdulici)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance72

Regular maintenance activity

Popularity1

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

167d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3da7268ff9cf7d8a0f7ded0bc1721b30e474655f35334e828faea97aa60603e3?d=identicon)[edoardoagnelli1357](/maintainers/edoardoagnelli1357)

---

Top Contributors

[![denisdulici](https://avatars.githubusercontent.com/u/5254835?v=4)](https://github.com/denisdulici "denisdulici (117 commits)")[![C0DeB100D](https://avatars.githubusercontent.com/u/78369687?v=4)](https://github.com/C0DeB100D "C0DeB100D (9 commits)")[![thomascombe](https://avatars.githubusercontent.com/u/39582382?v=4)](https://github.com/thomascombe "thomascombe (6 commits)")[![HaroldST](https://avatars.githubusercontent.com/u/70189863?v=4)](https://github.com/HaroldST "HaroldST (4 commits)")[![mozami](https://avatars.githubusercontent.com/u/613641?v=4)](https://github.com/mozami "mozami (4 commits)")[![samehdoush](https://avatars.githubusercontent.com/u/48515888?v=4)](https://github.com/samehdoush "samehdoush (2 commits)")[![andreia](https://avatars.githubusercontent.com/u/38911?v=4)](https://github.com/andreia "andreia (2 commits)")[![vlasscontreras](https://avatars.githubusercontent.com/u/17748144?v=4)](https://github.com/vlasscontreras "vlasscontreras (1 commits)")[![ip2location-com](https://avatars.githubusercontent.com/u/6367210?v=4)](https://github.com/ip2location-com "ip2location-com (1 commits)")[![2000calories](https://avatars.githubusercontent.com/u/25191098?v=4)](https://github.com/2000calories "2000calories (1 commits)")

---

Tags

laravelsecurityxssblacklistfirewallsqliwafrfilfi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/edoardoagnelli1357-laravel-firewall/health.svg)

```
[![Health](https://phpackages.com/badges/edoardoagnelli1357-laravel-firewall/health.svg)](https://phpackages.com/packages/edoardoagnelli1357-laravel-firewall)
```

###  Alternatives

[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[masterro/laravel-xss-filter

Filter user input for XSS but don't touch other html

41254.5k](/packages/masterro-laravel-xss-filter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
