다음을 통해 공유


Deny by Failure <denyByFailure>

개요

요소는 <denyByFailure> FTP 클라이언트가 기간 내에 인증에 실패한 횟수에 따라 FTP 서비스에 대한 액세스를 거부하도록 FTP 서비스를 구성합니다. 실패한 로그인 시도 횟수에 도달하면 FTP 연결이 강제로 닫히게 되고, 기간 동안(entryExpiration 특성에 의해 설정된 대로) 클라이언트 IP 주소가 FTP 서비스에 액세스하지 못하도록 차단됩니다. 실패율에 따른 액세스 거부는 개별 사이트가 아닌 서버에 대해서만 사용하도록 설정할 수 있습니다.

참고

클라이언트의 IP 주소가 서버 수준에서 지정된 FTP IP 주소의 특정 IP 주소 항목 허용 및 도메인 제한 기능과 일치하는 경우 클라이언트는 추가 신뢰로 처리되며 FTP 로그온 시도 제한 검사 무시하도록 허용됩니다.

호환성

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

설치 프로그램

FTP 서버에서 인증을 통한 액세스 거부를 지원하려면 FTP 서비스 역할 서비스를 설치해야 합니다.

Windows Server 2012

  1. Windows 로고 키를 누른 다음 서버 관리자 클릭합니다.

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

  3. 역할 및 기능 추가 마법사에서 다음을 수행합니다.

    • 시작하기 전 페이지에서 다음을 클릭합니다.
    • 설치 유형 페이지에서 설치 유형을 선택하고 다음을 클릭합니다.
    • 서버 선택 페이지에서 적절한 서버를 선택하고 다음을 클릭합니다.
    • 서버 역할 페이지에서 웹 서버(IIS)가 선택되어 있는지 확인하고 확장합니다.
    • FTP 서버를 확장한 다음 FTP 서비스FTP 확장성을 모두 선택한 다음, 다음을 클릭합니다.
    • 기능 페이지에서 다음을 클릭합니다.
    • 설치 선택 확인 페이지에서 설치를 클릭합니다.
    • Results(결과) 페이지에서 Close(닫기)를 클릭합니다.

Windows 8

  1. Windows 제어판을 엽니다.
  2. Windows 제어판 프로그램 및 기능을 엽니다.
  3. 프로그램 및 기능에서 Windows 기능 켜기/끄기를 클릭합니다.
  4. Windows 기능 대화 상자에서 인터넷 정보 서비스를 확장한 다음 FTP 서버를 확장합니다.
  5. FTP 서버에서 FTP 서비스FTP 확장성을 선택한 다음 확인을 클릭합니다.

방법

로그온 실패율에 따라 FTP 서버에 대한 액세스를 거부하는 방법

  1. IIS(인터넷 정보 서비스) 관리자를 엽니다.

    • Windows Server 2012 이상을 사용하는 경우:

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

      • Windows 키를 누른 채로 문자 X를 누른 다음 제어판 클릭합니다.
      • 관리 도구를 클릭한 다음 IIS(인터넷 정보 서비스) 관리자를 두 번 클릭합니다.
  2. 연결 창에서 서버를 선택합니다.

  3. 창에서 FTP 로그온 시도 제한 기능을 두 번 클릭합니다.

    FTP 로그온 시도 제한 사용, 실패한 최대 로그인 시도 횟수 및 시간(초) 필드의 스크린샷.

  4. FTP 로그온 시도 제한 대화 상자에서 사용을 클릭하여 제한을 사용하도록 설정한 다음, 최대 오류 수와 이러한 오류로 인해 FTP 서비스에 대한 액세스가 거부될지 묻는 메시지가 표시되는 시간 프레임을 입력합니다.

  5. 로그에 쓰기를 클릭하여 조건이 충족되었음을 기록하지만 로그온 시도를 차단하지는 않습니다.

  6. 작업 창에서 적용을 클릭합니다.

구성

<denyByFailure> 요소는 서버 수준에서 구성됩니다.

특성

attribute Description
enabled 선택적 부울 특성입니다.

