PHPackages                             lokhman/silex-firewall - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. lokhman/silex-firewall

ActiveLibrary[Security](/categories/security)

lokhman/silex-firewall
======================

Silex 2.0+ service provider for firewall rules

2.0.0(8y ago)03221MITPHP

Since May 16Pushed 8y ago2 watchersCompare

[ Source](https://github.com/lokhman/silex-firewall)[ Packagist](https://packagist.org/packages/lokhman/silex-firewall)[ RSS](/packages/lokhman-silex-firewall/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (1)

silex-firewall
==============

[](#silex-firewall)

[![StyleCI](https://camo.githubusercontent.com/699cbb4924208448e6cf929a346daad5c7507c9bcd2b321866a95d62f4c164a0/68747470733a2f2f7374796c6563692e696f2f7265706f732f39313435373339382f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/91457398)

Firewall rules service provider for [**Silex 2.0+**](http://silex.sensiolabs.org/) micro-framework.

> This project is a part of [`silex-tools`](https://github.com/lokhman/silex-tools) library.

Installation
----------------------------------------------------

[](#installation)

You can install `silex-firewall` with [Composer](http://getcomposer.org):

```
composer require lokhman/silex-firewall

```

Documentation
------------------------------------------------------

[](#documentation)

Register `FirewallServiceProvider` with firewall *allow* or/and *deny* settings:

```
use Lokhman\Silex\Provider\FirewallServiceProvider;

$app->register(new FirewallServiceProvider(), [
    'firewall.options' => [
        'allow' => ['127.0.0.1', '::1'],  // as array
        'deny'  => '127.0.0.1, ::1',      // as string
    ],
]);

// override default blocking function
$app['firewall.blocker'] = $app->protect(function (Request $request) {
    return JsonResponse(['deny' => $request->getClientIp()]);
});

```

License
------------------------------------------

[](#license)

Library is available under the MIT license. The included LICENSE file describes this in detail.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3282d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17a4b2bb3c64905c2663115cb0a3ef36854123b51709645576a591fb72fbef10?d=identicon)[lokhman](/maintainers/lokhman)

---

Top Contributors

[![lokhman](https://avatars.githubusercontent.com/u/7714105?v=4)](https://github.com/lokhman "lokhman (3 commits)")

---

Tags

toolssilexfirewall

### Embed Badge

![Health badge](/badges/lokhman-silex-firewall/health.svg)

```
[![Health](https://phpackages.com/badges/lokhman-silex-firewall/health.svg)](https://phpackages.com/packages/lokhman-silex-firewall)
```

###  Alternatives

[pragmarx/firewall

A Laravel IP whitelisting and blacklisting

1.4k988.9k](/packages/pragmarx-firewall)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[shieldon/shieldon

Web application firewall for PHP.

87328.2k1](/packages/shieldon-shieldon)[jeroenvisser101/leakybucket

An implementation of the Leaky Bucket algorithm.

44116.6k](/packages/jeroenvisser101-leakybucket)[bnomei/kirby3-redirects

Setup performant HTTP Status Code Redirects from within the Kirby Panel

269.1k](/packages/bnomei-kirby3-redirects)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
