Nix Systems Ubuntu Server(Unix システム)ログを収集する

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

このドキュメントでは、Bindplane を使用して Ubuntu Server(Unix システム)のログを Google Security Operations に取り込む方法について説明します。パーサーは syslog 形式と JSON 形式のログを取り込み、統合データモデル(UDM)のさまざまなフィールドを空の文字列に初期化し、message フィールドに対して複数の文字列置換を実行してから、メッセージを JSON として解析しようとします。JSON 解析が失敗した場合は、grok パターンを使用して messageevent_details.original のコンテンツに基づいてフィールドを抽出し、イベントタイプとさまざまな条件チェックに基づいて抽出されたフィールドを UDM にマッピングします。さまざまな Unix システム プロセスとサービスからのさまざまなログ形式と構造を処理します。

始める前に

次の前提条件を満たしていることを確認します。

  • Google SecOps インスタンス
  • プロキシの背後で実行されている場合、ファイアウォール ポートが開いている
  • RHEL サーバーへの特権アクセス

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

  1. Google SecOps コンソールにログインします。
  2. [SIEM 設定] > [コレクション エージェント] に移動します。
  3. Ingestion Authentication File をダウンロードします。Bindplane をインストールするシステムにファイルを安全に保存します。

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

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

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

Linux のインストール

  1. root 権限または sudo 権限でターミナルを開きます。
  2. 次のコマンドを実行します。

    sudo sh -c `$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)` install_unix.sh
    

その他のインストール リソース

その他のインストール オプションについては、インストール ガイドをご覧ください。

Syslog を取り込んで Google SecOps に送信するように Bindplane エージェントを構成する

  1. 構成ファイルにアクセスします。
    • config.yaml ファイルを見つけます。通常、Linux では /etc/bindplane-agent/ ディレクトリにあります。
    • テキスト エディタ(nanovi など)を使用してファイルを開きます。
  2. config.yaml ファイルを次のように編集します。

    receivers:
      filelog/unix:
        include:
          - /var/log/auth.log
          - /var/log/lastlog
          - /var/log/btmp
          - /var/log/wtmp
          - /var/log/faillog
          - /var/log/dpkg.log
          - /var/log/boot.log
          - /var/log/kern.log
          - /var/log/syslog
        start_at: end
        poll_interval: 5s
    
    exporters:
        chronicle/linux:
            # Adjust the path to the credentials file you downloaded in Step 1
            creds: '/path/to/ingestion-authentication-file.json'
            # Replace with your actual customer ID from Step 2
            customer_id: <customer_id>
            endpoint: malachiteingestion-pa.googleapis.com
            # Add optional ingestion labels for better organization
            log_type: 'NIX_SYSTEM'
            override_log_type: false
            raw_log_field: body
    
    service:
      pipelines:
        logs/linux:
          receivers:
          - filelog/linux
      exporters: [chronicle/linux]
    
  3. <customer_id> は、実際の顧客 ID に置き換えます。

  4. /path/to/ingestion-authentication-file.json の値を、Google SecOps の取り込み認証ファイルを取得するで認証ファイルを保存したパスに更新します。

Bindplane エージェントを起動して変更を適用する

  1. Bindplane エージェントを起動します。

    sudo systemctl start bindplane-agent
    
  2. observIQ otel コレクタ サービスを有効にします。

    systemctl enable --now bindplane-agent
    
  3. 必要に応じて Bindplane エージェントを再起動します。

    sudo systemctl restart bindplane-agent
    

UDM マッピング テーブル

