다음을 통해 공유


FTP 보안 <보안> 섹션 그룹

개요

<security> 섹션 그룹은 섹션에 <system.ftpServer> 상주하며 IIS(인터넷 정보 서비스) 7 서버에서 보안 설정을 구성하는 요소를 포함합니다. 여기에는 권한 부여 규칙 설정, IP 보안 및 요청 필터링 구성 설정이 포함됩니다.

참고 항목

보안 강화를 위해 Windows 7 및 Windows Server 2008 R2는 기본적으로 FTP 7을 설치하지 않습니다. FTP 7을 설치하면 기본 사이트가 만들어지지 않습니다. FTP 사이트를 수동으로 만들어야 합니다. 이 전략은 IIS 7 공격 표면을 크게 줄입니다.

호환성

버전 주의
IIS 10.0 <authentication> IIS 10.0에서 요소가 수정되지 않았습니다.
IIS 8.5 <security> IIS 8.5에서 요소가 수정되지 않았습니다.
IIS 8.0 <authentication> 요소의 <security> 요소는 IIS 8.0의 기능으로 제공됩니다.
IIS 7.5 <security> 요소의 <system.ftpServer> 요소는 IIS 7.5의 기능으로 제공됩니다.
IIS 7.0 <security> 요소의 <system.ftpServer> 요소는 IIS 7.0에 대한 별도의 다운로드인 FTP 7.0에서 도입되었습니다.
IIS 6.0 해당 없음

참고 항목

FTP 7.0 및 FTP 7.5 서비스는 IIS 7.0용 대역 외 서비스를 제공했으며, 다음 URL에서 모듈을 다운로드하고 설치해야 했습니다.

https://www.iis.net/expand/FTP

Windows 7 및 Windows Server 2008 R2를 사용하면 FTP 7.5 서비스가 IIS 7.5의 기능으로 제공됩니다. 따라서 FTP 서비스를 더 이상 다운로드할 필요가 없습니다.

설정

웹 서버에 대한 FTP 게시를 지원하려면 FTP 서비스를 설치해야 합니다. 이렇게 하려면 다음 단계를 수행합니다.

Windows Server 2012 또는 Windows Server 2012 R2

  1. 작업 표시줄에서 서버 관리자를 클릭합니다.

  2. 서버 관리자 관리 메뉴를 클릭한 다음 역할 및 기능 추가를 클릭합니다.

  3. 역할 및 기능 추가 마법사에서 다음을 클릭합니다. 설치 유형을 선택하고 다음을 클릭합니다. 대상 서버를 선택하고 다음을 클릭합니다.

  4. 서버 역할 페이지에서 웹 서버(IIS)를 확장한 다음 FTP 서버를 선택합니다.

    참고 항목

    ASP를 지원합니다. FTP 서비스에 대한 멤버 자격 인증 또는 IIS 관리자 인증은 FTP 서비스 외에도 FTP 확장성을 선택해야 합니다.
    Windows Server 2012 인터페이스에서 선택한 FT P 서비스 및 F T P 확장성의 스크린샷 .

  5. 다음을 클릭한 다음 기능 선택 페이지에서 다음을 다시 클릭합니다.

  6. 설치 선택 확인 페이지에서 설치를 클릭합니다.

  7. Results(결과) 페이지에서 Close(닫기)를 클릭합니다.

Windows 8 또는 Windows 8.1

  1. 시작 화면에서 포인터를 왼쪽 아래 모서리로 이동하고 시작 단추를 마우스 오른쪽 단추로 클릭한 다음 제어판 클릭합니다.

  2. 제어판 프로그램 및 기능을 클릭한 다음 Windows 기능 켜기 또는 끄기를 클릭합니다.

  3. 인터넷 정보 서비스 확장한 다음 FTP 서버를 선택합니다.

    참고 항목

    ASP를 지원합니다. FTP 서비스에 대한 멤버 자격 인증 또는 IIS 관리자 인증도 FTP 확장성을 선택해야 합니다.
    Windows 8 인터페이스에서 선택한 FT P 서비스 및 F T P 확장성의 스크린샷

  4. 확인을 클릭합니다.

  5. 닫기를 클릭합니다.

