Securing your WebDAV SSL file server in IIS

 

Table of Contents


Introduction

In this article we explain how you can implement some security measurements to secure the WebDAV connection from the internet.

Step 1. Enable 'IP Address and Domain Restrictions'

IIS has a feature called 'IP Address and Domain Restrictions', which you can use to secure the connection.

You can enable this by installing it on your WebDAV server via the Server Manager. Go to:

Add Roles and Features -> Server Roles -> Web Server (IIS) -> Web Server -> Security -> enable IP and Domain Restrictions.

Picture1.png

Back to top

 

Step 2. Configure IP Addresses and the Rules

After installing the feature 'IP and Domain Restrictions', you can configure the IP Addresses and the Rules.

  1. Open IIS on your WebDAV server.
  2. Navigate to the website that hosts the WebDAV.
  3. Double-click IP Addresses and Domain Restrictions.

    Picture2.png

  4. From the Actions menu at the right side, click Edit Feature Settings.

    Picture3.png

  5. A dialogue window will open. Make sure it looks as depicted below. Click OK.

    Picture4.png
    These settings abort a connection when an unspecified client tries to connect to the WebDAV web URL.
  6. From the Actions menu at the right side, click Add Allow Entry…

    Picture5.png

  7. A dialog window will open. Specify the IP address or IP address range that is allowed access.
  8. Click OK when done.

    You need to create a separate 'Allow Entry' for each IP address or IP address range. Which IP address(es) and/or range you need to allow depends on your network setup. E.g. the Workspace 365 webserver, client IP-addresses or router/gateway IP. If Workspace is hosted by us, whitelist our IP range. Refer to the IIS logs if necessary to see from which IP address connections are initiated.

    Picture6.png

  9. Verify that you are able to access the WebDAV file shares from the clients as defined in IIS.

Back to top

 

Step 3. Prevent File Execution

IIS uses 'Handler Mappings' to prevent or allow execution of files.

The Workspace implementation of WebDAV does not require File Execution, therefore we advise to disable File Execution.

There are three different mappings:

  • Read – enables or disables handlers that require read access.
  • Scripts – enables or disables handlers that require script rights.
  • Execute – enables or disables handlers that require execute rights.

  1. Select the WebDAV site in IIS.
  2. Double-click Handler Mappings.

    Picture7.png

  3. From the Actions menu at the right side, click Edit Feature Permissions…

    Picture8.png

  4. A dialog window will open. Uncheck the Script checkbox.
  5. Click OK.

    Picture9.png

Back to top

 

Step 4. Request filtering

WebDAV uses two special HTTP methods for administrative tasks:

  • MKCOL (create a new collection, like a directory).
  • MOVE (move files from one URL to another, or rename files).

These are not used by Workspace 365. Workspace created its own implementation to perform these actions and to make it more secure. Therefore, we describe how to deny MKCOL and MOVE actions below.

Ensure that Request filtering is installed from the IIS features.
  1. Select the WebDAV site in IIS.
  2. Double-click Request Filtering.

    Picture10.png

  3. Click the HTTP Verbs tab.

    Picture11.png

  4. From the Actions menu at the right side, click Deny Verb…

    Picture12.png

  5. A dialog window will open. Enter MOVE and click OK.
  6. Repeat step 4 and 5, but this time, enter MKCOL and click OK.

Back to top

 

Step 5. Block file extensions

In addition to the above, it’s possible block specific file extensions via the WebDAV URL. We advise to block the following file extensions:

  • .php
  • .cs
  • .cc
  • .cpp
  • .asp
  • .exe
  • .aspx

To block a file extension, follow the steps below.

  1. In the Request Filtering section, click the tab File Name Extensions.

    Picture13.png

  2. From the Actions menu at the right side, click Deny File Name Extensions…

    Picture14.png

  3. A dialog window will open. Enter the extension name you want to block and click OK. Repeat this step for each extension you want to block.
  4. Click the tab Hidden Segments.
  5. Verify the web.config is added. If not, click Add Hidden Segment in the Actions menu on the right side to add it.

    Picture15.png

Back to top