
Answer-first summary for fast verification
Answer: Restrict access by using CORS
Restrict access by using CORS - Cross-origin resource sharing (CORS) defines a way for client web applications that are loaded in one domain to interact with resources in a different domain. When your API's resources receive requests from a domain other than the API's own domain and you want to restrict servicing these requests, you must disable cross-origin resource sharing (CORS) for selected methods on the resource. Incorrect options: Use Account-level throttling - To prevent your API from being overwhelmed by too many requests, Amazon API Gateway throttles requests to your API. By default, API Gateway limits the steady-state request rate to 10,000 requests per second (rps). It limits the burst (that is, the maximum bucket size) to 5,000 requests across all APIs within an AWS account. This is Account-level throttling. As you see, this is about limit on the number of requests and is not a suitable answer for the current scenario. Use Mapping Templates - A mapping template is a script expressed in Velocity Template Language (VTL) and applied to the payload using JSONPath expressions. Mapping templates help format/structure the data in a way that it is easily readable, unlike a server response that might always be easy to ready. Mapping Templates have nothing to do with access and are not useful for the current scenario. Assign a Security Group to your API Gateway - API Gateway does not use security groups but uses resource policies, which are JSON policy documents that you attach to an API to control whether a specified principal (typically an IAM user or role) can invoke the API. You can restrict IP address using this, the downside being, an IP address can be changed by the accessing user. So, this is not an optimal solution for the current use case.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your team is responsible for managing a public API Gateway that is frequently accessed by clients from a specific domain. For the past few months, client usage has remained stable, but there has recently been a significant increase, with usage more than doubling. This surge has led to a rise in costs, and you are concerned about unauthorized access from other domains.
What actions should you take to ensure that your API is only accessed by authorized domains and prevent unauthorized domain access?
A
Assign a Security Group to your API Gateway
B
Restrict access by using CORS
C
Use Account-level throttling
D
Use Mapping Templates
No comments yet.