FTP 서비스가 실패율에 따라 액세스를 거부할 수 있도록 합니다.

기본값은 False입니다.
maxFailure 선택적 uint 특성입니다.

FTP 서비스에 대한 액세스를 거부하라는 메시지를 표시하는 특정 시간 범위의 오류 수를 지정합니다.

기본값은 4입니다.
entryExpiration 선택적 TimeSpan 특성입니다.

지정된 수의 오류가 FTP 서비스에 대한 액세스를 거부하라는 메시지를 표시하는 기간을 지정합니다.

기본값은 00:00:30입니다.
loggingOnlyMode 선택적 부울 특성입니다.

실패율 때문에 액세스가 거부되지 않지만 이벤트가 기록되도록 지정합니다.

기본값은 False입니다.

자식 요소

없음

구성 샘플

다음 샘플에서는 요소를 구성합니다 <denyByFailure> .

<system.ftpServer>
   <security>
      <authentication>
         <denyByFailure enabled="true" maxFailure="5" entryExpiration="00:00:45" loggingOnlyMode="false" />
      </authentication>
   </security>
</system.ftpServer>

샘플 코드

다음 코드 샘플은 로그온 실패율에 따라 FTP 서버에 대한 액세스 거부를 구성합니다.

AppCmd.exe

appcmd.exe set config  -section:system.ftpServer/security/authentication /denyByFailure.enabled:"True" /denyByFailure.maxFailure:"10" /denyByFailure.entryExpiration:"00:00:35" /denyByFailure.loggingOnlyMode:"False"  /commit:apphost

참고

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 authenticationSection = config.GetSection("system.ftpServer/security/authentication");
            
            ConfigurationElement denyByFailureElement = authenticationSection.GetChildElement("denyByFailure");
            denyByFailureElement["enabled"] = true;
            denyByFailureElement["maxFailure"] = 10;
            denyByFailureElement["entryExpiration"] = TimeSpan.Parse("00:00:35");
            denyByFailureElement["loggingOnlyMode"] = false;
            
            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 authenticationSection As ConfigurationSection = config.GetSection ("system.ftpServer/security/authentication")
      Dim denyByFailureElement As ConfigurationElement = authenticationSection.GetChildElement("denyByFailure")
      denyByFailureElement("enabled") = true
      denyByFailureElement("maxFailure") = 10
      denyByFailureElement("entryExpiration") = TimeSpan.Parse("00:00:35")
      denyByFailureElement("loggingOnlyMode") = false
      serverManager.CommitChanges
   End Sub
End Module

JavaScript

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

var authenticationSection = adminManager.GetAdminSection("system.ftpServer/security/authentication", "MACHINE/WEBROOT/APPHOST");
var denyByFailureElement = authenticationSection.ChildElements.Item("denyByFailure");
denyByFailureElement.Properties.Item("enabled").Value = true;
denyByFailureElement.Properties.Item("maxFailure").Value = 10;
denyByFailureElement.Properties.Item("entryExpiration").Value = "00:00:35";
denyByFailureElement.Properties.Item("loggingOnlyMode").Value = false;

adminManager.CommitChanges();

VBScript

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

Set authenticationSection = adminManager.GetAdminSection("system.ftpServer/security/authentication", "MACHINE/WEBROOT/APPHOST")
Set denyByFailureElement = authenticationSection.ChildElements.Item("denyByFailure")
denyByFailureElement.Properties.Item("enabled").Value = true
denyByFailureElement.Properties.Item("maxFailure").Value = 10
denyByFailureElement.Properties.Item("entryExpiration").Value = "00:00:35"
denyByFailureElement.Properties.Item("loggingOnlyMode").Value = false

adminManager.CommitChanges()

PowerShell

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.ftpServer/security/authentication/denyByFailure" -name "enabled" -value "True"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.ftpServer/security/authentication/denyByFailure" -name "maxFailure" -value 10
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.ftpServer/security/authentication/denyByFailure" -name "entryExpiration" -value "00:00:35"
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.ftpServer/security/authentication/denyByFailure" -name "loggingOnlyMode" -value "False"