Microsoft Windows AD 데이터 수집

이 문서에는 다음 정보가 포함되어 있습니다.

  • 배포 아키텍처 및 설치 단계와 Microsoft Windows Active Directory 이벤트용 Chronicle 파서가 지원하는 로그를 생성하는 데 필요한 구성 Chronicle 데이터 수집 개요는 Chronicle 데이터 수집을 참조하세요.
  • 파서가 원래 로그의 필드를 Chronicle 통합 데이터 모델 필드에 매핑하는 방법에 대한 정보

이 문서의 정보는 WINDOWS_AD 수집 라벨이 있는 파서에 적용됩니다. 수집 라벨은 원시 로그 데이터를 구조화된 UDM 형식으로 정규화하는 파서를 식별합니다.

시작하기 전에

이 다이어그램은 Microsoft Windows 이벤트를 수집하고 Chronicle로 전송하기 위해 배포 아키텍처에서 권장되는 기본 구성요소를 보여줍니다. 이 정보를 사용자 환경과 비교하여 이러한 구성요소가 설치되어 있는지 확인합니다. 각 고객 배포는 이 표현과 다르며, 더 복잡할 수 있습니다. 다음은 필수 항목입니다.

  • 배포 아키텍처의 모든 시스템은 UTC 시간대로 구성됩니다.
  • USER_CONTEXT 및 ASSET_CONTEXT 데이터를 수집하기 위해 각 Microsoft Windows AD 서버에서 Powershell 스크립트가 생성되고 구성됩니다.
  • NXLog는 데이터를 중앙 Microsoft Windows 또는 Linux 서버로 전송하기 위해 각 Microsoft Windows AD 서버에 설치됩니다.
  • Chronicle 전달자는 로그 데이터를 Chronicle로 전달하기 위해 중앙 Microsoft Windows 또는 Linux 서버에 설치됩니다.

    배포 아키텍처

지원되는 기기 및 버전 검토

Chronicle 파서는 다음 Microsoft Windows Server 버전의 로그를 지원합니다. Microsoft Windows Server는 Foundation, Essentials, Standard, Datacenter 버전으로 출시됩니다. 각 버전에서 생성된 로그의 이벤트 스키마는 다르지 않습니다.

  • Microsoft Windows Server 2019
  • Microsoft Windows Server 2016
  • Microsoft Windows Server 2012

Chronicle 파서는 NXLog Community 또는 Enterprise Edition에서 수집한 로그를 지원합니다.

지원되는 로그 유형 검토

Chronicle 파서는 사용자 컨텍스트자산 컨텍스트에서 검색된 데이터를 파싱하고 정규화합니다. 영어 텍스트로 생성된 로그를 지원하며 영어가 아닌 언어로 생성된 로그에서는 지원되지 않습니다.

Microsoft Windows AD 서버 구성