Windows Server 2008 R2

  1. 작업 표시줄에서 시작을 클릭하고 관리istrative Tools를 가리킨 다음 서버 관리자 클릭합니다.

  2. 서버 관리자 계층 구조 창에서 역할을 확장한 다음 웹 서버(IIS)를 클릭합니다.

  3. 웹 서버(IIS) 창에서 Role Services 섹션으로 스크롤한 다음 역할 서비스 추가를 클릭합니다.

  4. 역할 서비스 추가 마법사역할 서비스 선택 페이지에서 FTP 서버를 확장합니다.

  5. FTP 서비스를 선택합니다.

    참고 항목

    ASP를 지원합니다. FTP 서비스에 대한 멤버 자격 인증 또는 IIS 관리자 인증도 FTP 확장성을 선택해야 합니다.
    Windows Server 2008 인터페이스에서 선택한 FT P 서비스 및 F T P 확장성의 스크린샷

  6. 다음을 클릭합니다.

  7. 설치 선택 확인 페이지에서 설치를 클릭합니다.

  8. Results(결과) 페이지에서 Close(닫기)를 클릭합니다.

Windows 7

  1. 작업 표시줄에서 시작을 클릭한 다음 제어판 클릭합니다.

  2. 제어판 프로그램 및 기능을 클릭한 다음 Windows 기능 켜기 또는 끄기를 클릭합니다.

  3. 인터넷 정보 서비스 확장한 다음 FTP 서버를 확장합니다.

  4. FTP 서비스를 선택합니다.

    참고 항목

    ASP를 지원합니다. FTP 서비스에 대한 멤버 자격 인증 또는 IIS 관리자 인증도 FTP 확장성을 선택해야 합니다.
    Windows 7 인터페이스에서 선택한 FT P 서비스 및 F T P 확장성의 스크린샷

  5. 확인을 클릭합니다.

Windows Server 2008 또는 Windows Vista

  1. 다음 URL에서 설치 패키지를 다운로드합니다.

  2. 다음 연습의 지침에 따라 FTP 서비스를 설치합니다.

방법

FTP 권한 부여 규칙을 추가하는 방법

  1. IIS(open 인터넷 정보 서비스) 관리자:

    • Windows Server 2012 또는 Windows Server 2012 R2를 사용하는 경우:

      • 작업 표시줄에서 서버 관리자 클릭하고 도구를 클릭한 다음 인터넷 정보 서비스(IIS) 관리자를 클릭합니다.
    • Windows 8 또는 Windows 8.1을 사용하는 경우:

      • Windows 키를 누른 상태로 문자 X를 누른 다음 제어판 클릭합니다.
      • 관리istrative Tools를 클릭한 다음 IIS(인터넷 정보 서비스) 관리자를 두 번 클릭합니다.
    • Windows Server 2008 또는 Windows Server 2008 R2를 사용하는 경우:

      • 작업 표시줄에서 시작을 클릭하고 관리영구 도구를 가리킨 다음 IIS(인터넷 정보 서비스) 관리자를 클릭합니다.
    • Windows Vista 또는 Windows 7을 사용하는 경우:

      • 작업 표시줄에서 시작을 클릭한 다음 제어판 클릭합니다.
      • 관리istrative Tools를 두 번 클릭한 다음 IIS(인터넷 정보 서비스) 관리자를 두 번 클릭합니다.
  2. 커넥트 창에서 서버 이름을 확장하고 사이트를 확장한 다음 권한 부여를 구성하려는 사이트 또는 URL로 이동합니다.

  3. 창에서 권한 부여 규칙을 두 번 클릭합니다.
    빈 FT P 권한 부여 규칙 창의 스크린샷.

  4. 새 권한 부여 규칙을 추가하려면 [작업] 창에서 [허용 규칙 추가] 또는 [거부 규칙 추가]를 클릭합니다.

  5. 사이트 또는 애플리케이션에 필요한 권한 부여 설정을 적용합니다. 고려해야 할 두 가지 섹션이 있습니다.

    • 이 콘텐츠에 대한 액세스 허용: 라디오 단추를 사용하여 액세스 규칙이 적용되도록 지정합니다.

      • 모든 사용자
      • 모든 익명 사용자
      • 지정된 역할 또는 사용자 그룹 (여러 그룹/역할을 쉼표로 구분할 수 있습니다).
      • 지정된 사용자 (여러 사용자를 쉼표로 구분할 수 있습니다).
    • 사용 권한: 검사 상자를 사용하여 규칙에 대한 읽기 또는 쓰기 액세스를 지정합니다.
      애플리케이션에 대한 모든 사용자 권한 부여를 허용하는 스크린샷

  6. 확인을 클릭합니다.

