Skip to content
This repository was archived by the owner on May 30, 2022. It is now read-only.

IP White Listing

David San Filippo edited this page Sep 11, 2017 · 1 revision
Category Notes
Module Location Feature.IPWhiteList
Recommended If Needed
Default On
Dependencies None
Pipelines Targeted HttpBeginRequest
Events Targeted None
Site Settings /sitecore/templates/SF/Feature/IPWhiteList/Interface Templates/_SiteWhiteListSettings
Page Settings None
Patch Config Feature.IPWhiteList\WhiteListing.config

IIS provides an "IP Address and Domain Restrictions" module to restrict users access. This works if all the sites on that Sitecore Instance require the same IP restrictions. Even if they do, keep in mind this restriction executes before Sitecore gets a handle on the request and if this feature is misconfigured you can find yourself troubleshooting 500 level errors with no good indication as to the root cause. Duplicate entries in this file can cause this issue.

Instead, ASF Extends the Sitecore Configuration to support configuring IP Access Restrictions at the site level and configure both global and site specific IP Addresses and IP Ranges. To enable this feature, modify the following 2 fields within the Multi Site Configuration:

ip1.png

The Restricted Access Page will always be exempt from the restriction and if configured any visitors not white listing will be redirected to the configured page using a 301 redirect. If omitted, you will instead get a 403 Forbidden http status returned to the client and any configured "Custom Error" for this code would be displayed.

When enabled, the list of valid IP addresses is the union of the ip address and ranges configured at both the global level and for that particular site.

ip2.png

You can configure both a single IP and an IP ranges. A single IP allows the content author the ability to configure a single IP address that will be granted access to the site.

ip3.png

An ip range allows the content author to specify a range of IPs. If the visitors IP is anywhere in that range they will be permitted access.

ip4.png

The code that evaluates the rules is implemented in a Sitecore Pipeline. It uses the Request.UserHostAddress to get the client's ip address. This is the same as the Server Variable "REMOTE_ADDR". If the client is behind a proxy server, it will be the address of the proxy server. Nothing was done to use another header such as Forwarded For.

Clone this wiki locally