Windows 拡張保護 <extendedProtection>

概要

<extendedProtection> 要素は、IIS 7.5 で Windows 認証の拡張保護を構成する設定を指定します。

拡張保護は、認証リレーまたは "中間者" 攻撃を軽減するために、既存の Windows 認証機能を強化します。 この軽減策は、次の 2 つのセキュリティ メカニズムによって実装されるセキュリティ情報を使用して実現されます。

  • 主に SSL 接続に使用されるチャネル バインド トークン (CBT) を介して指定されるチャネル バインド情報。
  • サービス プリンシパル名 (SPN) を介して指定されるサービス バインド情報。これは、主に SSL を使用しない接続に使用されます。また、プロキシ サーバーやロード バランサーなどの SSL オフロードを提供するシナリオを通じて接続が確立された場合に使用されます。

<extendedProtection> 要素には <spn> 要素のコレクションを含めることができます。各要素には、サービス バインド情報の一意の SPN が含まれます。 各 SPN は、接続パス内の一意のエンドポイントを表します。これは、接続先サーバーまたはプロキシ サーバーの完全修飾ドメイン名 (FQDN) または NetBIOS 名である可能性があります。 たとえば、クライアントがプロキシ サーバーを介して宛先サーバーに接続している場合、移行先サーバー上の SPN コレクションには、プロキシ サーバーの SPN を含める必要があります。 コレクション内の各 SPN にはプレフィックスとして "HTTP" を付ける必要があるため、"www.contoso.com" の結果の SPN は "HTTP/www.contoso.com" になります。

IIS 拡張保護のチャネル バインドと追加の動作を構成する <extendedProtection> 要素には、次の 2 つの属性があります。

  • tokenChecking 属性は、チャネル バインド トークンをチェックするための動作を構成します。 この属性に指定できる値は、次のとおりです。

    名前 説明
    None この値は、IIS がチャネル バインド トークン チェックを実行しないことを指定します。 この設定は、拡張保護の前に存在していた動作をエミュレートします。

    数値は 0 です。
    Allow この値は、チャネル バインド トークンのチェックが有効になっているが、必須ではないことを指定します。 この設定により、拡張保護をサポートしているが、拡張保護を使用できないクライアントを引き続きサポートするクライアントとの安全な通信が可能になります。

    数値は 1 です。
    Require この値は、チャネル バインド トークンのチェックが必要であることを指定します。 この設定では、拡張保護をサポートしていないクライアントはサポートされません。

    数値は 2 です。
  • flags 属性は、拡張保護の追加動作を構成します。 使用可能なフラグは次のとおりです。

    名前 説明
    None このフラグは、拡張保護に対して追加の動作が有効になっていないことを指定します。 (たとえば、プロキシ サーバーが使用されておらず、SPN チェックが有効になっており、FQDN が必要です)。

    数値は 0 です。
    Proxy このフラグは、通信パスの一部がプロキシ経由であるか、クライアントが HTTP 経由で宛先サーバーに直接接続していることを指定します。

    数値は 1 です。
    NoServiceNameCheck このフラグは、SPN チェックが無効であることを指定します。このフラグは、SPN のみがチェックされているシナリオでは使用しないでください。

    数値は 2 です。
    AllowDotlessSpn このフラグは、SPN が FQDN である必要がないことを指定します。 このフラグを設定すると、NetBIOS ベースの SPN が許可されます。 注: このフラグの設定はセキュリティで保護されたシナリオではありません。FQDN ベース以外の名前は、名前解決のポイズニング攻撃に対して脆弱です。

    数値は 4 です。
    ProxyCohosting このフラグは、クライアントからサーバーへの通信パス全体で HTTP のみを使用することを指定します。通信パスで SSL を使用している部分がなく、SPN チェックが使用されます。 注: このフラグを指定する場合は、Proxy フラグも指定する必要があります。

    数値は 32 です。

拡張保護のシナリオ