ログフィールド UDM マッピング ロジック
AccessControlRuleAction security_result.action AccessControlRuleActionAllow の場合は、ALLOW に設定します。AccessControlRuleActionBlock の場合は、BLOCK に設定します。
ACPolicy security_result.rule_labels キー: ACPolicy、値: ACPolicy
AccessControlRuleName security_result.rule_name 直接マッピング。
acct event.idm.read_only_udm.target.user.userid 引用符とバックスラッシュを削除した後、直接マッピングされます。
addr event.idm.read_only_udm.target.ipevent.idm.read_only_udm.target.asset.ip 空、?UNKNOWN のいずれでもない場合、直接マッピングされます。
ApplicationProtocol event.idm.read_only_udm.network.application_protocol 直接マッピング。
auid event.idm.read_only_udm.additional.fields キー: auid、値: auid
comm event.idm.read_only_udm.target.process.command_line 直接マッピング。
command event.idm.read_only_udm.target.process.command_line 先頭と末尾の空白文字を削除した後、直接マッピングされます。
Computer event.idm.read_only_udm.principal.hostnameevent.idm.read_only_udm.principal.asset.hostname 直接マッピング。空の場合は、HostName を使用します。
ConnectionID security_result.detection_fields キー: Connection ID、値: ConnectionID
cwd event.idm.read_only_udm.target.process.file.full_path 引用符を削除した後、直接マッピングされます。
data message grok パターンで使用されます。
desc security_result.description 直接マッピング。
description event.idm.read_only_udm.metadata.descriptionsecurity_result.description 直接マッピング。
descript security_result.description ハッシュを削除した後の直接マッピング。
DeviceUUID event.idm.read_only_udm.metadata.product_log_id 直接マッピング。
DNSQuery event.idm.read_only_udm.additional.fields キー: DNSQuery、値: DNSQuery
DNSRecordType event.idm.read_only_udm.additional.fields キー: DNSRecordType、値: DNSRecordType
DNSResponseType event.idm.read_only_udm.additional.fields キー: DNSResponseType、値: DNSResponseType
DNS_TTL event.idm.read_only_udm.additional.fields キー: DNS_TTL、値: DNS_TTL
DstIP event.idm.read_only_udm.target.ipevent.idm.read_only_udm.target.asset.ip 直接マッピング。
DstPort event.idm.read_only_udm.target.port 直接マッピングされ、整数に変換されます。
dvc event.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ipevent.idm.read_only_udm.principal.hostnameevent.idm.read_only_udm.principal.asset.hostnameevent.idm.read_only_udm.intermediary.ipevent.idm.read_only_udm.target.ipevent.idm.read_only_udm.target.asset.ipevent.idm.read_only_udm.target.hostnameevent.idm.read_only_udm.target.asset.hostname 有効な IP の場合、プリンシパル/ターゲット IP にマッピングされます。ホスト名の場合、プリンシパル/ターゲットのホスト名にマッピングされます。有効な IP の場合は、中間 IP にも使用されます。
EgressInterface event.idm.read_only_udm.principal.asset.attribute.labels キー: EgressInterface、値: EgressInterface
EgressVRF event.idm.read_only_udm.principal.asset.attribute.labels キー: EgressVRF、値: EgressVRF
EgressZone event.idm.read_only_udm.target.location.name 直接マッピング。
eventType event.idm.read_only_udm.metadata.product_event_typeevent.idm.read_only_udm.target.application 直接マッピング。SERVICE_STARTSERVICE_STOP の場合、target.application にマッピングされてからクリアされます。
EventTime @timestamp タイムスタンプとして解析されます。
exe event.idm.read_only_udm.target.process.command_line 引用符とバックスラッシュを削除した後、直接マッピングされます。
extended_description event.idm.read_only_udm.metadata.description ハイフンと引用符を削除した後、直接マッピングされます。
Facility event.idm.read_only_udm.principal.resource.attribute.labels キー: Facility、値: Facility
filepath event.idm.read_only_udm.principal.process.file.full_path 直接マッピング。
file_path event.idm.read_only_udm.target.file.full_path 直接マッピング。
file_path_value event.idm.read_only_udm.target.file.full_path 直接マッピング。
FirstPacketSecond security_result.detection_fields キー: FirstPacketSecond、値: FirstPacketSecond
from event.idm.read_only_udm.network.email.from 山かっこを削除した後、直接マッピングされます。
generic_ip event.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ip 有効な IP で A256: でない場合、直接マッピングされます。
gid event.idm.read_only_udm.target.user.group_identifiers 直接マッピング。
grp event.idm.read_only_udm.target.group.group_display_name 引用符とバックスラッシュを削除した後、直接マッピングされます。
hashing_algo security_result.summary 直接マッピング。
home event.idm.read_only_udm.target.file.full_path 直接マッピング。
HostName Computer Computer が空の場合に使用されます。
HostIP event.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ip HostIP% より前の部分が抽出され、validated_ip としてマッピングされます。
hostname event.idm.read_only_udm.target.hostnameevent.idm.read_only_udm.target.asset.hostnameevent.idm.read_only_udm.principal.hostnameevent.idm.read_only_udm.principal.asset.hostname 空でないか ? でない場合、直接マッピングされます。
host_name event.idm.read_only_udm.target.hostnameevent.idm.read_only_udm.target.asset.hostname 直接マッピング。
InitiatorBytes event.idm.read_only_udm.network.sent_bytes 直接マッピングされ、符号なし整数に変換されます。
InitiatorPackets event.idm.read_only_udm.network.sent_packets 直接マッピングされ、整数に変換されます。
insertId event.idm.read_only_udm.metadata.product_log_id 直接マッピング。
InstanceID security_result.detection_fields キー: Instance ID、値: InstanceID
int_dvc event.idm.read_only_udm.intermediary.hostname 直接マッピング。
ip event.idm.read_only_udm.target.ipevent.idm.read_only_udm.target.asset.ipevent.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ip 直接マッピング。
ip_protocol event.idm.read_only_udm.network.ip_protocol 直接マッピング。
laddr event.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ip 空でないか ? でない場合、直接マッピングされます。
level security_result.severity info の場合は、INFORMATIONAL に設定。
log.syslog.facility.name event.idm.read_only_udm.target.application 直接マッピング。
log.syslog.severity.name security_result.severity Emergency の場合は、HIGH に設定。
logName logname 直接マッピング。
log_description security_result.description 直接マッピング。
log_level security_result.severity error の場合は、ERROR に設定。
log_summary security_result.summary 直接マッピング。
logger_name event.idm.read_only_udm.principal.resource.attribute.labels キー: logger_name、値: logger_name
log_type event.idm.read_only_udm.metadata.log_type NIX_SYSTEM にハードコードされています。
lport event.idm.read_only_udm.principal.port 直接マッピングされ、整数に変換されます。
MG event.idm.read_only_udm.principal.resource.attribute.labels キー: MG、値: MG
method event.idm.read_only_udm.network.http.method 直接マッピングされ、大文字に変換されます。
msg1 event.idm.read_only_udm.metadata.descriptionevent.idm.read_only_udm.additional.fieldssecurity_result.description grok パターンを使用して解析されます。event_typeGENERIC_EVENT の場合、description にマッピングされます。
msg2 event.idm.read_only_udm.network.received_bytessecurity_result.summary 数字が含まれている場合は、符号なし整数に変換され、received_bytes にマッピングされます。それ以外の場合は summary にマッピングされます。
NAPPolicy security_result.rule_labels キー: NAPPolicy、値: NAPPolicy
name event.idm.read_only_udm.target.process.file.full_path 引用符を削除した後、直接マッピングされます。
outcome security_result.action Succeeded または success を含む場合は、ALLOW に設定します。
p_id event.idm.read_only_udm.target.process.pid 直接マッピング。
pid event.idm.read_only_udm.target.process.pidevent.idm.read_only_udm.principal.process.pid 直接マッピング。
principal_hostname event.idm.read_only_udm.principal.hostnameevent.idm.read_only_udm.principal.asset.hostname 直接マッピング。
principal_ip event.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ip 直接マッピング。
principal_present event.idm.read_only_udm.metadata.event_type truehas_targettrue の場合、event_typeNETWORK_UNCATEGORIZED に設定します。true または user_presenttrue の場合、event_typeUSER_UNCATEGORIZED に設定します。
process event.idm.read_only_udm.target.applicationevent.idm.read_only_udm.metadata.product_event_type 直接マッピング。eventType が空の場合、target.application として使用されます。
ProcessID event.idm.read_only_udm.principal.process.pid 直接マッピングされ、文字列に変換されます。
ProcessName event.idm.read_only_udm.principal.resource.attribute.labels キー: ProcessName、値: ProcessName
prod_eve_type event.idm.read_only_udm.metadata.product_event_type 直接マッピング。
product_event_type event.idm.read_only_udm.metadata.product_event_type 直接マッピング。
Protocol event.idm.read_only_udm.network.ip_protocol icmpudptcp(大文字と小文字を区別しない)と一致する場合、対応する大文字の値にマッピングされます。
proto event.idm.read_only_udm.network.application_protocol ssh または ssh2 の場合は、SSH に設定。
pwd event.idm.read_only_udm.target.file.full_path 直接マッピング。
reason security_result.summarysecurity_result.description action および desc と組み合わせて security_result.description を作成します。security_result.summary にもマッピングされます。
relayHostname event.idm.read_only_udm.intermediary.hostname 直接マッピング。
relayIp event.idm.read_only_udm.intermediary.ip 直接マッピング。
res security_result.summary 直接マッピング。
resource.labels.instance_id event.idm.read_only_udm.target.resource.product_object_id 直接マッピング。
resource.labels.project_id event.idm.read_only_udm.target.asset.attribute.cloud.project.id 直接マッピング。
resource.labels.zone event.idm.read_only_udm.target.asset.attribute.cloud.availability_zone 直接マッピング。
resource.type event.idm.read_only_udm.target.resource.resource_subtype 直接マッピング。
response_code event.idm.read_only_udm.network.http.response_code 直接マッピングされ、整数に変換されます。
ResponderBytes event.idm.read_only_udm.network.received_bytes 直接マッピングされ、符号なし整数に変換されます。
ResponderPackets event.idm.read_only_udm.network.received_packets 直接マッピングされ、整数に変換されます。
rhost event.idm.read_only_udm.additional.fields キー: rhost、値: rhost
ruser srcUser 直接マッピング。
sec_action security_result.action action または eventType に基づいてマッピングされます。
sec_summary security_result.summary 直接マッピング。
security_action security_result.action 直接マッピング。
sent_bytes event.idm.read_only_udm.network.sent_bytes 直接マッピングされ、符号なし整数に変換されます。
ses event.idm.read_only_udm.network.session_idevent.idm.read_only_udm.network.session_duration 数値の場合、UNIX タイムスタンプとして解析され、session_duration にマッピングされます。それ以外の場合は session_id にマッピングされます。
SeverityLevel security_result.severity 値に基づいてさまざまな重大度にマッピングされます(notice/info -> INFORMATIONAL、warn -> HIGH、error -> ERROR、その他 -> UNKNOWN_SEVERITY)。
sessionId event.idm.read_only_udm.network.session_id 直接マッピング。
size event.idm.read_only_udm.network.received_bytes 直接マッピングされ、符号なし整数に変換されます。
source event.idm.read_only_udm.principal.hostnameevent.idm.read_only_udm.principal.asset.hostname 先頭の空白文字を削除した後、直接マッピングされます。
SourceSystem event.idm.read_only_udm.principal.resource.attribute.labelsevent.idm.read_only_udm.principal.platform キー: SourceSystem、値: SourceSystemplatform にもマッピングされます(Linux -> LINUX、Window -> WINDOWS、Mac/iOS -> MAC)。
SrcIP event.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ip 直接マッピング。
SrcPort event.idm.read_only_udm.principal.port 直接マッピングされ、整数に変換されます。
srcIp event.idm.read_only_udm.principal.ipevent.idm.read_only_udm.principal.asset.ip 直接マッピング。
srcPort event.idm.read_only_udm.principal.port 直接マッピングされ、整数に変換されます。
srcUser event.idm.read_only_udm.principal.user.userid 直接マッピング。
src_user event.idm.read_only_udm.principal.user.userid 直接マッピング。
src_user_display_name event.idm.read_only_udm.principal.user.user_display_name 直接マッピング。
status security_result.action Deferred の場合は、BLOCK に設定します。Sent の場合は、ALLOW に設定。
summary security_result.summary 直接マッピング。
SyslogMessage security_result.description 直接マッピング。
targetEmail event.idm.read_only_udm.network.email.to 直接マッピング。
targetEmailfrom event.idm.read_only_udm.network.email.from 直接マッピング。
targetHostname event.idm.read_only_udm.target.hostnameevent.idm.read_only_udm.target.asset.hostname 直接マッピング。
target_hostname event.idm.read_only_udm.target.hostnameevent.idm.read_only_udm.target.asset.hostname 直接マッピング。
target_ip event.idm.read_only_udm.target.ipevent.idm.read_only_udm.target.asset.ip 直接マッピング。
target_mac event.idm.read_only_udm.target.mac 直接マッピング。
target_uri event.idm.read_only_udm.target.url 直接マッピング。
TenantId event.idm.read_only_udm.principal.user.product_object_id 直接マッピング。
terminal event.idm.read_only_udm.additional.fields キー: terminal、値: 空でない場合は terminal、空の場合は ?
TimeGenerated event.idm.read_only_udm.metadata.collected_timestamp タイムスタンプとして解析されます。
timestamp @timestamp タイムスタンプとして解析されます。
tls_cipher event.idm.read_only_udm.network.tls.cipher 直接マッピング。
Type event.idm.read_only_udm.principal.resource.attribute.labels キー: Type、値: Type
uid event.idm.read_only_udm.principal.user.userid 0 の場合は、root に設定します。それ以外の場合は、直接マッピング。
uid_2 event.idm.read_only_udm.target.user.userid uid が空の場合、直接マッピングされます。
unit event.idm.read_only_udm.target.application 直接マッピング。
url event.idm.read_only_udm.target.url 直接マッピング。
user username 直接マッピング。
username event.idm.read_only_udm.target.user.useridevent.idm.read_only_udm.principal.user.userid 直接マッピング。
user_display_name event.idm.read_only_udm.target.user.user_display_name 直接マッピング。
user_present event.idm.read_only_udm.metadata.event_type true または principal_presenttrue の場合、event_typeUSER_UNCATEGORIZED に設定します。
_Internal_WorkspaceResourceId event.idm.read_only_udm.target.resource.attribute.labelsevent.idm.read_only_udm.target.resource.product_object_id キー: _Internal_WorkspaceResourceId、値: _Internal_WorkspaceResourceId。サブスクリプション ID が抽出され、product_object_id にマッピングされます。
_ItemId event.idm.read_only_udm.principal.resource.attribute.labels キー: _ItemId、値: _ItemId
_ResourceId event.idm.read_only_udm.principal.resource.attribute.labelsevent.idm.read_only_udm.principal.resource.product_object_id キー: _ResourceId、値: _ResourceId。サブスクリプション ID が抽出され、product_object_id にマッピングされます。
_timestamp @timestamp タイムスタンプとして解析されます。
_timestamp_tz @timestamp タイムスタンプとして解析されます。

event.idm.read_only_udm.metadata.event_type: 最初は GENERIC_EVENT に設定されますが、パーサー ロジックに基づいて上書きされます。event.idm.read_only_udm.metadata.product_name: Unix System にハードコードされています。event.idm.read_only_udm.extensions.auth.type: 特定のイベントタイプでは MACHINE に設定します。event.idm.read_only_udm.target.asset.attribute.cloud.environment: Google Cloud 監査ログの場合は GOOGLE_CLOUD_PLATFORM に設定します。event.idm.read_only_udm.target.resource.resource_type: Google Cloud 監査ログの場合は VIRTUAL_MACHINE に設定します。event.idm.read_only_udm.extensions.auth.mechanism: ログイン イベントの場合は USERNAME_PASSWORD に設定します。has_target_resource: resource.labels.instance_id または _Internal_WorkspaceResourceId が存在する場合は、true に設定します。

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