AuditLogLocation 열거형

정의

보안 관련 이벤트 로그가 기록되는 위치를 지정합니다.

public enum class AuditLogLocation
public enum AuditLogLocation
type AuditLogLocation = 
Public Enum AuditLogLocation
상속
AuditLogLocation

필드

Application 1

이벤트 로그에 애플리케이션 로그를 지정합니다.

Default 0

운영 체제에서 결정하는 기본 위치를 지정합니다. 보안 로그에 쓰기가 지원되는 경우(예: Windows Vista 및 Windows Server 2003 이상 플랫폼에서) 기본 로그 위치는 보안 로그입니다. 그렇지 않으면(예: Windows XP SP2) 기본 로그 위치는 애플리케이션 로그입니다.

Security 2

이벤트 로그에 보안 로그를 지정합니다. 호출하는 스레드에는 보안 로그에 기록할 수 있는 SeAuditPrivilege가 있어야 합니다.

예제

다음 예제에서는 속성을 값 중 AuditLogLocation 하나로 설정합니다ServiceSecurityAuditBehavior.AuditLogLocation.

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

설명

인증 및/또는 호출자의 권한 부여를 요구 하는 Windows Communication Foundation (WCF) 애플리케이션을 만들 때 성공, 실패 또는 둘 다에 대 한 보안 관련 이벤트가 기록 되도록 지정할 수 있습니다. 로그의 위치는 이 열거형에 의해 결정됩니다.

감사 로그 수준은 MessageAuthenticationAuditLevel 또는 ServiceAuthorizationAuditLevel 클래스의 ServiceSecurityAuditBehavior 속성을 AuditLevel 값 중 하나로 설정하여 지정합니다.

serviceSecurityAudit 바인딩을 사용하여 감사 동작을 <지정할 수도 있습니다.>

중요

경우는 AuditLogLocation 보안 속성 및 Audit Object Access 설정 하지 않으면는 Local Security Policy, 감사 이벤트 보안 로그에 기록 되지 것입니다. 오류가 반환되지는 않지만 감사 항목이 보안 로그에 기록되지 않습니다. 또한 호출 스레드에는 보안 로그에 기록할 수 있는 SeAuditPrivilege가 있어야 합니다.

운영 체제에 따라 달라지는 기본값

속성의 기본값을 설정할 때 운영 체제는 로그에 실제로 기록 됩니다 결정 합니다. 자세한 내용은 감사합니다.

적용 대상

추가 정보