Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jTakasuRyuji/bee4e81bd4927872cd892f6fb3d1c35b to your computer and use it in GitHub Desktop.

Select an option

Save jTakasuRyuji/bee4e81bd4927872cd892f6fb3d1c35b to your computer and use it in GitHub Desktop.
S3,IAM(Group,User,Policy)をCLI(CloudShell)にてまとめて定義
#[step1/6]S3バケットの新規作成
aws s3 mb s3://9999.lab1.example.jp
#[step2/6]ユーザーを新規作成する
aws iam create-user --user-name scott --tags Key=department,Value=car_shop_scott Key=location,Value=tuchiura_ibaraki_japan
#[step3/6]アクセスキーを発行する
aws iam create-access-key --user-name scott
#[step4/6]新しいグループを作成する
aws iam create-group --group-name corp_scott
#[step5/6]グループにユーザーを参加させる
aws iam add-user-to-group --user-name scott --group-name corp_scott
#[step6/6]グループに権限付与する
aws iam attach-group-policy --group-name corp_scott --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess
@jTakasuRyuji
Copy link
Author

このグループポリシーを適用すると、以下のリスクが発生します
corp_scottのすべてのメンバーは バケットの作成・削除といったS3に対するすべてのタスクが実行可能になる
→適切なポリシー付与が必要(テックデモの為、AmazonS3FullAccessとして説明)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment