akaunting/laravel-firewall

PHPakaunting.com

Web Application Firewall (WAF) package for Laravel

phplaravelfirewallwafsecurityblacklistwhitelistakaunting
스타 성장
스타
1k
포크
117
주간 성장
+1
이슈
0
5001k
2019년 7월2021년 11월2024년 4월2026년 9월
아티팩트Packagist
README

Web Application Firewall (WAF) package for Laravel

Downloads Tests StyleCI License

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

1. Install

Run the following command:

composer require akaunting/laravel-firewall

2. Publish

Publish configuration, language, and migrations

php artisan vendor:publish --tag=firewall

3. Database

Create db tables

php artisan migrate

4. Configure

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

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

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

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

Contributing

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

Security

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

Credits

License

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

관련 저장소
laravel/laravel

Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things.

Bladelibraryphpframework
laravel.com
84.9k24.9k
coollabsio/coolify

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 280+ one-click services on your own servers.

PHPPackagistApache License 2.0nodejsmysql
coolify.io
61.5k5.4k
LeCoupa/awesome-cheatsheets

👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.

JavaScriptnpmawesomeMIT Licensecheatsheetsjavascript
lecoupa.github.io/awesome-cheatsheets/
46.4k6.7k
nextcloud/server

☁️ Nextcloud server, a safe home for all your data

PHPPackagistGNU Affero General Public License v3.0open-sourcefile-sharing
nextcloud.com
36.7k5.2k
laravel/framework

Laravel is a web application framework with expressive, elegant syntax.

PHPPackagistlibraryMIT Licensephpframework
laravel.com
34.9k12k
ziadoz/awesome-php

A curated list of amazingly awesome PHP libraries, resources and shiny things.

awesomeDo What The F*ck You Want To Public Licensephpphp-framework
32.7k5.1k
symfony/symfony

The Symfony PHP framework

PHPPackagistlibraryMIT Licenseframeworkphp
symfony.com
31.1k9.9k
composer/composer

Dependency Manager for PHP

PHPPackagistMIT Licensephpcomposer
getcomposer.org
29.5k4.8k
bagisto/bagisto

Open Source eCommerce & Multi-Vendor Marketplace Platform Built with Laravel for Enterprise-Scale Commerce, Supporting 10M+ SKUs

PHPPackagistappMIT Licenseecommerce-frameworklaravel
bagisto.com
28.1k3.3k
monicahq/monica

Personal CRM. Remember everything about your friends, family and business relationships.

PHPPackagistappGNU Affero General Public License v3.0laravelcrm
beta.monicahq.com
25.2k2.6k
firefly-iii/firefly-iii

Firefly III: a personal finances manager

PHPPackagistappGNU Affero General Public License v3.0phpmoney
firefly-iii.org
24.5k2.3k
krayin/laravel-crm

Krayin CRM is Free & Open Source CRM Built with Laravel for Customer, Lead, and Sales Management.

PHPPackagistMIT Licensephplaravel
krayincrm.com
23.8k1.6k