배포 아키텍처에서 Microsoft Windows AD 서버를 구성하는 단계:

  1. UTC 시간대로 모든 시스템을 구성합니다.
  2. 각 Microsoft Windows Active Directory 서버에서 로그 데이터를 출력 파일에 수집하도록 PowerShell 스크립트를 만들고 구성합니다. NXLog는 출력 파일을 읽고 데이터를 중앙 Microsoft Windows 또는 Linux 서버로 전송합니다.
  3. Powershell 스크립트를 만듭니다. 아래 예시를 참조하세요. $OUTPUT_FILENAME 값을 출력 파일이 작성되는 위치로 변경합니다. NXLog가 이 파일을 읽습니다. 데이터는 JSON 형식으로 저장해야 합니다. 인코딩을 utf8로 설정합니다. Get-ADUserGet-ADComputer cmdlets를 호출할 때 -LDAPFilter 매개변수가 아닌 -Filter 매개변수를 사용합니다.

    # Set the location where the log file will be written
    $OUTPUT_FILENAME="<Path_of_the_output_file>"
    
    If (Test-Path -Path $OUTPUT_FILENAME) { Remove-Item -path $OUTPUT_FILENAME -ErrorAction SilentlyContinue}
    
    # USER_CONTEXT: Gets all Active Directory users and their properties.
    Get-ADUser -Filter * -properties samAccountName | % { Get-ADUser $_.SamAccountName -properties * | ConvertTo-JSON -compress | Out-File -encoding utf8 $OUTPUT_FILENAME -Append }
    
    # ASSET_CONTEXT: Gets all Active Directory assets and their properties.
    Get-ADComputer -Filter * -properties samAccountName | % { Get-ADComputer $_.SamAccountName -properties * | ConvertTo-JSON -compress | Out-File -encoding utf8 $OUTPUT_FILENAME -Append }
    
  4. 스크립트를 실행하여 출력 파일에 데이터를 가져오고 기록하는 반복 태스크를 만듭니다.

    1. 작업 스케줄러 애플리케이션을 엽니다.
    2. 오른쪽 패널에서 '작업 만들기'를 클릭합니다.
    3. 태스크의 이름과 설명을 입력합니다.
    4. "가장 높은 권한으로 실행" 체크박스를 선택하여 모든 데이터가 검색되었는지 확인합니다.

      태스크 만들기

    5. "트리거" 탭에서 태스크를 반복할 시점을 정의합니다.

    6. "작업" 탭에서 새 작업을 추가하고 스크립트가 저장된 파일의 경로를 제공합니다.

      일정 만들기

  5. 각 Microsoft Windows Active Directory 서버에 NXLog 에이전트를 설치합니다. 이 애플리케이션은 중앙 Microsoft Windows 또는 Linux 서버로 로그를 전달합니다. NXLog 문서를 따릅니다.

  6. 각 NXLog 인스턴스에 대한 구성 파일을 만듭니다. NXLog im_file 모듈을 사용하여 파일에서 읽고 줄을 파싱합니다. om_tcp 모듈을 사용하여 데이터를 중앙 Microsoft Windows 또는 Linux 서버로 전달합니다.

    다음은 NXLog 구성의 예입니다. <hostname><port> 값을 대상 중앙 Microsoft Windows 또는 Linux 서버에 대한 정보로 바꿉니다. <Input in_adcontext> 섹션 및 File 속성에서 Powershell 스크립트로 작성된 출력 로그 파일의 경로를 추가합니다. 항상 DirCheckIntervalPollInterval을 설정합니다. 이를 정의하지 않으면 NXLog는 1초마다 파일을 폴링합니다.

    define ROOT C:\Program Files\nxlog
    define ADCONTEXT_OUTPUT_DESTINATION_ADDRESS <hostname>
    define ADCONTEXT_OUTPUT_DESTINATION_PORT <port>
    
    Moduledir   %ROOT%\modules
    CacheDir    %ROOT%\data
    Pidfile     %ROOT%\data\nxlog.pid
    SpoolDir    %ROOT%\data
    LogFile     %ROOT%\data\nxlog.log
    
    <Input in_adcontext>
        Module im_file
        File "<Path_of_the_output_file>"
        DirCheckInterval 3600
        PollInterval 3600
    </Input>
    
    <Output out_chronicle_adcontext>
        Module  om_tcp
        Host    %ADCONTEXT_OUTPUT_DESTINATION_ADDRESS%
        Port    %ADCONTEXT_OUTPUT_DESTINATION_PORT%
    </Output>
    
    <Route ad_context_to_chronicle>
        Path in_adcontext => out_chronicle_adcontext
    </Route>
    
  7. 각 시스템에서 NXLog 서비스를 시작합니다.

중앙 Microsoft Windows 또는 Linux 서버 구성