次の例のシナリオがあるとします。

  • 次の各シナリオでは、ネットワーク環境で NetBIOS ベースの SPN がサポートされている場合に AllowDotlessSpn フラグを指定することもできますが、NetBIOS ベースの SPN はセキュリティで保護されません。
  • SPN チェックが使用され、チャネル バインド トークン チェックが使用されない次の各シナリオでは、NoServiceNameCheck フラグを指定しないでください。
シナリオ Flags 説明
クライアントが HTTP を使用して宛先サーバーに直接接続する ProxyProxyCohosting SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。
クライアントが SSL を使用して宛先サーバーに直接接続する None チャネル バインド トークン チェックが使用され、SPN チェックは使用されません。
クライアントは、パス全体に HTTP を使用してプロキシ サーバー経由で宛先サーバーに接続する ProxyProxyCohosting SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。
クライアントは、パス全体に SSL を使用してプロキシ サーバー経由で宛先サーバーに接続する Proxy SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。
クライアントは SSL を使用してプロキシ サーバーに接続し、プロキシ サーバーは HTTP を使用して宛先サーバーに接続する (SSL のオフロード) Proxy SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。

追加情報

拡張保護の詳細については、次のトピックを参照してください。

統合 Windows 認証と拡張保護

サービス プリンシパル名

互換性

バージョン メモ
IIS 10.0 <extendedProtection> 要素は、IIS 10.0 では変更されませんでした。
IIS 8.5 <extendedProtection> 要素は、IIS 8.5 では変更されませんでした。
IIS 8.0 <extendedProtection> 要素は IIS 8.0 では変更されませんでした。
IIS 7.5 <extendedProtection> 要素が IIS 7.5 で導入されました。
IIS 7.0 該当なし
IIS 6.0 該当なし

段取り

IIS 7 以降の既定のインストールには、Windows 認証の役割サービスは含まれません。 IIS で Windows 認証を使用するには、役割サービスをインストールし、Web サイトまたはアプリケーションの匿名認証を無効にしてから、サイトまたはアプリケーションの Windows 認証を有効にする必要があります。

Note

役割サービスをインストールすると、IIS 7 は ApplicationHost.config ファイルに次の構成設定をコミットします。

<windowsAuthentication enabled="false" />

Windows Server 2012 または Windows Server 2012 R2

  1. タスク バーで [サーバー マネージャー]をクリックします。
  2. [サーバー マネージャー] で、[管理] メニューをクリックし、[役割と機能の追加] をクリックします。
  3. 役割と機能の追加ウィザードで、[次へ] をクリックします。 [インストールの種類] を選択し、[次へ] をクリックします。 対象サーバーを選択し、[次へ] をクリックします。
  4. [サーバーの役割] ページで [Web サーバー (IIS)] を展開し、[Web サーバー][セキュリティ][Windows 認証] の順に展開します。 次へ をクリックします。
    Screenshot of the Server Roles page. The Windows Authentication option is selected and highlighted.
  5. [機能の選択] ページで、[次へ] をクリックします。
  6. [インストール オプションの確認] ページで、[インストール] をクリックします。
  7. [結果] ページで、 [閉じる]をクリックします。

Windows 8 または Windows 8.1

  1. [スタート] 画面で、ポインターを左下隅まで移動し、[スタート] ボタンを右クリックし、[コントロール パネル] をクリックします。
  2. [コントロール パネル][プログラムと機能] をクリックし、[Windows の機能の有効化または無効化] をクリックします。
  3. [インターネット インフォメーション サービス] を展開し、[World Wide Web Services] を展開し、[セキュリティ] を展開して、[Windows 認証] を選択します。
    Screenshot of the Programs and Features navigation tree. The Windows Authentication option is selected and highlighted.
  4. OK をクリックします。
  5. 閉じるをクリックします。

