Question 1
A company exposes a public REST API through Amazon API Gateway. Security reviewers found cross-site scripting payloads in request bodies sent to the API. The company wants protection against common web exploits without writing custom rules, and with the LEAST operational overhead. What should it do?
- A.Write an AWS WAF byte match rule for each malicious string found in the logs, and update the rule every time a new payload appears, and keep a log of each change.
- B.Enable Amazon Inspector so that it blocks cross-site scripting payloads that reach the API, using its network exposure findings.
- C.Enable AWS Shield Standard, which inspects request bodies for cross-site scripting patterns and blocks any payload that matches.
- D.Attach an AWS WAF web ACL to the REST API that uses the AWS managed Core rule set, which inspects request bodies for cross-site scripting patterns.
Show answer and explanation
Correct answer: D
The AWS managed Core rule set is maintained by AWS and includes cross-site scripting rules for query arguments, the URI path, cookies and the request body. Attaching it to the API's web ACL needs no custom rules.
Why the other options are wrong
- A.A byte match rule is a custom rule, which the company wants to avoid, and each new payload would need another rule.
- B.Inspector finds software vulnerabilities and network exposure in EC2, ECR and Lambda. It does not inspect or block web requests.
- C.Shield Standard defends against network and transport layer DDoS attacks. It doesn't inspect request bodies for cross-site scripting.