Microsoft Windows AD データを収集する
このドキュメントには、次の情報が含まれています。
- デプロイ アーキテクチャとインストール手順、さらに Microsoft Active Directory イベントに対して Chronicle パーサーがサポートするログを生成するために必要な構成。Chronicle のデータ取り込みの概要については、Chronicle へのデータの取り込みをご覧ください。
- パーサーが元のログのフィールドを Chronicle の統一データモデル フィールドにマッピングする方法に関する情報。
このドキュメントの情報は、WINDOWS_AD 取り込みラベルを持つパーサーに適用されます。取り込みラベルは、未加工のログデータを構造化 UDM 形式に正規化するパーサーを識別します。
準備
推奨されるデプロイ アーキテクチャを確認する
この図は、Microsoft Windows のイベントを収集して Chronicle に送信する、デプロイ アーキテクチャで推奨される基本コンポーネントを示しています。この情報と環境を比較して、これらのコンポーネントがインストールされていることを確認してください。お客様のデプロイはそれぞれ異なり、より複雑な場合があります。次のことが必要です。
- デプロイ アーキテクチャ内のすべてのシステムは、UTC タイムゾーンを使用して構成されています。
- USER_CONTEXT と ASSET_CONTEXT のデータを収集するように、各 Microsoft Windows AD サーバー上に PowerShell スクリプトが作成され、構成されます。
- NXLog は各 Microsoft Windows AD サーバーにインストールされ、中央の Microsoft Windows または Linux サーバーにデータが送信されます。
Chronicle のフォワーダーは、中央の Microsoft Windows または Linux サーバーにインストールされ、ログデータを Chronicle に転送します。
サポートされているデバイスとバージョンを確認する
Chronicle パーサーは、次の Microsoft Windows サーバー バージョンのログをサポートしています。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 サーバーを構成する手順:
- すべてのシステムを UTC タイムゾーンで構成します。
- 各 Microsoft Windows Active Directory サーバーで、ログデータを出力ファイルに収集する PowerShell スクリプトを作成して構成します。NXLog は出力ファイルを読み取り、データを中央の Microsoft Windows または Linux サーバーに送信します。
Powershell スクリプトを作成します。次の例をご覧ください。
$OUTPUT_FILENAME
の値を、出力ファイルを書き込む場所に変更します。このファイルは NXLog によって読み取られます。データは JSON 形式で保存する必要があります。エンコードを utf8 に設定します。Get-ADUser
とGet-ADComputer
コマンドレットを呼び出すときは、-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 }
データを取得して出力ファイルに書き込むスクリプトを実行する繰り返しタスクを作成します。
- タスク スケジューラ アプリケーションを開きます。
- 右側のパネルで [タスクを作成] をクリックします。
- タスクの名前と説明を入力します。
[最高権限で実行] チェックボックスをオンにして、すべてのデータが取得されるようにします。
[トリガー] タブで、タスクを繰り返すタイミングを定義します。
[Action] タブで、新しいアクションを追加し、スクリプトを保存するファイルのパスを指定します。
各 Microsoft Windows Active Directory サーバーに NXLog エージェントをインストールします。このアプリケーションは、中央の Microsoft Windows または Linux サーバーにログを転送します。NXLog のドキュメントの手順を行います。
NXLog インスタンスごとに構成ファイルを作成します。NXLog im_file モジュールを使用して、ファイルから読み取り、行をフィールドに解析します。om_tcp モジュールを使用して、中央の Microsoft Windows または Linux サーバーにデータを転送します。
NXLog の構成例を次に示します。
<hostname>
と<port>
の値は、移行先の Microsoft Windows または Linux Server に関する情報に置き換えます。<Input in_adcontext>
セクションとFile
プロパティで、Powershell スクリプトによって書き込まれた出力ログファイルのパスを追加します。常にDirCheckInterval
とPollInterval
を設定します。これらが定義されていない場合、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>
各システムで NXLog サービスを起動します。
中央の Microsoft Windows または Linux サーバーを構成する
フォワーダーのインストールと構成については、Linux へのフォワーダーのインストールと構成または Microsoft Windows でのフォワーダーのインストールと構成をご覧ください。
- UTC タイムゾーンを使用してシステムを構成します。
- 中央の Microsoft Windows または Linux サーバーに Chronicle フォワーダーをインストールします。
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 |
姓 | entity.entity.user.last_name |
SamAccountName | entity.entity.user.userid |
SID.Value | entity.entity.user.windows_sid |
ObjectClass | 値が「user」の場合、 entity.metadata.entity_type は USER に設定されます。 |
ObjectGuid | entity.entity.user.product_object_id |
AccountExpirationDate | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
badPwdCount | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
CanonicalName | entity.enitity.administrative_domain |
City | entity.entity.user.personal_address.city |
会社 | entity.entity.user.company_name |
国 | entity.entity.user.personal_address.country_or_region |
部門 | 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.attribute.label.key/value ペアとして格納されます。 |
lastLogoff | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
lastLogon | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
LastLogonDate | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
マネージャー | GUID、SAMAccountname、SID の値はすべて異なる UDM フィールドにマッピングされます。 - SID は manager.windows_sid に保存されます。 - 識別名(最初の CN 内の値)は Manager.user_display_name に保存されます - GUID,SamAccountName は Manager.userid に格納されます。 |
MemberOf | CN の初出で次のフィールドが設定されます。 entity.relations.entity.group.group_display_name entity.relations.entity_type が GROUP に設定 entity.relations.relationship が MEMBER に設定 entity.relations.direction が UNIDIRECTIONAL に設定 |
MobilePhone | entity.entity.user.phone_numbers |
Office | entity.entity.user.office_address.name |
PasswordExpired | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
PasswordLastSet | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
PasswordNeverExpires | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
PasswordNotRequired | entity.entity.user.attribute.label.key/value ペアとして格納されます。 |
PrimaryGroup | 次のフィールドが設定されます。 - entity.relations.entity.group.group_display_name - entity.relations.entity_type を GROUP に設定 - entity.relations.relationship を MEMBER に設定 - entity.relations.direction を UNIDIRECTIONAL に設定 |
ServicePrincipalName | entity.entity.user.attributes.label.key/value ペアとして保存されます。 |
州 | entity.entity.user.personal_address.state |
StreetAddress | entity.entity.user.personal_address.name |
タイトル | entity.entity.user.title |
whenCreated | entity.user.attributes.creation_time |
アセット コンテキスト ログ
NXLog フィールド | UDM フィールド |
---|---|
DNSHostName | entity.entity.asset.hostname |
SamAccountName | entity.entity.asset.asset_id |
SID.Value | entity.entity.user.windows_sid |
ObjectClass | 値が「computer」の場合、entity.metadata.entity_type は ASSET に設定されています |
ObjectGuid | entity.entity.asset.product_object_id |
AccountExpirationDate | entity.entity.asset.attributes.label.key/value |
badPwdCount | entity.entity.asset.attributes.label.key/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.asset.attributes.label.key/value ペアとして格納されます。 |
lastLogoff | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
lastLogon | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
LastLogonDate | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
場所 | entity.entity.asset.location.name |
ManagedBy | 次のフィールドが設定されます。 entity.entity.user.user_display_name entity.relations.entity_type が USER に設定 エンティティ.relations.relationship を ADMINISTERS に設定 entity.relations.direction を UNIDIRECTIONAL に設定 |
ObjectCategory | entity.entity.asset.category |
OperatingSystem | 名前に「Windows」が含まれている場合、entity.entity.asset.platform_software.platform フィールドは WINDOWS に設定されます。 |
オペレーティング システム サービス パック | entity.entity.asset.platform_software.platform_patch_level |
OperatingSystemVersion | フィールド entity.entity.asset.platform_software.platform_version は %{オペレーティングシステム}~%{オペレーティングシステム バージョン} に設定されています。 |
PasswordExpired | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
PasswordLastSet | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
PasswordNeverExpires | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
PasswordNotRequired | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
PrimaryGroup | 次のフィールドが設定されます。 - entity.relations.entity.group.group_display_name - entity.relations.entity_type は GROUP に設定 - entity.relations.relationship を MEMBER に設定 - entity.relations.direction を UNIDIRECTIONAL に設定 |
ServicePrincipalName | entity.entity.asset.attributes.label.key/value ペアとして格納されます。 |
whenChange | entity.entity.asset.attributes.last_update_time |
whenCreated | entity.entity.asset.attributes.creation_time |