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

AWS Well-Architected な インシデントレスポンスを実装しよう / Impl...

Avatar for Masanori Yamaguchi Masanori Yamaguchi
June 25, 2025
280

AWS Well-Architected な インシデントレスポンスを実装しよう / Implementing Incident Response with AWS Well-Architected

AWS Summit Japan 2025 登壇資料です

Avatar for Masanori Yamaguchi

Masanori Yamaguchi

June 25, 2025
Tweet

More Decks by Masanori Yamaguchi

Transcript

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

    rights reserved. © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Well-Architected な インシデントレスポンスを実装しよう 山口 正徳 AWS Community Hero JAWS-UG 千葉支部 C O M M U N I T Y S T A G E – D A Y 1
  2. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 山口 正徳 フォージビジョン株式会社 JAWS-UG千葉支部運営メンバー グローバル認定/表彰 ・AWS Community HERO ・AWS Ambassador ・APJ AWS Community Leaders Award 2回受賞(2022、2024) ・AWS Gold Jacket Club 日本国内認定/表彰 ・AWS Samurai 2020 ・Japan AWS Top Engineer 2019 – 2023 ・APN ALL AWS Certifications Engineers 2023 – 2024 自己紹介
  3. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS Well-Architected Framework - セキュリティの柱 01 セキュリティ基盤 05 データ保護 02 Identity and access management 06 インシデントへの対応 03 検出 07 アプリケーションの セキュリティ 04 インフラストラクチャの 保護
  4. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. What’s this number? 943,600,000 件 2,400,000,000,000 件 過去6ヶ月の悪意あるスキャンの阻止件数 S3オブジェクトに対する不正な暗号化の試み (阻止数)
  5. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. なぜインシデントレスポンスが重要なのか • セキュリティインシデントは「いつか起きるもの」ではなく、 「いつでも起こり得るもの」。 • インシデントが発生してから対応を開始するのでは遅い。 • インシデントは発生する前提で、常に対応の準備をしておく必要がある。 • AWS Well-Architected Framework - セキュリティの柱では、 インシデント対応はライフサイクルを意識して計画すべきものと定義されている。
  6. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. インシデントレスポンスのライフサイクル AWS Well-Architected Framework - Security Pillar https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/aspects-of-aws-incident-response.html
  7. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 復旧までのインシデントレスポンスオペレーション 封じ込め 検証 収集 分析 セキュリティイン シデントの拡大と 影響を最小限に抑 える 調査と分析のため に証拠を取得し、 保全する 収集した証拠から 侵害の兆候を特定 する 検証結果をもとに、 影響範囲とインシ デントの全体像を 把握する これらの作業は迅速かつ正確に、ミスなく実行する必要があります。
  8. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「封じ込め」の手順が紹介されているドキュメント AWS Well-Architected Framework - Security Pillar https:// docs.aws.amazon.com/ja_jp/wellarchitected/latest/security-pillar/operations.html AWS Security Incident Response User Guide https://docs.aws.amazon.com/ja_jp/security-ir/latest/userguide/containment.html AWS Prescriptive Guidance https://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/automate-incident-response-and-forensics.html AWS Security Incident Response Technical Guide https://docs.aws.amazon.com/ja_jp/whitepapers/latest/aws-security-incident-response-guide/infrastructure-domain- incidents.html AMS Advanced User Guide https://docs.aws.amazon.com/ja_jp/managedservices/latest/userguide/sir-contain.html
  9. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 各ドキュメントに共通する 「封じ込め」手順 ✓ セキュリティグループによるリソースの隔離 ✓ ネットワークACLや隔離用VPCによるネットワーク分離 ✓ IAMユーザー、ロール、ポリシーの無効化 ✓ アクセスキー、APIキー、パスワードのローテーション ✓ 公開された認証情報や機密データの削除 ✓ 侵害されたコンピュートリソースの終了・停止・削除 ✓ 影響を受けたリソースへのパブリックアクセスの制限 ✓ オートスケーリンググループおよびロードバランサーからのデタッチ ✓ Amazon S3 バケットポリシーによるアクセスブロック
  10. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「収集」の手順が紹介されているドキュメント AWS Well-Architected Framework - Security Pillar https://docs.aws.amazon.com/ja_jp/wellarchitected/latest/security-pillar/operations.html AWS Security Incident Response User Guide https://docs.aws.amazon.com/ja_jp/security-ir/latest/userguide/operations.html https://docs.aws.amazon.com/ja_jp/security-ir/latest/userguide/capture-backups-and-snapshots.html https://docs.aws.amazon.com/ja_jp/security-ir/latest/userguide/appendix-b-incident-response-resources.html#forensic- resources https://docs.aws.amazon.com/ja_jp/security-ir/latest/userguide/collect-relevant-artifacts.html AWS Prescriptive Guidance https://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/automate-incident-response-and-forensics.html
  11. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「収集」の手順が紹介されているドキュメント (続き) AWS Security Incident Response Technical Guide https://docs.aws.amazon.com/ja_jp/whitepapers/latest/aws-security-incident-response-guide/infrastructure-domain- incidents.html https://docs.aws.amazon.com/ja_jp/whitepapers/latest/aws-security-incident-response-guide/capturing-volatile- data.html https://docs.aws.amazon.com/ja_jp/whitepapers/latest/aws-security-incident-response-guide/using-aws-systems- manager.html https://docs.aws.amazon.com/ja_jp/whitepapers/latest/aws-security-incident-response-guide/automating-the- capture.html AMS Advanced User Guide https://docs.aws.amazon.com/ja_jp/managedservices/latest/userguide/sir-contain.html
  12. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 各ドキュメントに共通する 「収集」手順 ✓ インスタンスの終了保護を有効化 ✓ Amazon EBS データボリュームのスナップショットを作成 ✓ インスタンスメタデータを収集 ✓ メモリを取得 ✓ ライブレスポンスを実行し、アーティファクト(ディスク、メモリ、 ログ)を収集
  13. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. インシデントレスポンス準備における課題 AWSの公式ドキュメントでも、インシデントレスポンスの手順は複数の 資料に分散して記載されています。 さらに、ドキュメントごとに手順が少しずつ異なるため、全体像を把握 するのは容易ではありません。 本セッションでは、チャレンジとして、各ドキュメントに共通して求め られる「封じ込め」と「収集」の必須手順を整理します。
  14. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「封じ込め」の必須タスク 封じ込め セキュリティイン シデントの拡大と 影響を最小限に抑 える 01 調査中であることを示すタグを インスタンスに付与 02 IAMインスタンスプロファイルを デタッチ 03 Auto Scaling Groupから デタッチ 04 ターゲットグループから登録解除 05 隔離用セキュリティグループを アタッチ
  15. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「封じ込め」の必須タスク リファレンス(参照元) 01 調査中であることを示すタグを インスタンスに付与 ・AMS Advanced User Guide ・AWS Prescriptive Guidance ・AWS Security Incident Response Technical Guide 02 IAMインスタンスプロファイルを デタッチ ・AMS Advanced User Guide ・AWS Prescriptive Guidance 03 Auto Scaling Groupからデタッチ ・AWS Security Incident Response Technical Guide 04 ターゲットグループから登録解除 ・AMS Advanced User Guide ・AWS Security Incident Response Technical Guide 05 隔離用セキュリティグループを アタッチ ・AWS Well-Architected Framework - Security Pillar ・AMS Advanced User Guide ・AWS Prescriptive Guidance ・AWS Security Incident Response Technical Guide
  16. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「封じ込め」の必須タスク AWS Cloud Virtual private cloud (VPC) Availability Zone 1 NAT gateway Availability Zone 2 NAT gateway Auto Scaling group Instance Instance Application Load Balancer Target Group EBS volumes EBS volumes Security group Security group 調査中であることを 示すタグを インスタンスに付与 ① ① IAMインスタンスプ ロファイルを デタッチ ② ② AutoScaling Groupから 登録解除 ③ ③ ターゲット グループから 登録解除 ④ ④ 隔離用 セキュリティ グループを アタッチ ⑤ ⑤ Role Role
  17. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「収集」の必須タスク 01 インスタンスメタデータを取得 02 インスタンスの終了保護と停止保護 を有効化 03 EBSボリュームの DeleteOnTermination を無効化 04 インスタンスにアタッチされている EBS ボリュームのスナップショット を作成 収集 調査と分析のため に証拠を取得し、 保全する
  18. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「収集」の必須タスク リファレンス(参照元) 01 インスタンスメタデータを取得 ・AWS Security Incident Response User Guide ・AWS Security Incident Response Technical Guide ・AMS Advanced User Guide 02 インスタンスの終了保護と 停止保護を有効化 ・AWS Security Incident Response User Guide ・AWS Security Incident Response Technical Guide 03 EBSボリュームの DeleteOnTermination を無効化 ・AWS Security Incident Response User Guide 04 インスタンスにアタッチされている EBS ボリュームのスナップショット を作成 ・AWS Security Incident Response User Guide ・AWS Prescriptive Guidance ・AWS Security Incident Response Technical Guide ・AMS Advanced User Guide
  19. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「収集」の必須タスク AWS Cloud Virtual private cloud (VPC) Availability Zone 1 NAT gateway Availability Zone 2 NAT gateway Auto Scaling group Instance Instance Application Load Balancer Target Group EBS volumes EBS volumes Security group Security group インスタンスメタ データを取得 ① ① インスタンスの終了 保護と停止保護を 有効化 ② EBSボリュームの DeleteOnTermina tion を無効化 ③ ③ インスタンスにア タッチされている EBS ボリュームの スナップショット を作成 ④ ④ Role Role ②
  20. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 必須タスクの手順はどう準備すればよいか? ツールキット を用意する 手順書による 手作業 自動化
  21. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. インシデントレスポンスにおける自動化の重要性 侵害発生時の時間的なプレッシャーや精神的なストレスは ヒューマンエラーのリスクを大きく高める要因となる。 ミスを起こした場合、復旧や影響範囲の調査に必要な情報の 消失だけではなく、2次障害などにつながる可能性もある。 AWS規範ガイダンスでも、インシデントレスポンスやフォレン ジック作業の自動化が強く推奨されている。
  22. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS 規範ガイダンス https://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/automate-incident-response-and-forensics.html
  23. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 自動化のオプション 本セッションで重要視するポイント: • 高度なスキルセットを必要と しないこと • 実行状況が可視化できること • メンテナンスが容易であること https://docs.aws.amazon.com/ja_jp/whitepapers/latest/aws-security-incident-response-guide/options-for-automating-response.html
  24. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS Lambda AWS Step Functions Technical skillset プログラミングスキルが必要 (Python, Node.js, etc.) プログラミングスキルは不要 (ワークフロースタジオを利用可) Workflow 主にシングルタスク向け ワークフローオーケストレーション 機能を備えている Visualization 処理状況の理解はログ出力など の実装に依存する ステートマシンの実行状況を可視化 する機能を備えている Flexibility プログラミング言語で表現 できる処理は実装可能 SDK統合、組み込み関数の場合の 範囲で実装する必要がある Maintenance コードを理解する必要がある ワークフロースタジオで処理全体を 把握することができる Speed 速い 速い AWS Lambda と AWS Step Functions のどちらを利用するか
  25. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. State Machine for Essential Incident Response Tasks
  26. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. State Machine for Essential Incident Response Tasks EC2インスタンスへのタグ付与 EC2インスタンスメタデータの 取得 指定したEC2インスタンスIDの データセット分を並列起動 EBSスナップショット 取得 EBSスナップショット 暗号化 非暗号化 EBSスナップショット の削除 EBSスナップショット へのタグ付与 DeleteOnTerminate 無効化 IAMインスタンス プロファイルの確認 IAMインスタンス プロファイルの デタッチ AutoScaling Group のアタッチ確認 AutoScaling Group からのデタッチ ターゲットグループ の登録状況確認 ターゲットグループ からの解除 EC2インスタンスに アタッチされている ENIの確認 ENIごとに 隔離用セキュリティ グループの作成 隔離用セキュリティ グループの付け替え EC2インスタンス終了保護と 削除保護の有効化
  27. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「封じ込め」と「収集」の必須タスク 01 調査中であることを示すタグをイ ンスタンスに付与 05 EBSボリュームの DeleteOnTermination を無効化 02 インスタンスの終了保護と停止保 護を有効化 06 IAMインスタンスプロファイルを デタッチ 03 インスタンスメタデータを取得 07 AutoScaling Groupからデタッチ 04 インスタンスにアタッチされてい る EBS ボリュームのスナップ ショットを作成 08 ターゲットグループから登録解除 09 隔離用セキュリティグループを アタッチ
  28. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 調査中であることを示すタグをインスタンスに付与 • インシデント対応中のインスタ ンスにタグを付けてステータス を管理します。 • CheckTag ステートはタグの設 定を確認し、設定されていない 場合は異常終了します。
  29. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. インスタンスの終了保護と停止保護を有効化 • 強制終了や削除を防ぐために、イン スタンスの終了保護を有効化します。 • シャットダウン動作を「停止」に 設定し、終了しないようにします。 • すべての設定が正しく適用されてい ることを確認し、いずれかが未設定 であれば異常終了します。
  30. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. インスタンスメタデータを取得 • 侵害時の状態を後から調査できるよう、 インスタンスメタデータを取得します。 • 取得したメタデータは、ステート マシンの実行結果に記録されます。 • メタデータには、インスタンスID、 タイプ、IPアドレス、VPC/サブネッ トID、リージョン、AMI ID、アタッ チされているセキュリティグループ、 起動時刻などが含まれます。
  31. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 「封じ込め」と「収集」の必須タスク 01 調査中であることを示すタグをイ ンスタンスに付与 05 EBSボリュームの DeleteOnTermination を無効化 02 インスタンスの終了保護と停止保 護を有効化 06 IAMインスタンスプロファイルを デタッチ 03 インスタンスメタデータを取得 07 オートスケーリンググループから デタッチ 04 インスタンスにアタッチされてい る EBS ボリュームのスナップ ショットを作成 08 ターゲットグループから登録解除 09 隔離用セキュリティグループをア タッチ 04 から 09 は並列実行
  32. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Parallel state による並列実行
  33. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. インスタンスにアタッチされている EBS ボリュームのスナップ ショットを作成 • インスタンスにアタッチされて いるすべての EBS ボリュームの スナップショットを取得します。 • スナップショットが暗号化 されていることを確認します。 • スナップショットには インシデント対応中タグを 付与します。
  34. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. EBSボリュームの DeleteOnTermination を無効化 • すべての EBS ボリュームで DeleteOnTermination 属性を 無効にします。 • 設定が適用されていることを 確認した後、処理を終了します。
  35. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. IAMインスタンスプロファイルをデタッチ • 他の AWS リソースへのアクセ スを防ぐため、インスタンスプ ロファイルをデタッチします。 • 対象のインスタンスから他の AWSサービスにアクセスされる ことを防ぎます。 ※一時トークンの無効化処理も 実装予定
  36. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AutoScaling Groupからデタッチ • 侵害されたインスタンスをオー トスケーリンググループからデ タッチします。 • オートスケーリンググループに よるインスタンスの終了を防ぐ だけでなく、調査対象のインス タンスを取り除き正常なインス タンス数に戻す効果もあります。
  37. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. オートスケーリンググループからデタッチ • 侵害されたインスタンスをオー トスケーリンググループからデ タッチします。 • オートスケーリンググループに よるインスタンスの終了を防ぐ だけでなく、調査対象のインス タンスを取り除き正常なインス タンス数に戻す効果もあります。
  38. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ターゲットグループから登録解除 • インスタンスがターゲット グループに登録されている場合 は、ロードバランサーからのト ラフィック振り分けを防ぐため 登録を解除します。 • 調査対象のインスタンスがリク エストに応答することを防ぎま す。
  39. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 隔離用セキュリティグループをアタッチ • すべての ENI からセキュリティ グループをデタッチし、隔離用 セキュリティグループを適用し ます。 • 隔離用のセキュリティグループ は、送信・受信の許可ルールが 一切ないセキュリティグループ を使用します。
  40. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. (オプション) OSに存在する揮発性情報の収集 • アプリケーションやオペレーティング システムによってメモリに保存・ キャッシュされているデータを取得 します。 • インスタンスストアボリュームがある 場合は、バックアップを作成します。 • この処理には、AWS Systems Manager Run Command を使用して OS コマンドを実行する権限が必要 です。
  41. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. まとめ • セキュリティインシデントは発生することを前提に準備しておく • インシデント発生時に実行するプレイブック(手順)のうち 必須手順は自動化することで備える • 自動化のための仕組みは属人化せずに継続的にメンテナンス できることを考える • “State Machine for Essential Incident Response Tasks”を使って あなたの環境にもAWS Well-Architectedなインシデントレスポンスを!
  42. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. State Machine for Essential Incident Response Tasks https://github.com/masanoriyamaguchi/Well-Architected-incident-response-state-machine GitHubで公開しています。 (Future plan) ・一時トークンの無効化 ・OS揮発性データの取得
  43. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Thank you! Thank you! 山口 正徳 @kinunori linkedin.com/in/kinunori github.com/masanoriyamaguchi