ポリシー概要の例 - AWS Identity and Access Management

ポリシー概要の例

以下の例には、JSON ポリシーと共に、関連するポリシー概要サービス概要アクション概要が 含まれており、ポリシーを通じて付与されるアクセス許可を理解するのに役立ちます。

ポリシー 1: DenyCustomerBucket

このポリシーは、同じサービスに対する許可および拒否を示します。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "FullAccess", "Effect": "Allow", "Action": ["s3:*"], "Resource": ["*"] }, { "Sid": "DenyCustomerBucket", "Action": ["s3:*"], "Effect": "Deny", "Resource": ["arn:aws:s3:::customer", "arn:aws:s3:::customer/*" ] } ] }

DenyCustomerBucket ポリシー概要:

ポリシー概要のダイアログイメージ

DenyCustomerBucket S3 (Explicit deny) サービス概要:

サービス概要のダイアログイメージ

GetObject (Read) アクション概要:

アクション概要のダイアログイメージ

ポリシー 2: DynamoDbRowCognitoID

このポリシーでは、ユーザーの Amazon Cognito ID に基づいて、行レベルで Amazon DynamoDB にアクセスできます。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "dynamodb:DeleteItem", "dynamodb:GetItem", "dynamodb:PutItem", "dynamodb:UpdateItem" ], "Resource": [ "arn:aws:dynamodb:us-west-1:123456789012:table/myDynamoTable" ], "Condition": { "ForAllValues:StringEquals": { "dynamodb:LeadingKeys": [ "${cognito-identity.amazonaws.com:sub}" ] } } } ] }

DynamoDbRowCognitoID ポリシー概要:

ポリシー概要のダイアログイメージ

DynamoDbRowCognitoID DynamoDB (Allow) サービス概要:

サービス概要のダイアログイメージ

GetItem (List) アクション概要:

アクション概要のダイアログイメージ

ポリシー 3: MultipleResourceCondition

このポリシーには、複数のリソースと条件が含まれます。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:PutObjectAcl" ], "Resource": ["arn:aws:s3:::Apple_bucket/*"], "Condition": {"StringEquals": {"s3:x-amz-acl": ["public-read"]}} }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:PutObjectAcl" ], "Resource": ["arn:aws:s3:::Orange_bucket/*"], "Condition": {"StringEquals": { "s3:x-amz-acl": ["custom"], "s3:x-amz-grant-full-control": ["1234"] }} } ] }

MultipleResourceCondition ポリシー概要:

ポリシー概要のダイアログイメージ

MultipleResourceCondition S3 (Allow) サービス概要:

サービス概要のダイアログイメージ

PutObject (Write) アクション概要:

アクション概要のダイアログイメージ

ポリシー 4: EC2_Troubleshoot

以下のポリシーでは、ユーザーは実行中の Amazon EC2 インスタンスのスクリーンショットを取得できます。このスクリーンショットは EC2 のトラブルシューティングに役立つ場合があります。このポリシーでは、Amazon S3 開発者バケット内のアイテムに関する情報の表示も許可されます。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:GetConsoleScreenshot" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::developer" ] } ] }

EC2_Troubleshoot ポリシー概要:

ポリシー概要のダイアログイメージ

EC2_Troubleshoot S3 (Allow) サービス概要:

サービス概要のダイアログイメージ

ListBucket (List) アクション概要:

アクション概要のダイアログイメージ

ポリシー 5: CodeBuild_CodeCommit_CodeDeploy

このポリシーでは、特定の CodeBuild、CodeCommit、および CodeDeploy リソースへのアクセスを許可します。これらのリソースは各サービスに固有であるため、一致するサービスでのみ表示されます。いずれのサービスとも一致しないリソースを Action 要素の含めた場合、そのリソースはすべてのアクション概要に表示されます。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1487980617000", "Effect": "Allow", "Action": [ "codebuild:*", "codecommit:*", "codedeploy:*" ], "Resource": [ "arn:aws:codebuild:us-east-2:123456789012:project/my-demo-project", "arn:aws:codecommit:us-east-2:123456789012:MyDemoRepo", "arn:aws:codedeploy:us-east-2:123456789012:application:WordPress_App", "arn:aws:codedeploy:us-east-2:123456789012:instance/AssetTag*" ] } ] }

CodeBuild_CodeCommit_CodeDeploy ポリシー概要:

ポリシー概要のダイアログイメージ

CodeBuild_CodeCommit_CodeDeploy CodeBuild (Allow) サービス概要:

サービス概要のダイアログイメージ

CodeBuild_CodeCommit_CodeDeploy StartBuild (Write) アクション概要:

アクション概要のダイアログイメージ