구성

<security> 요소의 <system.ftpServer> 요소는 서버, 사이트 또는 폴더 수준에서 구성됩니다.

특성

없음

자식 요소

요소 설명
authentication 선택적 요소입니다.

인증 관련 설정을 지정합니다.
authorization 선택적 요소입니다.

권한 부여 관련 설정을 지정합니다.
ipSecurity 선택적 요소입니다.

IP 버전 4 주소 또는 DNS do기본 이름에 따라 액세스 제한을 지정합니다.
requestFiltering 선택적 요소입니다.

요청 필터링에 대한 구성 설정을 지정합니다.

구성 샘플

다음 샘플에서는 FTP 사이트에 대한 요소의 <system.ftpServer> 몇 가지 보안 관련 구성 설정을 보여 줍니다. 보다 구체적으로 이 예제의 설정은 <location> 다음을 하는 방법을 보여 줍니다.

  • 관리자 그룹에 대한 읽기 및 쓰기 액세스에 대한 FTP 권한 부여 규칙을 지정합니다.
  • *.exe, *.bat 및 *.cmd 파일을 거부하는 FTP 요청 필터링 옵션을 지정합니다.
  • 최대 콘텐츠 길이 1000000바이트 및 최대 URL 길이 1024바이트에 대한 FTP 요청 제한을 지정합니다.
  • FrontPage 서버 확장과 함께 사용되는 _vti_bin 가상 디렉터리에 대한 FTP 액세스를 차단합니다.
  • 127.0.0.1에서 액세스를 허용하고 169.254.0.0/255.255.0.0 범위의 IP 주소 액세스를 거부하는 FTP IP 필터링 옵션을 지정합니다.
<location path="ftp.example.com">
  <system.ftpServer>
    <security>
      <authorization>
        <add accessType="Allow" roles="administrators" permissions="Read, Write" />
      </authorization>
      <requestFiltering>
        <fileExtensions allowUnlisted="true">
          <add fileExtension=".exe" allowed="false" />
          <add fileExtension=".bat" allowed="false" />
          <add fileExtension=".cmd" allowed="false" />
        </fileExtensions>
        <requestLimits maxAllowedContentLength="1000000" maxUrl="1024" />
        <hiddenSegments>
          <add segment="_vti_bin" />
        </hiddenSegments>
      </requestFiltering>
      <ipSecurity enableReverseDns="false" allowUnlisted="true">
        <add ipAddress="127.0.0.1" allowed="true" />
        <add ipAddress="169.254.0.0" subnetMask="255.255.0.0" allowed="false" />
      </ipSecurity>
    </security>
  </system.ftpServer>
</location>

예제 코드

