Service Principle Name <spn>

Overview

The <spn> element adds a Service Principle Name (SPN) to the collection of SPNs. Each SPN specifies a unique endpoint for client activity using the extended protection features for Windows authentication.

Extended protection enhances the existing Windows authentication functionality in order to mitigate authentication relay or "man in the middle" attacks. This mitigation is accomplished by using security information that is implemented through two security mechanisms:

Channel-binding information that is specified through a Channel Binding Token (CBT), which is primarily used for SSL connections.

Service-binding information that is specified through a Service Principle Name (SPN), which is primarily used for connections that do not use SSL, or when a connection is established through a scenario that provides SSL-offloading, such as a proxy server or load-balancer.

The <extendedProtection> element may contain a collection of <spn> elements, each of which contains a unique SPN for the service binding information. Each SPN represents a unique endpoint in the connection path, which may be a Fully Qualified Domain Name (FQDN) or NetBIOS name of the destination server or a proxy server. For example, if a client is connecting to a destination server through a proxy server, the SPN collection on the destination server would need to contain the SPN for the proxy server. Each SPN in the collection must be prefixed with "HTTP," so the resulting SPN for "www.contoso.com" would be "HTTP/www.contoso.com."

There are two attributes of the <extendedProtection> element that configure the channel-binding and additional behavior for IIS extended protection:

The tokenChecking attribute configures the behavior for checking for channel-binding tokens. The possible values for this attribute are:

Name

Description

None

This value specifies that IIS will not perform channel-binding token checking. This setting emulates the behavior that existed before extended protection.

The numerical value is 0.

Allow

This value specifies that channel-binding token checking is enabled, but not required. This setting allows secure communication with clients that support extended protection, but still supports clients that are not capable of using extended protection.

The numerical value is 1.

Require

This value specifies that channel-binding token checking is required. This setting does not provide support for clients that do not support extended protection.

This flag specifies that no additional behavior is enabled for extended protection. (For example, no proxy server is being used and SPN checking is enabled and requires FQDNs.)

The numerical value is 0.

Proxy

This flag specifies that part of the communication path will be through a proxy, or that the client is connecting directly to the destination server over HTTP.

The numerical value is 1.

NoServiceNameCheck

This flag specifies that SPN checking is disabled; this flag should not be used in scenarios where only SPNs are being checked.

The numerical value is 2.

AllowDotlessSpn

This flag specifies that SPNs are not required to be FQDNs. Setting this flag allows NetBIOS-based SPNs. Note: Setting this flag is not a secure scenario; non-FQDN-based names are vulnerable to name resolution poisoning attacks.

The numerical value is 4.

ProxyCohosting

This flag specifies that the entire client-to-server communication path will use HTTP only; no part of the communication path will use SSL, and SPN checking will be used. Note: When you specify this flag, you must also specify the Proxy flag.

The numerical value is 32.

Extended Protection Scenarios

Consider the following example scenarios:

In each of the following scenarios, you could also specify the AllowDotlessSpn flag if your networking environment supports NetBIOS-based SPNs; however, NetBIOS-based SPNs are not secure.

For each of the following scenarios where SPN checking will be used and channel-binding token checking will not be used, you should not specify the NoServiceNameCheck flag.

Scenario

Flags

Description

Client connects directly to destination server using HTTP

Proxy, ProxyCohosting

SPN checking will be used and channel-binding token checking will not be used.

Client connects directly to destination server using SSL

None

Channel-binding token checking is used and SPN checking is not used.

Client connects to destination server through a proxy server using HTTP for the entire path

Proxy, ProxyCohosting

SPN checking will be used and channel-binding token checking will not be used.

Client connects to destination server through a proxy server using SSL for the entire path

Proxy

SPN checking will be used and channel-binding token checking will not be used.

Client connects to proxy server using SSL and proxy server connects to the destination server using HTTP (SSL off-loading)

Proxy

SPN checking will be used and channel-binding token checking will not be used.

Additional Information

More information about Extended Protection is available in the following topic:

Compatibility

The <spn> element of the <extendedProtection> element was introduced in IIS 7.5.

IIS 7.0

N/A

IIS 6.0

N/A

Setup

The default installation of IIS 7 and later does not include the Windows authentication role service. To use Windows authentication on IIS, you must install the role service, disable Anonymous authentication for your Web site or application, and then enable Windows authentication for the site or application.

Note: After you install the role service, IIS 7 commits the following configuration settings to the ApplicationHost.config file.

<windowsAuthentication enabled="false" />

Windows Server 2012 or Windows Server 2012 R2

On the taskbar, click Server Manager.

In Server Manager, click the Manage menu, and then click Add Roles and Features.

In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Next.

In the Connections pane, expand the server name, expand Sites, and then the site, application, or Web service for which you want to enable Extended Protection for Windows authentication.

Scroll to the Security section in the Home pane, and then double-click Authentication.

In the Authentication pane, select Windows Authentication.

Click Enable in the Actions pane.

Click Advanced Settings in the Actions pane.

When the Advanced Settings dialog box appears, select one of the following options in the Extended Protection drop-down menu:

Select Accept if you want to enable extended protection while providing down-level support for clients that do not support extended protection.

Select Required if you want to enable extended protection without providing down-level support.

Click OK to close the Advanced Settings dialog box.

Configuration

The <spn> element of the <extendedProtection> element is configurable at the site, application, or virtual directory level in the ApplicationHost.config file.

Attributes

Attribute

Description

name

Optional string attribute.

Specifies a unique SPN.

There is no default value.

Child Elements

None.

Configuration Sample

The following sample displays a <extendedProtection> element that demonstrates enabling Windows authentication with extended protection for the Default Web Site, and adds two SPN entries to the collection of SPNs.

Note: You must be sure to set the commit parameter to apphost when you use AppCmd.exe to configure these settings. This commits the configuration settings to the appropriate location section in the ApplicationHost.config file.