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
AWS でのクラウド時代のログ活用
Search
Tsuyoshi Ito
May 29, 2024
Technology
680
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AWS でのクラウド時代のログ活用
OpsJAWS Meetup29 ロギング、ログ管理 での発表資料。
https://opsjaws.connpass.com/event/314570/
Tsuyoshi Ito
May 29, 2024
More Decks by Tsuyoshi Ito
See All by Tsuyoshi Ito
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
500
Other Decks in Technology
See All in Technology
toB プロダクトから見たWAF
tokai235
0
250
AI時代における最適なQA組織の作り方
ymty
3
170
Comment regagner la souveraineté de vos données tout en étant payé grâce à Nostr !
rlifchitz
0
220
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
150
BPaaSで進むAIオペレーションの現在地 AI実装が効く領域とスケーラビリティの選定と実装
kentarofujii
0
210
現場のトークンマネジメント
dak2
1
200
テスト設計の本質を改めて考えてみる~生成AIを活用する時代だからこそ、作ったテストの説明性を高めよう~
yamasaki696
1
140
徹底討論!ECS vs EKS!
daitak
3
1.8k
2026 AI Memory Architecture
nagatsu
0
580
Lightning近況報告
kozy4324
0
230
AWS Summit 2026で見えたSIerにとっての Amazon Quickの位置づけ
maf_0521
0
120
When Platform Engineering Meets GenAI
sucitw
0
200
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
55k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
260
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
490
Embracing the Ebb and Flow
colly
88
5.1k
エンジニアに許された特別な時間の終わり
watany
107
250k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
200
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
450
Transcript
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWS でのクラウド時代のログ活用 アマゾン ウェブ サービス ジャパン合同会社 O P S J A W S # 2 9 ソリューションアーキテクト 伊藤 威 (Tsuyoshi Ito) 1
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 自己紹介 • 名前 • 伊藤 威 (Tsuyoshi Ito) • 所属 • 主に通信業界のお客様をご支援 • ソリューションアーキテクト • 好きなサービス • Amazon CloudWatch 2
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. なぜログを集める必要があるのか? 短期・長期にわたりシステムの状態を 検知・検査ができるようにするため 数ある手段の中でどの方法を取るべきか? 3
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログ活用をデータ分析のフローで考える ログを集める目的「検知・検査」 “データ分析”の考え方に則り ログの収集・ログの蓄積・ログの分析 の流れで活用例を考える 4 3 © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 応⽤ (可視化等) データレイクを中⼼とした構成︓データの流れ • 多様な⽣データをデータレイクに蓄積 • データレイクの機能の1つに、前処理を含む 収集 データレイク 処理系 (DWH,RDB等) 応⽤ (可視化等) 収集&格納 処理系 (DWH,RDB等) カタログ (メタデータ) 変形・整形 (前処理) 蓄積 ⽣データ 整形・ 最適化済 AWSのETLソリューション紹介 より https://pages.awscloud.com/rs/112-TZM-766/images/AWS-ETL-Solutions-202107.pdf 収集 蓄積 分析
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. アジェンダ • AWS ではどんなログがあるのか • ログの収集 • ログの蓄積 • ログの分析 • まとめ 5
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWS ではどんなログがあるのか 6
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. “オンプレミス”と”クラウド”のログの考え方の違い ログの世界でも責任共有モデルの考え方と似ている 7 収集ロジックを作る必要がある部分 AWS が自動でログを提供する部分 オンプレミス アプリケーション OS ハードウェア AWS アプリケーション OS ハードウェア AWS コントロール プレーン マネージド サービス 責任共有モデル
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログの収集 8 3 © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 応⽤ (可視化等) データレイクを中⼼とした構成︓データの流れ • 多様な⽣データをデータレイクに蓄積 • データレイクの機能の1つに、前処理を含む 収集 データレイク 処理系 (DWH,RDB等) 応⽤ (可視化等) 収集&格納 処理系 (DWH,RDB等) カタログ (メタデータ) 変形・整形 (前処理) 蓄積 ⽣データ 整形・ 最適化済 収集 蓄積 分析
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. EC2 インスタンスやコンテナ上に Agent を使用して収集 • Amazon CloudWatch 統合 Agent • AWS Distro for OpenTelemetry (ADOT) • Firelens • Fluentd 等の OSS の仕組み 収集方法 9 アプリケーション OS ハードウェア AWS コントロール プレーン マネージド サービス AWS がマネージドで下記の場所に自動で収集 • CloudWatch Logs • Amazon S3 収集ロジックを作る必要がある部分 AWS が自動でログを提供する部分 AWS
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWS マネージドサービスのログ収集宛先 (一部) 10 サービス名 内容 CloudWatch Logs Amazon S3 Amazon Config 構成変更ログ ◯ Amazon CloudFront 標準ログ(アクセスログ) ◯ Amazon CloudTrail API 呼び出しログ ◯ ◯ VPC Flow logs VPC の NIC の IP トラフィック ◯ ◯ Elastic Load Balancing アクセスログ ◯ Amazon Network Firewall アラートログ/フローログ ◯ ◯ Amazon Route 53 パブリック DNS クエリログ ◯ Amazon Route 53 Resolver のクエリログ ◯ ◯ Amazon Lambda 実行ログ ◯ Amazon RDS (監査ログ、エラーログ、全般ログ、スロークエリログ)等 ◯ Amazon S3 サーバーアクセスログ ◯ Amazon Bedrock 呼び出しログ、モデル入力データ、モデル出力データ ◯ ◯ 対象のログがどこに収集先を意識する必要がある (厳密には、配信先設定に Amazon Data Firehose も選択できるサービスがあるが、簡単のため省略) https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ドキュメントリンク集 11 サービス名 内容 リンク Amazon Config 構成変更ログ https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.htm Amazon CloudFront 標準ログ(アクセスログ) https://docs.aws.amazon.com/ja_jp/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html Amazon CloudTrail API 呼び出しログ https://docs.aws.amazon.com/ja_jp/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html VPC Flow logs VPC の NIC の IP トラフィック https://docs.aws.amazon.com/ja_jp/vpc/latest/userguide/flow-logs.html Elastic Load Balancing アクセスログ https://docs.aws.amazon.com/ja_jp/elasticloadbalancing/latest/application/load-balancer-access-logs.html Amazon Network Firewall アラートログ/フローログ https://aws.amazon.com/jp/builders-flash/202310/network-firewall-log-analysis/ Amazon Route 53 パブリック DNS クエリログ https://docs.aws.amazon.com/ja_jp/Route53/latest/DeveloperGuide/query-logs.html#query-logs-changing-retention- period Amazon Route 53 Resolver のクエリログ https://docs.aws.amazon.com/ja_jp/Route53/latest/DeveloperGuide/resolver-query-logs.html Amazon Lambda 実行ログ https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/monitoring-cloudwatchlogs.html Amazon RDS (監査ログ、エラーログ、全般ログ、スロークエリログ)等 https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/USER_LogAccess.Procedural.UploadtoCloudWatch.ht ml Amazon S3 サーバーアクセスログ https://docs.aws.amazon.com/ja_jp/AmazonS3/latest/userguide/logging-with-S3.html Amazon Bedrock 呼び出しログ、モデル入力データ、モデル出力データ https://docs.aws.amazon.com/ja_jp/bedrock/latest/userguide/model-invocation-logging.html
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログの蓄積 12 3 © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 応⽤ (可視化等) データレイクを中⼼とした構成︓データの流れ • 多様な⽣データをデータレイクに蓄積 • データレイクの機能の1つに、前処理を含む 収集 データレイク 処理系 (DWH,RDB等) 応⽤ (可視化等) 収集&格納 処理系 (DWH,RDB等) カタログ (メタデータ) 変形・整形 (前処理) 蓄積 ⽣データ 整形・ 最適化済 収集 蓄積 分析
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログの蓄積先に求められる要件 • システム規模やトラフィック量に応じてログは増加 § 安価な保存料 § サイジング不要 • ログのローテション (保存期間が過ぎたら削除等) § ”Amazon CloudWatch logs 保持期間設定” § ”Amazon S3 オブジェクト有効期限” ”ログの蓄積”とクラウドは相性が良い 13
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWS における代表的なログの蓄積先 Amazon CloudWatch Logs Amazon S3 用途 リアルタイムに分析したいとき/短期保存 アドホックに分析したいとき/長期保存 保存料金 (東京リージョン) [USD] 保存 (アーカイブ) 0.033/GB S3 標準 0.025 /GB S3 標準 - 低頻度アクセス 0.0138USD / GB S3 Glacier Deep Archive 0.002USD/GB 保管期間 デフォルトは”無制限” 1日~10年単位で設定可能 デフォルトでは設定されていない. 1日単位できめ細かに設定可能 (期間に上限なし) 14 https://aws.amazon.com/jp/cloudwatch/pricing/ https://aws.amazon.com/jp/s3/pricing/ * Amazon CloudWatch Logs と Amazon S3 のログ取り込み料金を直接比較するのは困難であるので記載しない * Amazon S3 のストレージクラスは他の選択肢もある
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログの分析 15 3 © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 応⽤ (可視化等) データレイクを中⼼とした構成︓データの流れ • 多様な⽣データをデータレイクに蓄積 • データレイクの機能の1つに、前処理を含む 収集 データレイク 処理系 (DWH,RDB等) 応⽤ (可視化等) 収集&格納 処理系 (DWH,RDB等) カタログ (メタデータ) 変形・整形 (前処理) 蓄積 ⽣データ 整形・ 最適化済 収集 蓄積 分析
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログの分析方法は多岐にわたる データ分析では、目的に応じて処理系 や応用先が異なる ログ分析でも同様に「検知・検査」 対象によって構成がことなる 16 AWSのETLソリューション紹介 より https://pages.awscloud.com/rs/112-TZM-766/images/AWS-ETL-Solutions-202107.pdf 3 © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 応⽤ (可視化等) データレイクを中⼼とした構成︓データの流れ • 多様な⽣データをデータレイクに蓄積 • データレイクの機能の1つに、前処理を含む 収集 データレイク 処理系 (DWH,RDB等) 応⽤ (可視化等) 収集&格納 処理系 (DWH,RDB等) カタログ (メタデータ) 変形・整形 (前処理) 蓄積 ⽣データ 整形・ 最適化済 収集 蓄積 分析
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログ分析サービス 17 短期的なログ利用 中長期的なログ利用 Amazon CloudWatch Amazon S3 Amazon Athena Amazon OpenSearch Service 障害調査 構成調査・セキュリティイベントの調査 中心となるサービス
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 短期的なログ利用 18
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. CloudWatch による監視 • リアルタイムにシステムの異常検知と原因追求 § 問題を検知したい際の原因分析を可能に 19 Amazon CloudWatch Amazon EC2 Amazon RDS アプリケーション構成サービス Alarm メトリクスフィルターでログを メトリクスに変換 アラート対象にすることが可能 Logs Insight ログのクエリ、クエリ結果の可視化が 可能
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. マルチアカウントでのログの分析 • “CloudWatch のクロスアカウントオブザーバビリティ”で、テレメトリを共有可能 § 「メトリクス」「CloudWatch Logs グループ」「AWS X-ray のトレース」 + 他 • CloudWatch のコンソール上で設定が完結 § ログやメトリクスのコピーには追加料金が発生しない • モニタリングアカウントで、ソースアカウントのテレメトリに対して分析やアラート設定が可能 20 ソースアカウント A ソースアカウント B Amazon CloudWatch モニタリングアカウント Amazon CloudWatch *ソースアカウントとモニタリングアカウントは同一リージョン CloudWatch のクロスアカウントオブザーバビリティ https://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html Alarm Logs Insight
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 中長期的なログ利用 21
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Athenaによるアドホックな分析 • 分析頻度が少いもの (システム稼働レポート) § Amazon S3 で長期的に保存 – CloudWatch のログは S3 にエクスポート 可能 ログの横断的な分析が可能 22 AWS BlackBelt Amazon Athena より https://pages.awscloud.com/rs/112-TZM-766/images/20200617_BlackBelt_Amazon_Athena.pdf © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. ユースケース 2: ログ分析 S3 に出⼒される様々な AWS サービスのログや収集データに対してクエリ https://docs.aws.amazon.com/ja_jp/athena/latest/ug/querying-AWS-service-logs.html https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/athena.html https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-inventory-query.html https://aws.amazon.com/jp/about-aws/whats-new/2019/08/amazon-athena-supports-querying-data-from-amazon-s3/ • Elastic Load Balancing (ALB/CLB/NLB) ログ • Amazon CloudFront ログ • AWS CloudTrail ログ • Amazon EMR ログ • AWS Global Accelerator ログ • Amazon GuardDuty ログ • Amazon VPC フローログ • AWS WAF ログ • AWS Cost and Usage Reports データ • AWS Systems Manager インベントリデータ • Amazon S3リクエスタ⽀払いバケットデータ S3 Athena
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark. ユースケース 2: ログ分析 S3 に出⼒される様々な AWS サービスのログや収集データに対してクエリ https://docs.aws.amazon.com/ja_jp/athena/latest/ug/querying-AWS-service-logs.html https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/athena.html https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-inventory-query.html https://aws.amazon.com/jp/about-aws/whats-new/2019/08/amazon-athena-supports-querying-data-from-amazon-s3/ • Elastic Load Balancing (ALB/CLB/NLB) ログ • Amazon CloudFront ログ • AWS CloudTrail ログ • Amazon EMR ログ • AWS Global Accelerator ログ • Amazon GuardDuty ログ • Amazon VPC フローログ • AWS WAF ログ • AWS Cost and Usage Reports データ • AWS Systems Manager インベントリデータ • Amazon S3リクエスタ⽀払いバケットデータ S3 Athena 横断的な分析の難しさ ログの形式に一貫性がないので、クエリが複雑化。一貫した分析をするためには正規化等が必要 マルチアカウントでデータ収集時は、所有権問題等も発生 23 3 © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 応⽤ (可視化等) データレイクを中⼼とした構成︓データの流れ • 多様な⽣データをデータレイクに蓄積 • データレイクの機能の1つに、前処理を含む 収集 データレイク 処理系 (DWH,RDB等) 応⽤ (可視化等) 収集&格納 処理系 (DWH,RDB等) カタログ (メタデータ) 変形・整形 (前処理) 蓄積 ⽣データ 整形・ 最適化済 AWSのETLソリューション紹介 より https://pages.awscloud.com/rs/112-TZM-766/images/AWS-ETL-Solutions-202107.pdf AWS BlackBelt Amazon Athena より https://pages.awscloud.com/rs/112-TZM-766/images/20200617_BlackBelt_Amazon_Athena.pdf
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. SIEM on Amazon OpenSearch Service • 様々なログを Amazon S3 に集約 § CloudTrail API アクセスログ, Config システム変更ログ • OpenSearch にログを 正規化して投入 24 https://github.com/aws-samples/siem-on-amazon-opensearch-service/blob/main/README_ja.md
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ログの収集方法の選択肢 • マルチアカウントでログを集約する機能を他のサービスを使って代替が可能 § Amazon Security Lake § AWS Control Tower 25 https://github.com/aws-samples/siem-on-amazon-opensearch-service/blob/main/README_ja.md
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Security Lake とは • Organization内で有効化し、OCSF形式でセキュリティログを一元的に集約保存 & クエリを可能にするサービス § SIEM on AOS では ECS の正規化. OCSF → ECS は自動マッピングに対応 26 Security Lake 委任アカウント S3バケット (セキュリティデータレイク) Amazon Security Lake OCSF形式 & Parquet 出⼒ クエリ データ ⾃動取込み データ 投⼊ 3rd Party & AWS 分析サービス データ取り込み ユーザー アプリケーション or AWSサービス データ 投⼊ OCSF形式 & Parquet 出⼒ ネイティブ対応AWSサービス ※オレンジ⽂字︓Security Lake提供機能範囲 登録 Glue データカタログ ※⾮Organizations環境での利⽤も可能 AWSパートナー セキュリティ ソリューション AWS Cloud https://docs.aws.amazon.com/ja_jp/security-lake/latest/userguide/what-is-security-lake.html Open Cybersecurity Schema Framework (OCSF) Elastic Common Schema (ECS)
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWS Control Tower とは マルチアカウント環境のセットアップを⾃動化するマネージドサービス メンバーアカウントの CloudTrail 証跡や AWS Config アグリゲータでログを集約 27 https://pages.awscloud.com/rs/112-TZM-766/images/AWS-Black-Belt_2023_AWS-ControlTower-Procedures_0831_v1.pdf © 2023, Amazon Web Services, Inc. or its affiliates. まとめ: セットアップ内容の概要 13 AWS Control Tower 管理アカウント ログアーカイブアカウント 監査アカウント AWS Organizations Security OU Sandbox OU AWS IAM Identity Center AWS Service Catalog (Account Factory) AWS CloudFormation スタックセット AWS CloudTrail 組織証跡 CloudTrail 証跡 CloudTrail 証跡 AWS CloudFormation スタック (ベースライン) AWS CloudFormation スタック (ベースライン) Amazon S3 バケット AWS Config アグリゲーター Amazon SNS トピック 13 作成されるリソースの詳細は、 下記ドキュメントをご参照ください https://docs.aws.amazon.com/ja_jp/controltower/ latest/userguide/how-control-tower- works.html#what-shared
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWS Config アグリゲータ • AWS Config のデータの構成変更ログのレプリケートをサポート • 複数のアカウントと複数のリージョン • 単一のアカウントと複数のリージョン • 内の組織 AWS Organizations と、その組織内で AWS Config が有効になっているすべてのアカウント 28 https://docs.aws.amazon.com/ja_jp/config/latest/developerguide/aggregate-data.html
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. まとめ 29
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. まとめ • AWSのログ関連サービスを利用することで、ログの収集・蓄積・分析をコスト効 率よく少ない手間で実現可能 • ご自身の担当されている業務で、これらのサービスの適応を考えましょう 30
© 2024, Amazon Web Services, Inc. or its affiliates. All
rights reserved. AWS Summit Japan 6 ⽉ 20 ⽇ (⽊) – 21 ⽇ (⾦) 幕張メッセにて開催︕ ⽇本最⼤の AWS に関する『ラーニングカンファレンス』 クラウドコンピューティングコミュニティが⼀堂に会して、 アマゾン ウェブ サービス (AWS) にて学習し、ベストプラクティスの 共有や情報交換ができる全てのクラウドでイノベーションを起こすこと に興味がある皆さまのためのイベント 幕張メッセとライブ配信 同時開催 40,000 + 述べ参加者数 2 基調講演 150 + セッション 110 + ご協賛社