Microsoft Windows AD-Daten erfassen

Dieses Dokument enthält die folgenden Informationen:

  • Bereitstellungsarchitektur und Installationsschritte sowie alle erforderlichen Konfigurationen zum Generieren von Logs, die vom Google Security Operations-Parser für Microsoft Windows Active Directory-Ereignisse unterstützt werden. Eine Übersicht über die Datenaufnahme in Google Security Operations finden Sie unter Datenaufnahme in Google Security Operations.
  • Informationen dazu, wie der Parser Felder im ursprünglichen Log den Feldern des einheitlichen Datenmodells von Google Security Operations zuordnet.

Die Informationen in diesem Dokument gelten für den Parser mit dem Aufnahmelabel WINDOWS_AD. Das Aufnahmelabel gibt an, welcher Parser die Logrohdaten in das strukturierte UDM-Format normalisiert.

Hinweise

Dieses Diagramm veranschaulicht die empfohlenen grundlegenden Komponenten in einer Bereitstellungsarchitektur zum Erfassen und Senden von Microsoft Windows-Ereignissen an Google Security Operations. Vergleichen Sie diese Informationen mit Ihrer Umgebung, um sicherzustellen, dass diese Komponenten installiert sind. Jede Kundenbereitstellung unterscheidet sich von dieser Darstellung und kann komplexer sein. Folgendes ist erforderlich:

  • Für alle Systeme in der Bereitstellungsarchitektur wird die UTC-Zeitzone verwendet.
  • Das PowerShell-Skript wird auf jedem Microsoft Windows-AD-Server erstellt und konfiguriert, um USER_CONTEXT- und ASSET_CONTEXT-Daten zu erfassen.
  • NXLog wird auf jedem Microsoft Windows-AD-Server installiert, um Daten an den zentralen Microsoft Windows- oder Linux-Server zu senden.
  • Der Google Security Operations-Forwarder ist auf dem zentralen Microsoft Windows- oder Linux-Server installiert, um Protokolldaten an Google Security Operations weiterzuleiten.

    Deployment-Architektur

Unterstützte Geräte und Versionen ansehen

Der Google Security Operations Parser unterstützt Protokolle aus den folgenden Microsoft Windows Server-Versionen. Microsoft Windows Server wird mit den folgenden Versionen veröffentlicht: Foundation, Essentials, Standard und Datacenter. Das Ereignisschema der von den einzelnen Versionen generierten Logs unterscheidet sich nicht.

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

Der Google Security Operations-Parser unterstützt Logs, die von der NXLog Community oder Enterprise Edition erfasst wurden.

Unterstützte Logtypen ansehen

Der Google Security Operations-Parser parst und normalisiert die aus dem Nutzerkontext und dem Asset-Kontext abgerufenen Daten. Sie unterstützt Logs, die mit englischsprachigem Text generiert wurden. Logs, die in anderen Sprachen als Englisch generiert wurden, werden nicht unterstützt.

Microsoft Windows-AD-Server konfigurieren

Schritte zum Konfigurieren von Microsoft Windows-AD-Servern in der Bereitstellungsarchitektur:

  1. Konfigurieren Sie alle Systeme mit der UTC-Zeitzone.
  2. Erstellen und konfigurieren Sie auf jedem Microsoft Windows Active Directory-Server ein PowerShell-Skript, um Logdaten in einer Ausgabedatei zu erfassen. NXLog liest die Ausgabedatei und sendet die Daten an den zentralen Microsoft Windows- oder Linux-Server.
  3. Erstellen Sie das PowerShell-Skript. Sehen Sie sich folgendes Beispiel an. Ändern Sie den Wert von $OUTPUT_FILENAME in den Speicherort, an den die Ausgabedatei geschrieben werden soll. Diese Datei wird von NXLog gelesen. Daten müssen im JSON-Format gespeichert werden. Legen Sie die Codierung auf utf8 fest. Verwenden Sie beim Aufrufen der Cmdlets Get-ADUser und Get-ADComputer den Parameter -Filter und nicht den Parameter -LDAPFilter.

    # 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. Erstellen Sie eine wiederkehrende Aufgabe, die das Skript zum Abrufen und Schreiben von Daten in die Ausgabedatei ausführt.

    1. Öffnen Sie den Taskplaner.
    2. Klicken Sie auf Aufgabe erstellen.
    3. Geben Sie einen Namen und eine Beschreibung für die Aufgabe ein.
    4. Klicken Sie das Kästchen Mit höchsten Berechtigungen ausführen an, damit alle Daten abgerufen werden.
    5. Legen Sie auf dem Tab Trigger fest, wann die Aufgabe wiederholt werden soll.
    6. Fügen Sie auf dem Tab Aktion eine neue Aktion hinzu und geben Sie den Pfad der Datei an, in der das Skript gespeichert ist.
  5. Installieren Sie den NXLog-Agent auf jedem Microsoft Windows Active Directory-Server. Diese Anwendung leitet die Protokolle an den zentralen Microsoft Windows- oder Linux-Server weiter. Folge der NXLog-Dokumentation.

  6. Erstellen Sie für jede NXLog-Instanz eine Konfigurationsdatei. Verwenden Sie das NXLog-Modul im_file, um aus der Datei zu lesen und die Zeilen in Felder zu parsen. Verwenden Sie das Modul om_tcp, um Daten an den zentralen Microsoft Windows- oder Linux-Server weiterzuleiten.

    Hier ist ein Beispiel für eine NXLog-Konfiguration. Ersetzen Sie die Werte <hostname> und <port> durch Informationen zum zentralen Ziel von Microsoft Windows oder Linux Server. Fügen Sie im Abschnitt <Input in_adcontext> und im Attribut File den Pfad der vom PowerShell-Skript geschriebenen Ausgabe-Logdatei hinzu. Immer DirCheckInterval und PollInterval festlegen. Wenn diese nicht definiert sind, fragt NXLog alle 1 Sekunde Dateien ab.

    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. Starten Sie den NXLog-Dienst in jedem System.

Zentralen Microsoft Windows- oder Linux-Server konfigurieren

Informationen zum Installieren und Konfigurieren des Forwarders finden Sie unter Weiterleitung unter Linux installieren und konfigurieren oder Weiterleitung unter Microsoft Windows installieren und konfigurieren.

  1. Konfigurieren Sie das System mit der UTC-Zeitzone.
  2. Installieren Sie die Google Security Operations-Weiterleitung auf dem zentralen Microsoft Windows- oder Linux-Server.
  3. Konfigurieren Sie den Google Security Operations-Forwarder so, dass Protokolle an Google Security Operations gesendet werden. Hier ist ein Beispiel für eine Forwarder-Konfiguration.

      - 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
    

Referenz zur Feldzuordnung: Geräteprotokollfelder zu UDM-Feldern

In diesem Abschnitt wird beschrieben, wie der Parser die ursprünglichen Logfelder den Feldern des einheitlichen Datenmodells zuordnet.

Nutzerkontext-Logs

NXLog-Feld UDM-Feld
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

Asset-Kontextlogs

NXLog-Feld UDM-Feld
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