Restrict Umbraco Back Office by IP

Reasons behind IP restriction:

In some cases, having the back office open to the public can be an issue for security, especially for high profile websites as it starts to become an issue for brute force. Not to mention employees accessing the admin interface from home or other unauthorised locations such as libraries etc.

A quick fix for this is to add an IP restriction to the Umbraco directory so that only people in authorised locations can access the service. Employees would then have to use a VPN or wait until they're into the office before they could access the UI.

Applying an IP restriction to the Umbraco back office so that is displays a 404 error:

To apply the restriction, you'll need to create a new web.config file within the Umbraco directory, providing one doesn't already exist, and add the following XML to it, then add/remove/update the IP addresses referenced in the example below so that they match the IP addresses of the office locations you'd like to grant access:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true">
                    <match url="*surface*" negate="true" />
                    <conditions>
			<add input="{REMOTE_ADDR}" pattern="123.456.789.10" negate="true" />
                        <add input="{REMOTE_ADDR}" pattern="963.852.741.123" negate="true" />
                    </conditions>
                    <action type="CustomResponse" statusCode="404" statusReason="File or directory not found." statusDescription="The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable." />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Once you've implemented that, anyone trying to access the back office that doesn't have one of your defined IP addresses will see a 404 error within the browser.

Other methods:

Other methods of protecting the back office might include changing the directory that it resides in.


Published at

Tags: Umbraco,IIS

Luke Alderton

Comments

Share with
Tags
Latest Comments
By Mark Gentry on Windows Server 2019 - Change product key does nothing
20 Aug 2021, 03:30 AM
By Cathy on In-Place Upgrade for a Windows Server domain controller
31 Jul 2021, 18:28 PM
By Mr. Greymatter on Raspberry Pi - Running Java app on Raspbian
16 Feb 2021, 07:35 AM
By Mikko Seittenranta on Xamarin Forms multiple instances of same app open
16 Feb 2021, 04:34 AM
By Andrew on Auto/Custom height on Xamarin Forms WebView for Android and iOS
22 Jan 2021, 22:15 PM
By Nick on Raspberry Pi - Running Java app on Raspbian
14 Oct 2020, 19:37 PM
By Ivan on Fixed: Value cannot be null Parameter Name: source
15 Sep 2020, 19:47 PM
By Anand on Raspberry Pi - Bluetooth using Bluecove on Raspbian
7 Sep 2020, 16:53 PM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development