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

Post a comment
Sit tight...
We're adding your comment.
Thank you.
Your comment has been added.
There's been a problem.
Please try again later.
Share with
Tags
Latest Comments
By gf on Xamarin forms - Stop/Cancel back button event
16 Oct 2018, 17:32 PM
By AEndumpbub on Reducing Umbraco memory usage by enabling 32-bit applications
13 Oct 2018, 07:04 AM
By nseo-sw.men on MVC forms in Umbraco
12 Oct 2018, 11:30 AM
By JM on Solved: You need to use a Theme.AppCompat theme (or descendant) with this activity
10 Oct 2018, 13:36 PM
By praveen on Xamarin Forms - Working with threads
5 Oct 2018, 12:05 PM
By Jasonced on MVC forms in Umbraco
27 Sep 2018, 05:41 AM
By Евгения on MVC forms in Umbraco
27 Sep 2018, 02:47 AM
By Wokeq62 on Using SQL DataTables to speed up database performance
25 Sep 2018, 17:28 PM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development