AWS sms-voice: Add aws:SourceAccount condition to S3 bucket policy example for RCS files
Summary
Documents the RCS file message FileMessage/FileUrl and ThumbnailUrl parameters. Besides copy edits (Amazon S3 wording, demo bucket name amzn-s3-demo-bucket, punctuation), it hardens the example S3 bucket policy by adding a Condition requiring aws:SourceAccount to match the account ID, adds guidance to replace that account ID, and clarifies that an SSE-KMS key policy must grant the sms-voice.amazonaws.com service permission to use the key.
Security assessment
The example resource-based bucket policy now includes a Condition with aws:SourceAccount, a confused-deputy/authorization safeguard that restricts which account's requests the S3 read grant trusts—preventing an unintended principal from using AWS End User Messaging as a deputy to read the bucket. The surrounding text also tells users to replace the placeholder account ID and to grant the sms-voice.amazonaws.com service use of KMS keys for SSE-KMS, tightening encryption-related access. No specific vulnerability, incident, or CVE is referenced, so this is documented hardening rather than a fix for a named issue; other edits are purely editorial (e.g. s3://my-media-bucket renamed to s3://amzn-s3-demo-bucket).
Evidence
+ "aws:SourceAccount": "123456789012"
Diff
diff --git a/sms-voice/latest/userguide/rcs-file-messages.md b/sms-voice/latest/userguide/rcs-file-messages.md index d814706f5..2585b9812 100644 --- a//sms-voice/latest/userguide/rcs-file-messages.md +++ b//sms-voice/latest/userguide/rcs-file-messages.md @@ -15 +15 @@ File messages are distinct from rich card media. A file message delivers a singl -You can attach message-level suggestions (such as reply chips or action buttons) to file messages. For details about suggestions, see [Configuring RCS suggestions](./rcs-suggestions.html). +You can attach message-level suggestions, such as reply chips or action buttons, to file messages. For details about suggestions, see [Configuring RCS suggestions](./rcs-suggestions.html). @@ -25,2 +25,2 @@ The `FileMessage` object is nested inside the `Content` field of the `RcsMessage - "FileUrl": "s3://my-media-bucket/campaigns/welcome-image.png", - "ThumbnailUrl": "s3://my-media-bucket/thumbnails/welcome-thumb.jpg" + "FileUrl": "s3://amzn-s3-demo-bucket/campaigns/welcome-image.png", + "ThumbnailUrl": "s3://amzn-s3-demo-bucket/thumbnails/welcome-thumb.jpg" @@ -35 +35 @@ The `FileMessage` object is nested inside the `Content` field of the `RcsMessage -The S3 or HTTPS URL of the file to send. Maximum length is 2,000 characters. The URL must match the pattern `^(https://|s3://).+$`. The maximum file size is 100 MB. +The Amazon S3 or HTTPS URL of the file to send. Maximum length is 2,000 characters. The URL must match the pattern `^(https://|s3://).+$`. The maximum file size is 100 MB. @@ -40 +40 @@ The S3 or HTTPS URL of the file to send. Maximum length is 2,000 characters. The -The S3 or HTTPS URL of a thumbnail image. Maximum length is 2,000 characters. Follows the same URL pattern as `FileUrl`. Recommended for video and PDF files. +The Amazon S3 or HTTPS URL of a thumbnail image. Maximum length is 2,000 characters. The URL follows the same URL pattern as `FileUrl`. Recommended for video and PDF files. @@ -46 +46 @@ The `FileUrl` parameter accepts two URL formats: - * **Amazon S3 URLs** (`s3://bucket-name/object-key`). When you specify an S3 URL, AWS End User Messaging retrieves the object, rehosts it, and generates a time-limited presigned URL for delivery to the recipient's device. The S3 bucket must have a resource-based policy that grants the service read access. See S3 bucket policy for file delivery. + * **Amazon S3 URLs** (`s3://bucket-name/object-key`) – When you specify an Amazon S3 URL, AWS End User Messaging retrieves the object, rehosts it, and generates a time-limited presigned URL for delivery to the recipient's device. The S3 bucket must have a resource-based policy that grants the service read access. For more information, see S3 bucket policy for file delivery. @@ -48 +48 @@ The `FileUrl` parameter accepts two URL formats: - * **HTTPS URLs** (`https://cdn.example.com/path/to/file.jpg`). The URL is passed through to the carrier for delivery. The URL must be publicly accessible without authentication. Plain `http://` URLs are not supported. + * **HTTPS URLs** (`https://cdn.example.com/path/to/file.jpg`) – The URL is passed through to the carrier for delivery. The URL must be publicly accessible without authentication. Plain `http://` URLs are not supported. @@ -55 +55 @@ The `FileUrl` parameter accepts two URL formats: -When you use an S3 URL, the API validates at request time that the object exists, is within size limits, and is accessible. If validation fails, the API returns a `ValidationException` with a descriptive error message. HTTPS URLs are not validated at request time in the same way. +When you use an Amazon S3 URL, the API validates at request time that the object exists, is within size limits, and is accessible. If validation fails, the API returns a `ValidationException` error with a descriptive error message. HTTPS URLs are not validated at request time in the same way. @@ -59 +59 @@ When you use an S3 URL, the API validates at request time that the object exists -To allow AWS End User Messaging to retrieve files from your Amazon S3 bucket, attach the following resource-based policy to the bucket: +To allow AWS End User Messaging to retrieve files from your S3 bucket, attach the following resource-based policy to the bucket: @@ -71 +71,6 @@ To allow AWS End User Messaging to retrieve files from your Amazon S3 bucket, at - "Resource": "arn:aws:s3:::YOUR-BUCKET/*" + "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*", + "Condition": { + "StringEquals": { + "aws:SourceAccount": "123456789012" + } + } @@ -76 +81 @@ To allow AWS End User Messaging to retrieve files from your Amazon S3 bucket, at -Replace `YOUR-BUCKET` with your bucket name. To restrict access to a specific prefix, replace `/*` with the desired path (for example, `arn:aws:s3:::YOUR-BUCKET/rcs-media/*`). +Replace `123456789012` with the account ID for your AWS account. Replace `amzn-s3-demo-bucket` with the name of your S3 bucket. To restrict access to a specific prefix in the bucket, replace `/*` with the path—for example, `arn:aws:s3:::amzn-s3-demo-bucket/rcs-media/*`. @@ -80 +85 @@ Replace `YOUR-BUCKET` with your bucket name. To restrict access to a specific pr -If your bucket uses SSE-KMS encryption, you must also grant the `sms-voice.amazonaws.com` service permission to use the KMS key in the key policy. SSE-S3 encryption does not require additional configuration. +If your S3 bucket uses SSE-KMS encryption, the key policy for the AWS KMS key must also grant permissions for the `sms-voice.amazonaws.com` service to use the key. SSE-S3 encryption does not require additional configuration. @@ -103 +108 @@ The 100 MB file size limit is enforced at the API layer. Individual carriers mig -You can provide a thumbnail image for video and PDF file messages using the `ThumbnailUrl` parameter. The thumbnail displays as a preview in the conversation before the recipient opens or downloads the full file. +You can provide a thumbnail image for video and PDF file messages by using the `ThumbnailUrl` parameter. The thumbnail displays as a preview in the conversation before the recipient opens or downloads the full file. @@ -105 +110 @@ You can provide a thumbnail image for video and PDF file messages using the `Thu - * Supported thumbnail formats: JPEG, PNG. + * Supported thumbnail formats are JPEG and PNG. @@ -107 +112 @@ You can provide a thumbnail image for video and PDF file messages using the `Thu - * The thumbnail URL follows the same format rules as `FileUrl` (S3 or HTTPS, maximum 2,000 characters). + * The thumbnail URL follows the same format rules as `FileUrl` (Amazon S3 or HTTPS, maximum 2,000 characters). @@ -116 +121 @@ You can provide a thumbnail image for video and PDF file messages using the `Thu -To send a file message, call the `SendRcsMessage` API with a `FileMessage` object inside the `RcsMessageContent` parameter. You specify the origination identity (a pool or an AWS RCS Agent) using the `--origination-identity` parameter. +To send a file message, call the `SendRcsMessage` API with a `FileMessage` object inside the `RcsMessageContent` parameter. You specify the origination identity (a pool or an AWS RCS Agent) by using the `--origination-identity` parameter. @@ -118 +123 @@ To send a file message, call the `SendRcsMessage` API with a `FileMessage` objec -The following JSON shows the `RcsMessageContent` value for a file message with suggestions: +The following JSON example shows the `RcsMessageContent` value for a file message with suggestions. @@ -124,2 +129,2 @@ The following JSON shows the `RcsMessageContent` value for a file message with s - "FileUrl": "s3://my-media-bucket/documents/invoice.pdf", - "ThumbnailUrl": "s3://my-media-bucket/thumbnails/invoice-thumb.jpg" + "FileUrl": "s3://amzn-s3-demo-bucket/documents/invoice.pdf", + "ThumbnailUrl": "s3://amzn-s3-demo-bucket/thumbnails/invoice-thumb.jpg" @@ -140 +145 @@ The following JSON shows the `RcsMessageContent` value for a file message with s -When you send a file message, AWS End User Messaging attempts to deliver it over the RCS channel. If the recipient's device does not support RCS, or if the message expires before delivery (based on the `TimeToLive` value), the service can fall back to SMS or MMS depending on your fallback configuration. +When you send a file message, AWS End User Messaging attempts to deliver it over the RCS channel. If the recipient's device does not support RCS or the message expires before delivery (based on the `TimeToLive` value), the service can fall back to SMS or MMS depending on your fallback configuration.