概要
<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 を使用して宛先サーバーに直接接続する | Proxy, ProxyCohosting |
SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。 |
| クライアントが SSL を使用して宛先サーバーに直接接続する | None |
チャネル バインド トークン チェックが使用され、SPN チェックは使用されません。 |
| クライアントは、パス全体に HTTP を使用してプロキシ サーバー経由で宛先サーバーに接続する | Proxy, ProxyCohosting |
SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。 |
| クライアントは、パス全体に SSL を使用してプロキシ サーバー経由で宛先サーバーに接続する | Proxy |
SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。 |
| クライアントは SSL を使用してプロキシ サーバーに接続し、プロキシ サーバーは HTTP を使用して宛先サーバーに接続する (SSL のオフロード) | Proxy |
SPN チェックが使用され、チャネル バインド トークン チェックは使用されません。 |
追加情報
拡張保護の詳細については、次のトピックを参照してください。
互換性
| バージョン | メモ |
|---|---|
| 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
- タスク バーで [サーバー マネージャー]をクリックします。
- [サーバー マネージャー] で、[管理] メニューを選択し、[役割と機能の追加] を選択します。
- [役割と機能の追加] ウィザードで、[次へ] をクリックします。 インストールの種類を選択し、[次へ] をクリックします。 対象サーバーを選択し、[次へ] を選択します。
- [サーバーの役割] ページで [Web サーバー (IIS)] を展開し、[Web サーバー]、[セキュリティ]、[Windows 認証] の順に展開します。 次へ をクリックします。
. - [機能の選択] ページで、[次へ] をクリックします。
- [インストール オプションの確認] ページで、[インストール] をクリックします。
- [結果] ページで、 [閉じる]をクリックします。
Windows 8 または Windows 8.1
- [スタート] 画面で、ポインターを左下隅まで移動し、[スタート] ボタンを右クリックし、[コントロール パネル] をクリックします。
- [コントロール パネル] で [プログラムと機能] を選択し、[Windows の機能の有効化または無効化] を選択します。
- [インターネット インフォメーション サービス] を展開し、[World Wide Web サービス] を展開し、[セキュリティ] を展開して、[Windows 認証] を選択します。
![[プログラムと機能] ナビゲーション ツリーのスクリーンショット。[Windows 認証] オプションが選択され、強調表示されています。](index/_static/image4.png)
- OK をクリックします。
- 閉じるをクリックします。
Windows Server 2008 または Windows Server 2008 R2
- タスク バーで [スタート] をクリックし、[管理ツール] をポイントして、[サーバー マネージャ] をクリックします。
- [サーバー マネージャ] 階層ウィンドウで [役割] を展開し、[Web サーバー (IIS)] をクリックします。
- [Web サーバー (IIS)] ウィンドウで、[役割サービス] セクションまでスクロールし、[役割サービスの追加] を選択します。
- 役割サービスの追加ウィザードの [役割サービスの選択] ページで、[Windows 認証] を選択し、[次へ] を選択します。
![[ロール サービスの選択] ページのスクリーンショット。[セキュリティ] オプションが展開されています。[Windows 認証] オプションが選択され、強調表示されています。](index/_static/image6.png)
- [インストール オプションの確認] ページで、[インストール] をクリックします。
- [結果] ページで、 [閉じる]をクリックします。
Windows Vista または Windows 7
- タスク バーで、[スタート]、[コントロール パネル] の順にクリックします。
- [コントロール パネル] で [プログラムと機能] を選択し、[Windows の機能の有効化または無効化] を選択します。
- [インターネット インフォメーション サービス]、[World Wide Web サービス]、[セキュリティ] の順に展開します。
- [Windows 認証] を選択し、[OK] を選択します。
![[プログラムと機能] ナビゲーション ツリーのスクリーンショット。Windows 認証が強調表示され、選択されています。[セキュリティ] フォルダーが展開されています。](index/_static/image8.png)
操作方法
Windows 認証の拡張保護を有効にする方法
インターネット インフォメーション サービス (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) マネージャー] をダブルクリックします。
[接続] ウィンドウで、サーバー名を展開し、[サイト] を展開し、Windows 認証の拡張保護を有効にするサイト、アプリケーション、または Web サービスを展開します。
[ホーム] ウィンドウの [セキュリティ] セクションまでスクロールし、[認証] をダブルクリックします。
[認証] ウィンドウで、[Windows 認証] を選択します。
[操作] ウィンドウの [詳細設定] をクリックします。
[詳細設定] ダイアログ ボックスが表示されたら、[拡張保護] ドロップダウン メニューで次のいずれかのオプションを選択します。
[OK] をクリックして [詳細設定] ダイアログ ボックスを閉じます。
構成
<extendedProtection> 要素は、ApplicationHost.config ファイル内のサイト、アプリケーション、または仮想ディレクトリ レベルで構成できます。
属性
| 属性 | 説明 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
flags |
省略可能なフラグ属性。 拡張保護の追加の動作設定を指定します。 flags 属性には、次の値を組み合わせて使用できます。既定値は None です。
|
||||||||||||
tokenChecking |
省略可能な列挙型属性。 チャネル バインド情報を確認する動作を指定します。 tokenChecking 属性には、次の値のいずれかを使用できます。既定値は None です。
|
子要素
| 要素 | 説明 |
|---|---|
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()
![[認証] ページのスクリーンショット。Windows 認証が強調表示されています。[有効化] ボタンは、[操作] ウィンドウにあります。](index/_static/image10.png)
![[詳細設定] ダイアログ ボックスのスクリーンショット。[拡張保護] ドロップダウン メニューの [承諾] オプションが強調表示されています。](index/_static/image12.png)