コンテンツにスキップ

Fluentd経由のSplunk Enterprise

本手順書では、WallarmとFluentdのデータ収集機能を統合し、イベントを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

Webhook flow

使用リソース

  • Splunk Enterprise(WEB URL https://109.111.35.11:8000およびAPI URL https://109.111.35.11:8088

  • Fluentd(Debian 11.x (bullseye)にインストールされ、URL https://fluentd-example-domain.comで利用可能)

  • EUクラウドのWallarm Consoleに管理者アクセス権があり、Fluentd統合の設定が可能

Wallarm Cloud IP addresses

To provide Wallarm Cloud access to your system, you may need a list of its public IP addresses:

35.235.66.155
34.102.90.100
34.94.156.115
35.235.115.105
34.94.85.217
34.94.51.234
34.102.59.122
34.94.238.72
34.141.230.156
34.91.138.113
34.90.114.134
35.204.127.78

Splunk EnterpriseおよびFluentdのサービスへのリンクは例示であるため、実際の応答はありません。

Splunk Enterpriseの設定

Fluentdのログは、Wallarm Fluentd logsという名称およびその他のデフォルト設定でSplunk HTTP Event Controllerに送信されます。

HTTP Event Collector Configuration

HTTP Event Controllerにアクセスするために、生成されたトークン f44b3179-91aa-44f5-a6f7-202265e10475 が使用されます。

Splunk HTTP Event Controllerの詳細な設定手順については、公式Splunkドキュメントを参照してください。

Fluentdの設定

Wallarmはwebhooks経由でFluentd中間データ収集機能にログを送信するため、Fluentdの設定は以下の要件を満たす必要があります。

  • POSTまたはPUTリクエストを受け付ける

  • HTTPSリクエストを受け付ける

  • パブリックURLを持つ

  • ログをSplunk Enterpriseへ転送する(この例では、splunk_hecプラグインを使用してログを転送します)

Fluentdはtd-agent.confファイルで設定されます。

  • 受信するwebhookの処理は、sourceディレクティブで設定されます:

    • トラフィックはポート9880に送信されます
    • FluentdはHTTPS接続のみを受け付けるように設定されています
    • 公開された信頼できるCAにより署名されたFluentd TLS証明書は、/etc/ssl/certs/fluentd.crtファイル内に配置されています
    • TLS証明書の秘密鍵は、/etc/ssl/private/fluentd.keyファイル内にあります
  • ログのSplunkへの転送およびログ出力は、matchディレクティブで設定されます:

    • すべてのイベントログはFluentdからコピーされ、出力プラグインfluent-plugin-splunk-hec経由でSplunk HTTP Event Controllerへ転送されます
    • Fluentdのログは、さらにJSON形式でコマンドラインに表示されます(コード行19~22)。この設定は、イベントがFluentd経由でログに記録されることを確認するために使用されます
<source>
  @type http # HTTPおよびHTTPSトラフィック用入力プラグイン
  port 9880 # 受信リクエスト用ポート
  <transport tls> # 接続処理の設定
    cert_path /etc/ssl/certs/fluentd.crt
    private_key_path /etc/ssl/private/fluentd.key
  </transport>
</source>
<match **>
  @type copy
  <store>
      @type splunk_hec # Splunk API経由でログを転送するための出力プラグイン fluent-plugin-splunk-hec
      hec_host 109.111.35.11 # Splunkホスト
      hec_port 8088 # Splunk APIポート
      hec_token f44b3179-91aa-44f5-a6f7-202265e10475 # HTTP Event Controllerトークン
    <format>
      @type json # 転送されるログの形式
    </format>
  </store>
  <store>
     @type stdout # コマンドラインにFluentdログを出力するための出力プラグイン
     output_type json # コマンドラインに出力されるログの形式
  </store>
</match>

設定ファイルの詳細な説明については、公式Fluentdドキュメントを参照してください。

Fluentd設定のテスト

Fluentdのログが作成され、Splunkへ転送されることを確認するために、PUTまたはPOSTリクエストをFluentdに送信することができます。

リクエスト例:

curl -X POST 'https://fluentd-example-domain.com' -H "Content-Type: application/json" -H "Authorization: Splunk f44b3179-91aa-44f5-a6f7-202265e10475" -d '{"key1":"value1", "key2":"value2"}'

Fluentdログ:
Fluentdログ

Splunkログ:
Splunkログ

Fluentd統合の設定

  • Webhooks are sent to https://fluentd-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

FluentdとのWebhook統合

Fluentd統合設定の詳細

テスト例

To test the configuration, a new user is added in Wallarm Console:

Adding user

Fluentdは次のようにイベントをログに記録します。

FluentdからSplunkへの新規ユーザのログ

Splunkのイベントには、次のエントリーが表示されます。

FluentdからSplunkへの新規ユーザカード

Splunk Enterpriseでイベントを整理しダッシュボードに表示する

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.

Splunk dashboard

To install the Wallarm application for Splunk:

  1. In the Splunk UI ➝ Apps find the Wallarm API Security application.

  2. 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.