spinzar/firewall
Composer 安装命令:
composer require spinzar/firewall
包简介
Web Application Firewall (WAF) package for Laravel
README 文档
README
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 spinzar/firewall
2. Register (for Laravel < 5.5)
Register the service provider in config/app.php
Spinzar\Firewall\Provider::class,
3. Publish
Publish configuration, language, and migrations
php artisan vendor:publish --tag=firewall
4. Database
Create db tables
php artisan migrate
5. 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 what has changed recently.
Contributing
Pull requests are more than welcome. You must follow the PSR coding standards.
Security
If you discover any security related issues, please email security@spinzar.co instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see LICENSE for more information.
spinzar/firewall 适用场景与选型建议
spinzar/firewall 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 117 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 10 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「security」 「firewall」 「laravel」 「xss」 「blacklist」 「sqli」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 spinzar/firewall 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 spinzar/firewall 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 spinzar/firewall 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Basic Firewall
Provide a way to secure accesses to all routes of an symfony application.
It's a barebone security class written on PHP
Contao CMS integrity check for some files
A PHP security linter to detect insecure functions like var_dump, print_r, and other dangerous functions in your codebase
Web Application Firewall (WAF) package for Laravel
统计信息
- 总下载量: 117
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-15