Post

IP Whitelist Add-on for Optimizely CMS 12

Recentlly, I have been working on a new CMS 12 module - IP Whitelist and I finally make it available on the nuget.org.

The primary goal of this module is to simplify the environment access control for customers/partners during the development phase especially for rebranding projects as clients usually do not want to disclose their new brand/designs before it goes live.

This module is free and designed for blocking/restricting access on a per site basis for Optimizely CMS 12+ solution hosted on Optimizely DXP with the following features

  • Fully multi-site supports.
  • Whitelist single IP address.
  • Whitelist a range of IP addresses using Classless Inter-Domain Routing (CIDR).
  • Whitelist known paths (e.g. /episerver/health)

Interfaces

IP screenshot



CIDR screenshot



Ignore Path(s) screenshot

Installation & Configuration

Startup.cs

After installing the package IPWhitelist in your project, you need to ensure the following lines are added to the startup.cs class of your solution:

1
2
3
4
5
6
7
8
9
10
11
12
13
public void ConfigureServices(IServiceCollection services)
{
   // .... other services

   services.AddIpWhitelist();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    // Add IPWhitelist middleware before any other middleware
    app.UseIpWhitelist();
    // ... other middleware
}

The call to services.AddIpWhitelist() sets up the dependency injection required by the IPWhitelist to ensure the solution works as intended. This works by following the Services Extensions pattern defined by Microsoft.

Documentation

Details can be found here. If you encounter any issue, feel free to raise the issue there.

Limitations

  • This module is NOT designed to work with Optimizely CMS 11 or below.

Support

IPWhitelist is a free module. If you like this module and keen to support me, you can get me a coffee 😃

Happy Coding! 😇

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.

© Vincent. Some rights reserved.