MIT License

项目介绍

akaunting/laravel-firewall 是一个托管在 GitHub 上的开源项目,主要使用 PHP 编写,采用 MIT License 许可证,目前获得 1.0k 个 Star、116 次 Fork。

仓库全名
akaunting/laravel-firewall
开源许可证
MIT License
Star 数
1.0k
Fork 数
116

README 摘要

Web Application Firewall (WAF) package for Laravel 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)…

完整内容见 GitHub 原始 README 或本页 。

常见问题

laravel-firewall 用什么语言开发?

主要使用 PHP 编写,采用 MIT License 许可证,目前有 1.0k 个 Star。

laravel-firewall 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 laravel-firewall 的源码?

可以直接克隆仓库:git clone https://github.com/akaunting/laravel-firewall.git,默认分支为 master;安装与运行步骤见仓库 README。

laravel-firewall 最近还在维护吗?

仓库最近一次更新为 5月17日,当前没有未关闭的 Issue;Star 数为 1.0k,可作为社区活跃度的参考。

简要分析

热度分
1265
价值分
646
活跃状态
活跃

语言占比

PHP

Release

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.

评论

暂无评论