Logstash経由でのSplunk Enterprise連携¶
本手順では、WallarmとデータコレクターLogstashを連携し、イベントをSplunkのSIEMシステムへ転送するための統合例を示します。
The most common logging scheme in complex systems consists of the following components:
-
Data collector: accepts logs from several sources and forwards logs to the SIEM system
-
SIEM system or log management systems: used to analyze logs and monitor the system status
使用リソース¶
-
Splunk Enterprise(WEB URL
https://109.111.35.11:8000
、API URLhttps://109.111.35.11:8088
) -
Logstash 7.7.0(Debian 11.x(bullseye)にインストール、
https://logstash.example.domain.com
で利用可能) -
EU cloudのWallarm Consoleへの管理者アクセス(Logstash統合の設定用)
Wallarm Cloud IP addresses
To provide Wallarm Cloud access to your system, you may need a list of its public IP addresses:
Splunk EnterpriseおよびLogstashのサービスへのリンクは例として記載しているため、応答しません。
Splunk Enterpriseの設定¶
Logstashのログは、名前をWallarm Logstash logs
とし、その他はデフォルト設定のままでSplunkのHTTP Event Controllerに送信します。
HTTP Event Controllerへのアクセスには、生成したトークン93eaeba4-97a9-46c7-abf3-4e0c545fa5cb
を使用します。
SplunkのHTTP Event Controllerのセットアップの詳細は、Splunk公式ドキュメントにあります。
Logstashの設定¶
Wallarmはwebhook経由で中継データコレクターLogstashにログを送信するため、Logstashの設定は次の要件を満たす必要があります。
-
POSTまたはPUTリクエストを受け付けること
-
HTTPSリクエストを受け付けること
-
公開URLを持つこと
-
Splunk Enterpriseへログを転送すること(本例では
http
プラグインを使用して転送)
Logstashはlogstash-sample.conf
ファイルで設定します:
-
受信webhookの処理は
input
セクションで設定します:- トラフィックはポート5044に送られます
- LogstashはHTTPS接続のみを受け付けるように設定します
- 公的に信頼されたCAが署名したLogstashのTLS証明書は
/etc/server.crt
に配置します - TLS証明書の秘密鍵は
/etc/server.key
に配置します
-
Splunkへの転送とログ出力は
output
セクションで設定します:- LogstashからSplunkへはJSON形式でログを転送します
- すべてのイベントログはPOSTリクエストでLogstashからSplunkのAPIエンドポイント
https://109.111.35.11:8088/services/collector/raw
へ転送します。リクエストの認可にはHTTPS Event Collectorのトークンを使用します - さらに、(コードの15行目で)Logstashのログをコマンドラインにも出力します。この設定は、イベントがLogstash経由で記録されていることを確認するために使用します
設定ファイルの詳細はLogstash公式ドキュメントにあります。
Logstash設定のテスト
Logstashのログが作成されSplunkへ転送されていることを確認するには、LogstashにPOSTリクエストを送信します。
リクエスト例:
Logstash統合の設定¶
-
Webhooks are sent to
https://logstash.example.domain.com
-
Webhooks are sent via POST requests
-
The webhook integration has default advanced settings
-
Webhooks sent to Webhook URLs are all available events: hits, system events, vulnerabilities, scope changes
テストの例¶
To test the configuration, a new user is added in Wallarm Console:
Logstashはイベントを次のように記録します。
Splunkのイベントには次のエントリが表示されます。
ダッシュボードでイベントを整理して表示する¶
To get Wallarm events organized into a ready-to-use dashboard in Splunk 9.0 or later, you can install the Wallarm application for Splunk.
This application provides you with a pre-configured dashboard that is automatically filled with the events received from Wallarm. In addition to that, the application enables you to proceed to detailed logs on each event and export the data from the dashboard.
To install the Wallarm application for Splunk:
-
In the Splunk UI ➝ Apps find the
Wallarm API Security
application. -
Click Install and input the Splunkbase credentials.
If some Wallarm events are already logged in Splunk, they will be displayed on the dashboard, as well as further events Wallarm will discover.
In addition, you can fully customize the ready-to-use dashboard, e.g. its view or search strings used to extract data from all Splunk records.