An application running on an Amazon EC2 instance in Account A () must write logs to an Amazon CloudWatch Logs log group in Account B (). A SysOps administrator is configuring the application to programmatically assume an IAM role named `CrossAccountLogWriterRole` in Account B to perform this action.
Which of the following configuration steps are required to establish this cross-account access? (Select TWO.)
- Attach an IAM policy to the EC2 instance's IAM role in Account A that allows the `sts:AssumeRole` action on the `CrossAccountLogWriterRole` ARN in Account B.Cevap
- Modify the trust policy of `CrossAccountLogWriterRole` in Account B to allow the EC2 instance's IAM role in Account A to perform the `sts:AssumeRole` action.Cevap
- CAttach an IAM policy to the EC2 instance's IAM role in Account A that allows the `iam:PassRole` action on the `CrossAccountLogWriterRole` ARN in Account B.
- DModify the trust policy of `CrossAccountLogWriterRole` in Account B to allow the EC2 instance's IAM role in Account A to perform the `iam:PassRole` action.
Cevap
To configure cross-account access, the administrator must attach an IAM policy to the EC2 instance's IAM role in Account A to allow the sts:AssumeRole action on the target role, and modify the trust policy of the CrossAccountLogWriterRole in Account B to allow the EC2 instance's IAM role to perform the sts:AssumeRole action.
Establishing cross-account delegation requires configuring both sides of the trust relationship. First, the calling identity (the EC2 instance's IAM role in Account A) must have an IAM policy that permits the sts:AssumeRole action on the destination role's ARN in Account B. Second, the destination role (CrossAccountLogWriterRole in Account B) must have a trust policy that permits the EC2 instance's IAM role to assume it.
Adım Adım Çözüm
Anahtar Kavram
Cross-account delegation requires a two-way handshake: the source principal's permission policy must allow calling sts:AssumeRole on the target role, and the target role's trust policy must trust the source principal.