AWS AmazonS3: S3: correct s3:annotation-prefix condition key usage and actions
Summary
Fixes Example 9 to describe restricting annotation listing (not access) by name prefix, corrects the actions to s3:ListObjectAnnotations/s3:ListObjectVersionAnnotations, fixes the prefix value and the s3:ListObjectAnnotation action name, and adds a note that s3:annotation-prefix cannot be combined with Put/Get/DeleteObjectAnnotation.
Security assessment
The change corrects IAM policy examples and clarifies which actions the s3:annotation-prefix condition key applies to, improving accuracy of access-control documentation; it is a documentation correction, not a fix for a specific vulnerability.
Evidence
+You can't use `s3:annotation-prefix` with `PutObjectAnnotation`, `GetObjectAnnotation`, or `DeleteObjectAnnotation`. If a policy statement combines this condition key with those actions, IAM rejects the policy with the error `Conditions do not apply to combination of actions and resources in statement`.
Diff
diff --git a/AmazonS3/latest/userguide/amazon-s3-policy-keys.md b/AmazonS3/latest/userguide/amazon-s3-policy-keys.md index 07d011f..587614e 100644 --- a//AmazonS3/latest/userguide/amazon-s3-policy-keys.md +++ b//AmazonS3/latest/userguide/amazon-s3-policy-keys.md @@ -43 +43 @@ Several of the example policies show how you can use conditions keys with [PUT O - * Example 9: Restricting annotation access by name prefix + * Example 9: Restricting annotation listing by name prefix @@ -340 +340 @@ For bucket policy examples that use conditions in a bucket policy to enforce con -### Example 9: Restricting annotation access by name prefix +### Example 9: Restricting annotation listing by name prefix @@ -342 +342,5 @@ For bucket policy examples that use conditions in a bucket policy to enforce con -The following bucket policy grants the `s3user` user permission to create, retrieve, and delete annotations that have names beginning with `ml-output.`. This allows you to restrict annotation access by annotation name prefix. +The following bucket policy grants the `s3user` user permission to list only the annotations whose names start with `ml-output` on objects in `amzn-s3-demo-bucket`. The `s3:annotation-prefix` condition key applies only to the `ListObjectAnnotations` and `ListObjectVersionAnnotations` actions. + +###### Note + +You can't use `s3:annotation-prefix` with `PutObjectAnnotation`, `GetObjectAnnotation`, or `DeleteObjectAnnotation`. If a policy statement combines this condition key with those actions, IAM rejects the policy with the error `Conditions do not apply to combination of actions and resources in statement`. @@ -354,3 +358,2 @@ The following bucket policy grants the `s3user` user permission to create, retri - "s3:PutObjectAnnotation", - "s3:GetObjectAnnotation", - "s3:DeleteObjectAnnotation" + "s3:ListObjectAnnotations", + "s3:ListObjectVersionAnnotations" @@ -361 +364 @@ The following bucket policy grants the `s3user` user permission to create, retri - "s3:annotation-prefix": "ml-output.*" + "s3:annotation-prefix": "ml-output*" @@ -406 +409 @@ The following bucket policy limits the `max-annotation-results` parameter to 100 - "Action": "s3:ListObjectAnnotation", + "Action": "s3:ListObjectAnnotations",