How to Restrict Access to the CMS Admin Area in SilverStripe

In a world where cloud web applications are becoming increasingly common, securing applications against malicious third parties is now becoming a must-have for any website. 

SilverStripe offers a great CMS admin interface where content authors can easily add, modify or delete content on their SilverStripe application but we do not want to give unauthorized parties access to the CMS.

The Internetrix Solution

Internetrix has recently developed and released an open-source IP Restriction module for SilverStripe which offers the ability to only provide access to the SilverStripe CMS admin to whitelisted IP addresses, without the need for any server infrastructure changes.

All that is required is for a developer to install the module, configure the controllers which we want to restrict access to, and provide a list of whitelisted IP addresses that can visit these controllers.

For example, if we want to give access to the CMS admin area to users from the IP address 123.0.0.1, all we need to do is 3 simple steps:

1. Install the module via Composer:

composer require
internetrix/silverstripe-controller-ip-restriction

2.Configure in a YML file which Controller we want to restrict. In the below case, we want to restrict access to the CMS admin.

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

3.Define the list of IP addresses that can access the restricted controller using an SS_ADMIN_ALLOWED_IPS environment variable. 

SS_ADMIN_ALLOWED_IPS='123.0.0.1'

Once at least one IP address has been added in the environment variable, additional IP addresses can be configured using the SilverStripe CMS Site Settings area without any developer intervention required.

To Wrap Things Up

You can try out the new Internetrix Controller IP Restriction module for the SilverStripe Framework by checking it out on Github

If you have any questions or need support implementing the module, let us know!

Need to know more?

Get in touch with our expert team to answer any of your questions!

Get in touch!