SDLC Automation

A CodeBuild project in account A must retrieve a rotating Secrets Manager secret from account B at build time without assuming another role or copying the secret. The secret uses account B's AWS managed aws/secretsmanager key, and no cross-account permissions exist; which configuration meets these requirements?

Show the answer

Correct answerD. Use a customer managed key; authorize the CodeBuild role through the secret resource policy, identity policy, and key policy.

AWhy not this: The AWS managed aws/secretsmanager key cannot be used for cross-account secret access.

BWhy not this: Cross-account retrieval also requires a secret resource policy that authorizes the CodeBuild role.

CWhy not this: CodeBuild retrieves the secret using its service role; permissions for the pipeline role do not authorize that retrieval.

DWhy this is right: This authorizes the actual caller to retrieve the secret and decrypt it across accounts using a customer managed key.

Direct cross-account retrieval requires secret access in the CodeBuild role's identity policy and the secret resource policy, plus decrypt authorization for a customer managed KMS key. The AWS managed aws/secretsmanager key cannot support cross-account secret access.