전달자 설치 및 구성에 대한 자세한 내용은 Linux에서 전달자 설치 및 구성 또는 Microsoft Windows에서 전달자 설치 및 구성을 참조하세요.

  1. UTC 시간대로 시스템을 구성합니다.
  2. 중앙 Microsoft Windows 또는 Linux 서버에 Chronicle 전달자를 설치합니다.
  3. Chronicle로 로그를 보내도록 Chronicle 전달자를 구성합니다. 다음은 전달자 구성의 예입니다.

      - syslog:
          common:
            enabled: true
            data_type: WINDOWS_AD
            batch_n_seconds: 10
            batch_n_bytes: 1048576
          tcp_address: 0.0.0.0:10518
          connection_timeout_sec: 60
    

필드 매핑 참조: 기기 로그 필드에서 UDM 필드로

이 섹션에서는 파서가 통합 로그 모델을 통합 데이터 모델 필드에 매핑하는 방법을 설명합니다.

사용자 컨텍스트 로그

NXLog 필드 UDM 필드
GivenName entity.entity.user.first_name
Surname entity.entity.user.last_name
SamAccountName entity.entity.user.userid
SID.Value entity.entity.user.windows_sid
ObjectClass If the value is user,
entity.metadata.entity_type is set to USER
ObjectGuid If the ObjectGuid log field value is not empty, then the ObjectGuid log field is mapped to the entity.entity.user.product_object_id UDM field.
Else, If the objectGUID log field value is not empty, then the objectGUID log field is mapped to the entity.entity.user.product_object_id UDM field.
Else, If the ObjectGUID log field value is not empty, then the ObjectGUID log field is mapped to the entity.entity.user.product_object_id UDM field.
objectGUID If the ObjectGuid log field value is not empty, then the ObjectGuid log field is mapped to the entity.entity.user.product_object_id UDM field.
Else, If the objectGUID log field value is not empty, then the objectGUID log field is mapped to the entity.entity.user.product_object_id UDM field.
Else, If the ObjectGUID log field value is not empty, then the ObjectGUID log field is mapped to the entity.entity.user.product_object_id UDM field.
ObjectGUID If the ObjectGuid log field value is not empty, then the ObjectGuid log field is mapped to the entity.entity.user.product_object_id UDM field.
Else, If the objectGUID log field value is not empty, then the objectGUID log field is mapped to the entity.entity.user.product_object_id UDM field.
Else, If the ObjectGUID log field value is not empty, then the ObjectGUID log field is mapped to the entity.entity.user.product_object_id UDM field.
AccountExpirationDate entity.entity.user.account_expiration_time
badPwdCount entity.entity.user.attribute.label.key and entity.entity.user.attribute.label.value
CanonicalName entity.entity.administrative_domain
City entity.entity.user.personal_address.city
Company entity.entity.user.company_name
Country entity.entity.user.personal_address.country_or_region
Department entity.entity.user.department
Description entity.metadata.description
DisplayName entity.entity.user.user_display_name
EmailAddress entity.entity.user.email_addresses
EmployeeID entity.entity.user.employee_id
HomeDirectory entity.entity.file.full_path
HomePage entity.entity.url
HomePhone entity.entity.user.phone_numbers
LastBadPasswordAttempt entity.entity.user.last_bad_password_attempt_time
lastLogoff entity.entity.user.attribute.label.key and entity.entity.user.attribute.label.value
lastLogon entity.entity.user.attribute.label.key and entity.entity.user.attribute.label.value
LastLogonDate entity.entity.user.last_login_time
Manager Values for GUID, SAMAccountname, SID all mapped to different UDM fields:
- SID is stored in manager.windows_sid
- Distinguished name (i.e. value in first CN) is stored in manager.user_display_name
- GUID,SamAccountName is stored in manager.userid
MemberOf The following fields in the first occurrence of CN are set:
entity.relations.entity.group.group_display_name
entity.relations.entity_type set to GROUP
entity.relations.relationship set t0 MEMBER
entity.relations.direction set to UNIDIRECTIONAL
MobilePhone entity.entity.user.phone_numbers
Office entity.entity.user.office_address.name
PasswordExpired entity.entity.user.attribute.label.key and entity.entity.user.attribute.label.value
PasswordLastSet entity.entity.user.last_password_change_time
PasswordNeverExpires entity.entity.user.attribute.label.key and entity.entity.user.attribute.label.value
PasswordNotRequired entity.entity.user.attribute.label.key and entity.entity.user.attribute.label.value
PrimaryGroup Following fields are set:
- entity.relations.entity.group.group_display_name
- entity.relations.entity_type set to GROUP
- entity.relations.relationship set to MEMBER
- entity.relations.direction set to UNIDIRECTIONAL
ServicePrincipalNames entity.entity.user.attribute.label.key and entity.entity.user.attribute.label.value
State entity.entity.user.personal_address.state
StreetAddress entity.entity.user.personal_address.name
Title entity.entity.user.title
whenCreated entity.user.attribute.creation_time
AccountLockoutTime entity.entity.user.account_lockout_time

