Download the PHP package turbo124/bot-licker without Composer
On this page you can find all versions of the php package turbo124/bot-licker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download turbo124/bot-licker
More information about turbo124/bot-licker
Files in turbo124/bot-licker
Package bot-licker
Short Description Package for Laravel to block IPs at the network edge
License MIT
Informations about the package bot-licker
BotLicker
Ban / Challenge IPs/Countries at the network edge.
The Problem: After researching some laravel packages that provide firewall functionality, a common theme was that they all block at the application level.
This may work for sites with low levels of traffic, but when dealing with a large number of requests it becomes ineffective. It also continues to use resources unnecessarily.
Enter BotLicker where you can send your WAF rules direct to Cloudflare for instant implementation.
Installation
Configuration
In your .env file, enter in the following environment variables:
Usage
To permanently ban an IP address from reaching your server.
To ban an IP address for a certain period of time, simply pass a Carbon instance as the second argument
To unban and IP address
If you would prefer to issue a challenge to an IP address
To then disable
If you would prefer to ban an entire country simply pass in the iso_3166_2 country code
To then disable
Protected IPs and Countries
If you need rules to whitelist IP address range or Countries simply...
These can be added to the configuration file bot-licker.php
Automated rules
Are you tired of seeing bots trying to hit .env or phpinfo.php in your logs? You can build a custom ruleset which matches a string in the request URI. And then perform an action on the user arriving from this IP (or Country).
This will match any incoming request URIs with phpinfo.php in the URL ie https://domain.com/phpinfo.php and then ban the IP address for a year.
Extending BotLicker with new providers
Currently only Cloudflare is supported, however you can easily implement the ProviderContract and generate the corresponding methods for other WAFs. Once you have created your provider, simply inject it into the setProvider()
or replace the default provider in the configuration file.
Console commands
If you prefer to ban from the console you can use these commands:
-
Firewall rules:
-
Delete rule from WAF
-
Ban from the command line:
- Show bans
TODO:
Currently the package perform simply bans/unbans etc. In the next iteration, ban duration will be also be added in order for some rules to be removed after X timeperiod. ie
License
The MIT License (MIT)