다음을 통해 공유


다대일 매핑 <추가>

개요

<add> 요소의 <manyToOneMappings> 요소는 고유 클라이언트 인증서 매핑을 다대일 매핑 컬렉션에 추가합니다.

각 다대일 매핑은 Windows 인증 또는기본 인증과 같이 일반적으로 사용되는 인증 방법 대신 사용할 수 있는 사용자 계정 및 암호에 매핑됩니다.

다대일 규칙에 사용할 수 있는 두 가지 액세스 방법인 허용 또는 거부가 있습니다. 이러한 설정을 사용하면 다른 조건에 따라 다른 인증서 그룹에 대한 액세스를 거부하면서 사이트에 대한 액세스를 허용하는 클라이언트 인증서 그룹을 허용하는 규칙을 만들 수 있습니다. 예를 들어 Sales organization 단위의 직원에 대한 액세스를 거부하면서 인사 organization 단위의 모든 Contoso 직원에 대한 액세스를 허용하는 규칙을 만들 수 있습니다.

참고

다대일 인증서 매핑은 개별 클라이언트 인증서를 개별 사용자 계정에 매핑하는 일대일 인증서 매핑과 다릅니다.

호환성

버전 참고
IIS 10.0 <add> 요소가 IIS 10.0에서 수정되지 않았습니다.
IIS 8.5 <add> 요소가 IIS 8.5에서 수정되지 않았습니다.
IIS 8.0 <add> 요소가 IIS 8.0에서 수정되지 않았습니다.
IIS 7.5 <add> 요소가 IIS 7.5에서 수정되지 않았습니다.
IIS 7.0 <add> 요소의 <manyToOneMappings> 요소는 IIS 7.0에서 도입되었습니다.
IIS 6.0 요소는 <manyToOneMappings> IIS 6.0 IIsCertMapper 메타베이스 개체를 대체합니다.

설치 프로그램

<iisClientCertificateMappingAuthentication> 요소는 IIS 7 이상의 기본 설치에서 사용할 수 없습니다. 설치하려면 다음 단계를 사용합니다.

Windows Server 2012 또는 Windows Server 2012 R2

  1. 작업 표시줄에서 서버 관리자를 클릭합니다.
  2. 서버 관리자관리 메뉴를 클릭한 다음 역할 및 기능 추가를 클릭합니다.
  3. 역할 및 기능 추가 마법사에서 다음을 클릭합니다. 설치 유형을 선택하고 다음을 클릭합니다. 대상 서버를 선택하고 다음을 클릭합니다.
  4. 서버 역할 페이지에서 웹 서버(IIS)를 확장하고, 웹 서버를 확장하고, 보안을 확장한 다음, IIS 클라이언트 인증서 매핑 인증을 선택합니다. 다음을 클릭합니다.
    웹 서버 및 보안 창이 확장되고 I S 클라이언트 인증서 매핑 인증이 선택된 이미지입니다. .
  5. 기능 선택 페이지에서 다음을 클릭합니다.
  6. 설치 선택 확인 페이지에서 설치를 클릭합니다.
  7. Results(결과) 페이지에서 Close(닫기)를 클릭합니다.

Windows 8 또는 Windows 8.1

  1. 시작 화면에서 포인터를 왼쪽 아래 모서리로 이동하고 시작 단추를 마우스 오른쪽 단추로 클릭한 다음 제어판 클릭합니다.
  2. 제어판프로그램 및 기능을 클릭한 다음 Windows 기능 켜기 또는 끄기를 클릭합니다.
  3. 인터넷 정보 서비스를 확장하고, World Wide Web Services를 확장하고, 보안을 확장한 다음, IIS 클라이언트 인증서 매핑 인증을 선택합니다.
    World Wide Web Services 및 보안 창이 확장되고 IS 클라이언트 인증서 매핑 인증이 선택된 스크린샷
  4. 확인을 클릭합니다.
  5. 닫기를 클릭합니다.

