More Related Content Similar to Security Operations and Automation on AWS
Similar to Security Operations and Automation on AWS (20) More from Noritaka Sekiyama
More from Noritaka Sekiyama (9) Security Operations and Automation on AWS1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Noritaka Sekiyama / Senior Cloud Support Engineer (Big Data)
Amazon Web Services Japan
2018.07.05 / OpsSecJAWS #01
Security Operations and Automation on AWS
2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
関山 宜孝 (Noritaka Sekiyama)
Senior Cloud Support Engineer
- AWS サポートの中の人
- 専門は Big Data (EMR, Glue, Athena, …)
- もう一つの専門は CloudWatch
- OpsJAWS, JAWS-UG ビッグデータ支部に出没
Who I am...
@moomindani
3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Amazon CloudWatch
AWS CloudTrail
AWS Config
AWS Trusted Advisor
Amazon GuardDuty
Amazon Macie
Amazon Inspector
AWS WAF
AWS Firewall Manager
セキュリティや運用に関係性が深い AWS サービス
AWS Systems Manager
AWS Lambda
AWS Step Functions
AWS IAM
Amazon VPC
Amazon SNS
AWS Organizations
…
4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
適応型セキュリティアーキテクチャ
Gartner’s Adaptive Security Architecture
システムの要塞化・隔離
攻撃の抑制
問題の阻止
問題の検出
リスクの検証と優先付け
問題の抑制調査/フォレンジック
設計/モデル変更
回復/修復
定常状態の把握
攻撃の予測
事前のリスク分析
継続的
監視と分析
予測 防御
検知対応
5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
AWS サービスのマッピング
継続的
監視と分析
予測 防御
検知対応
Amazon
GuardDuty
Network
ACL
Security
Group
AWS WAFAWS Shield
Auto Scaling
Amazon
Macie
AWS CloudFormationAWS
Systems Manager
AWS
Config
Amazon InspectorAWS Step Functions Amazon SNS
AWS Lambda
AWS Trusted
Advisor
AWS
CloudTrail
Amazon Athena
Amazon
QuickSight
Amazon CloudWatch
IAM
6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
QuickSight と Athena を使った CloudTrail/VPC Flow
Logs に基づくセキュリティ分析
CloudWatch イベントバスによるセキュリティ自動化
Systems Manager と Config Aggregator によるコンプラ
イアンス管理
3つのユースケース
7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
QuickSight と Athena を使った
CloudTrail/VPC Flow Logs に
基づくセキュリティ分析
8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
AWSユーザの操作をロギング
• ユーザーのアクティビティ(API コール, コンソー
ルサインイン) を記録・トラッキング
• 管理イベントとデータイベント(S3/Lambda)の2
種類
ログデータは複数個所に保存し活用可能
• CloudTrail イベント履歴
(過去 90日間/管理イベントのみ)
• S3 (無期限)
• CloudWatch Logs (無期限)
AWS CloudTrail
AWS CloudTrail
9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
S3 上の複数のファイルに対して標準 SQL で
クエリ実行可能
• 分散処理エンジンとして Presto を利用
サーバーレスで運用コストがかからない
クエリでスキャンしたデータの分だけ従量課金
Amazon Athena
Amazon Athena
11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
AWS の各種サービスと統合された BI ツール
データの可視化、アドホック分析、ダッシュ
ボードの作成などをサポート
ユーザーによるアクセスについてのみセッショ
ン単位の料金で課金
Amazon QuickSight
Amazon QuickSight
16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
トラフィックをキャプチャ
• VPC のネットワークインタフェースとの間で行
き来する IP トラフィック情報をキャプチャ
ログデータは CloudWatch Logs に保管
• CloudWatch Logs の Vended Log 対象なので通常の
CloudWatch Logs 料金よりも割安
トラブルシューティングやセキュリティなど
の目的で利用可能
VPC Flow Log
VPC Flow Log
25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.version account-id interface-id srcaddr dstaddr srcport dstport protocol packets bytes start end action log-status
26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
最初は Athena フルスキャン or QuickSight で SPICE に
インポートするところからスタート
大規模でインクリメンタルに増大するログも対象にするなら
コストとパフォーマンスを最適化するために Glue による
ファイルフォーマット変換・パーティショニング推奨
• 参考: AWS Cloudtrail Logs を AWS Glue と Amazon
Quicksight 使って可視化する - AWS ブログ
https://aws.amazon.com/jp/blogs/news/streamline-aws-
cloudtrail-log-visualization-using-aws-glue-and-amazon-
quicksight-2/
本格運用に向けて
30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
CloudWatch イベントバスによる
セキュリティ自動化
31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
AWSサービスやリソースをモニタリング
• メトリクス: AWSサービスのメトリクスやカスタムメ
トリクスを保管、グラフ描画、再利用
• アラーム: メトリクスに対して設定し、閾値をもとにア
クション(SNS, AutoScaling, EC2)を実行
• ログ: AWSサービスのログやOS,アプリケーションのロ
グを保管、再利用
• イベント: AWS リソースの状態変化や API コール等の
イベントを契機に任意の処理や通知を実行
イベントバス
• アカウント間でイベントを送受信
Amazon CloudWatch
Amazon CloudWatch
32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
CloudWatch イベントの動作
EC2
ASG
CloudTrail
Application
Schedule
イベント
ルール
Lambda
SNS
SQS
Kinesis
Built-in
イベントソース ターゲット
Route53
Step function
SSM RunCommand
33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Auto Scaling イベント
AWS API の呼び出しイベント
AWS Batch イベント
CodeBuild イベント
CodeCommit イベント
CodeDeploy イベント
CodePipeline イベント
マネジメントコンソールサインインイベント
EBS イベント
EC2 イベント
OpsWorks のスタックイベント
Systems Manager イベント
Systems Manager パラメータストア
のイベント
イベントソース
Systems Manager設定コンプライアンスイベント
EC2 メンテナンスウィンドウのイベント
ECS イベント
EMR イベント
GameLift イベント
Glue イベント
GuardDuty イベント
Health イベント
KMS イベント
Macie イベント
スケジュールイベント
Server Migration Service イベント
AWS Trusted Advisor イベント
34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
EC2 インスタンス
Lambda 関数
Kinesis Data Streams
Kinesis Data Firehose
ECS タスク
SSM Run Command
SSM Automation
AWS Batch ジョブ
Step Functions ステートマシン
ターゲット
CodePipeline のパイプライン
CodeBuild プロジェクト
Inspector の評価テンプレート
SNS トピック
SQS キュー
組み込みターゲット
別の AWS アカウントのイベントバス
35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
イベントバスによるイベント集約と自動化
CloudWatch
Event Bus
CloudWatch
Event Bus
Trusted Advisor
Personal Health
Dashboard
Identity and Access
Management
36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
受信側でのイベントバス設定
• 送信側アカウントから送信されたイベントの受信を許可するようイベ
ントバスを設定
送信側のルール設定
• 受信側アカウントのイベントバスをターゲットとする 1 つ以上のルー
ルを設定
受信側のルール設定
• 送信側アカウントからのイベントに一致する 1 つ以上のルールを設定
アカウント間のイベント送受信に必要なステップ
37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
1. 受信側でのイベントバス設定
38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
2. 送信側のルール設定
39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
3. 受信側のルール設定
40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
例:Trusted Advisor イベント→Lambda/SNS
CloudWatch
Event Rule
CloudWatch
Event Rule
Trusted Advisor
セキュリティグループで
TCP/22 が 0.0.0.0 に対して
オープンになってます
Event Bus
Eメール通知
管理者アカウント 開発者アカウント
Amazon
SNS
AssumeRole して
開発者アカウントの
セキュリティグループを
変更して TCP/22 を
特定 IP レンジのみ許可
41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Lambda 関数コードサンプル (Python 3.6)
AssumeRole により子アカウントの一時クレデンシャルを取得
セキュリティグループの Ingress ルールを新しいIPレンジで再作成
Trusted Advisor -> (CloudWatch Events – Event Bus) -> Lambda
の経路で届いたイベントの JSON をパース
42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
まずはセキュリティ・運用の観点で重要なイベントを集めて
通知するところから
CloudWatch Events – Lambda 連携で変更系の対応をリア
ルタイムに実装する場合は、本番システムへの影響範囲等、
十分に事前検証する必要あり
本格運用に向けて
43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Systems Manager と
Config Aggregator による
コンプライアンス管理
44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
インフラストラクチャを可視化し制御
• システム設定、OSパッチレベル、ソフトウェア
インストール状況等をダッシュボードで確認可能
• メンテナンスやデプロイ等のタスクのオートメー
ションが可能
ハイブリッド環境の管理
• AWS 上のリソースだけでなくオンプレミスの
サーバーの管理も可能
AWS Systems Manager
AWS Systems Manager
45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
AWSリソースのレポジトリ情報から、リソー
スの変更履歴、構成変更を管理
• 構成情報は定期的にスナップショットとし
てS3に保存
• 必要に応じSNSを使った通知も可能
構成情報を元に、現在のシステムがあるべき
状態になっているかを評価
• AWS マネージド ルール
• カスタム ルール(Lambda Function)
AWS Config / Config Rules
AWS Config
46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
EC2 インベントリー管理
AWS Config
AWS
Config
AWS
Systems Manager
EC2
AWS
Config
AWS
Systems Manager
EC2
47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Security Operations and Automation on AWS
• AWS サービスをうまく活用して予測→防御→検知→対応のサイ
クルを回していきましょう
3つのユースケース
• QuickSight と Athena を使った CloudTrail/VPC Flow Logs に
基づくセキュリティ分析
• CloudWatch イベントバスによるセキュリティ自動化
• Systems Manager と Config Aggregator によるコンプライア
ンス管理
まとめ
49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
Editor's Notes 初めてAmazon 目黒オフィスに来られた方? 7:26
AWSの優れたモニタリングの仕組みを使い、どのように早くリスクを検知し、その仕組をどうスケールさせ、どう集約させるのかについてお話してきました。
アカウント間連携→CWE Bus
EventBase→CloudTrail
RuleBase→AWS Config