MSPとしてのオペチー向け 
ReadOnly IAMポリシー 
Ⓒ Classmethod, Inc. 
1 
DEVIO-MTUP11-TOKYO-013 
クラスメソッド株式会社 
三井田 
2014年12月16日 
#cmdevio
自己紹介 
• 三井田誠(みいだ) 
• id: macotomii 
• AWSコンサルティング部 
• 2014年3月入社 
• AWSオペレーションチーム(オペチー) 
• 主にQA対応、障害対応、定例作業対応など 
! 
• ダジャレ好き 
• 麻婆豆腐好き 
Ⓒ Classmethod, Inc. 
2
アジェンダ 
• リードオンリー権限のチューニング 
• MSPから見たチューニングのポイント 
! 
• Let’s tunings! 
• 既存(Read Only Access)の修正 
• Read Only Accessに含まれない他サービスのポリシー統合 
Ⓒ Classmethod, Inc. 
3
AWS謹製ポリシーテンプレート 
IAM -> User/Group/Role -> Attach ** Policy 
Ⓒ Classmethod, Inc. 
4
チューニングのポイント 
★ テンプレートは、『利用者向け』想定と思われる 
★ リードオンリー=何でも読めてしまう、と具合が悪 
いことがある 
★ リードオンリーのテンプレートには入ってない有益 
なAPI Actionもある 
Ⓒ Classmethod, Inc. 
5
Let’s tuning! 
IAMポリシーの例 
Ⓒ Classmethod, Inc. 
6 
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Action": [ 
"ds:Check*", 
"ds:Describe*", 
"ds:Get*", 
"ds:List*", 
"ec2:DescribeNetworkInterfaces", 
"ec2:DescribeSubnets", 
"ec2:DescribeVpcs" 
], 
"Effect": "Allow", 
"Resource": "*" 
} 
] 
} 
この赤い部分、 
アクションをチューニング 
していきます
Let’s tuning! 
S3のReadOnly 
Ⓒ Classmethod, Inc. 
GetObjectの許可は 
具合が悪いので・・・ 
(機密性) 
7 
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Effect": "Allow", 
"Action": [ 
"s3:Get*", 
"s3:List*" 
], 
"Resource": "*" 
} 
] 
} 
{ 
"Version": "2012-10-17", 
"Statement": [ 
{ 
"Effect": "Allow", 
"Action": [ 
"s3:GetBucket*", 
"s3:GetLifecycleConfiguration", 
"s3:GetObjectAcl", 
"s3:GetObjectTorrent", 
"s3:GetObjectVersion", 
"s3:GetObjectVersionAcl", 
"s3:GetObjectVersionTorrent" 
], 
"Resource": "*" 
} 
] 
}
Let’s tuning! 
DynamoDBのReadOnly 
Ⓒ Classmethod, Inc. 
GetItemの許可は 
具合が悪いので・・・ 
(機密性) 
8 
"dynamodb:BatchGetItem", 
"dynamodb:DescribeTable", 
"dynamodb:GetItem", 
"dynamodb:ListTables", 
"dynamodb:Query", 
“dynamodb:Scan", 
! 
※ポリシーテンプレートでは、 
 他に連携するcloudwatchや 
 datapipelineのアクションも 
 あります 
"dynamodb:DescribeTable", 
“dynamodb:ListTables", 
! 
※ここまで絞っちゃいました
Let’s tuning! 
EC2のReadOnly 
Ⓒ Classmethod, Inc. 
お問合せの際、トラブルシュート 
を支援するために・・・ 
9 
{ 
"Effect": "Allow", 
"Action": "ec2:Describe*", 
"Resource": "*" 
}, 
! 
※他に連携するcloudwatchや 
 ELB, AutoScalingのアクションも 
 あります 
{ 
"Effect": "Allow", 
"ec2:Describe*", 
"ec2:GetConsoleOutput", 
"Resource": "*" 
}, 
! 
※コンソールログを追加しました
Let’s tuning! 
他サービスのReadOnlyを統合! 
Route 53 Domains, CloudWatch Logsの 
リードオンリー権限を追加してみよう! 
! 
 ※問合せの大半は、設定方法などについてです 
Ⓒ Classmethod, Inc. 
10 
{ 
"Effect": "Allow", 
"route53domains:Get*", 
“route53domains:List*", 
"logs:Describe*" 
"Resource": "*" 
}, 
! 
※足しました
最後に! 
• 厳密なチューニングには骨が折れる!コツは! 
• APIリファレンスと仲良くなる 
• APIはAWSで何が出来るのかの入り口!自ずと 
詳しくなってきて、何かと知識がつくw 
! 
• お客様との契約条項で、ReadOnlyと言わずに、PowerUser権限を委譲してもらう 
Ⓒ Classmethod, Inc. 
11
Ⓒ Classmethod, Inc. 
#cmdevio 
ご静聴ありがとうございました。 
スライドは後日ブログで公開します。 
12 
DevIO MTUP11-001 
I am IAMer… 
哎呀!麻!!

