An enterprise is auditing its multi-account AWS environment to strengthen network and identity security. The environment consists of a central logging AWS account (Account A) and a production member account (Account B). Applications running in Account B currently write log files to an Amazon S3 bucket located in Account A. The S3 bucket is encrypted using the default AWS managed key (`aws/s3`), and the bucket policy allows wildcard access (`"Principal": "*"`) filtered by a condition restricting access to the organization's ID.
To improve the security posture, the company wants to implement the following changes:
1. Enforce encryption of the logs using a Customer Managed Key (CMK) that supports key rotation and cross-account access.
2. Restrict bucket access strictly to a specific IAM role (`AppLogRole`) in Account B.
3. Ensure all logging traffic is routed privately and securely, preventing access to the bucket from outside a specific VPC interface endpoint (`vpce-12345678`) deployed in Account B.
Which combination of actions will meet these security requirements?
- Create a customer managed key in Account A with a key policy that grants kms:GenerateDataKey and kms:Decrypt permissions to the AppLogRole in Account B. Update the S3 bucket policy in Account A to allow s3:PutObject permissions to the AppLogRole in Account B, while adding a policy statement that denies any S3 actions on the bucket if the aws:sourceVpce condition does not match vpce-12345678.Cevap
- BCreate a customer managed key in Account A. Apply a Service Control Policy (SCP) to Account B that allows the AppLogRole to perform kms:GenerateDataKey against Account A's key resource. Update the S3 bucket policy in Account A to allow s3:PutObject permissions to the AppLogRole in Account B, while adding a policy statement that denies any S3 actions if the aws:sourceVpc condition does not match the production VPC ID.
- CModify the key policy of the default AWS managed S3 key (aws/s3) in Account A to grant kms:GenerateDataKey and kms:Decrypt permissions to the AppLogRole in Account B. Update the S3 bucket policy in Account A to allow s3:PutObject permissions to the AppLogRole in Account B, while adding a policy statement that denies any S3 actions if the aws:sourceVpce condition does not match vpce-12345678.
- DCreate a customer managed key in Account A with a key policy that grants kms:GenerateDataKey and kms:Decrypt permissions to Account B's root account. Update the S3 bucket policy in Account A to allow s3:PutObject permissions to the AppLogRole in Account B, but do not restrict the VPC endpoint in the bucket policy, relying instead on a Service Control Policy (SCP) in Account B to block S3 API calls unless the request originates from vpce-12345678.