Windows Server 2008 또는 Windows Server 2008 R2

  1. 작업 표시줄에서 시작을 클릭하고 관리 도구를 가리킨 다음 서버 관리자 클릭합니다.
  2. 서버 관리자 계층 구조 창에서 역할을 확장한 다음 웹 서버(IIS)를 클릭합니다.
  3. 웹 서버(IIS) 창에서 Role Services 섹션으로 스크롤한 다음 역할 서비스 추가를 클릭합니다.
  4. 역할 서비스 추가 마법사역할 서비스 선택 페이지에서 IIS 클라이언트 인증서 매핑 인증을 선택하고 다음을 클릭합니다.
    I S 클라이언트 인증서 매핑 인증이 선택된 역할 서비스 선택 페이지의 이미지.
  5. 설치 선택 확인 페이지에서 설치를 클릭합니다.
  6. Results(결과) 페이지에서 Close(닫기)를 클릭합니다.

Windows Vista 또는 Windows 7

  1. 작업 표시줄에서 시작을 클릭한 다음 제어판 클릭합니다.
  2. 제어판프로그램 및 기능을 클릭한 다음 Windows 기능 켜기 또는 끄기를 클릭합니다.
  3. 인터넷 정보 서비스를 확장한 다음 IIS 클라이언트 인증서 매핑 인증을 선택한 다음 확인을 클릭합니다.
    인터넷 정보 서비스 창이 확장되고 IS 클라이언트 인증서 매핑 인증이 강조 표시된 스크린샷

방법

IIS 7에 대한 IIS 클라이언트 인증서 매핑 인증을 구성하기 위한 사용자 인터페이스가 없습니다. IIS 클라이언트 인증서 매핑 인증을 프로그래밍 방식으로 구성하는 방법에 대한 예제는 이 문서의 코드 샘플 섹션을 참조하세요.

구성

특성

attribute Description
Description 선택적 문자열 특성입니다.

이 일대다 매핑에 대한 설명을 지정합니다.
enabled 선택적 부울 특성입니다.

이 일대다 매핑을 사용할 수 있는지 여부를 지정합니다.

기본값은 true입니다.
name 필수 문자열 특성입니다.

이 일대다 매핑의 이름을 지정합니다.
password 선택적 문자열 특성입니다.

이 규칙과 일치하는 클라이언트를 인증하는 데 사용되는 계정의 암호를 지정합니다.

참고: 암호화되지 않은 암호 문자열을 구성 파일에 저장하지 않도록 하려면 항상 AppCmd.exe 또는 IIS Manager를 사용하여 암호를 입력합니다. 이러한 관리 도구를 사용하는 경우 암호 문자열은 XML 구성 파일에 기록되기 전에 자동으로 암호화됩니다. 이렇게 하면 암호화되지 않은 암호를 저장하는 것보다 더 나은 암호 보안이 제공됩니다.
permissionMode 선택적 열거형 특성입니다.

permissionMode 특성은 다음과 같은 가능한 값 중 하나일 수 있습니다. 기본값은 Allow입니다.
Description
Allow 클라이언트 인증서가 일치하는 클라이언트에 인증 권한을 허용하도록 지정합니다.

숫자 값은 입니다 1.
Deny 클라이언트 인증서가 일치하는 클라이언트에 인증 권한이 거부되도록 지정합니다.

숫자 값은 입니다 2.
username 선택적 문자열 특성입니다.

이 규칙과 일치하는 클라이언트를 인증하는 데 사용되는 계정의 사용자 이름을 지정합니다.

자식 요소

요소 Description
rules 선택적 요소입니다.

많은 클라이언트가 하나의 인증서를 사용할 수 있도록 IIS를 사용하여 클라이언트 인증서를 매핑하기 위한 조건을 지정합니다.

구성 샘플

다음 구성 샘플은 기본 웹 사이트에 대해 다음 작업을 수행합니다.

  • 다대일 인증서 매핑을 사용하여 IIS 클라이언트 인증서 매핑 인증을 사용하도록 설정합니다.
  • Contoso와 일치하는 클라이언트 인증서의 주체에 있는 organization 필드를 기반으로 사용자 계정에 대한 다대일 인증서 매핑 규칙을 만듭니다.
  • SSL을 요구하고 클라이언트 인증서를 협상하도록 사이트를 구성합니다.