Windows Server 2008 または Windows Server 2008 R2

  1. タスク バーで [スタート] をクリックし、[管理ツール] をポイントして、[サーバー マネージャー] をクリックします。
  2. [Server Manager] (サーバー マネージャー) 階層ウィンドウで [ロール] を展開し、[Web Server (IIS)] (Web サーバー (IIS)) をクリックします。
  3. [Web Server (IIS)] (Web サーバー (IIS)) ウィンドウで、[Role Services] (役割サービス) セクションまでスクロールし、[Add Role Services] (役割サービスの追加) をクリックします。
  4. 役割サービスの追加ウィザード[役割サービスの選択] ページで、[Windows 認証] を選択し、[次へ] をクリックします。
    Screenshot of the Select Role Services page. The Security option is expanded. The Windows Authentication option is selected and highlighted.
  5. [インストール オプションの確認] ページで、[インストール] をクリックします。
  6. [結果] ページで、 [閉じる]をクリックします。

Windows Vista または Windows 7

  1. タスク バーで、[スタート][コントロール パネル] の順にクリックします。
  2. [コントロール パネル][プログラムと機能] をクリックし、[Turn Windows Features on or off] (Windows の機能の有効化または無効化) をクリックします。
  3. [インターネット インフォメーション サービス][World Wide Web サービス][セキュリティ] の順に展開します。
  4. [Windows 認証] を選択し、[OK] をクリックします。
    Screenshot of the Programs and Features navigation tree. Windows Authentication is highlighted and selected. The Security folder is expanded.

操作方法

Windows 認証の拡張保護を有効にする方法

  1. インターネット インフォメーション サービス (IIS) マネージャーを開きます。

    • Windows Server 2012 または Windows Server 2012 R2 を使用している場合:

      • タスク バーで、[サーバー マネージャー] をクリックし、[ツール][インターネット インフォメーション サービス (IIS) マネージャー] の順にクリックします。
    • Windows 8 または Windows 8.1 を使用している場合:

      • Windows キーを押しながら文字 X を押し、[コントロール パネル] をクリックします。
      • [管理ツール] をクリックし、[インターネット インフォメーション サービス (IIS) マネージャー] をダブルクリックします。
    • Windows Server 2008 または Windows Server 2008 R2 を使用している場合:

      • タスク バーで、[スタート] ボタンをクリックし、[管理ツール][インターネット インフォメーション サービス (IIS) マネージャー] の順にクリックします。
    • Windows Vista または Windows 7 を使用している場合:

      • タスク バーで、[スタート][コントロール パネル] の順にクリックします。
      • [管理ツール] をダブルクリックし、[インターネット インフォメーション サービス (IIS) マネージャー] をダブルクリックします。
  2. [接続] ウィンドウで、サーバー名を展開し、[サイト] を展開し、Windows 認証の拡張保護を有効にするサイト、アプリケーション、または Web サービスを展開します。

  3. [ホーム] ウィンドウの [セキュリティ] セクションまでスクロールし、[認証] をダブルクリックします。

  4. [認証] ウィンドウで、[Windows 認証] を選択します。

  5. [操作] ウィンドウで、[有効] をクリックします。
    Screenshot of the Authentication page. Windows Authentication is highlighted. The Enable button is found in the Actions pane.

  6. [操作] ウィンドウの [詳細設定] をクリックします。

  7. [詳細設定] ダイアログ ボックスが表示されたら、[拡張保護] ドロップダウン メニューで次のいずれかのオプションを選択します。

    • 拡張保護を有効にしながら、拡張保護をサポートしていないクライアントに対して下位レベルのサポートを提供する場合は、[同意する] を選択します。
    • 下位レベルのサポートを提供せずに拡張保護を有効にする場合は、[必須] を選択します。
      Screenshot of the Advanced Settings dialog box. In the Extended Protection drop down menu, the Accept option is highlighted.
  8. [OK] をクリックして [詳細設定] ダイアログ ボックスを閉じます。

構成

<extendedProtection> 要素は、ApplicationHost.config ファイル内のサイト、アプリケーション、または仮想ディレクトリ レベルで構成できます。

属性

属性 説明
flags 省略可能なフラグ属性。

拡張保護の追加の動作設定を指定します。

flags 属性には、次の値を組み合わせて使用できます。既定値は None です。
名前 説明
None

