UserLock Documentation
UserLock Documentation
You are here: Use cases > Advanced use cases > Secure Remote Access to an Exchange Mailbox using HTTP Modules

How to Secure Remote Access to an Exchange Mailbox with UserLock (using HTTP Modules)

Unauthorized access to users’ Exchange mailbox is a key security concern for many organizations.

In a previous article (that we advise you to read first), we explained how UserLock can control remote access to Exchange mailbox through either Outlook Web Access (OWA) or ActiveSync using ISAPI Filters.

In this article we will outline how UserLock protects access to Exchange 2013 mailbox and offers the control and visibility to Internet Information (IIS) sessions to help stop security breaches.

This procedure also applies to Exchange 2010 and Exchange 2016. For Exchange 2016, you will find a specificity at the end of this article.

Deploy the IIS Agent to monitor & audit mailbox access

As before, we will perform our demonstration on a small Active Directory environment: The server VES1 is the domain controller where UserLock is installed. The server VES2 has Exchange 2013 installed with the Client Access role. We will also use a workstation VEW1 to access a mailbox with Outlook 2013 and OWA.

  1. From the ‘Agent distribution’ view we can install the IIS agent on the server VES2.

    install UserLock IIS session agent

  2. The first difference you will notice is that we need to finish the installation either by registering the ISAPI filter (as we did in our previous article) or by registering the HttpModule.

    registering HttpModule

  3. The UserLock HttpModule is a new agent to control IIS sessions. The main goal of this new agent is to improve the overall compatibility with most web applications. With Exchange 2013 we get a better result with the HttpModule so we will continue our demonstration with this.

    Next, switch to the IIS management console on the server VES2. At the root of the server we open the Modules.

    IIS Manager modules

  4. Click on Configure Native Modules.

    Configure native modules

  5. Next click on Register.

    configure native modules register

  6. Specify the path to the UserLock HttpModule located at the following path: c:\Windows\System32\UlHttpModule.dll.

    configure native modules select path

  7. Once we click OK the module is selected in the native module list. If we leave the module selected it will be active server wide for all IIS applications. We recommend unselecting it and enabling it only on selected applications.

    configure native modules selected applications

  8. To illustrate this, if we had left it selected for the whole server, the result after opening a single instance of Outlook 2013 on the workstation VEW1 (10.2.2.11) would be as follows. Looking at the sessions in the UserLock console you can see a lot of different sessions for just one instance of Outlook.

    viewing many different IIS sessions mailbox access

  9. Now remove the UserLock agent from the modules list at the root of IIS. The module will remain registered and available for selection in child applications.

    remove UserLock agent modules list IIS

  10. Next enable it only in the OWA and Microsoft-Server-ActiveSync applications.

    enable UserLock agent OWA ActiveSync

  11. We can now see the result after all application pools have been recycled. The user Bob has an interactive session open on the workstation VEW1 (10.2.2.11) with Outlook and OWA open but we no longer see the IIS sessions generated by Outlook.

    Monitor mailbox acccess on Exchange 2013 with UserLock

Detect when a user signs out from OWA

Next, let’s make Bob sign out from OWA.

owa sign out

If we look at the session view in the UserLock console we can see that the session is gone and Bob has only its workstation session on VEW1 still open. UserLock can detect when a user signs out from OWA.

Mailbox access Exchange 2013 logged off UserLock

Detect unauthorized mailbox access & close IIS sessions

Now, if we let Bob open a session on OWA with Alice’s credentials you can see clearly in the UserLock console that the OWA session from Alice is generated from the IP address of the workstation VEW1 where Bob is logged on.

monitor-suspicious-mailbox-access-exchange-2013-userlock

If we are the UserLock administrator, we would now be legitimately suspicious by seeing Bob accessing Alice’s mailbox. In this scenario the administrator can simply select the identified suspicious session and click logoff to close the suspicious access.

logoff-react-suspicious-mailbox-access-exchange-2013-userlock

Restricting mailbox access by IP address

As a precautionary measure the administrator could create a protected account rule for Alice to deny IIS sessions from the address 10.2.2.11.

restrict logon by IP address for IIS Sessions with UserLock

What’s the result? When Bob tries to do something in OWA he will be automatically redirected to the logon page:

outlook web access logon page

And if Bob tries to logon again with Alice credentials on OWA, he will receive the following deny message.

deny logon workstation restriction message with UserLock

As you can see, with UserLock an administrator can quickly react and sign out a user from a mailbox thanks to the new IIS session logoff feature.

About Exchange 2016

The same procedure will work on Exchange 2016 too. There is only one point that you should care about Exchange 2016.

If you do this procedure till the end, the IIS Agent will be configured only for “OWA” and “Microsoft-Server-ActiveSync” applications.

With Exchange 2016, the problem is that, after any update, all HTTP modules (including the IIS Agent) configured in applications only (not at the root level of IIS) will be automatically disabled.

Workaround

  1. Configure the HTTP Module IIS UserLock Agent at the root level of IIS (as documented at the beginning of the article).

  2. Specify IIS Application Pools to monitor:

    • By default, when you configure the IIS agent on an IIS website, all applications from this site are monitored independently of the application pool they run on.

    • If needed, you can choose to monitor only Web applications running on specific application pools by creating the following registry value (REG_MULTI_SZ type) on the IIS server:

      HKEY_LOCAL_MACHINE\SOFTWARE\ISDecisions\UserLock\IIS\ProtectedApplicationPools
    • Then enter the list of all application pools you want to supervise (one per line).

    • On an Exchange server for example, many Web applications are created on the 'IIS Default' website. If you configure the UserLock 'IIS agent' for this site, UserLock will display a lot of IIS sessions.

    • In most cases, you only want to control sessions from 'Outlook Web Access' and ignore the other Web applications. You can do this by specifying only “MSExchangeOWAAppPool” as application pool to monitor.

    • If you are interested in Active Sync, add “MSExchangeSyncAppPool”.

    • Example with both “MSExchangeOWAAppPool” and “MSExchangeSyncAppPool” application pools:

      protected application pools

About ISAPI Filters

Lastly, What about ISAPI Filters? The answer is yes, with UserLock it is also possible to control sessions to OWA and ActiveSync using ISAPI Filters in place of HTTP Modules.

Please see this article.