Mais conteúdo relacionado
Semelhante a Data Lake Security on AWS (20)
Mais de Amazon Web Services Japan (20)
Data Lake Security on AWS
- 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Lake Security on AWS
能仁 信亮
ソリューションアーキテクト
アマゾン ウェブ サービス ジャパン株式会社
- 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
自己紹介
能仁 信亮(のうにん しんりょう)
エンタープライズ ソリューション本部
ソリューション アーキテクト
普段の仕事
金融機関のお客様へクラウド活用のご支援をさせていただいております
好きなAWSのサービス
S3, Service Catalog
- 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
このセッションの背景・目的
• 背景
• Data Lakeの活用は急速に広がっています
• データソース、利用側ともに複数のシステム、複数の部門が関
連しており、個別システムのセキュリティ担保とは違った観点
でのセキュリティ・ガバナンス対策が必要になってきています
• 利用部門の利便性、アジリティとセキュリティの確保のバラン
スをどうとるかを議論される機会が増えています
• ゴール
• 事例等をもとに、AWS上にData Lakeを構築する際のセキュリ
ティ/ガバナンス上の考慮点を取り上げます
- 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Lakeに係わるセキュリティ考慮事項の例
• アクセス管理
• データ保護 (暗号化/匿名化)
• メタデータ管理
• 監査
• 監視
• 忘れられる権利
• データ汚染からの保護
…
- 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
このセッションで取り上げる内容
• アクセス管理 → 課題: 多様な利用者のアクセス管理
• データ保護 (暗号化/匿名化) → 課題:データ漏洩リスク
• メタデータ管理 → 課題: 必要なデータを発見する方法は?
• 監査
• 監視
• 忘れられる権利
• データ汚染からの保護
…
- 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
1. AWS上でのData Lake
2. アクセス管理
3. データ保護
4. メタデータ管理
- 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS上でのData Lake
- 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
これまで:
1. ディスクが高価で上限がある
2. データはサマリーだけ、もし
くは期間限定で保存
3. 処理できる内容は固定的
Data Lake:データは加工せず全期間を残す
On AWS:
1. 安価・上限無しのストレージ
2. オリジナルデータを全て残す
3. 処理対象・処理内容はビジネ
スに合わせて変わる
インフラ管理者の仕事:
データを活用して新しい課題に素早く
対応できるインフラを用意する。個別
リクエストへの対応
インフラ管理者の仕事:
ストレージを溢れさせず、時間
内に処理が終るようにサイズや
処理内容を調整する
- 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データレイク
• 多様なデータを一元的に保存
• データを失わない
• サイズ制限からの開放
• 決められた方法(API)ですぐにア
クセスできる
→システム全体のハブ
センター
データ
非構造化ファイル
テキストファイル
RDBMS
データレイク
API呼び出しによる連携
- 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
大規模データ分析 on クラウド
• データをデータレイクに集め、多様な分析につなげる
• 分析はスケールアウト可能なインフラの上で実現
収集 データレイク
(保存)
分析 可視化
データを収集
し、データレイ
クへ格納
全期間保存。
共通APIでア
クセス
可視化
スケールアウト
可能な技術
分析
スケールアウト
可能な技術API
- 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWSのデータレイク=Amazon S3AWSのデータレイク=Amazon S3
Amazon S3
データ分析
Elastic
MapReduce
Redshift
データ
バックアップ
EC
2
RDS
Storage
Gateway
EBS
Redshift
ETL
CloudFront
コンテンツ変換
コンテンツ配信
Elastic
Transcoder
データ
アーカイブ
Glacier
Athena
Amazon Lex
Amazon Polly
Amazon
Rekognition
AmazonMachine
Learning
AI
IoT
AWS IoT
BI
QuickSight
AWS Glue
- 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazonのデータレイクプロジェクト "ANDES"
アマゾンの「正」データを集
めておく場所("THE" Place
for Data at Amazon)
S3がデータレイクの核
分析にはEMR(Hadoop)や
Redshiftを活用することでス
ケーラビリティを確保
- 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
FINRA
• FINRA: Financial Industry Regulatory Authority
米国のすべての証券会社が加盟する非政府規制機関
• 米国での株式取引の99%、オプション取引の70%を監視
• 一日750億イベント、20PBを超えるデータレイクをAWS上に構築
- 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Data Lake Solution
• AWS Answers で公開されているAWS
上でのData Lakeのリファレンス実装
https://aws.amazon.com/jp/answers/
big-data/data-lake-solution/
• 個々の機能はAPIとして、実装されて
いるので、拡張が容易
• ソースコードはGitHubで公開
https://github.com/awslabs/aws-
data-lake-solution
- 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アクセス管理
- 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Lakeのアクセス管理の課題
粒度の細かなアクセス管理
が求められる
• 複数の部門がS3バケットやク
ラスターを共有
• 結果としてアクセス管理の設
定やメンテナンスが複雑に
A部門 B部門 C部門
Amazon EMR cluster
Amazon S3 buckets
Local FS
HDFS
EMRFS
Amazon Redshift cluster
Databases and schemas
/foo/bar /abc/xyz /local
hdfs:///data/1st hdfs:///data2
s3://bucket/prfx s3://group/data
Zeppelin Presto Hive …
- 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データ処理エンジンとデータのアクセス管理
データ処理エンジン
EMR Redshift
ストレージ
S3
…
- 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データ処理エンジンのアクセス管理
データ処理エンジン
EMR Redshift
ストレージ
S3
…
• データ処理エンジン固有のアク
セス管理の仕組みを利用
EMR: Apache Ranger
Apache Ranger on EMR
など
• 多数の部署や関連会社が関連
する場合は、EMRやRedshiftク
ラスターを部門や目的ごとに分
割することも考えられる
- 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データ処理エンジンごとの認証・認可方式
認証 認可
Athena IAM IAM/Glue Data Catalog
Redshift IAM Federation/DBでの
認証設定
Grants (DBでの認可設定)
Hive (EMR) Kerberos/LDAP Ranger/Metastore
Spark SQL (EMR) Kerberos Ranger-LLAP
Presto (EMR) LDAP Hive SQL
HBase (EMR) Kerberos Ranger
技術的にはエンジンごとの認証認可の仕組みを利用すればよい
課題: 利用部門が増えてきた際に誰がどのように認証・認可を管理していくか
- 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
利用部門ごとに個別のデータ処理エンジンを利用
データレイク
(保存)
部門A用の分析基盤
全期間保存。
共通APIでア
クセス
API
部門B用の分析基盤
…..
利用部門や目的ごとにEMRやRedshiftのクラスタを用意すれば、
権限管理はシンプルになり、利用部門の自由度も増す
課題: Data Lakeから各利用部門がどのようにデータを発見するか
- 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon.comのデータウェアハウス
多数の会社・部門で分析・レポー
トに利用されるDWH
多様で膨大なデータ
• コアデータ:圧縮後で5PB+
• 全ストレージ:35PB+
• 100億行+ロード/日
• 20万クエリ/日
- 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
活用データから見えてくる利用の特長
DWH利用:2,300チーム
チームごとの表の数
• 最小1~最大598
• 平均:49
どんなチームも部分的に必要な
データを活用するため、全部入の
DWHは無駄が多い
分析環境にはスケーラビリティが
必須要件
- 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
課題と解決:
調停からセルフサービスへ
• どこにデータがあるか分からない
• どこに有るか問い合わせる必要がある
• データを自分達が利用可能にするまで
が大変
• 自分達の環境にコピーしてもらうには、
データ転送やETL等の仕組みの調停と構
築するための申請(予算化)が必要
• データ鮮度が不明
• データの更新頻度の調整に開発が必要
• 利用者が検索出来るよ
うにする
• 利用者が必要なデータ
を自分の領域に「登録
(Subscribe)」出来るよ
うにする
• 利用者が更新頻度の調
整等を設定・変更出来
るようにする
[課題] [解決]
- 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 収集と後続処理が分離され、収集側がデータレイクにデータを置くだけ
で良い構成
• セルフサービスを促進するために「発見」「登録」層を導入
セルフサービスを実現するための仕組み
収集 データ
レイク
分析 可視化・
応用
発見 登録
Discover Subscribe
セルフサービス化
- 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
✔
「登録」による調停・開発不要のデータ取得
欲しいデータを発見したら、登録
(Subscribe)する
登録時にはデータの行き先を指定
(自部門のRedshiftやEMR等)
自動的にコピー処理やメタデータ
同期処理が構築され、定期的にフ
レッシュなデータが供給される
✔
登録
(Subscribe)
Amazon
Redshift
Amazon
EMR
データ定期コピー
(バッチ)
メタデータ同期
(S3へは透過アクセス)
- 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon.com におけるデータの管理
https://www.slideshare.net/AmazonWebServices/a-look-under-the-hood-how-amazoncom-uses-aws-services-for-analytics-at-massive-scale-abd329-reinvent-2017
検索機能
部署や
データタイプに
よる分類
利用者からの
フィードバック
各種情報を提供
• 登録者情報
• 詳細情報
• スキーマ
• サポートレベル
• フィードバック
* この図はアイデア検討時のモックアップであり,実物とは異なります
- 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon.com Andes 事例のまとめ
• データ処理エンジンを部門ごとに分割することで、権限管理がシンプ
ルになり、利用部門の自由度は増す
• このパターンではセルフサービスでData Lakeから必要なデータを取得
するメタデータ管理が重要になってくる
• メタデータ管理の実装方式に関しては、本セッションの後半で取り上
げる
- 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ストレージのアクセス管理
データ処理エンジン
EMR Redshift
ストレージ
S3
…
- 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
S3のアクセス制御の方式の例
• IAMポリシー
• S3 Bucketポリシー
• 署名付きURL
…
- 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon S3 IAMポリシー
• S3に対してどのような操作を許可/
拒否するかを直接記述
• アクセス管理は、IAM管理者によっ
て管理される
• IAMユーザーやIAMロールに割り当
てる
• バケットやプリフィックスなどの指
定も可能
{ "Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Action":[
"s3:ListAllMyBuckets"
],
"Resource":"arn:aws:s3:::*"
},
"Effect":"Allow",
"Action":[
"s3:PutObject",
"s3:PutObjectAcl",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:DeleteObject"
],
"Resource":"arn:aws:s3:::reinventbucket/*"
}
]}
- 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon S3 Bucket Policies
• 誰がS3バケットにアクセスできるかを
定義
• ポリシーはS3バケットに直接紐付けら
れる
• Amazon S3 bucket 所有者による管理
• アクセス制御のポリシーをAmazon S3
に閉じて制御できる
{ “Version”: “2012-10-17”, “Id”: “123”,
"Statement": [
{ "Sid": ”require-mfa",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource":
"arn:aws:s3:::bucket/tax/*",
"Condition": { "Null":
{"aws:MultiFactorAuthAge": true }}
}
]
}
- 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
署名付きURL
署名付
き の
生成
S3
アクセス要求
署名付きURLを返す
オブジェクト
のGET/PUT
• オブジェクトに対するPUT/GETの
権限を一時的に付与する仕組み
• URLを生成したユーザーの権限で
アクセス
• URL作成時に指定した期間のみ
有効
- 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IAMポリシーやBucketポリシーによる管理の課題
• 権限管理の対象となるデータセットの数 × 権限を分けたい
ユーザー群の数(利用部門数など)の権限管理が必要となるた
め、大規模なData Lakeでは管理が複雑になる
• IAMポリシーを利用する場合は、大規模な場合、IAMの制限
にも考慮する必要がある
• 管理ポリシーの最大サイズ: 6144文字
• ロール/グループにアタッチ可能な
• 管理ポリシー数: 10 (デフォルト)
- 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
課題に対する解決策の例
• カスタムの認証プロバイダーを利用し、STSや署名付きURL
を利用して一時的にアクセスを許可する。
• 実装例: FINRA Herd, AWS Data Lake Solution
- 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
FINRAのデータカタログ - herd
• オープンソースとして開発しているデータ
カタログ
FINRA herd http://finraos.github.io/herd/
• 統合されたデータカタログ
• スキーマ、バージョン、暗号化のタイプ、
ストレージポリシーなどの管理
• データのリネージ(出自)と利用の管理
• データの発行者とデータの利用者の追跡
• 関連するジョブの特定と、元となるデー
タの確認が容易に
- 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Securing the services–Amazon S3
- 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Data Lake Solution
• AWS Data Lake Solutionで認可の管理を行い、署名付きURLを発行す
ることも可能
- 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アクセス管理の最後に: Permissions Boundary
Permissions Boundary Permissions Policy
実際に有効な
権限
• IAMユーザやIAMロールに対して、
アクセス制限の「境界」を設定する
• Permissions Boundaryで設定し
た範囲を超えて、Policyで権限を
付与しても、その権限は有効にな
らない
• Data Lakeのように、厳密な権限
管理が難しい場合でも、これ以上
の権限を与えてはならないという
「ガードレール」として機能する
- 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データ保護
- 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
S3の暗号化によるデータ保護
サーバサイド暗号化
• AWSのサーバリソースを利用して格納データの暗号化処理を実施
• 暗号化種別
• SSE-S3 : AWSが管理する鍵を利用して暗号化
• SSE-KMS:Key Management Service(KMS)の鍵を利用して暗号化
• SSE-C:ユーザが提供した鍵を利用して暗号化(AWSで鍵は管理しない)
クライアントサイド暗号化
• 暗号化プロセスはユーザ管理
• クライアント側で暗号化したデータをS3にアップロード
• 暗号化種別
• AWS KMSで管理されたカスタマーキーを利用して暗号化
• クライアントが管理するマスターキーを利用して暗号化
https://docs.aws.amazon.com/ja_jp/AmazonS3/latest/dev/UsingEncryption.html
- 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
S3の暗号化: FINRAの例
KMS (SSE-KMSを活用)
- 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
KMSを利用したAWSでのサーバー側暗号化
2層の暗号鍵の階層
• データを暗号化するためのデータキー
• データキーを暗号化するカスタマ−・マスター
キー
利点
• データキーの漏洩によるリスクの極小化
• 大きなデータを暗号化する際により良いパ
フォーマンス
• 数千のデータキーを管理する代わりに少数のマ
スターキーを管理することによる管理の容易さ
• キーに関するアクセスと監査の集約
Customer master
keys
Data key 1
S3 object EBS
volume
Amazon
Redshift
cluster
Data key 2 Data key 3 Data key 4
Custom
application
KMS
- 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
匿名化 : FINRAの例
一方向ハッシュ/トークン
• データの関連性を保持
• ハッシュ値で検索
Format-preserving-encryption
• 文字数や文字形式を保持して暗号化
- 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
メタデータ管理
- 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
メタデータ管理の課題
• システム的なメタデータ (データの位置やフォーマットなど): AWS Glue
• ビジネス的なメタデータ: データの業務的な意味など: ?
• データのリネージ
• データの出自やデータ間の関係性
例: データAはデータBとデータCから処理Xで生成された
- 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リネージの管理
典型的なユースケース
• 分析結果をもとにビジネス上の判断
を下す際に、分析のソースとなった
データが信頼に足るデータなのか、
データの出自や加工のプロセスを確
認したい
• データに新しいバージョン(訂正な
ど)が登録された際に、古いバージョ
ンから算出された結果がどれで、ど
の処理を再実行する必要があるのか
を知りたい(FINRAのような金融規制
では典型的なユースケース)
- 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
メタデータの管理
システム的なメタデータ管理
ビジネス的なメタデータ管理
- 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
表のメタデータをHiveメタストアで管理
メタデータ
• 列・プロパティ・型
• データロケーション(URI)
• 更新情報
等
クローラーによる自動チェックと登録
• Hiveパーティションを認識し登録を自動化
Glue データカタログ (Data catalog)
/mydata
/year=2017
/month=11/...
- 49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
テーブルの
主要情報
テーブルの
プロパティ
テーブル
スキーマ
テーブル
パーティション
メタデータ(定義)の例
- 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
テーブルのスキーマバージョン一覧
スキーマバージョンの比較
スキーマのバージョン管理
- 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
クローラーが自動的にスキーマを推測
• ファイルタイプを識別し、どのような内容が含ま
れるのかを分類(Classifier)しスキーマ、ファイル
タイプ、パーティションを抽出
• Grokフィルタでカスタマイズ可能
クローラーをスケジュール実行することで新しい
データやスキーマの変更を発見
クローラーを使わず手動での登録も可能
ログはCloudWatch Logsに出力
クローラーによるデータカタログの自動更新
- 52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リソースベースのアクセス許可も可能に
https://aws.amazon.com/jp/about-aws/whats-new/2018/10/aws-glue-now-supports-resource-
based-policies-and-resource-level-permissions-and-for-the-AWS-Glue-Data-Catalog/
- 53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
メタデータの管理
システム的なメタデータ管理
ビジネス的なメタデータ管理
- 54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon.com におけるデータの管理
https://www.slideshare.net/AmazonWebServices/a-look-under-the-hood-how-amazoncom-uses-aws-services-for-analytics-at-massive-scale-abd329-reinvent-2017
検索機能
部署や
データタイプに
よる分類
利用者からの
フィードバック
各種情報を提供
• 登録者情報
• 詳細情報
• スキーマ
• サポートレベル
• フィードバック
* この図はアイデア検討時のモックアップであり,実物とは異なります
- 55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Data Lake Solution
シンプルな機能が中心だが、APIベースで構築されており、拡張も用意なため、
メタデータ管理をはじめるスタート地点として最適
https://aws.amazon.com/jp/answers/big-data/data-lake-solution/
- 56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データカタログ - herd
• オープンソースとして開発しているデータ
カタログ
FINRA herd http://finraos.github.io/herd/
• 統合されたデータカタログ
• スキーマ、バージョン、暗号化のタイプ、
ストレージポリシーなどの管理
• データのリネージ(出自)と利用の管理
• データの発行者とデータの利用者の追跡
• 関連するジョブの特定と、元となるデー
タの確認が容易に
- 57. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめにかえて: 本日紹介した資料やソフトウェア
• AWS Data Lake Solution
https://aws.amazon.com/jp/answers/big-data/data-lake-solution/
• GitHub: FINRA herd
https://github.com/FINRAOS/herd
https://github.com/FINRAOS/herd-mdl
http://technology.finra.org/opensource.html
• Amazon.com Andes
https://www.slideshare.net/AmazonWebServices/a-look-under-the-
hood-how-amazoncom-uses-aws-services-for-analytics-at-massive-
scale-abd329-reinvent-2017
- 58. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
関連セッション
サーバーレスセキュリティ
10/31(水) 11:20~ Serverless Application Security on AWS
データレイクセキュリティ
11/1(木) 15:20~ Data Lake Security on AWS
IoTセキュリティ
11/1(木) 14:00~ IoTにおけるセキュリティ
ITインフラストラクチャセキュリティ
10/30(火) 14:00~ Threat Detection and Remediation on AWS