다음 예제에서는 기본 웹 사이트에 대한 두 개의 FTP 권한 부여 규칙을 추가합니다. 첫 번째 규칙은 관리자 그룹에 대한 읽기 및 쓰기 액세스를 허용하고, 두 번째 규칙은 게스트 계정에 대한 읽기 및 쓰기 액세스를 거부합니다.

Appcmd.exe

appcmd.exe set config "Default Web Site" -section:system.ftpServer/security/authorization /+"[accessType='Allow',roles='administrators',permissions='Read, Write']" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.ftpServer/security/authorization /+"[accessType='Deny',users='guest',permissions='Read, Write']" /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 authorizationSection = config.GetSection("system.ftpServer/security/authorization", "Default Web Site");
         ConfigurationElementCollection authorizationCollection = authorizationSection.GetCollection();

         ConfigurationElement addElement = authorizationCollection.CreateElement("add");
         addElement["accessType"] = @"Allow";
         addElement["roles"] = @"administrators";
         addElement["permissions"] = @"Read, Write";
         authorizationCollection.Add(addElement);

         ConfigurationElement addElement1 = authorizationCollection.CreateElement("add");
         addElement1["accessType"] = @"Deny";
         addElement1["users"] = @"guest";
         addElement1["permissions"] = @"Read, Write";
         authorizationCollection.Add(addElement1);

         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 authorizationSection As ConfigurationSection = config.GetSection("system.ftpServer/security/authorization", "Default Web Site")
      Dim authorizationCollection As ConfigurationElementCollection = authorizationSection.GetCollection

      Dim addElement As ConfigurationElement = authorizationCollection.CreateElement("add")
      addElement("accessType") = "Allow"
      addElement("roles") = "administrators"
      addElement("permissions") = "Read, Write"
      authorizationCollection.Add(addElement)

      Dim addElement1 As ConfigurationElement = authorizationCollection.CreateElement("add")
      addElement1("accessType") = "Deny"
      addElement1("users") = "guest"
      addElement1("permissions") = "Read, Write"
      authorizationCollection.Add(addElement1)

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";
var authorizationSection = adminManager.GetAdminSection("system.ftpServer/security/authorization", "MACHINE/WEBROOT/APPHOST/Default Web Site");
var authorizationCollection = authorizationSection.Collection;

var addElement = authorizationCollection.CreateNewElement("add");
addElement.Properties.Item("accessType").Value = "Allow";
addElement.Properties.Item("roles").Value = "administrators";
addElement.Properties.Item("permissions").Value = "Read, Write";
authorizationCollection.AddElement(addElement);

var addElement1 = authorizationCollection.CreateNewElement("add");
addElement1.Properties.Item("accessType").Value = "Deny";
addElement1.Properties.Item("users").Value = "guest";
addElement1.Properties.Item("permissions").Value = "Read, Write";
authorizationCollection.AddElement(addElement1);

adminManager.CommitChanges();

VBScript

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

Set authorizationSection = adminManager.GetAdminSection("system.ftpServer/security/authorization", "MACHINE/WEBROOT/APPHOST/Default Web Site")
Set authorizationCollection = authorizationSection.Collection

Set addElement = authorizationCollection.CreateNewElement("add")
addElement.Properties.Item("accessType").Value = "Allow"
addElement.Properties.Item("roles").Value = "administrators"
addElement.Properties.Item("permissions").Value = "Read, Write"
authorizationCollection.AddElement(addElement)

Set addElement1 = authorizationCollection.CreateNewElement("add")
addElement1.Properties.Item("accessType").Value = "Deny"
addElement1.Properties.Item("users").Value = "guest"
addElement1.Properties.Item("permissions").Value = "Read, Write"
authorizationCollection.AddElement(addElement1)

adminManager.CommitChanges()

다음 예제에서는 목록에 없는 IP 주소를 허용하도록 FTP IP 보안을 구성한 다음, 127.0.0.1에서 액세스를 허용하고 169.254.0.0/255.255.0.0 범위의 액세스를 거부하는 IP 제한을 지정합니다.

