Soru

Zorluk: OrtaAPI Gateway Security and Authorization

An organization is migrating a legacy system to AWS and exposing its services through an Amazon API Gateway REST API. The client applications authenticate using custom JWTs issued by a proprietary on-premises identity provider that cannot be integrated with Amazon Cognito. The API Gateway must validate these tokens and extract custom claims to authorize requests before forwarding them to the backend microservices. Which authorization strategy should the developer implement to secure this API with the least operational complexity?

  1. Configure a Lambda authorizer on the API Gateway to decode and validate the incoming JWT, and return an IAM policy that grants or denies access to the API methods.Cevap
  2. B
    Configure a Lambda proxy integration for the API, and write validation logic inside the backend Lambda function to decode the JWT and return a 401 Unauthorized status if invalid.
  3. C
    Configure an Amazon Cognito identity pool to authenticate the clients, exchange their proprietary JWTs for temporary AWS credentials, and enforce IAM authorization on the API.
  4. D
    Configure an Amazon Cognito user pool with a built-in Cognito authorizer on the API Gateway, and configure client applications to authenticate natively with User Pool endpoints.

Cevap

Configure a Lambda authorizer on the API Gateway to decode and validate the incoming JWT, and return an IAM policy that grants or denies access to the API methods.
The correct strategy is to use a Lambda authorizer on the API Gateway. This allows the API Gateway to execute a custom Lambda function to validate the incoming proprietary JWT and return a cached IAM policy that controls access to the API methods, securing the API at the perimeter.

Adım Adım Çözüm

1
Analyze the token source and integration requirements.
The clients use custom JWTs from a proprietary on-premises provider that cannot integrate with Amazon Cognito.
This rules out native Amazon Cognito User Pool authorizers since the tokens are not Cognito-native.
2
Evaluate where token validation and authorization should occur.
Validation should occur at the API Gateway boundary rather than in the backend proxy integration.
Performing checks at the gateway prevents unauthorized invocations of backend services, optimizing cost and security.
3
Select the correct API Gateway custom authentication mechanism.
Configure a Lambda authorizer.
Lambda authorizers are designed to parse custom tokens, validate them against custom logic, and return an IAM policy representing permissions.

Anahtar Kavram

Lambda Authorizers for Custom Token Validation
Tahmini Süre:1m 30s
Bu soruyu puanla