Skip to content

devitools/arceau

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arceau Firewall

How to install

composer require devitools/arceau

Get started

Create a PHP file as below

<?php

use Devitools\Arceau\Security\Firewall;

use const Devitools\Arceau\Security\Helper\FIREWALL_ALLOW;
use const Devitools\Arceau\Security\Helper\FIREWALL_DENY;

/**
 */
return static function () {
    $allowed = [
        'query:code=10&t=*',
        '172.30.0.1',
        '192.168.*',
    ];

    Firewall::instance()
        ->setDefaultMode(FIREWALL_DENY)
        ->addItem('10.0.0.*', FIREWALL_ALLOW)
        ->addItems($allowed, FIREWALL_ALLOW)
        ->handle();
};

Then use it anywhere

$firewall = require __DIR__ . '/../../firewall.php';
$firewall();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages