Linux 監査と AIX システムログを収集する

以下でサポートされています。

このパーサーは、SYSLOG 形式の Linux 監査ログを処理し、UDM に変換します。JSON 形式と書式なしテキストの両方のログメッセージを処理し、grok、XML 解析、JSON 解析の手法を使用してフィールドを抽出して、イベントタイプに基づいて適切な UDM フィールドにマッピングします。また、パーサーは AIX システムの特定の監査ログ形式を処理し、security_result や仲介者の詳細などの追加フィールドで UDM を拡充します。

始める前に

  • Google Security Operations インスタンスがあることを確認します。
  • Auditd ホストに対する root 権限があることを確認します。
  • Auditd ホストに rsyslog がインストールされていることを確認します。
  • Windows 2012 SP2 以降または systemd を使用する Linux ホストがあることを確認します。
  • プロキシの背後で実行している場合は、ファイアウォールのポートが開いていることを確認します。

Google SecOps の取り込み認証ファイルを取得する

  1. Google SecOps コンソールにログインします。
  2. [SIEM Settings] > [Collection Agents] に移動します。
  3. Ingestion Authentication File をダウンロードします。

Google SecOps のお客様 ID を取得する

  1. Google SecOps コンソールにログインします。
  2. [SIEM 設定] > [プロファイル] に移動します。
  3. [組織の詳細情報] セクションから [お客様 ID] をコピーして保存します。

Bindplane エージェントをインストールする

  1. Windows へのインストールの場合は、次のスクリプトを実行します。
    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
  2. Linux へのインストールの場合は、次のスクリプトを実行します。
    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
  3. その他のインストール オプションについては、インストール ガイドをご覧ください。

Syslog を取り込んで Google SecOps に送信するように Bindplane Agent を構成する

  1. Bindplane がインストールされているマシンにアクセスします。
  2. config.yaml ファイルを次のように編集します。

    receivers:
      tcplog:
        # Replace the below port <54525> and IP <0.0.0.0> with your specific values
        listen_address: "0.0.0.0:54525" 
    
    exporters:
        chronicle/chronicle_w_labels:
            compression: gzip
            # Adjust the creds location below according the placement of the credentials file you downloaded
            creds: '{ json file for creds }'
            # Replace <customer_id> below with your actual ID that you copied
            customer_id: <customer_id>
            endpoint: malachiteingestion-pa.googleapis.com
            # You can apply ingestion labels below as preferred
            ingestion_labels:
            log_type: SYSLOG
            namespace: auditd
            raw_log_field: body
    service:
        pipelines:
            logs/source0__chronicle_w_labels-0:
                receivers:
                    - tcplog
                exporters:
                    - chronicle/chronicle_w_labels
    
  3. 次のコマンドを使用して Bindplane Agent を再起動して、変更を適用します。 sudo systemctl bindplane restart

Auditd から Syslog をエクスポートする

  1. 監査ログをエクスポートするマシンにアクセスします。
  2. Auditd 構成ファイル(通常は /etc/audit/auditd.conf にあります)を開きます。

    sudo vi /etc/audit/auditd.conf
    
  3. 次の行を見つけるか追加して、auditd を構成します。

    active = yes
    output = syslog
    log_format = ENRICHED
    dispatcher = /sbin/audispd
    

省略可: Syslog Facility を指定します。auditd.conf に次の行を追加または変更します。

```none
syslog_facility = LOG_AUTHPRIV
```
  1. audispd 構成ファイル(通常は /etc/audisp/plugins.d/syslog.conf にあります)を開きます。

    sudo vi /etc/audisp/plugins.d/syslog.conf
    
  2. 次の行を見つけるか追加して、audispd を構成します。

    active = yes
    direction = out
    path = builtin_syslog
    type = builtin
    args = LOG_INFO
    format = string
    
  3. Auditd サービスを再起動して変更を適用します。

    sudo systemctl restart auditd
    
  4. tail などのツールを使用して syslog をモニタリングし、Auditd ログが送信されていることを確認します。

    tail -f /var/log/syslog | grep auditd # Follow syslog and filter for auditd messages (path may vary depending on your system)
    
  5. rsyslog.conf を編集するか、カスタム構成を作成します。

    sudo vi /etc/rsyslog.d/50-audit-forwarding.conf
    
  6. ログを転送するルールを追加します。

    • if $programname == 'auditd' then @@<Bindplane_Agent>:<Bindplane_Port>
    • UDP には @、TCP には @@ を使用します。
    • <BindPlane_Agent> は、サーバーの IP/ホスト名に置き換えます。
    • <BindPlane_Port> は、サーバーのポートに置き換えます。
  7. rsyslog サービスを再起動して変更を適用します。

    sudo systemctl restart rsyslog
    

UDM マッピング テーブル

ログフィールド UDM マッピング 論理
acct target.user.user_display_name 未加工ログの acct の値は、UDM の target.user.user_display_name フィールドにマッピングされます。これは、イベントに関連付けられているアカウントを表します。
addr principal.ip 未加工ログの addr の値は、UDM の principal.ip フィールドにマッピングされます。これは、イベントに関与したプリンシパルの IP アドレスを表します。
additional.fields additional.fields 解析された Key-Value ペアまたはラベルの追加フィールドは、UDM の additional.fields 配列に追加されます。
agent.googleapis.com/log_file_path (マッピングされていません) このラベルは一部のログに存在しますが、UDM の IDM オブジェクトにはマッピングされません。
algo (この例では使用されていません) このフィールドはパーサーと一部のロギングデータに存在しますが、提供されている例では使用されておらず、最終的な UDM には表示されません。
application principal.application ログタイプに応じて、未加工ログの terminal フィールドまたは exe などの他のフィールドから派生します。関連するアプリケーションを表します。
arch security_result.about.platform_version 未加工ログの arch フィールドのアーキテクチャは security_result.about.platform_version にマッピングされます。
auid about.user.useridsecurity_result.detection_fields.auid 監査ユーザー ID(auid)が about.user.userid にマッピングされ、security_result の検出フィールドとして追加されます。
cmd target.process.command_line 未加工ログの cmd フィールドのコマンドは target.process.command_line にマッピングされます。
collection_time (マッピングされていません) このフィールドはログ収集時間であり、UDM の IDM オブジェクトにはマッピングされません。
comm principal.application コマンド名(comm)は principal.application にマッピングされます。
compute.googleapis.com/resource_name principal.hostname このラベルのリソース名は principal.hostname にマッピングされます。
create_time (マッピングされていません) このフィールドは、UDM の IDM オブジェクトにマッピングされません。
cwd security_result.detection_fields.cwd 現在の作業ディレクトリ(cwd)が security_result の検出フィールドとして追加されます。
data (処理済み) data フィールドにはメインのログメッセージが含まれ、パーサーによって処理されてさまざまなフィールドが抽出されます。単一の UDM フィールドに直接マッピングされません。
exe principal.process.file.full_pathtarget.process.file.full_path 実行可能パス(exe)は、コンテキストに応じて principal.process.file.full_path または target.process.file.full_path にマッピングされます。
extensions.auth.type extensions.auth.type 認証タイプは、イベントタイプに基づいてパーサー ロジックによって設定されます。多くの場合、MACHINE または AUTHTYPE_UNSPECIFIED に設定されます。
fp network.tls.client.certificate.sha256 フィンガープリント(fp)が解析されて SHA256 ハッシュが抽出され、network.tls.client.certificate.sha256 にマッピングされます。
insertId (マッピングされていません) このフィールドは、UDM の IDM オブジェクトにマッピングされません。
jsonPayload.message (処理済み) このフィールドには、メインのログメッセージが JSON 形式で含まれ、パーサーによって処理されます。
key security_result.about.registry.registry_key キー フィールドは security_result.about.registry.registry_key にマッピングされます。
labels (処理済み) 未加工ログのラベルが処理され、さまざまな UDM フィールドにマッピングされるか、additional.fields に追加されます。
logName (マッピングされていません) このフィールドは、UDM の IDM オブジェクトにマッピングされません。
msg security_result.summary メッセージ(msg)は、多くの場合、security_result.summary フィールドへの入力に使用されます。
network.application_protocol network.application_protocol イベントタイプ(SSH、HTTP)。
network.direction network.direction イベントタイプ(INBOUND、OUTBOUND)。
network.ip_protocol network.ip_protocol 通常は SSH イベントの TCP に、パーサー ロジックによって設定されます。
network.session_id network.session_id ses フィールドからマッピングされるか、他のフィールドから派生します。
network.tls.cipher network.tls.cipher 暗号情報は未加工ログから抽出され、このフィールドにマッピングされます。
network.tls.curve network.tls.curve 鍵交換曲線が未加工ログから抽出され、このフィールドにマッピングされます。
pid principal.process.pidtarget.process.pid プロセス ID(pid)は、コンテキストに応じて principal.process.pid または target.process.pid にマッピングされます。
ppid principal.process.parent_process.pidtarget.process.parent_process.pid 親プロセス ID(ppid)は、コンテキストに応じて principal.process.parent_process.pid または target.process.parent_process.pid にマッピングされます。
principal.asset.hostname principal.asset.hostname principal.hostname からコピーされます。
principal.asset.ip principal.asset.ip principal.ip からコピーされます。
principal.platform principal.platform オペレーティング システムに基づいてパーサー ロジックによって設定されます(例: Linux)。
principal.port principal.port プリンシパルに関連付けられているポート番号。
principal.user.group_identifiers principal.user.group_identifiers プリンシパル ユーザーに関連付けられたグループ ID。
receiveTimestamp (マッピングされていません) このフィールドはログ受信タイムスタンプであり、UDM の IDM オブジェクトにマッピングされません。
res security_result.action_details 結果(res)は security_result.action_details にマッピングされます。
resource.labels (マッピングされていません) これらのラベルは一部のロギングデータに存在しますが、UDM 内の IDM オブジェクトにはマッピングされません。
resource.type (マッピングされていません) このフィールドは一部のロギングデータに存在しますが、UDM の IDM オブジェクトにはマッピングされません。
security_result.action security_result.action res フィールドに基づいてパーサー ロジックによって設定されます(例: ALLOW、BLOCK)。
security_result.detection_fields security_result.detection_fields 未加工ログのさまざまなフィールドが、コンテキストの Key-Value ペアとしてこの配列に追加されます。
security_result.rule_id security_result.rule_id パーサー ロジックによって設定されます。多くの場合、syscall イベントの type_name に設定されます。
security_result.severity security_result.severity 未加工ログの重大度レベルに基づいてパーサー ロジックによって設定されます。
security_result.summary security_result.summary イベントの概要。多くの場合、msg フィールドまたは他の関連フィールドから取得されます。
ses network.session_id セッション ID(ses)は network.session_id にマッピングされます。
source (マッピングされていません) このフィールドにはログソースに関するメタデータが含まれますが、UDM の IDM オブジェクトにはマッピングされません。
subj (処理済み) 件名フィールド(subj)が処理され、ユーザーとセキュリティのコンテキスト情報が抽出されます。
syscall security_result.about.labels.Syscall syscall 番号は security_result.about 内のラベルとして追加されます。
target.administrative_domain target.administrative_domain ターゲット ユーザーのドメイン。
target.group.group_display_name target.group.group_display_name ターゲット グループの名前。
target.ip target.ip ターゲットの IP アドレス。
target.port target.port ターゲットに関連付けられているポート番号。
target.process.command_line target.process.command_line ターゲット プロセスのコマンドライン。
target.resource.type target.resource.type ターゲット リソースのタイプ。パーサー ロジックによって設定されます(例: CREDENTIAL、SETTING)。
target.user.attribute.permissions target.user.attribute.permissions ターゲット ユーザーに関連する権限。
target.user.group_identifiers target.user.group_identifiers ターゲット ユーザーに関連付けられたグループ ID。
target.user.userid target.user.userid ターゲットのユーザー ID。
textPayload (処理済み) ログのテキスト ペイロード。パーサーによって処理され、さまざまなフィールドが抽出されます。
timestamp metadata.event_timestamp イベントのタイムスタンプ。
tty security_result.about.labels.tty tty は security_result.about 内のラベルとして追加されます。
type metadata.product_event_type イベントタイプ(type)は metadata.product_event_type にマッピングされます。
uid principal.user.useridtarget.user.userid ユーザー ID(uid)は、コンテキストに応じて principal.user.userid または target.user.userid のいずれかにマッピングされます。

さらにサポートが必要な場合 コミュニティ メンバーや Google SecOps のプロフェッショナルから回答を得ることができます。