このフラグは、拡張保護に対して追加の動作が有効になっていないことを指定します。 (たとえば、プロキシ サーバーが使用されておらず、SPN チェックが有効になっており、FQDN が必要です)。

数値は 0 です。

Proxy

このフラグは、通信パスの一部がプロキシ経由であるか、クライアントが HTTP 経由で宛先サーバーに直接接続していることを指定します。

数値は 1 です。

NoServiceNameCheck

このフラグは、SPN チェックが無効であることを指定します。このフラグは、SPN のみがチェックされているシナリオでは使用しないでください。

数値は 2 です。

AllowDotlessSpn

このフラグは、SPN が FQDN である必要がないことを指定します。 このフラグを設定すると、NetBIOS ベースの SPN が許可されます。 注: このフラグの設定はセキュリティで保護されたシナリオではありません。FQDN ベース以外の名前は、名前解決のポイズニング攻撃に対して脆弱です。

数値は 4 です。

ProxyCohosting

このフラグは、クライアントからサーバーへの通信パス全体で HTTP のみを使用することを指定します。通信パスで SSL を使用している部分がなく、SPN チェックが使用されます。 注: このフラグを指定する場合は、Proxy フラグも指定する必要があります。

数値は 32 です。

tokenChecking 省略可能な列挙型属性。

チャネル バインド情報を確認する動作を指定します。

tokenChecking 属性には、次の値のいずれかを使用できます。既定値は None です。
名前 説明
None

この値は、IIS がチャネル バインド トークン チェックを実行しないことを指定します。 この設定は、拡張保護の前に存在していた動作をエミュレートします。

数値は 0 です。

Allow

この値は、チャネル バインド トークンのチェックが有効になっているが、必須ではないことを指定します。 この設定により、拡張保護をサポートしているが、拡張保護を使用できないクライアントを引き続きサポートするクライアントとの安全な通信が可能になります。

数値は 1 です。

Require

この値は、チャネル バインド トークンのチェックが必要であることを指定します。 この設定では、拡張保護をサポートしていないクライアントはサポートされません。

数値は 2 です。

子要素

要素 説明
spn SPN をコレクションに追加します。
clearSpns SPN のコレクションをクリアします。
removeSpn コレクションから SPN を削除します。

構成サンプル

次の例では、既定の Web サイトの拡張保護を使用して Windows 認証を有効にし、SPN のコレクションに 2 つの SPN エントリを追加する <extendedProtection> 要素を表示します。

<location path="Default Web Site">
   <system.webServer>
      <security>
         <authentication>
            <windowsAuthentication enabled="true">
               <extendedProtection tokenChecking="Allow" flags="None">
                  <spn name="HTTP/www.contoso.com" />
                  <spn name="HTTP/contoso.com" />
               </extendedProtection>
            </windowsAuthentication>
         </authentication>
      </security>
   </system.webServer>
</location>

サンプル コード

次の例では、既定の Web サイトの拡張保護を使用して Windows 認証を構成し、SPN のコレクションに 2 つの SPN エントリを追加する方法を示します。

AppCmd.exe

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/windowsAuthentication /extendedProtection.tokenChecking:"Allow" /extendedProtection.flags:"None" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/windowsAuthentication /+"extendedProtection.[name='HTTP/www.contoso.com']" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/windowsAuthentication /+"extendedProtection.[name='HTTP/contoso.com']" /commit:apphost

Note

AppCmd.exe を使用してこれらの設定を構成する場合は、commit パラメーターを必ず apphost に設定する必要があります。 これにより、ApplicationHost.config ファイルの適切な場所セクションに構成設定がコミットされます。

C#

using System;
using System.Text;
using Microsoft.Web.Administration;

