Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2023/09/14 Fin-JAWS #32 「SIEM on Amazon OpenSearch Serviceを1年運用してわかったこと」

JunjiKoide
September 14, 2023

2023/09/14 Fin-JAWS #32 「SIEM on Amazon OpenSearch Serviceを1年運用してわかったこと」

JunjiKoide

September 14, 2023
Tweet

More Decks by JunjiKoide

Other Decks in Technology

Transcript

  1. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SIEM on Amazon OpenSearch Serviceを 1年運用してわかったこと Fin-JAWS運営 小出 淳二
  2. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 自己紹介 小出 淳二 (こいで じゅんじ) 株式会社QUICK グループ統括CIO補佐 株式会社QES クラウドプラットフォーム本部 本部長補佐 Fin-JAWS 運営 E-JAWS 人材育成分科会運営 re:Invent歴:5回(2015,2016,2017,2019,2022) AWS認定13冠 趣味:海外旅行(渡航60ヵ国)世界遺産巡り
  3. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SIEM導入の背景 • ミッションクリティカルな株価配信サービス基盤を AWS へ移行し 1,500 台の仮想サーバーのクラウド化で 60% のサーバーコスト を削減 競合優位性の獲得に向けてクラウドネイティブ化を加速 https://aws.amazon.com/jp/solutions/case-studies/quick/ • 今後オンプレミスのさらに大規模な AWS 移行を予定している。 現状さまざまな課題があるので、 このタイミングで全社統合ログ分析基盤の構築を検討したい
  4. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. • リアルタイムなログ分析 現状のログ分析基盤はリアルタイムな集計や分析に対応していないため、 顧客のニーズやインサイトをいち早く捉えることが出来ない • トラブル発生時のログ調査 アプリケーション不具合、セキュリティインシデント等のトラブル発生時、 ログの調査に時間がかかり対応も属人的になっている • AWS サービスログの分析 Amazon Athena で SQL クエリー文を書く必要があり学習コストが高い ダッシュボードが準備されておらず分析等に有効活用できていない 当時の課題
  5. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 課題解決に向けて • 全社ログの集約 全社のログを一カ所に集約し、横串で相関分析できるようにする • データソースの拡充(アクセスログ、アプリログの取り込み) データソースの範囲を AWS 全サービスログ、OS、アクセスログ、 アプリケーションログ等に広げる • ログの可視化 ダッシュボードを見れば一目で社内システムの状況がわかるように、 ログを可視化する
  6. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SIEM基盤が出来ると何がうれしいのか トラブル対応(セキュリティインシデント等) トラブル発生時、迅速に原因を特定し対応することが出来る 学習コスト ダッシュボードと使い易い GUI を用意することにより、 学習コストが下がり、迅速な分析が可能になる データ活用 ログにおける様々なデータをニアリアルタイムに集約・収集・ 分析出来ることにより、サービスの機能改善や分析データの顧客 提供などデータの活用が促進できる
  7. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SIEM基盤の要件 • AWS 全サービスログ、OS、アクセスログ、アプリケーションログ等を取り込み ダッシュボードによる可視化が可能であること • ログの取り込みはマルチアカウントに対応していること • ニアリアルタイムな分析が可能であること • ログ監視基盤でもあること (柔軟なアラート設定が可能であること) • 1年は即時検索可能であること (1年経過したログは、Amazon S3 に保管し Amazon Athena で検索可能)
  8. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Amazon Elasticsearch Service における課題 どうやって Amazon Elasticsearch Service にログを取り込めばい いのか? ログの取り込みにコストが掛かる • AWS各サービスのログを取り込むためには、Amazon S3 または Amazon CloudWatch Logs に出力されたログを取り込む Logstash サーバを立てる必要がある • 各ログのフォーマットを分析して Logstash で ETL 処理するのは 正直つらい・・
  9. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 2020/10/23 SIEM on Amazon Elasticsearch Service (SIEM on Amazon ES) が オープンソースで公開!
  10. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SIEM on Amazon ES(現SIEM on Amazon OpenSearch Service)が課題をすべて解決!
  11. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SIEM on Amazon ES とは • AWS が OSS で公開している SIEM ソリューション • このソリューションを利用することで、AWS CloudTrail や VPC Flow Logs、 Amazon GuardDuty、OS などの各種ログの可視化やセキュリティ分析を行 う事が可能 • 各種ログが適切に正規化されている • マネージドサービスとサーバーレスの仕組みで作られていて運用が楽 • マルチアカウント、マルチリージョンのログ取り込みが可能 https://github.com/aws-samples/siem-on-amazon-elasticsearch- service/blob/main/README_ja.md
  12. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. なぜログ分析に Amazon Elasticsearch Service なのか? Kibana の操作性が秀逸(これに尽きる!) • 簡単な直感的な操作でログをフィルタリングして調査できる • アドホックな分析に強く、検索性能も高い • ダッシュボード作成も難易度は低い “ 学習コストが低いため、利用者への説明コストもかなり低くなった ”
  13. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Kibana(現 OpenSearch Dashboard) 画面 ❶全文検索機能 & 簡単操作でのフィルタリング ❷ 直 感 的 な フ ィ ー ル ド 選 択 ❹時間の範囲選択も簡単 ❸フィールド値の上位5位まで表示 SQL知識が無くても格納されているデータをすぐに把握できるのが最大の魅力
  14. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ユースケース コンテナアプリログ(ECS/Fargate)のログ取り込み
  15. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ※アプリケーション毎に Amazon Kinesis Data Firehose をデプロイ アプリケーション毎に Amazon S3 のファイルパスを分ける AWS Cloud Fargate Task Application A Firelens log Amazon Kinesis Data Firehose Fluent bit S3 Bucket Fargate Task Application B Firelens log Amazon Kinesis Data Firehose Fluent bit S3 Bucket AWS Cloud S3 Replication Time Control S3 Bucket S3 Bucket S3 Replication Time Control Amazon Elasticsearch Service es-loader es-loader ログ分析基盤アカウント
  16. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. アプリケーションログをJSONで出力してもらうことで、 アプリケーション独自のフィールドをOpenSearchに取り 込んでいる
  17. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 本番運用を1年以上やってわかったこと
  18. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 本番運用を1年以上やってわかったこと • 全AWSサービスログの取り込み、特にVPC Flowlogs はムリ 全取り込みしていたが、ログ全体の95%以上が VPC Flowlogsというよくわからない状況にw 大規模構成では、コスト見合いで必要なサブネット だけ取り込むとか、rejectだけ取り込むとか、あきら める、とかの工夫が必要
  19. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 本番運用を1年以上やってわかったこと • バージョンアップがつらい
  20. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 開発環境で週末に セキュリティパッチを適用 してみました(B/Gデプロイが走ります)
  21. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. パッチ適用に時間かかっても、B/Gデプロイだから Kibanaダッシュボードは普通に使えるんでしょ? Lambdaからのログ取り込みも問題ないんでしょ?
  22. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 3時間ほどKibanaダッシュボードが 使えませんでした・・・
  23. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. https://dev.classmethod.jp/articles/tsnote-opensearch-kibana-01/
  24. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. バージョン 1.3 → 2.5 へのバージョンアップ作業を 実施するにあたり、数時間のKibanaダッシュボード 利用不可に関して、利用者からは「どうにかしてほ しい」と申し入れがあった。
  25. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 対応策として、別アカウントにSIEMのコピーをもう 一面作成して、バージョンアップ中はそちらを参照 することにより、Kibanaダッシュボードのサービス 提供を継続!
  26. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ※利用者への案内
  27. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. OpenSearch別面構築は、手順化したため超簡単に構 築可能。今後設定変更の事前確認等でも活用予定。 なお、もう1面の追加費用は約80USD/日 ※r6g.2xlarge.search×3台、ストレージ3TB
  28. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. まとめ エンタープライズの AWS利用に関して、SIEM基盤構築は組 織や事業にとって非常に重要 バージョンアップ運用(セキュリティパッチ含む)は結構つ らい SIEM on Amazon OpenSearch Service は、AWS CloudFormation で手軽に導入可能なので是非ご活用いただ きたい! https://github.com/aws-samples/siem-on-amazon-opensearch- service/blob/main/README_ja.md
  29. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ご清聴ありがとうございました