Skip to content

Referer

Goal

Prevent certain referrers

Enabled

Enable or disable this wire

Methods

The methods specifies which methods should be inspected

Options:

  • 'post'
  • 'put'
  • 'patch'
  • 'get'
  • 'all' or '*'

The 'all' or '*' is a alias to inspect all methods

php
    ->methods(['post', 'put']) // only post and put method
php
    ->methods(['*']) // all methods

Attack score

This is this wire severity, the higher the number the more severe. All attackScores will be summarized and if it exceeds the PunishScore the block will be activated. Set this to a number that reflects the severity.

  • A very high number will immediately block the user/ip
  • A low number will only block if there are many requests

TIP

sqli and xss are very common attack vectors with high confidence detection. You should set those to a very high number

Filters

Specify the list of referers that should be forbidden

Filters

This specifies what to allow and what to block

php
    ->filters(AllowBlockFilterConfig::make()->allow(['allow-this'])->block(['block-this']));

Example: Exception

allow must be at least ['*'] to allow all

php
    ->allow([])->block([])

Example: Allowed

firefox is allowed

php
    ->allow(['firefox'])->block([])

Example: Blocked

brave is blocked

php
    ->allow(['*'])->block(['brave'])

Example: Not Blocked

firebrave is not blocked, so allowed

php
    ->allow(['*'])->block([])

Example: Not Blocked

Chrome is not blocked, so allowed

php
    ->allow(['*'])->block(['brave'])

Example: Allowed and Blocked

firebrave is both allowed and blocked, so allowed

php
    ->allow(['firebrave'])->block(['firebrave'])

Example: Unspecified

firebrave is both not as allowed and not as blocked The return depends on where it is used.

php
    ->allow(['firebrave'])->block(['firebrave'])

Example

php
WireDetailsConfig::make()
    ->enabled(true)
    ->methods(['*'])
    ->attackScore(1000)
    ->filters([
        'allow' => [],
        'block' => []
    ]);
    
    //... optional overrides

optional global overriders

Released under the MIT License.