Recopila datos de Microsoft Windows AD

Compatible con:

Este documento incluye la siguiente información:

  • Arquitectura de Deployment y pasos de instalación, además de los requisitos configuración que produce registros compatibles con el analizador de Google Security Operations para eventos de Active Directory de Microsoft Windows. Para obtener una descripción general de Google Security Operations consulta Transferencia de datos a Google Security Operations.
  • Información sobre cómo el analizador asigna campos del registro original a los campos del modelo de datos unificado de Google Security Operations.

La información de este documento se aplica al analizador con la etiqueta de transferencia WINDOWS_AD. La etiqueta de transferencia identifica qué analizador normaliza los datos de registro sin procesar al formato estructurado del UDM.

Antes de comenzar

En este diagrama, se ilustran los componentes fundamentales recomendados de una implementación. para recopilar y enviar eventos de Microsoft Windows a Google Security Operations. Compara esta información con tu entorno para asegurarte de que los componentes esté instalado. Cada implementación de cliente diferirá de esta representación y pueden ser más complejos. Se requiere lo siguiente:

  • Todos los sistemas en la arquitectura de implementación se configuran con la UTC zona horaria.
  • La secuencia de comandos de PowerShell se crea y configura en cada servidor de AD de Microsoft Windows recopilar datos de USER_CONTEXT y ASSET_CONTEXT.
  • NXLog se instala en cada servidor de Microsoft Windows AD para enviar datos a la Servidor Microsoft Windows o Linux.
  • El servidor de reenvío de Google Security Operations se instala en el servidor central de Microsoft Windows o Linux para reenviar los datos de registro a Google Security Operations.

    Arquitectura de implementación

Revisa los dispositivos y las versiones compatibles

El analizador de operaciones de seguridad de Google admite registros de las siguientes versiones del servidor Microsoft Windows. Microsoft Windows Server se lanza con las siguientes ediciones: Foundation, Essentials, Standard y Datacenter. El esquema de eventos de los registros que genera cada edición no difiere.

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

El analizador de Google Security Operations admite registros recopilados por la comunidad o empresa de NXLog. Edición.

Revisa los tipos de registros compatibles

El analizador de Google Security Operations analizará y normalizará los datos recuperados de la Contexto del usuario y las Contexto del recurso. Admite registros generados con texto en inglés y no está es compatible con los registros generados en idiomas distintos al inglés.

Configura los servidores de Microsoft Windows AD

Pasos para configurar servidores de Microsoft Windows AD en la arquitectura de implementación:

  1. Configura todos los sistemas con la zona horaria UTC.
  2. Crea y configura en cada servidor de Microsoft Windows Active Directory un Secuencia de comandos de PowerShell para recopilar datos de registro en un archivo de salida. NXLog lee la archivo de salida y envía los datos al servidor central de Microsoft Windows o Linux.
  3. Crea la secuencia de comandos de PowerShell. Consulta el siguiente ejemplo. Cambia el valor de $OUTPUT_FILENAME en la ubicación en la que debe estar el archivo de salida escrita. NXLog leerá este archivo. Los datos deben almacenarse en JSON de un conjunto de datos tengan un formato común. Establece la codificación en utf8. Usa el parámetro -Filter, en lugar de el parámetro -LDAPFilter cuando se llama a Get-ADUser Get-ADComputer.

    # 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. Crear una tarea recurrente que ejecute la secuencia de comandos para recuperar y escribir datos en el archivo de salida.

    1. Abre la aplicación del Programador de tareas.
    2. Haz clic en Crear tarea.
    3. Ingresa un nombre y una descripción para la tarea.
    4. Selecciona la casilla de verificación Ejecutar con los privilegios más altos para asegurarte de que se recuperan todos los datos.
    5. En la pestaña Activadores, define cuándo quieres repetir la tarea.
    6. En la pestaña Acción, agrega una nueva acción y proporciona la ruta de el archivo en el que está almacenada la secuencia de comandos.
  5. Instala el agente de NXLog en cada servidor de Active Directory de Microsoft Windows. Esta aplicación reenvía registros al servidor central de Microsoft Windows o Linux. Sigue la documentación de NXLog.

  6. Crea un archivo de configuración para cada instancia de NXLog. Usar el NXLog im_file para leer desde el archivo y analizar las líneas en campos. Usa el Módulo om_tcp para reenviar datos al servidor central de Microsoft Windows o Linux.

    Este es un ejemplo de configuración de NXLog. Reemplaza <hostname> y <port>. valores con información sobre la cuenta central de destino de Microsoft Windows o Linux Servidor. En la sección <Input in_adcontext> y la propiedad File, agrega lo siguiente: la ruta de acceso del archivo de registro resultante que escribió la secuencia de comandos de PowerShell. Siempre establecida DirCheckInterval y PollInterval. Si no se definen, NXLog sondea los archivos cada 1 segundo.

    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. Inicia el servicio NXLog en cada sistema.

Configura el servidor central de Microsoft Windows o Linux.

Consulta Cómo instalar y configurar el objeto Forwarder en Linux. o Instalación y configuración del servidor de reenvío en Microsoft Windows para obtener información sobre cómo instalar y configurar el servidor de reenvío.

  1. Configurar el sistema con la zona horaria UTC.
  2. Instala el servidor de reenvío de Google Security Operations en el servidor central de Microsoft Windows o Linux.
  3. Configurar el servidor de reenvío de Google Security Operations para enviar registros a Google Security Operations Este es un ejemplo de configuración de Forwarder.

      - 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
    

Referencia de asignación de campos: campos de registro del dispositivo a campos de UDM

En esta sección, se describe cómo el analizador asigna campos de registro originales a campos del modelo de datos unificado.

Registros de contexto del usuario

Campo NXLog Campo de 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

Registros de contexto de recursos

Campo NXLog Campo de 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