Appcmd.exe

appcmd.exe set config "Default Web Site" -section:system.ftpServer/security/ipSecurity /allowUnlisted:"True" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.ftpServer/security/ipSecurity /+"[ipAddress='127.0.0.1',allowed='True']" /commit:apphost

appcmd.exe set config "Default Web Site" -section:system.ftpServer/security/ipSecurity /+"[ipAddress='169.254.0.0',subnetMask='255.255.0.0']" /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 ipSecuritySection = config.GetSection("system.ftpServer/security/ipSecurity", "Default Web Site");
         ConfigurationElementCollection ipSecurityCollection = ipSecuritySection.GetCollection();

         ipSecuritySection["allowUnlisted"] = true;

         ConfigurationElement addElement = ipSecurityCollection.CreateElement("add");
         addElement["ipAddress"] = @"127.0.0.1";
         addElement["allowed"] = true;
         ipSecurityCollection.Add(addElement);

         ConfigurationElement addElement1 = ipSecurityCollection.CreateElement("add");
         addElement1["ipAddress"] = @"169.254.0.0";
         addElement1["subnetMask"] = @"255.255.0.0";
         ipSecurityCollection.Add(addElement1);

         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 ipSecuritySection As ConfigurationSection = config.GetSection("system.ftpServer/security/ipSecurity", "Default Web Site")
      Dim ipSecurityCollection As ConfigurationElementCollection = ipSecuritySection.GetCollection

      ipSecuritySection("allowUnlisted") = True

      Dim addElement As ConfigurationElement = ipSecurityCollection.CreateElement("add")
      addElement("ipAddress") = "127.0.0.1"
      addElement("allowed") = True
      ipSecurityCollection.Add(addElement)

      Dim addElement1 As ConfigurationElement = ipSecurityCollection.CreateElement("add")
      addElement1("ipAddress") = "169.254.0.0"
      addElement1("subnetMask") = "255.255.0.0"
      ipSecurityCollection.Add(addElement1)

      serverManager.CommitChanges()
   End Sub
End Module

JavaScript

var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager');
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";
var ipSecuritySection = adminManager.GetAdminSection("system.ftpServer/security/ipSecurity", "MACHINE/WEBROOT/APPHOST/Default Web Site");
var ipSecurityCollection = ipSecuritySection.Collection;

ipSecuritySection.Properties.Item("allowUnlisted").Value = true;

var addElement = ipSecurityCollection.CreateNewElement("add");
addElement.Properties.Item("ipAddress").Value = "127.0.0.1";
addElement.Properties.Item("allowed").Value = true;
ipSecurityCollection.AddElement(addElement);

var addElement1 = ipSecurityCollection.CreateNewElement("add");
addElement1.Properties.Item("ipAddress").Value = "169.254.0.0";
addElement1.Properties.Item("subnetMask").Value = "255.255.0.0";
ipSecurityCollection.AddElement(addElement1);

adminManager.CommitChanges();

VBScript

Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"
Set ipSecuritySection = adminManager.GetAdminSection("system.ftpServer/security/ipSecurity", "MACHINE/WEBROOT/APPHOST/Default Web Site")
Set ipSecurityCollection = ipSecuritySection.Collection

ipSecuritySection.Properties.Item("allowUnlisted").Value = True

Set addElement = ipSecurityCollection.CreateNewElement("add")
addElement.Properties.Item("ipAddress").Value = "127.0.0.1"
addElement.Properties.Item("allowed").Value = True
ipSecurityCollection.AddElement(addElement)

Set addElement1 = ipSecurityCollection.CreateNewElement("add")
addElement1.Properties.Item("ipAddress").Value = "169.254.0.0"
addElement1.Properties.Item("subnetMask").Value = "255.255.0.0"
ipSecurityCollection.AddElement(addElement1)

adminManager.CommitChanges()