보안 인증 <인증>

개요

인증은 웹 사이트 또는 웹 애플리케이션에 대한 방문자의 ID를 확인하는 데 사용하는 메커니즘입니다. 일반적으로 방문자에게 사용자 이름 및 암호를 할당하거나 방문자가 사이트의 공개 콘텐츠에 익명으로 액세스하도록 허용하여 이 작업을 수행합니다.

인증을 사용하여 방문자의 ID를 확인하지만 권한 부여를 사용하여 사이트 또는 애플리케이션의 다른 영역에 대한 방문자의 액세스를 제어합니다.

IIS 7은 익명 인증, 기본 인증, 클라이언트 인증서 매핑 인증, 다이제스트 인증, IIS 클라이언트 인증서 매핑 인증 및 Windows 인증 지원합니다. 타사 인증 모듈에서 추가 인증 모드를 제공할 수 있습니다.

인증 모듈 중 하나를 설치한 후에는 사용하려는 웹 사이트, 웹 애플리케이션 또는 웹 서비스에 대해 선택한 인증 모듈을 사용하도록 설정해야 합니다.

또한 기본적으로 IIS 7은 Windows(Kerberos 또는 NTLM 사용) 인증 체계에 커널 모드 인증을 사용하도록 설정합니다. 커널 모드 인증은 다음과 같은 이점을 제공합니다.

  • 웹 애플리케이션은 낮은 권한의 계정을 사용하여 실행할 수 있습니다.
  • Kerberos 인증을 사용하는 경우 서버의 SPN(서비스 주체 이름)과 연결된 기본 계정과 다른 계정을 사용할 수 있습니다.
  • 커널 모드 인증을 사용하는 경우 명시적 SPN 구성을 수행하지 않고 Windows 인증 Kerberos 공급자를 사용할 수 있습니다.

호환성

버전 참고
IIS 10.0 <authentication> 요소가 IIS 10.0에서 수정되지 않았습니다.
IIS 8.5 <authentication> 요소가 IIS 8.5에서 수정되지 않았습니다.
IIS 8.0 <authentication> 요소가 IIS 8.0에서 수정되지 않았습니다.
IIS 7.5 <authentication> 요소가 IIS 7.5에서 수정되지 않았습니다.
IIS 7.0 요소는 <authentication> IIS 7.0에서 도입되었습니다.
IIS 6.0 해당 없음

설치 프로그램

요소는 <authentication> IIS 7의 기본 설치에 포함됩니다.

방법

익명 인증을 사용하지 않도록 설정하는 방법

  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. 연결 창에서 서버 이름을 확장하고 사이트를 확장한 다음 구성하려는 계층 구조 창의 수준으로 이동한 다음 웹 사이트 또는 웹 애플리케이션을 클릭합니다.

  3. 창에서 보안 섹션으로 스크롤한 다음 인증을 두 번 클릭합니다.

  4. 인증 창에서 익명 인증을 선택한 다음 작업 창에서 사용 안 함을 클릭합니다.
    인증 창을 보여 주는 스크린샷 익명 인증을 사용하도록 설정하고 선택합니다.

IUSR 계정에서 익명 인증 자격 증명을 변경하는 방법

  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. 연결 창에서 서버 이름을 확장하고 사이트를 확장한 다음 구성하려는 계층 구조 창의 수준으로 이동한 다음 웹 사이트 또는 웹 애플리케이션을 클릭합니다.

  3. 창에서 보안 섹션으로 스크롤한 다음 인증을 두 번 클릭합니다.

  4. 인증 창에서 익명 인증을 선택한 다음 작업 창에서편집...을 클릭합니다.

  5. 익명 인증 자격 증명 편집 대화 상자에서 다음 중 하나를 수행합니다.

    • 애플리케이션 풀 ID를 선택하여 애플리케이션 풀에 대한 ID 집합을 사용하고 확인을 클릭합니다.
      익명 인증 자격 증명 편집 대화 상자를 보여 주는 스크린샷 애플리케이션 풀 ID가 선택됩니다.

    • 설정...을 클릭한 다음 자격 증명 설정 대화 상자에서 사용자 이름 상자에 계정의 사용자 이름을 입력하고 암호암호 확인 상자에 계정의 암호를 입력하고 확인을 클릭한 다음 확인을 다시 클릭합니다.
      자격 증명 설정 대화 상자를 보여 주는 스크린샷

      참고

      이 절차를 사용하는 경우 IIS 서버 컴퓨터에서 새 계정에 최소 권한만 부여합니다.