internal static class Sample
{
   private static void Main()
   {
      using (ServerManager serverManager = new ServerManager())
      {
         Configuration config = serverManager.GetApplicationHostConfiguration();

         ConfigurationSection windowsAuthenticationSection = config.GetSection("system.webServer/security/authentication/windowsAuthentication", "Default Web Site");
         windowsAuthenticationSection["enabled"] = true;

         ConfigurationElement extendedProtectionElement = windowsAuthenticationSection.GetChildElement("extendedProtection");
         extendedProtectionElement["tokenChecking"] = @"Allow";
         extendedProtectionElement["flags"] = @"None";

         ConfigurationElementCollection extendedProtectionCollection = extendedProtectionElement.GetCollection();

         ConfigurationElement spnElement = extendedProtectionCollection.CreateElement("spn");
         spnElement["name"] = @"HTTP/www.contoso.com";
         extendedProtectionCollection.Add(spnElement);

         ConfigurationElement spnElement1 = extendedProtectionCollection.CreateElement("spn");
         spnElement1["name"] = @"HTTP/contoso.com";
         extendedProtectionCollection.Add(spnElement1);

         serverManager.CommitChanges();
      }
   }
}

VB.NET

Imports System
Imports System.Text
Imports Microsoft.Web.Administration

Module Sample
   Sub Main()
      Dim serverManager As ServerManager = New ServerManager
      Dim config As Configuration = serverManager.GetApplicationHostConfiguration

      Dim windowsAuthenticationSection As ConfigurationSection = config.GetSection("system.webServer/security/authentication/windowsAuthentication", "Default Web Site")
      windowsAuthenticationSection("enabled") = True

      Dim extendedProtectionElement As ConfigurationElement = windowsAuthenticationSection.GetChildElement("extendedProtection")
      extendedProtectionElement("tokenChecking") = "Allow"
      extendedProtectionElement("flags") = "None"

      Dim extendedProtectionCollection As ConfigurationElementCollection = extendedProtectionElement.GetCollection

      Dim spnElement As ConfigurationElement = extendedProtectionCollection.CreateElement("spn")
      spnElement("name") = "HTTP/www.contoso.com"
      extendedProtectionCollection.Add(spnElement)

      Dim spnElement1 As ConfigurationElement = extendedProtectionCollection.CreateElement("spn")
      spnElement1("name") = "HTTP/contoso.com"
      extendedProtectionCollection.Add(spnElement1)

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";

var windowsAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/windowsAuthentication", "MACHINE/WEBROOT/APPHOST/Default Web Site");
windowsAuthenticationSection.Properties.Item("enabled").Value = true;

var extendedProtectionElement = windowsAuthenticationSection.ChildElements.Item("extendedProtection");
extendedProtectionElement.Properties.Item("tokenChecking").Value = "Allow";
extendedProtectionElement.Properties.Item("flags").Value = "None";

var extendedProtectionCollection = extendedProtectionElement.Collection;

var spnElement = extendedProtectionCollection.CreateNewElement("spn");
spnElement.Properties.Item("name").Value = "HTTP/www.contoso.com";
extendedProtectionCollection.AddElement(spnElement);

var spnElement1 = extendedProtectionCollection.CreateNewElement("spn");
spnElement1.Properties.Item("name").Value = "HTTP/contoso.com";
extendedProtectionCollection.AddElement(spnElement1);

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set windowsAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/windowsAuthentication", "MACHINE/WEBROOT/APPHOST/Default Web Site")
windowsAuthenticationSection.Properties.Item("enabled").Value = True

Set extendedProtectionElement = windowsAuthenticationSection.ChildElements.Item("extendedProtection")
extendedProtectionElement.Properties.Item("tokenChecking").Value = "Allow"
extendedProtectionElement.Properties.Item("flags").Value = "None"

Set extendedProtectionCollection = extendedProtectionElement.Collection

Set spnElement = extendedProtectionCollection.CreateNewElement("spn")
spnElement.Properties.Item("name").Value = "HTTP/www.contoso.com"
extendedProtectionCollection.AddElement(spnElement)

Set spnElement1 = extendedProtectionCollection.CreateNewElement("spn")
spnElement1.Properties.Item("name").Value = "HTTP/contoso.com"
extendedProtectionCollection.AddElement(spnElement1)

adminManager.CommitChanges()