IPWhitelist 1.0.0-beta.2

This is a prerelease version of IPWhitelist.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package IPWhitelist --version 1.0.0-beta.2                
NuGet\Install-Package IPWhitelist -Version 1.0.0-beta.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IPWhitelist" Version="1.0.0-beta.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IPWhitelist --version 1.0.0-beta.2                
#r "nuget: IPWhitelist, 1.0.0-beta.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IPWhitelist as a Cake Addin
#addin nuget:?package=IPWhitelist&version=1.0.0-beta.2&prerelease

// Install IPWhitelist as a Cake Tool
#tool nuget:?package=IPWhitelist&version=1.0.0-beta.2&prerelease                

Optimzely IPWhitelist

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

  • Whitelist single IP address per site basis
  • Whitelist a range of IP addresses via CIDR per site basis
  • Whitelist known paths (e.g. /episerver/health)

img.png

Configuration

Startup.cs

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

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.

Module access control

By default, only users in CmsAdmins, WebAdmins and Administrators role can access Admin UI. If you would like to use you custom policy, you can customize it with your own AuthorizationOptions when registering the IPWhitelist.

services.AddIpWhitelist(options =>
{
    options.AddPolicy("yourPolicyName", policy =>
    {
        policy.RequireRole("yourRoleName");
    });
});

Troubleshooting

The module has extensive logging. Turn on information logging for the IPWhitelist namespace in your logging configuration.

  "Logging": {
    "LogLevel": {
      "Default": "Warning",
      "IPWhitelist":"Information" // Add this line
    }
  }

Limitations

  • This module is NOT designed to work with Optimizely CMS 11 or below.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-beta.5 1,908 3/20/2024
1.0.0-beta.4 70 3/18/2024
1.0.0-beta.3 63 3/12/2024
1.0.0-beta.2 59 3/7/2024
1.0.0-beta.1 63 3/6/2024