웹 사이트, 웹 애플리케이션 또는 웹 서비스에 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 인증 사용하도록 설정할 사이트, 애플리케이션 또는 웹 서비스를 확장합니다.

  3. 창에서 보안 섹션으로 스크롤한 다음 인증을 두 번 클릭합니다.

  4. 인증 창에서 Windows 인증을 선택한 다음 작업 창에서 사용을 클릭합니다.
    인증 창을 보여 주는 스크린샷 Windows 인증을 사용하지 않도록 설정하여 선택합니다.

구성

<authentication> 섹션 그룹은 구성 섹션에 <system.webServer> 정의되어 있습니다. 이 섹션 그룹은 서버에 설치하고 사용하도록 설정할 수 있는 모든 사용자 인증 유형에 대한 구성 섹션을 정의합니다. ApplicationHost.config 파일의 서버 수준과 Web.config 파일의 애플리케이션 수준에서 구성할 수 있습니다.

특성

없음

자식 요소

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

익명 인증에 대한 설정을 지정합니다.
basicAuthentication 선택적 요소입니다.

기본 인증에 대한 설정을 지정합니다.
clientCertificateMappingAuthentication 선택적 요소입니다.

Active Directory를 사용하여 클라이언트 인증서 매핑 인증 설정을 지정합니다.
digestAuthentication 선택적 요소입니다.

다이제스트 인증에 대한 설정을 지정합니다.
iisClientCertificateMappingAuthentication 선택적 요소입니다.

IIS를 사용하여 클라이언트 인증서 매핑 인증 설정을 지정합니다.
windowsAuthentication 선택적 요소입니다.

Windows 인증 대한 설정을 지정합니다.

구성 샘플

다음 구성 예제에서는 Contoso라는 사이트에 대해 익명 인증을 사용하지 않도록 설정한 다음, 사이트에 대해 기본 인증과 Windows 인증 모두 사용하도록 설정합니다.

<location path="Contoso">
   <system.webServer>
      <security>
         <authentication>
            <anonymousAuthentication enabled="false" />
            <basicAuthentication enabled="true" defaultLogonDomain="Contoso" />
            <windowsAuthentication enabled="true" />
          </authentication>
      </security>
   </system.webServer>
</location>

샘플 코드

다음 예제에서는 Contoso라는 사이트에 대해 익명 인증을 사용하지 않도록 설정한 다음, 사이트에 대해 기본 인증 및 Windows 인증 모두 사용하도록 설정합니다.

AppCmd.exe

appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False" /commit:apphost

appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/basicAuthentication /enabled:"True" /commit:apphost

appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /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 anonymousAuthenticationSection = config.GetSection("system.webServer/security/authentication/anonymousAuthentication", "Contoso");
         anonymousAuthenticationSection["enabled"] = false;

         ConfigurationSection basicAuthenticationSection = config.GetSection("system.webServer/security/authentication/basicAuthentication", "Contoso");
         basicAuthenticationSection["enabled"] = true;

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

         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 anonymousAuthenticationSection As ConfigurationSection = config.GetSection("system.webServer/security/authentication/anonymousAuthentication", "Contoso")
      anonymousAuthenticationSection("enabled") = False

      Dim basicAuthenticationSection As ConfigurationSection = config.GetSection("system.webServer/security/authentication/basicAuthentication", "Contoso")
      basicAuthenticationSection("enabled") = True

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

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

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

var anonymousAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/anonymousAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso");
anonymousAuthenticationSection.Properties.Item("enabled").Value = false;

var basicAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/basicAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso");
basicAuthenticationSection.Properties.Item("enabled").Value = true;

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

adminManager.CommitChanges();

VBScript

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

Set anonymousAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/anonymousAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso")
anonymousAuthenticationSection.Properties.Item("enabled").Value = False

Set basicAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/basicAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso")
basicAuthenticationSection.Properties.Item("enabled").Value = True

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

adminManager.CommitChanges()