PHPackages                             internetrix/silverstripe-controller-ip-restriction - 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. internetrix/silverstripe-controller-ip-restriction

ActiveSilverstripe-vendormodule

internetrix/silverstripe-controller-ip-restriction
==================================================

Restrict SilverStripe controllers to specific IP address

1.0.1(5y ago)1362[1 issues](https://github.com/Internetrix/silverstripe-controller-ip-restriction/issues)[1 PRs](https://github.com/Internetrix/silverstripe-controller-ip-restriction/pulls)BSD-3-ClausePHPPHP &gt;=7.1

Since May 7Pushed 2y ago3 watchersCompare

[ Source](https://github.com/Internetrix/silverstripe-controller-ip-restriction)[ Packagist](https://packagist.org/packages/internetrix/silverstripe-controller-ip-restriction)[ RSS](/packages/internetrix-silverstripe-controller-ip-restriction/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Introduction
============

[](#introduction)

This module allows SilverStripe developers to restrict access to arbitrary-defined controllers, according to a User's IP address. Requests to specific Controllers will be denied if a user's IP does not match the provided list of allowed IP addresses.

Allowed IP addresses can be set via an environment variable or via the SiteConfig. Common use cases of the module includes:

- Restricting access to the CMS admin section
- Restricting access to the dev/tasks admin.

Requirements
------------

[](#requirements)

- SilverStripe CMS ^4

Installation &amp; Configuration
--------------------------------

[](#installation--configuration)

1. Install the module via composer:

```
composer require internetrix/silverstripe-controller-ip-restriction

```

2. Set the following variables for `Internetrix\CMSAdminIPRestriction\AllowedIPMiddleware` in config:
    - enabled: Set this to true to enable this module's AllowedIPMiddleware
    - restricted\_controllers: A list of controllers you want to be restricted by IP addresses

In the following example, we are restricting access to the CMS admin as well as the `/dev` controller.

```
Internetrix\CMSAdminIPRestriction\AllowedIPMiddleware:
  enabled: true
  restricted_controllers:
    - SilverStripe\Admin\AdminRootController
    - SilverStripe\Dev\DevelopmentAdmin

```

3. Define which IP addresses are allowed in `.env` file, using a `SS_ADMIN_ALLOWED_IPS` variable. For multiple IP addresses, use a comma-limited list.

```
SS_ADMIN_ALLOWED_IPS='123.0.0.1,248.1.1.1'

```

- Additional allowed IP addresses can also be set by a CMS admin via the CMS SiteConfig, under the `Allowed IPs` tab. Simply create a new record with an exact IP address and label it with the corresponding physical location (used for audit purposes)

Bypass IP restriction
---------------------

[](#bypass-ip-restriction)

- If a certain user is an Admin, they can bypass the IP restriction check if the `CanBypassIPRestriction` database field is set to true. This can be set when editing the member in the CMS and is only applied if the User remains a CMS Administrator.

    **Important:** Due to race conditions, this features requires a user to be first logged-in so that the `CanBypassIPRestriction` value for the user can be checked. If the CMS admin or another Controller is restricted, a user must first log-in to SilverStripe via a non-restricted page (i.e A Only Logged-in Users Can View Page) before the IP Bypass will be applied.

Troubleshooting
---------------

[](#troubleshooting)

- If no IP address is specified in `.env` or via the `SiteConfig`, the restricted controllers will be inaccessible.

Todo
----

[](#todo)

- Currently, IP matching is based on exact matching IP address. Range, wildcard and CIDR is currently not supported and will included in the future. Pull requests welcome!

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Every ~0 days

Total

2

Last Release

1832d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2028df988ee004ba1951c38852161aef16c343d4831e37fa16edb7e77729c86?d=identicon)[Internetrix](/maintainers/Internetrix)

---

Tags

silverstripeip-addressip restrictionrestrict ipcontroller restriction

### Embed Badge

![Health badge](/badges/internetrix-silverstripe-controller-ip-restriction/health.svg)

```
[![Health](https://phpackages.com/badges/internetrix-silverstripe-controller-ip-restriction/health.svg)](https://phpackages.com/packages/internetrix-silverstripe-controller-ip-restriction)
```

###  Alternatives

[silverstripe-terraformers/gridfield-rich-filter-header

Rich filter header component for GridField

1325.7k1](/packages/silverstripe-terraformers-gridfield-rich-filter-header)

PHPackages © 2026

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