SlideShare a Scribd company logo
1 of 36
Download to read offline
Ⓒ  Classmethod,  Inc.
10分でわかる  
Key  Management  Serviceの仕組み
1
DEVIO-‐‑‒MTUP11-‐‑‒TOKYO-‐‑‒001
⻁虎塚,クラスメソッド株式会社
2014年年12⽉月16⽇日
Ⓒ Classmethod, Inc. 2
※モデル本人および所属先組織の見解とは一切関係ありません.
Ⓒ Classmethod, Inc.
自己紹介
3
こんにちは,虎塚です
Twitter & Hatena-id: torazuka
最近の趣味はクソコラ作成です(冒頭の画像は最新作)
AWSコンサルティング部で構築の仕事をしています
鳥形由希と申します
※モデル本人および所属先組織の見解とは一切関係ありません.
Ⓒ Classmethod, Inc.
ぱっと見よくわからないKMSについてご説明します
4
が2種類ある?
Encrypt APIと
Decrypt API

いつ使うん?
カスタマーキーと

データキー?
鰹節……
Key Management Serviceとは
5
Ⓒ Classmethod, Inc.
Key Management Service (KMS)
• re:Invent 2014で発表されました
• すでに全リージョンで利用できます
• データ暗号化/復号用の をAWS上で管理できます
6
正確には,データの暗号化に使う (データキー)を

暗号化するための (マスターキー)を管理できます
Ⓒ Classmethod, Inc. 7
は2種類あります
2つあわせてKMSでーす
マスターキーでーす
データキーでーす
Ⓒ Classmethod, Inc.
マスターキーとデータキーの特徴
8
マスターキー データキー
AWS内部で永続化される AWS内部で永続化されない
ユーザがローカルに

エクスポートできない
ユーザがローカルに
エクスポートできる
データキーを暗号化する データを暗号化する
一般的なデータと暗号化の話
9
Ⓒ Classmethod, Inc.
大切なデータを暗号化する
10
データ
暗号化
暗号化されたデータ
秘
Ⓒ Classmethod, Inc.
すると の保管場所が問題になる
11
暗号化された

データ
暗号化されたデータと を一緒に保管するのは危険
秘
単独で盗まれても大丈夫だが
一緒に盗まれると

アウト
Ⓒ Classmethod, Inc.
そこで を暗号化する
12
データ
暗号化
暗号化された

データ
秘
暗号化
の
暗号化対象と同じ は

使えないので,別の 

を用意する
暗号化された

秘
Ⓒ Classmethod, Inc.
すると の の保管場所が問題になる
13
暗号化された

データ
問題が解決していない!
暗号化された
秘
単独で盗まれても大丈夫だが
一緒に盗まれると

アウト
の
秘
Ⓒ Classmethod, Inc.
解決法: の を安全な場所で保管
14
暗号化された

データ
暗号化された
秘
の
秘
安全な場所
Ⓒ Classmethod, Inc.
安全な場所=Amazon KMS
15
暗号化された

データ
データキー
秘
マスターキー
秘
Amazon KMS
AWS/オンプレミス(場所を問わない)
自前で用意した

安全な場所よりも

さらに安全
Ⓒ Classmethod, Inc.
マスターキーとデータキーの特徴(再掲)
16
マスターキー データキー
AWS内部で永続化される AWS内部で永続化されない
ユーザがローカルに

エクスポートできない
ユーザがローカルに
エクスポートできる
データキーを暗号化する データを暗号化する
KMSの機能
17
Ⓒ Classmethod, Inc.
マスターキーの管理
18
マスターキーの管理者
利用不可 利用可能利用可能
作成 無効化 有効化 削除
※削除はサポート

されていません
更新
マスターキー( の )に対して可能な操作は,次のとおりです
マスターキーの状態
Ⓒ Classmethod, Inc.
マスターキーの管理操作に対応するKMS API
19
利用不可 利用可能利用可能
作成
CreateAlias
無効化 有効化更新
DeleteAlias
CreateKey
DisableKeyRotationEnableKeyRotation
UpdateKeyDescription
PutKeyPolicy
ListKeyPolicies
ListKeys
ListAliases
GetKeyPolicy
GetKeyRotationStatus
DisableKey EnableKey
DescribeKey
※太字はよく使うAPI
Ⓒ Classmethod, Inc.
データキーの利用
20
利用可能
データキーの利用者
データキーの生成
対応するマスターキーの状態
データキーの復号データキーの暗号化
一方,データキーに対して可能な操作は,次のとおりです
データの暗号化や復号は
AWS API
Ⓒ Classmethod, Inc.
データキーの利用操作に対応するKMS API
21
利用可能
Encrypt Decrypt
ReEncrypt
GenerateDataKey
GenerateDataKeyWithoutPlaintext
データキーの生成 データキーの復号データキーの暗号化
※太字はよく使うAPI
Ⓒ Classmethod, Inc.
マスターキーの作成
22
AWS KMS
CreateKey(Description, Policy)
KeyID, ARN, 作成日, など
マスターキーを

生成して保管する
マスターキー

の管理者
マスターキーそのものは

返却されない
Policy(権限)やDescription(説明)を

指定して,マスターキーを生成する
Ⓒ Classmethod, Inc.
データキーの生成
23
AWS KMS
GenerateDataKey(KeyID)
暗号化された

データキー
データキー
秘
データキー

の利用者
指定された

マスターキーで

データキーを生成
データキー自体は

保管しない
データキー自体が

返却される
マスターキーのIDを指定して,

データキーを生成する
Ⓒ Classmethod, Inc.
データキーでデータを暗号化
24
データ
暗号化
データキー
暗号化された

データ
秘
@ローカル
暗号化された

データキー
秘
データキー

の利用者
使い終わったら

即座に捨てる
重要
大事に保管する
暗号化されたデータキーを
紛失すると,データを

復号できなくなります!
超重要
Ⓒ Classmethod, Inc.
データキーの復号
25
AWS KMS
Decrypt(CiphertextBlob)
暗号化された

データキー
データキー
秘データキー

の利用者
暗号化に使われた

マスターキーで

データキーを復号
データキー自体は

保管しない
秘
暗号化されたデータキーを渡して,
データキーを復号する
Ⓒ Classmethod, Inc.
データキーでデータを復号
26
暗号化された
データ
復号
データキー
データ
@ローカル
データキー

の利用者
秘
利用
使い終わったら

即座に捨てる
重要
Ⓒ Classmethod, Inc.
• マスターキーを無効化すると,そのマスターキーを利用する

データキーの操作が,すべて失敗するようになります
• データキーが復号できない=暗号化したデータの復号もできない
無効化 有効化
マスターキーの有効化/無効化
27
利用不可 利用可能利用可能
データキーの利用者
データキーの生成 データキーの復号データキーの暗号化
マスターキーの状態
Ⓒ Classmethod, Inc.
マスターキーのローテーション
• マスターキーには1年ごとのローテーションを設定できます
• ローテーションされたキーは,それ以降,復号だけに利用されます
28
有効な
active
deactivated
ローテーション
ローテーション以降の

すべてのリクエスト
ローテーション以前の
マスターキーで作成された

データキーの復号リクエスト
Ⓒ Classmethod, Inc.
マスターキーとデータキーの特徴(再掲)
29
マスターキー データキー
AWS内部で永続化される AWS内部で永続化されない
ユーザがローカルに

エクスポートできない
ユーザがローカルに
エクスポートできる
データキーを暗号化する データを暗号化する
の権限管理
30
Ⓒ Classmethod, Inc.
Key Policy
• マスターキーを作成する時にPolicyを与える
• 与えない場合,デフォルトのPolicyが適用されます
31
{
"Id": "key-default",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {"AWS":"012345678901"},
"Action": ["kms:*"],
"Resource": "*"
}
]
}
すべてのKMS API
アカウントroot
すべてのリソース
Ⓒ Classmethod, Inc.
Key Policyで の管理と利用を分離
32
{
"Sid": "Allow access for Key Administrators",
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::012345678901:user/Administrator"},
"Action": [
"kms:Create*", "kms:Describe*", "kms:Enable*",
"kms:List*", "kms:Put*", "kms:Update*",
"kms:Revoke*", "kms:Disable*", "kms:Get*", "kms:Delete*"
],
"Resource": "*"
} {
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::012345678901:user/User"},
"Action": [
"kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt",
"kms:GenerateDataKey*", "kms:DescribeKey"
],
"Resource": "*"
}
管理系API
利用系API
データキー

の利用者
マスターキー

の管理者
まとめ
33
Ⓒ Classmethod, Inc.
まとめ
• 暗号化されたデータキーは大切に保管しましょう
• 紛失するとデータを復号できなくなります
• プレーンテキストのデータキーは使ったらすぐに

捨てましょう
• この部分はユーザが責任を持って運用する必要があります
• Key Policyを活用してマスターキーの管理者と

データキーのユーザを分けましょう
34
Ⓒ Classmethod, Inc.
参考資料
• AWS Key Management Service
• http://aws.amazon.com/jp/kms
• AWS Key Management Service whitepaper
• https://d0.awsstatic.com/whitepapers/KMS-
Cryptographic-Details.pdf
35
Ⓒ Classmethod, Inc.
#cmdevio
ご清聴ありがとうございました。
スライドは後日ブログで公開します。
36
DEVIO-MTUP11-TOKYO-001

More Related Content

Recently uploaded

論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 

Recently uploaded (9)

論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

10分でわかるKey Management Serviceの仕組み #cmdevio