<___location path="Default Web Site">
   <system.webServer>
      <security>
         <authentication>
            <windowsAuthentication enabled="false" />
            <anonymousAuthentication enabled="false" />
            <digestAuthentication enabled="false" />
            <basicAuthentication enabled="false" />
            <iisClientCertificateMappingAuthentication enabled="true"
                  manyToOneCertificateMappingsEnabled="true">
               <manyToOneMappings>
                  <add name="Contoso Employees"
                        enabled="true"
                        permissionMode="Allow"
                        userName="Username"
                        password="[enc:AesProvider:57686f6120447564652c2049495320526f636b73:enc]">
                     <rules>
                        <add certificateField="Subject"
                           certificateSubField="O"
                           matchCriteria="Contoso"
                           compareCaseSensitive="true" />
                     </rules>
                  </add>
               </manyToOneMappings>
            </iisClientCertificateMappingAuthentication>
         </authentication>
         <access sslFlags="Ssl, SslNegotiateCert" />
      </security>
   </system.webServer>
</___location>

샘플 코드

다음 코드 샘플은 기본 웹 사이트에 대해 다음 작업을 수행합니다.

  • 다대일 인증서 매핑을 사용하여 IIS 클라이언트 인증서 매핑 인증을 사용하도록 설정합니다.
  • Contoso와 일치하는 클라이언트 인증서의 주체에 있는 organization 필드를 기반으로 사용자 계정에 대한 다대일 인증서 매핑 규칙을 만듭니다.
  • SSL을 요구하고 클라이언트 인증서를 협상하도록 사이트를 구성합니다.

AppCmd.exe

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

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/iisClientCertificateMappingAuthentication /+"manyToOneMappings.[name='Contoso Employees',enabled='True',permissionMode='Allow',userName='Username',password='Password']" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/iisClientCertificateMappingAuthentication /+"manyToOneMappings.[name='Contoso Employees'].rules.[certificateField='Subject',certificateSubField='O',matchCriteria='Contoso',compareCaseSensitive='True']" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.webServer/security/access /sslFlags:"Ssl, SslNegotiateCert" /commit:apphost

참고

AppCmd.exe 사용하여 이러한 설정을 구성할 때 커밋 매개 변수 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 iisClientCertificateMappingAuthenticationSection = config.GetSection("system.webServer/security/authentication/iisClientCertificateMappingAuthentication", "Default Web Site");
         iisClientCertificateMappingAuthenticationSection["enabled"] = true;
         iisClientCertificateMappingAuthenticationSection["manyToOneCertificateMappingsEnabled"] = true;

         ConfigurationElementCollection manyToOneMappingsCollection = iisClientCertificateMappingAuthenticationSection.GetCollection("manyToOneMappings");
         ConfigurationElement addElement = manyToOneMappingsCollection.CreateElement("add");
         addElement["name"] = @"Contoso Employees";
         addElement["enabled"] = true;
         addElement["permissionMode"] = @"Allow";
         addElement["userName"] = @"Username";
         addElement["password"] = @"Password";

         ConfigurationElementCollection rulesCollection = addElement.GetCollection("rules");
         ConfigurationElement addElement1 = rulesCollection.CreateElement("add");
         addElement1["certificateField"] = @"Subject";
         addElement1["certificateSubField"] = @"O";
         addElement1["matchCriteria"] = @"Contoso";
         addElement1["compareCaseSensitive"] = true;
         rulesCollection.Add(addElement1);
         manyToOneMappingsCollection.Add(addElement);

         ConfigurationSection accessSection = config.GetSection("system.webServer/security/access", "Default Web Site");
         accessSection["sslFlags"] = @"Ssl, SslNegotiateCert";

         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 iisClientCertificateMappingAuthenticationSection As ConfigurationSection = config.GetSection("system.webServer/security/authentication/iisClientCertificateMappingAuthentication", "Default Web Site")
      iisClientCertificateMappingAuthenticationSection("enabled") = True
      iisClientCertificateMappingAuthenticationSection("manyToOneCertificateMappingsEnabled") = True

      Dim manyToOneMappingsCollection As ConfigurationElementCollection = iisClientCertificateMappingAuthenticationSection.GetCollection("manyToOneMappings")
      Dim addElement As ConfigurationElement = manyToOneMappingsCollection.CreateElement("add")
      addElement("name") = "Contoso Employees"
      addElement("enabled") = True
      addElement("permissionMode") = "Allow"
      addElement("userName") = "Username"
      addElement("password") = "Password"

      Dim rulesCollection As ConfigurationElementCollection = addElement.GetCollection("rules")
      Dim addElement1 As ConfigurationElement = rulesCollection.CreateElement("add")
      addElement1("certificateField") = "Subject"
      addElement1("certificateSubField") = "O"
      addElement1("matchCriteria") = "Contoso"
      addElement1("compareCaseSensitive") = True
      rulesCollection.Add(addElement1)
      manyToOneMappingsCollection.Add(addElement)

      Dim accessSection As ConfigurationSection = config.GetSection("system.webServer/security/access", "Default Web Site")
      accessSection("sslFlags") = "Ssl, SslNegotiateCert"

      serverManager.CommitChanges()
   End Sub