자산 컨텍스트 로그

NXLog 필드 UDM 필드
DNSHostName entity.entity.asset.hostname
SamAccountName entity.entity.asset.asset_id
SID.Value entity.entity.user.windows_sid
ObjectClass If the value is computer, entity.metadata.entity_type set to ASSET
ObjectGuid If the ObjectGuid log field value is not empty, then the ObjectGuid log field is mapped to the entity.entity.asset.product_object_id UDM field.
Else, If the ObjectGUID log field value is not empty, then the ObjectGUID log field is mapped to the entity.entity.asset.product_object_id UDM field.
ObjectGUID If the ObjectGuid log field value is not empty, then the ObjectGuid log field is mapped to the entity.entity.asset.product_object_id UDM field.
Else, If the ObjectGUID log field value is not empty, then the ObjectGUID log field is mapped to the entity.entity.asset.product_object_id UDM field.
AccountExpirationDate entity.entity.user.account_expiration_time
badPwdCount entity.entity.asset.attribute.label.key and entity.entity.asset.attribute.label.value
CanonicalName entity.entity.administrative_domain
countryCode entity.entity.asset.location.country_or_region
Description entity.entity.metadata.description
HomePage entity.entity.url
IPv4Address entity.entity.asset.ip
IPv6Address entity.entity.asset.ip
LastBadPasswordAttempt entity.entity.user.last_bad_password_attempt_time
lastLogoff entity.entity.asset.attribute.label.key and entity.entity.asset.attribute.label.value
lastLogon entity.entity.asset.attribute.label.key and entity.entity.asset.attribute.label.value
LastLogonDate entity.entity.user.last_login_time
Location entity.entity.asset.location.name
ManagedBy The following fields are set:

entity.entity.user.user_display_name
entity.relations.entity_type set to USER
entity.relations.relationship set to ADMINISTERS
entity.relations.direction set to UNIDIRECTIONAL
ObjectCategory entity.entity.asset.category
OperatingSystem If the name contains Windows, entity.entity.asset.platform_software.platform field is set to WINDOWS.
OperatingSystemServicePack entity.entity.asset.platform_software.platform_patch_level
OperatingSystemVersion The field entity.entity.asset.platform_software.platform_version is set to %{OperatingSystem} - %{OperatingSystemVersion}
PasswordExpired entity.entity.asset.attribute.label.key and entity.entity.asset.attribute.label.value
PasswordLastSet entity.entity.user.last_password_change_time
PasswordNeverExpires entity.entity.asset.attribute.label.key and entity.entity.asset.attribute.label.value
PasswordNotRequired entity.entity.asset.attribute.label.key and entity.entity.asset.attribute.label.value
PrimaryGroup The following fields are set:
- entity.relations.entity.group.group_display_name
- entity.relations.entity_type set to GROUP
- entity.relations.relationship set to MEMBER
- entity.relations.direction set to UNIDIRECTIONAL
ServicePrincipalNames entity.entity.asset.attribute.label.key and entity.entity.asset.attribute.label.value
whenChanged entity.entity.asset.attribute.last_update_time
whenCreated entity.entity.asset.attribute.creation_time
AccountLockoutTime entity.entity.user.account_lockout_time