Skip to content

Commit 8cf6d36

Browse files
committed
Clean up readme
1 parent 1ee7fa4 commit 8cf6d36

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

README.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ CLOUDFLARE_ACCOUNT_ID="your_account_id"
3535
To permanently ban an IP address from reaching your server.
3636

3737
```php
38-
Firewall::ban('101.1.1.254', Carbon::now()->addYear());
38+
Firewall::ban('101.1.1.254');
39+
```
40+
41+
To ban an IP address for a certain period of time, simply pass a Carbon instance as the second argument
42+
```php
43+
Firewall::ban('10.1.1.1', Carbon::now()->addYear();
3944
```
4045

4146
To unban and IP address
@@ -59,7 +64,7 @@ Firewall::unchallenge('101.1.1.254');
5964
If you would prefer to ban an entire country simply pass in the iso_3166_2 country code
6065

6166
```php
62-
Firewall::banCountry('DE', Carbon::now()->addYear());
67+
Firewall::banCountry('DE');
6368
```
6469

6570
To then disable
@@ -72,27 +77,21 @@ Firewall::unbanCountry('DE');
7277

7378
If you need rules to whitelist IP address range or Countries simply...
7479

75-
```php
76-
Firewall::whitelistIp('101.1.1.254');
77-
```
78-
79-
or
80-
81-
```php
82-
Firewall::whitelistCountry('US');
83-
```
80+
These can be added to the configuration file bot-licker.php
8481

8582
### Automated rules
8683

87-
Are you tired of seeing bots trying to hit .env or phpinfo.php in your logs? You can now zap these IPs instantly with, you can pass an option Carbon instance if you wish to have an expiry on the rule, otherwise it runs indefinitely.
84+
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).
8885

8986
```php
9087
Rule::matches('phpinfo.php', now()->addYear())->ban();
9188
```
9289

90+
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.
91+
9392
### Extending BotLicker with new providers
9493

95-
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()`
94+
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.
9695

9796
```php
9897
Firewall::setProvider(OtherWAF::class)->ban('101.1.1.254', now()->addMinutes(5));
@@ -101,9 +100,5 @@ Firewall::setProvider(OtherWAF::class)->ban('101.1.1.254', now()->addMinutes(5))
101100
### TODO:
102101
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
103102

104-
```php
105-
Firewall::ban('101.1.1.254', Carbon::now()->addYear());
106-
```
107-
108103
## License
109104
The MIT License (MIT)

0 commit comments

Comments
 (0)