End Module

JavaScript

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

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

var manyToOneMappingsCollection = iisClientCertificateMappingAuthenticationSection.ChildElements.Item("manyToOneMappings").Collection;
var addElement = manyToOneMappingsCollection.CreateNewElement("add");
addElement.Properties.Item("name").Value = "Contoso Employees";
addElement.Properties.Item("enabled").Value = true;
addElement.Properties.Item("permissionMode").Value = "Allow";
addElement.Properties.Item("userName").Value = "Username";
addElement.Properties.Item("password").Value = "Password";

var rulesCollection = addElement.ChildElements.Item("rules").Collection;
var addElement1 = rulesCollection.CreateNewElement("add");
addElement1.Properties.Item("certificateField").Value = "Subject";
addElement1.Properties.Item("certificateSubField").Value = "O";
addElement1.Properties.Item("matchCriteria").Value = "Contoso";
addElement1.Properties.Item("compareCaseSensitive").Value = true;
rulesCollection.AddElement(addElement1);
manyToOneMappingsCollection.AddElement(addElement);

var accessSection = adminManager.GetAdminSection("system.webServer/security/access", "MACHINE/WEBROOT/APPHOST/Default Web Site");
accessSection.Properties.Item("sslFlags").Value = "Ssl, SslNegotiateCert";

adminManager.CommitChanges();

VBScript

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

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

Set manyToOneMappingsCollection = iisClientCertificateMappingAuthenticationSection.ChildElements.Item("manyToOneMappings").Collection
Set addElement = manyToOneMappingsCollection.CreateNewElement("add")
addElement.Properties.Item("name").Value = "Contoso Employees"
addElement.Properties.Item("enabled").Value = True
addElement.Properties.Item("permissionMode").Value = "Allow"
addElement.Properties.Item("userName").Value = "Username"
addElement.Properties.Item("password").Value = "Password"

Set rulesCollection = addElement.ChildElements.Item("rules").Collection
Set addElement1 = rulesCollection.CreateNewElement("add")
addElement1.Properties.Item("certificateField").Value = "Subject"
addElement1.Properties.Item("certificateSubField").Value = "O"
addElement1.Properties.Item("matchCriteria").Value = "Contoso"
addElement1.Properties.Item("compareCaseSensitive").Value = True
rulesCollection.AddElement(addElement1)
manyToOneMappingsCollection.AddElement(addElement)

Set accessSection = adminManager.GetAdminSection("system.webServer/security/access", "MACHINE/WEBROOT/APPHOST/Default Web Site")
accessSection.Properties.Item("sslFlags").Value = "Ssl, SslNegotiateCert"

adminManager.CommitChanges()