2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[HTTPS復号編] Splunk Streamを使って http通信のWire Dataを可視化

Last updated at Posted at 2018-12-12

前置き

「Splunk Streamを使ってhttps通信のWire Dataを可視化」から続いて、今度はhttps通信をサーバーの秘密鍵を用いて復号したいと思います。

ポイント

  • Splunk Streamを使って、SSL復号が正常にできた場合、以下のstream:httpデータのように見えてきます。
スクリーンショット 2018-12-11 18.45.10.png

手順

参考元公式情報はこれだけ!Use SSL keys for decryption

  • まず、公開サーバの秘密鍵(privatekey)を手元に用意します。

  • 公開サーバの秘密鍵をSplunkサーバ上の任意のフォルダにアップロードします。

  • 秘密鍵をSplunk Stream Appに読み込ませて独自の鍵DBを作成します。

    • こちらのSplunk Stream紹介記事では Splunkサーバ(Deployment Server兼用)を使用しているため、鍵DBの作成はSplunkサーバにて実施します。
    • $SPLUNK_HOME/etc/apps/Splunk_TA_stream/linux_x86_64/bin配下に移動
      • 例: cd /opt/splunk/etc/deployment-apps/Splunk_TA_stream/linux_x86_64/bin
    • ./streamfwd --addsslkey <key_name> <pem_file> <password>コマンドを実行
      • *key_nameは任意。pem_fileは公開サーバの秘密鍵。passwordはパスワードなければ無しでも良し。
      • 例:./streamfwd --addsslkey serverA_key private.key
    • 成功すると以下のメッセージが表示される
      • 例:key 'serverA_key' added to /opt/splunk/etc/deployment-apps/Splunk_TA_stream/local/keystore.db
  • ~deployment-apps/Splunk_TA_streamを再度、Deployment Server経由でWebサーバに配布します。
    - # /opt/splunk/bin/splunk reload deploy-server

  • SSL復号テスト確認

    • QualysのSSL Server Testを利用すると、以下のようなデータが届きかつ、復号できていることがわかる。
    • スクリーンショット 2018-12-11 19.04.21.png

学びと課題点

  • Splunk Stream Appが復号をサポートしている鍵交換形式(kx)がRSAのみである点。
    • 今回一番苦労したのは、Webサーバ側のssl.confのSSLCipherSuiteを変更して、なるべくRSAベースの鍵交換を使っているSSLCipherSuiteをネゴシエート元のクライアントに利用させるためのWebサーバ側の設定確認に時間を使いました。
    • OSとブラウザの組み合わせによっては、 RSAベースの鍵交換を利用してくれないため、その場合、Streamでは復号できない制限があることもわかりました。
    • Splunk internalログを見ると、「cipher suiteが復号できない形式です」的なメッセージが出ています。
    • スクリーンショット 2018-12-12 10.24.09.png
    • 以上のことから、Webサーバ側でサポートしているCipher Suiteが広範囲(Diffie-Hellmanなども対応)の場合、全ての HTTPS通信を Splunk Streamで復号することは現実的にはできないことも分かりました。
    • Webリクエストの内、何割かは復号できないものもあることを理解した上でSSL復号機能とは付きあう必要がありそうです。

その他参考記事

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?