- Notifications
You must be signed in to change notification settings - Fork116
Web Application Firewall (WAF) package for Laravel
License
akaunting/laravel-firewall
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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 theMiddleware abstract class that they extend does all of the job, dynamically. In short, they all works ;)
Run the following command:
composer require akaunting/laravel-firewall
Publish configuration, language, and migrations
php artisan vendor:publish --tag=firewall
Create db tables
php artisan migrate
You can change the firewall settings of your app fromconfig/firewall.php file
Middlewares are already defined so should just add them to routes. Thefirewall.all middleware applies all the middlewares available in theall_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 inwhitelist access admin, by adding it to theinspections config:
Route::group(['middleware' =>'firewall.url'],function () { Route::get('/admin','AdminController@index');});
Available middlewares applicable to routes:
firewall.allfirewall.agentfirewall.botfirewall.geofirewall.ipfirewall.lfifirewall.phpfirewall.referrerfirewall.rfifirewall.sessionfirewall.sqlifirewall.swearfirewall.urlfirewall.whitelistfirewall.xss
You may also defineroutes for each middleware inconfig/firewall.php and apply that middleware orfirewall.all at the top of all routes.
Firewall will send a notification as soon as an attack has been detected. Emails entered innotifications.email.to config must be valid Laravel users in order to send notifications. Check out the Notifications documentation of Laravel for further information.
Please seeReleases for more information on what has changed recently.
Pull requests are more than welcome. You must follow the PSR coding standards.
Please reviewour security policy on how to report security vulnerabilities.
The MIT License (MIT). Please seeLICENSE for more information.
About
Web Application Firewall (WAF) package for Laravel
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors9
Uh oh!
There was an error while loading.Please reload this page.