A developer is designing a secure communication channel between an internal inventory processing application running on Amazon ECS tasks and a backend Amazon API Gateway REST API in the same AWS account. The API must only accept requests originating from the ECS tasks, and unauthorized access must be blocked at the API Gateway layer before invoking any backend integration. The developer wants to implement this security control with the least administrative and custom development effort.
Which of the following authorization strategies meets these requirements?
- Configure the API Gateway method authorization to AWS_IAM, attach an IAM policy to the ECS Task Role allowing the execute-api:Invoke action, and configure the ECS application to sign requests using Signature Version 4.Cevap
- BConfigure a Lambda custom authorizer that intercepts incoming requests, parses the ECS container metadata, and manually validates the caller's IAM role credentials against an access control list.
- CConfigure an Amazon Cognito Identity Pool as the API Gateway method authorizer, and configure the ECS application to obtain and submit OpenID Connect tokens to authenticate requests.
- DSet up API Gateway to use Lambda Proxy Integration, and write custom validation logic in the backend Lambda function to verify the caller's identity in the request context.
Cevap
Configure the API Gateway method authorization to AWS_IAM, attach an IAM policy to the ECS Task Role allowing the execute-api:Invoke action, and configure the ECS application to sign requests using Signature Version 4.
The correct strategy leverages the native AWS_IAM authorization feature of Amazon API Gateway. When a REST API method is configured with AWS_IAM authorization, callers must sign their requests using AWS Signature Version 4 (SigV4). The ECS Task Role is granted permissions via an IAM policy allowing the execute-api:Invoke action. This approach meets all security requirements, enforces authorization at the API Gateway layer before invoking backend resources, and requires zero custom code or authorizer management.
Adım Adım Çözüm
Anahtar Kavram
API Gateway AWS_IAM Authorization