February 2020
Intermediate to advanced
440 pages
13h 51m
English
In this section, we will create a policy with the JSON we generated in the previous recipe. If you are following along from the previous section, detach the current policy from the group (or user) and confirm that the testuser user cannot list the contents of the bucket. Let's get started:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "MyS3ListBucketPolicy", "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::awsseccookbook", "Condition": { "DateLessThan": { "aws:EpochTime": "1609415999" } } } ]}
The preceding policy will only allow access if the current EPOCH timestamp is less than the EPOCH timestamp ...
Read now
Unlock full access