MSPとしてのオペチー向けReadOnly IAMポリシー

  • 1.
    MSPとしてのオペチー向け ReadOnly IAMポリシー Ⓒ Classmethod, Inc. 1 DEVIO-MTUP11-TOKYO-013 クラスメソッド株式会社 三井田 2014年12月16日 #cmdevio
  • 2.
    自己紹介 • 三井田誠(みいだ) • id: macotomii • AWSコンサルティング部 • 2014年3月入社 • AWSオペレーションチーム(オペチー) • 主にQA対応、障害対応、定例作業対応など ! • ダジャレ好き • 麻婆豆腐好き Ⓒ Classmethod, Inc. 2
  • 3.
    アジェンダ • リードオンリー権限のチューニング • MSPから見たチューニングのポイント ! • Let’s tunings! • 既存(Read Only Access)の修正 • Read Only Accessに含まれない他サービスのポリシー統合 Ⓒ Classmethod, Inc. 3
  • 4.
    AWS謹製ポリシーテンプレート IAM ->User/Group/Role -> Attach ** Policy Ⓒ Classmethod, Inc. 4
  • 5.
    チューニングのポイント ★ テンプレートは、『利用者向け』想定と思われる ★ リードオンリー=何でも読めてしまう、と具合が悪 いことがある ★ リードオンリーのテンプレートには入ってない有益 なAPI Actionもある Ⓒ Classmethod, Inc. 5
  • 6.
    Let’s tuning! IAMポリシーの例 Ⓒ Classmethod, Inc. 6 { "Version": "2012-10-17", "Statement": [ { "Action": [ "ds:Check*", "ds:Describe*", "ds:Get*", "ds:List*", "ec2:DescribeNetworkInterfaces", "ec2:DescribeSubnets", "ec2:DescribeVpcs" ], "Effect": "Allow", "Resource": "*" } ] } この赤い部分、 アクションをチューニング していきます
  • 7.
    Let’s tuning! S3のReadOnly Ⓒ Classmethod, Inc. GetObjectの許可は 具合が悪いので・・・ (機密性) 7 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:Get*", "s3:List*" ], "Resource": "*" } ] } { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetBucket*", "s3:GetLifecycleConfiguration", "s3:GetObjectAcl", "s3:GetObjectTorrent", "s3:GetObjectVersion", "s3:GetObjectVersionAcl", "s3:GetObjectVersionTorrent" ], "Resource": "*" } ] }
  • 8.
    Let’s tuning! DynamoDBのReadOnly Ⓒ Classmethod, Inc. GetItemの許可は 具合が悪いので・・・ (機密性) 8 "dynamodb:BatchGetItem", "dynamodb:DescribeTable", "dynamodb:GetItem", "dynamodb:ListTables", "dynamodb:Query", “dynamodb:Scan", ! ※ポリシーテンプレートでは、  他に連携するcloudwatchや  datapipelineのアクションも  あります "dynamodb:DescribeTable", “dynamodb:ListTables", ! ※ここまで絞っちゃいました
  • 9.
    Let’s tuning! EC2のReadOnly Ⓒ Classmethod, Inc. お問合せの際、トラブルシュート を支援するために・・・ 9 { "Effect": "Allow", "Action": "ec2:Describe*", "Resource": "*" }, ! ※他に連携するcloudwatchや  ELB, AutoScalingのアクションも  あります { "Effect": "Allow", "ec2:Describe*", "ec2:GetConsoleOutput", "Resource": "*" }, ! ※コンソールログを追加しました
  • 10.
    Let’s tuning! 他サービスのReadOnlyを統合! Route 53 Domains, CloudWatch Logsの リードオンリー権限を追加してみよう! !  ※問合せの大半は、設定方法などについてです Ⓒ Classmethod, Inc. 10 { "Effect": "Allow", "route53domains:Get*", “route53domains:List*", "logs:Describe*" "Resource": "*" }, ! ※足しました
  • 11.
    最後に! • 厳密なチューニングには骨が折れる!コツは! • APIリファレンスと仲良くなる • APIはAWSで何が出来るのかの入り口!自ずと 詳しくなってきて、何かと知識がつくw ! • お客様との契約条項で、ReadOnlyと言わずに、PowerUser権限を委譲してもらう Ⓒ Classmethod, Inc. 11
  • 12.
    Ⓒ Classmethod, Inc. #cmdevio ご静聴ありがとうございました。 スライドは後日ブログで公開します。 12 DevIO MTUP11-001 I am IAMer… 哎呀!麻!!