There is an improvement that can be made around the 9:15 mark in the S3 Bucket Policies video within the Certified Security Specialty course. Ryan states that the "/*" wildcard is necessary for Bucket Policies and that this question will come up on the exam but this is incorrect. Certain S3 Actions require that wildcard but that same wildcard will generate an error message for other Action commands.
For instance, Ryan’s video is using the s3:DeleteObject Action for his example and this Action requires the "/" Resource wildcard so that AWS knows the policies applies to ALL objects within that bucket, without that wildcard the AWS console will return an error in applying this policy. BUT – Using this same scenario with s3:DeleteBucket Action instead of s3:DeleteObject returns an error if the "/" wildcard is used in this ARN segment because the bucket DeleteBucket Action is to be applied to S3 buckets NOT objects within the buckets themselves.
Thanks for all the great work your ACG team is doing! With your help I was able to pass the Certified Cloud Practitioner and the Associate Solutions Architect exams.
Yes I think it is inconsistent the way that rule seems to apply! Sometimes you need to add the wildcard and sometimes not.. I’ll take a look at this and see if I can figure out when you need it and if there’s a reason behind it!
Thanks js.doolitte and Faye! I’ve researched this and figured out the consistent rationale. This rationale is important too because I took one of AWS’ own Security Specialty practice tests and understanding this rationale was required for me to get one of the practice test’s questions correct.
There are two kinds of AWS S3 Bucket "Actions": 1 – Object Operations and 2 – Bucket Operations. Object Operations Actions must be applied to a object or an array or objects while Bucket Operations Actions must be applied to a bucket or a selection of buckets. Therefore the se:DeleteObject action requires that it is applied to an object resource or a wildcard of object resources such as: "arn:aws:s3:::examplebucket/*". I have included the AWS’ link below that explains the topic perfectly.
Considering this topic is important enough for AWS to include it in their practice tests, I would think that the content in the ACG video should be updated accordingly whenever your team takes its next pass through making Security Specialty updates.
Yes thanks Brian et al. I tested this too. Essentially, its best practice to create two statements, one for object operations and one for bucket operations if you are pointing to a single bucket. For object operations the relative ars resource needs a / operator at the end. If you need to allow bucket operations on the same bucket ars do not add the / otherwise it will fail unless you are using a wildcard for all users in the principal parameter. Looks like explicit denies and allows permit the use of the / too although, I tested without the /* and they work fine without them.
I think the answer is to include both resource types for example.