Email Appliance - Example: Configuring passwords for SPX email encryption using a web service

  • Article ID: 62638
  • Rating:
  • 3 customers rated this article 6.0 out of 6
  • Updated: 08 Jun 2012

This article shows you how to set up a web service that integrates with your existing authentication system to issue SPX passwords. The passwords are based on supplied email address/password combinations. These passwords are required for decryption of messages that have been encrypted using the Email Appliance's SPX encryption.

Note: Sophos Technical Support does not officially support the development of custom web services. For additional assistance with customization, contact your account manager to receive guidance from Sophos Professional Services.

Required Files

License:

Copyright (c) 2009, Sophos Group

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Sophos Group nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Prerequisites

  • IIS Server 7 on Windows 2008 server
  • IIS server with the full ASP.NET and ISAPI roles installed, set up, and ready to deploy (see the Microsoft website for more information).
  • A comma-separated (CSV) file containing a list of email addresses and their associated passwords.

Configuring the email appliance to issue passwords using a web service requires a number major steps, each of which is described in detail below. You must add the web service application to IIS, configure IIS to use the service, configure HTTPS (recommended), set up authentication, configure the web service application, configure the appliance to use the service, and test the service.

I - Adding the Application to IIS

  1. Extract the contents of PasswordService.zip into a directory under C:\inetpub\wwwroot. For this example, use C:\inetpub\wwwroot\SpxPasswordService.

    graphics1

  2. Right-click on each of the files in the SpxPasswordService directory (including files in the bin directory), and select Properties.
  3. Click Unblock.

    graphics2

  4. Click OK.

II - Configuring IIS to Use the Service

  1. Select Start > Programs > Administrative Tools > Internet Information Services (IIS) Manager.
  2. In the directory tree, click YourServerName > Sites > Default Web Site.

    graphics3

  3. Right-click Default Web Site, and select Add Application.
  4. In the Alias text box, enter SpxPasswordService.
  5. In the Physical Path text box, enter C:\inetpub\wwwroot\SpxPasswordService.

    graphics4

  6. Click OK.

III - Configuring HTTPS

Although it is possible to perform authentication without HTTPS, Sophos recommends that it be enabled.

  1. If necessary, install a certificate.
  2. Right-click Default Web Site.
  3. Select Edit Bindings.
  4. Click Add.

    graphics5

  5. Add https to the list.

IV - Setting up Anonymous Authentication

Note: SPX configuration in the Email Appliance has support for Basic Access Authentication using Active Directory or Anonymous Authentication, both with the option of using HTTPS. This example covers Anonymous Authentication only. For information about Basic Access Authentication on IIS Server 7, see the Microsoft documentation.

  1. In the directory tree, on the left side, click SpxPasswordService.
  2. In the middle pane, under IIS, double-click Authentication.

    graphics6

  3. Right-click Anonymous Authentication, and select enable (if it is not already enabled).

    graphics7

  4. The password service is now running at https://localhost/SpxPasswordService/PasswordService.asmx. If you open your web browser to this URL, the following is displayed:

    graphics8

V - Configuring the Application

The application can be integrated with most authentication infrastructures, whether it be database (MSSQL, MYSQL, Oracle, etc), LDAP (Active Directory, OpenLDAP, etc), or other means (for example, text files). The only requirement is that the passwords can be retrieved and transmitted to the Email Appliance for use with encrypted messages.

In this example, the script will attempt to retrieve passwords from a CSV file containing one email address and password combination on each line. In each entry, the two values must be separated by a comma, and there should be no spaces. For example:

user@example.com,somepassword

  1. To specify the CSV file, edit C:\inetpub\wwwroot\spxpasswordservice\Web.config. There will be a section in the file that looks like this:

    <appSetting>
    <add key="csvFile" value="C:\passwords.csv" />
    </appSettings>
  2. Replace C:\passwords.csv with the path to your CSV file.

    graphics9

  3. Ensure that both the the file name and the Windows permissions allow only the IIS user to read this file. The file must
    be in a location for which the IIS user has read access.

VI - Configuring and Testing the Web Service Password Service

  1. Log in to the Email Appliance.
  2. Select Configuration > Policy > Encryption.
  3. Click the SPX Encryption tab, and then click Add.
  4. Configure cover page options, and click Next.
  5. From the Password service drop-down list, select Use a Custom remote authentication service to assign passwords.

    graphics10

  6. Enter the URL of the IIS 7 web service, along with the domain path. For this example, the URL is http://<HostName>/SpxPasswordService/PasswordService.asmx
  7. If you opted for Basic Access Authentication instead of Anonymous Authentication, enter the username and password for the web service.
  8. Enter a sample email address and password from the CSV file that you created earlier (For example, email=user@example.com Password=somepassword), and click Test. SPX will authenticate using the web server, and a "Password Matched" message is displayed on the Appliance's status bar if the operation is successful.

    graphics11

  9. Proceed through the SPX Template wizard, and save your template. Your Web Service Password Authentication is now complete.

 
If you need more information or guidance, then please contact technical support.

Rate this article

Very poor Excellent

Comments