ServiceSecurityAuditBehavior 클래스

정의

보안 이벤트의 감사 동작을 지정합니다. 일반적으로 보안 이벤트는 전송, 메시지 또는 협상 인증과 같은 인증 이벤트와 권한 부여 이벤트로 구성됩니다. 자세한 내용은 ServiceAuthorizationManager를 참조하세요.

public ref class ServiceSecurityAuditBehavior sealed : System::ServiceModel::Description::IServiceBehavior
public sealed class ServiceSecurityAuditBehavior : System.ServiceModel.Description.IServiceBehavior
type ServiceSecurityAuditBehavior = class
    interface IServiceBehavior
Public NotInheritable Class ServiceSecurityAuditBehavior
Implements IServiceBehavior
상속
ServiceSecurityAuditBehavior
구현

예제

다음 코드에서는 ServiceHost 클래스의 인스턴스를 만들고 동작 컬렉션에 새 ServiceSecurityAuditBehavior를 추가합니다.

public static void Main()
{
    // Get base address from appsettings in configuration.
    Uri baseAddress = new Uri(ConfigurationManager.
        AppSettings["baseAddress"]);

    // Create a ServiceHost for the CalculatorService type
    // and provide the base address.
    using (ServiceHost serviceHost = new
        ServiceHost(typeof(CalculatorService), baseAddress))
    {
        // Create a new auditing behavior and set the log location.
        ServiceSecurityAuditBehavior newAudit =
            new ServiceSecurityAuditBehavior();
        newAudit.AuditLogLocation =
            AuditLogLocation.Application;
        newAudit.MessageAuthenticationAuditLevel =
            AuditLevel.SuccessOrFailure;
        newAudit.ServiceAuthorizationAuditLevel =
            AuditLevel.SuccessOrFailure;
        newAudit.SuppressAuditFailure = false;
        // Remove the old behavior and add the new.
        serviceHost.Description.
            Behaviors.Remove<ServiceSecurityAuditBehavior>();
        serviceHost.Description.Behaviors.Add(newAudit);
        // Open the ServiceHostBase to create listeners
        // and start listening for messages.
        serviceHost.Open();

        // The service can now be accessed.
        Console.WriteLine("The service is ready.");
        Console.WriteLine("Press <ENTER> to terminate service.");
        Console.WriteLine();
        Console.ReadLine();

        // Close the ServiceHostBase to shutdown the service.
        serviceHost.Close();
    }
}
Public Shared Sub Main() 
    ' Get base address from appsettings in configuration.
    Dim baseAddress As New Uri(ConfigurationManager.AppSettings("baseAddress"))
    
    ' Create a ServiceHost for the CalculatorService type 
    ' and provide the base address.
    Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)
    Try
        ' Create a new auditing behavior and set the log location.
        Dim newAudit As New ServiceSecurityAuditBehavior()
        newAudit.AuditLogLocation = AuditLogLocation.Application
        newAudit.MessageAuthenticationAuditLevel = _
            AuditLevel.SuccessOrFailure
        newAudit.ServiceAuthorizationAuditLevel = _
            AuditLevel.SuccessOrFailure
        newAudit.SuppressAuditFailure = False
        ' Remove the old behavior and add the new.
        serviceHost.Description.Behaviors.Remove(Of ServiceSecurityAuditBehavior)
        serviceHost.Description.Behaviors.Add(newAudit)
        ' Open the ServiceHostBase to create listeners 
        ' and start listening for messages.
        serviceHost.Open()
        
        ' The service can now be accessed.
        Console.WriteLine("The service is ready.")
        Console.WriteLine("Press <ENTER> to terminate service.")
        Console.WriteLine()
        Console.ReadLine()
        
        ' Close the ServiceHostBase to shutdown the service.
        serviceHost.Close()
    Finally
    End Try

End Sub

설명

ServiceSecurityAuditBehavior 클래스 Windows Communication Foundation (WCF) 인증 이벤트를 감사 하는 데 사용 됩니다. 감사 기능을 사용하도록 설정하면 성공한 인증 시도나 실패한 인증 시도 또는 둘 모두를 감사할 수 있습니다. 이벤트는 운영 체제 버전의 애플리케이션 로그, 보안 로그 또는 기본 로그의 세 가지 이벤트 로그 중 하나에 기록됩니다. 이벤트 로그는 Windows 이벤트 뷰어를 사용하여 볼 수 있습니다.

이 클래스를 사용하여 작성할 이벤트 로그 및 인증 이벤트의 종류를 지정할 수 있습니다. SuppressAuditFailure 속성을 false로 설정하여 감사 실패를 숨길지 여부를 지정할 수도 있습니다. 기본값은 true입니다.

WCF 애플리케이션에 대 한 보안 이벤트 감사에 대 한 자세한 내용은 참조 하세요. 감사합니다.

구성에서 감사 동작을 지정하려면 serviceSecurityAudit>을< 사용합니다.

생성자

ServiceSecurityAuditBehavior()

ServiceSecurityAuditBehavior 클래스의 새 인스턴스를 초기화합니다.

속성

AuditLogLocation

보안 관련 이벤트 로그를 쓸 위치를 가져오거나 설정합니다.

MessageAuthenticationAuditLevel

메시지 수준에서 감사할 인증 이벤트의 형식을 가져오거나 설정합니다.

ServiceAuthorizationAuditLevel

서비스 수준에서 감사할 권한 부여 이벤트의 형식을 가져오거나 설정합니다.

SuppressAuditFailure

감사 실패가 애플리케이션에 영향을 주는지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IServiceBehavior.AddBindingParameters(ServiceDescription, ServiceHostBase, Collection<ServiceEndpoint>, BindingParameterCollection)

계약 구현을 지원하려면 사용자 지정 데이터를 바인딩 요소에 전달합니다.

IServiceBehavior.ApplyDispatchBehavior(ServiceDescription, ServiceHostBase)

런타임 속성 값을 변경하거나 사용자 지정 확장명 개체(예: 오류 처리기, 메시지, 매개 변수 인터셉터 등), 보안 확장명 및 기타 사용자 지정 확장명 개체를 삽입하는 기능을 제공합니다.

IServiceBehavior.Validate(ServiceDescription, ServiceHostBase)

구현되지 않았습니다.

적용 대상