Red Hat Directory Server LDAP のログを収集する
このドキュメントでは、Bindplane エージェントを使用して Red Hat Directory Server LDAP ログを Google Security Operations に取り込む方法について説明します。
Red Hat Directory Server は、オープン標準に基づいて構築されたエンタープライズ クラスの LDAP ディレクトリ サービスです。Linux 環境と UNIX 環境に、一元化されたユーザー ID 管理、認証、アクセス制御を提供します。Directory Server は、アクセスログ、エラーログ、監査ログ、監査失敗ログ、セキュリティ ログを /var/log/dirsrv/slapd-instance_name/ ディレクトリに保存し、クライアント接続、LDAP オペレーション、構成の変更、失敗したオペレーション、認証試行や認可の問題などのセキュリティ イベントを記録します。
始める前に
次の前提条件を満たしていることを確認してください。
- Google SecOps インスタンス
systemdを使用する Linux ホスト- Bindplane エージェントと Red Hat Directory Server ホスト間のネットワーク接続
- プロキシの背後で実行している場合は、Bindplane エージェントの要件に従ってファイアウォール ポートが開いていることを確認します。
- Red Hat Directory Server ホストへの root または sudo アクセス権
- Red Hat Directory Server 11 以降がインストールされ、実行されている
- ディレクトリ サーバー ホストにインストールされて実行されている
rsyslogサービス
Google SecOps の取り込み認証ファイルを取得する
- Google SecOps コンソールにログインします。
- [SIEM 設定] > [収集エージェント] に移動します。
- 取り込み認証ファイル をダウンロードします。
Bindplane をインストールするシステムにファイルを安全に保存します。
Google SecOps のお客様 ID を取得する
- Google SecOps コンソールにログインします。
- [SIEM 設定] > [プロファイル] に移動します。
[組織の詳細情報] セクションから [お客様 ID] をコピーして保存します。
Bindplane エージェントをインストールする
次の手順に沿って、Linux オペレーティング システムに Bindplane エージェントをインストールします。
Linux のインストール
- root 権限または sudo 権限でターミナルを開きます。
次のコマンドを実行します。
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.shインストールが完了するまで待ちます。
次のコマンドを実行して、インストールの内容を確認します。
sudo systemctl status observiq-otel-collectorサービスは active (running) と表示されます。
その他のインストール リソース
その他のインストール オプションとトラブルシューティングについては、Bindplane エージェントのインストール ガイドをご覧ください。
syslog を取り込んで Google SecOps に送信するように Bindplane エージェントを構成する
構成ファイルを探す
Linux:
sudo nano /opt/observiq-otel-collector/config.yaml
構成ファイルを編集します。
config.yamlの内容全体を次の構成に置き換えます。receivers: udplog: listen_address: "0.0.0.0:514" exporters: chronicle/redhat_ds: compression: gzip creds_file_path: '/etc/bindplane-agent/ingestion-auth.json' customer_id: '<customer_id>' endpoint: malachiteingestion-pa.googleapis.com log_type: REDHAT_DIRECTORY_SERVER raw_log_field: body service: pipelines: logs/redhat_ds: receivers: - udplog exporters: - chronicle/redhat_ds
構成パラメータ
各プレースホルダを次のように置き換えます。
レシーバーの構成:
udplog: プロトコルに基づく受信者のタイプ:udplog: UDP syslog- TCP Syslog の
tcplog - RFC 3164/5424 syslog の
syslog
0.0.0.0: リッスンする IP アドレス。0.0.0.0: すべてのインターフェースでリッスンします(推奨)。- 1 つのインターフェースでリッスンする特定の IP アドレス
514: リッスンするポート番号(514、1514、6514など)
エクスポータの構成:
<customer_id>: 前の手順で取得した顧客 IDmalachiteingestion-pa.googleapis.com: リージョン エンドポイント URL:- 米国:
malachiteingestion-pa.googleapis.com - ヨーロッパ:
europe-malachiteingestion-pa.googleapis.com - アジア:
asia-southeast1-malachiteingestion-pa.googleapis.com - 完全なリストについては、リージョン エンドポイントをご覧ください。
- 米国:
- プラットフォームに応じて
creds_file_pathを調整します。- Linux:
/etc/bindplane-agent/ingestion-auth.json
- Linux:
構成ファイルを保存する
- 編集が完了したら、ファイルを保存します。
- Linux:
Ctrl+O、Enter、Ctrl+Xの順に押します。
- Linux:
Bindplane エージェントを再起動して変更を適用する
Linux で Bindplane エージェントを再起動するには、次のコマンドを実行します。
sudo systemctl restart observiq-otel-collectorサービスが実行されていることを確認します。
sudo systemctl status observiq-otel-collectorログでエラーを確認します。
sudo journalctl -u observiq-otel-collector -f
Red Hat Directory Server で監査と監査失敗のロギングを有効にする
デフォルトでは、Red Hat Directory Server はアクセス、エラー、セキュリティのロギングを有効にしますが、監査と監査失敗のロギングは無効にします。これらのログを有効にすると、ディレクトリの変更と失敗したオペレーションをすべてキャプチャできます。
- ディレクトリ サーバー ホストで、root 権限または sudo 権限でターミナルを開きます。
次のコマンドを実行して、監査ログを有効にします。
dsconf -D "cn=Directory Manager" instance_name config replace nsslapd-auditlog-logging-enabled=on次のコマンドを実行して、監査失敗ログを有効にします。
dsconf -D "cn=Directory Manager" instance_name config replace nsslapd-auditfaillog-logging-enabled=onすべてのログタイプが有効になっていることを確認します。
dsconf -D "cn=Directory Manager" instance_name config get nsslapd-accesslog-logging-enabled nsslapd-errorlog-logging-enabled nsslapd-auditlog-logging-enabled nsslapd-auditfaillog-logging-enabled nsslapd-securitylog-logging-enabledログファイルがログ ディレクトリに存在することを確認します。
ls -la /var/log/dirsrv/slapd-instance_name/
省略可: ウェブ コンソールを使用してロギングを有効にする
- Red Hat Directory Server のウェブ コンソールにログインします。
- インスタンスを選択します。
- [Server] > [Logging] に移動します。
- 有効にするログタイプ([監査ログ] など)を選択します。
- 選択したログタイプのロギングを有効にします。
- [ログ設定を保存] をクリックします。
ディレクトリ サーバーログを Bindplane エージェントに転送するように rsyslog を構成する
Red Hat Directory Server は、Syslog に直接ではなく、/var/log/dirsrv/slapd-instance_name/ のファイルにログを書き込みます。rsyslog imfile モジュールを使用して、これらのログファイルをモニタリングし、エントリを Bindplane エージェントに転送します。
ディレクトリ サーバーのログ転送用に新しい rsyslog 構成ファイルを作成します。
sudo nano /etc/rsyslog.d/rhds-forward.conf構成ファイルに次の内容を追加します。
# Load the imfile module to read log files module(load="imfile" PollingInterval="10") # Monitor the access log input(type="imfile" File="/var/log/dirsrv/slapd-instance_name/access" Tag="dirsrv-access" Severity="info" Facility="local6") # Monitor the error log input(type="imfile" File="/var/log/dirsrv/slapd-instance_name/errors" Tag="dirsrv-errors" Severity="err" Facility="local6") # Monitor the audit log input(type="imfile" File="/var/log/dirsrv/slapd-instance_name/audit" Tag="dirsrv-audit" Severity="info" Facility="local6") # Monitor the security log input(type="imfile" File="/var/log/dirsrv/slapd-instance_name/security" Tag="dirsrv-security" Severity="info" Facility="local6") # Forward all Directory Server logs to the Bindplane agent local6.* @BINDPLANE_IP:514rsyslog 構成の構文を確認します。
sudo rsyslogd -N1rsyslog サービスを再起動して変更を適用します。
sudo systemctl restart rsyslogBindplane エージェントのログを確認して、Directory Server のログが転送されていることを確認します。
sudo journalctl -u observiq-otel-collector -f
UDM マッピング テーブル
| ログフィールド | UDM マッピング | ロジック |
|---|---|---|
attrs_label |
about.labels |
統合済み |
cn_label |
about.labels |
統合済み |
conn_label |
about.labels |
統合済み |
csn_label |
about.labels |
統合済み |
err_label |
about.labels |
統合済み |
etime_label |
about.labels |
統合済み |
fd_label |
about.labels |
統合済み |
filter_label |
about.labels |
統合済み |
label |
about.labels |
統合済み |
method_label |
about.labels |
統合済み |
msgid_label |
about.labels |
統合済み |
name_label |
about.labels |
統合済み |
nentries_label |
about.labels |
統合済み |
offset_label |
about.labels |
統合済み |
op_label |
about.labels |
統合済み |
optime_label |
about.labels |
統合済み |
org_label |
about.labels |
統合済み |
ou_label |
about.labels |
統合済み |
scope_label |
about.labels |
統合済み |
slot_label |
about.labels |
統合済み |
tag_label |
about.labels |
統合済み |
targetop_label |
about.labels |
統合済み |
version_label |
about.labels |
統合済み |
wtime_label |
about.labels |
統合済み |
desc |
metadata.description |
直接マッピングされます。 |
creationDate |
metadata.event_timestamp |
UNIX_MS として解析済み |
recordDate |
metadata.event_timestamp |
UNIX_MS として解析 |
time |
metadata.event_timestamp |
dd/MMM/yyyy:HH:mm:ss Z として解析 |
ts |
metadata.event_timestamp |
MMM d HH:mm:ss として解析済み |
operation |
metadata.product_event_type |
直接マッピングされます。 |
mrId |
metadata.product_log_id |
直接マッピングされます。 |
properties._ecs_agent_version |
metadata.product_version |
直接マッピングされます。 |
host |
principal.asset.hostname |
直接マッピングされます。 |
oid |
principal.asset.product_object_id |
直接マッピングされます。 |
host |
principal.hostname |
直接マッピングされます。 |
client_ip |
principal.ip |
統合済み |
namespace |
principal.namespace |
直接マッピングされます。 |
user |
principal.user.userid |
直接マッピングされます。 |
sec_result |
security_result |
統合済み |
properties._hostname |
target.asset.hostname |
直接マッピングされます。 |
properties.host |
target.asset.hostname |
直接マッピングされます。 |
properties._hostname |
target.hostname |
直接マッピングされます。 |
properties.host |
target.hostname |
直接マッピングされます。 |
target_ip |
target.ip |
統合済み |
properties.country |
target.location.country_or_region |
直接マッピングされます。 |
properties._file_path |
target.process.file.full_path |
直接マッピングされます。 |
properties._file_size |
target.process.file.size |
名前変更済み/マッピング済み |
discipline_label |
target.resource.attribute.labels |
統合済み |
document_type_label |
target.resource.attribute.labels |
統合済み |
environment_label |
target.resource.attribute.labels |
統合済み |
hostgroup_label |
target.resource.attribute.labels |
統合済み |
platform_label |
target.resource.attribute.labels |
統合済み |
product_label |
target.resource.attribute.labels |
統合済み |
project_label |
target.resource.attribute.labels |
統合済み |
base |
target.user.group_identifiers |
統合済み |
dn |
target.user.group_identifiers |
統合済み |
| なし | metadata.event_type |
定数: NETWORK_CONNECTION |
| なし | metadata.product_name |
定数: REDHAT_DIRECTORY_SERVER |
| なし | metadata.vendor_name |
定数: REDHAT |
| なし | target.platform |
定数: LINUX |
properties._file_inode |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
properties._file_offset |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
conn |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
op |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
err |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
tag |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
nentries |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
wtime |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
optime |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
etime |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
csn |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
cn |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
ou |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
filter |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
attrs |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
scope |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
o |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
targetop |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
msgid |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
method |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
version |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
fd |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
slot |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
name |
event.idm.read_only_udm.additional.fields |
変更履歴からマッピング |
properties.discipline" ,"properties.document_type" ,"properties.environment" ,"properties.hostgroup" ,"properties.platform" ,"properties.product |
target.resource.attribute.labels |
変更履歴からマッピング |
変更ログ
さらにサポートが必要な場合 コミュニティ メンバーや Google SecOps のプロフェッショナルから回答を得ることができます。