Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ECSでGuardDutyのRuntime Monitoringを使ってみる
Search
Pretzelisa
January 20, 2024
0
200
ECSでGuardDutyのRuntime Monitoringを使ってみる
JAWS-UG横浜 #68 AWS re:Invent 2023 Recap Containerで発表
Pretzelisa
January 20, 2024
Tweet
Share
More Decks by Pretzelisa
See All by Pretzelisa
カスタムベクトルストアでRAGワークフローをカスタマイズする
risako
1
100
2023/11/30 JAWS-UG CLI支部
risako
0
67
Lambdaでカスタムウィジェットを作ろう
risako
0
130
ノイジーネイバーにさようなら FSx for NetApp ONTAP の QoS 機能~
risako
0
46
コマンドで楽々!リソースをTerraformコードにエクスポート
risako
0
85
徹底比較!RDS&RDSCustom@20230926_JAWS朝会#49
risako
2
160
Featured
See All Featured
Debugging Ruby Performance
tmm1
70
11k
Imperfection Machines: The Place of Print at Facebook
scottboms
261
12k
Facilitating Awesome Meetings
lara
43
5.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
GitHub's CSS Performance
jonrohan
1025
450k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Designing the Hi-DPI Web
ddemaree
276
33k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
Embracing the Ebb and Flow
colly
80
4.2k
The Cost Of JavaScript in 2023
addyosmani
21
4k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Transcript
ECSでGuardDutyのRuntime Monitoringを使ってみる 2024/1/20 JAWS-UG横浜 #68 AWS re:Invent 2023 Recap Container
齋藤理沙子
自己紹介 齋藤理沙子 オンプレからクラウドまで、インフラまわり色々 2023 Japan AWS Jr. Champions 2023 Japan
AWS All Certifications Engineers 好きなサービス:FSx for NetApp ONTAP 2
re:Invent2023でのアップデート コンテナセキュリティ Amazon GuardDutyのRuntime Monitoring機能が Amazon Elastic Container Service(ECS) でも利用できるようになった
※Amazon Elastic Compute Cloud(EC2)での利用はプレビュー 3
GuardDutyをざっとおさらい AWSサービスからのデータを分析し、 潜在的な脅威を検出するサービス 検出には攻撃者が使用する既知のIPアドレスや ドメインのリスト、機械学習を用いる 4
GuardDutyのRuntime Monitoringとは OSレベルのイベント(※)を監視し、 潜在的な脅威を検出するGuardDutyの機能 ※ファイルアクセス、プロセス実行、ネットワーク接続など Amazon GuardDutyユーザーガイド「GuardDuty Runtime Monitoring」 https://docs.aws.amazon.com/ja_jp/guardduty/latest/ug/runtime-monitoring.html
5
これまでのECS監視(マネージドサービス) VPCフローログとDNSログを監視 例: ランタイムの観点では、Command&ControlCenter(C&C)と 通信しているインスタンスIDの特定はできるが、 どのプロセスがC&Cサーバと通信しているのかは分からない コンテナの観点では、どのコンテナイメージに 脆弱性があるのかまでは特定することができない
6
Runtime Monitoringを使うメリット 不審なアクティビティのプロセスIDが分かる どのコンテナイメージに脆弱性があるか 特定することができる →脅威の早期検出がしやすくなった 7
Runtime Monitoringで検出できる アクティビティの例 Backdoor:Runtime/C&CActivity.B コンテナ(orEC2)がC&Cサーバに関連付けられた IP をクエリしている CryptoCurrency:Runtime/BitcoinTool.B
EC2インスタンス/コンテナで暗号通貨関連のIPアドレスを クエリしている DefenseEvasion:Runtime/FilelessExecution メモリからコードを実行している(インメモリ攻撃の可能性) Trojan:Runtime/BlackholeTraffic ブラックホール の IP アドレスと通信しようとしている 8
ランタイムの脅威を検出した後 GuardDutyでの検出結果を AWS Security Hub, Amazon EventBridge, Amazon Detectiveと連携させることも可能 Amazon
DetectiveがECS Runtime Monitoringもサポートする ようになった(re:Invent 2023期間中に発表) AWS「Amazon Detective が Amazon GuardDuty ECS ランタイムモニタリングの セキュリティ調査をサポート」 https://aws.amazon.com/jp/about-aws/whats-new/2023/11/amazon-detective- security-guardduty-ecs-monitoring/ 9
Runtime Monitoringを有効にしてみる 10 EC2 instance supportはプレビューで、 agentの自動設定は利用できない
サイドカーコンテナが立ち上がる サイドカーコンテナはタスク内の各コンテナに接続される コンテナ内でGuardDuty セキュリティエージェントが実行され、 各コンテナのランタイムイベントを収集する タスクが実行中の場合はサイドカーコンテナはデプロイされない タスクをいったん停止->再開することでデプロイされる 11
エージェントの仕組み(Fargate) 12 プライベートリポジトリでRuntime Monitoring Agentが 保管されている (パッチ当てやアップグレードはAWS側で行われる)
エージェントの仕組み(Fargate) 13 新しいタスクを開始すると最新のイメージがECRから pullされて、タスク内で実行される (ので、 ECSのタスク実行ロールで、ECRからのpullの許可が必要) pull
ECSで不審なアクティビティを行う DNSクエリの方法は以下を参考にさせていただきました クラスメソッド「【総まとめ】GuardDutyによるコンテナランタイム脅威検知の注意事項と設定手順と検出 の様子 #AWSreInvent」 https://dev.classmethod.jp/articles/ecs-fargate-runtime-detection/ 暗号通貨アクティビティに関連付けられているドメイン名にDNSクエリを行う (dig pool.supportxmr.com +short)
14
GuardDutyコンソールの検出結果に あがってくる 15
検出内容の詳細 16 プロセス名・ID、 実行ファイルのパス・ SHA-256ハッシュなどを 確認できる
まとめ ECSでGuardDuty Runtime Monitoringが利用可能に →マネージドサービスでランタイムアクティビティを 監視し、プロセスやコンテナイメージ単位で 脅威検出ができるようになった 17
参考サイト AWS re:Invent 2023 - Introducing GuardDuty ECS Runtime Monitoring,
including AWS Fargate (SEC239) https://www.youtube.com/watch?v=nuMOaQctNgE&t=1360s AWS「Amazon Detective が Amazon GuardDuty ECS ランタイムモニタリングの セキュリティ調査をサポート」 https://aws.amazon.com/jp/about-aws/whats-new/2023/11/amazon- detective-security-guardduty-ecs-monitoring/ クラスメソッド「【総まとめ】GuardDutyによるコンテナランタイム脅威検知の注意事項と設定 手順と検出の様子 #AWSreInvent」 https://dev.classmethod.jp/articles/ecs-fargate-runtime-detection/ Amazon GuardDutyユーザーガイド「GuardDuty Runtime Monitoring」 https://docs.aws.amazon.com/ja_jp/guardduty/latest/ug/runtime- monitoring.html 18