SCS-C03 practice question 11 of 15

A company is operating an open-source software platform that is internet facing. The legacy software platform no longer receives security updates…

Full set: 227 questions
A company is operating an open-source software platform that is internet facing. The legacy software platform no longer receives security updates. The software platform operates using Amazon Route 53 weighted load balancing to send traffic to two Amazon EC2 instances that connect to an Amazon RDS cluster. A recent report suggests this software platform is vulnerable to SQL injection attacks, with samples of attacks provided. The company's security engineer must secure this system against SQL injection attacks within 24 hours. The solution must involve the least amount of effort and maintain normal operations during implementation. What should the security engineer do to meet these requirements?
Answer options
A: Create an Application Load Balancer with the existing EC2 instances as a target group. Create an AWS WAF web ACL containing rules that protect the application from this attack, then apply it to the ALB. Test to ensure the vulnerability has been mitigated, then redirect the Route 53 records to point to the ALB. Update security groups on the EC2 instances to prevent direct access from the internet. Correct answer
B: Create an Amazon CloudFront distribution specifying one EC2 instance as an origin. Create an AWS WAF web ACL containing rules that protect the application from this attack, then apply it to the distribution. Test to ensure the vulnerability has been mitigated, then redirect the Route 53 records to point to CloudFront.
C: Obtain the latest source code for the platform and make the necessary updates. Test the updated code to ensure that the vulnerability has been mitigated, then deploy the patched version of the platform to the EC2 instances.
D: Update the security group that is attached to the EC2 instances, removing access from the internet to the TCP port used by the SQL database. Create an AWS WAF web ACL containing rules that protect the application from this attack, then apply it to the EC2 instances.
Correct Answer:
A. Create an Application Load Balancer with the existing EC2 instances as a target group. Create an AWS WAF web ACL containing rules that protect the application from this attack, then apply it to the ALB. Test to ensure the vulnerability has been mitigated, then redirect the Route 53 records to point to the ALB. Update security groups on the EC2 instances to prevent direct access from the internet.
Explanation

The most effective and rapid solution is to place an Application Load Balancer (ALB) in front of the EC2 instances and protect it with AWS WAF. AWS WAF can be configured with managed rule sets, such as the AWSManagedRulesSQLiRuleSet, to block common SQL injection attacks at the application layer. This approach acts as a virtual patch, requires no changes to the legacy application code, and can be implemented quickly. Redirecting traffic via Route 53 after testing ensures a smooth transition with no downtime, meeting all the requirements.

Why Incorrect

B. While AWS WAF can be used with CloudFront, an ALB is a more direct and suitable replacement for the existing Route 53 weighted load balancing between EC2 instances.
C. Patching the legacy source code is the ideal long-term fix but is unlikely to be completed within 24 hours with the least effort, especially for an unsupported platform.
D. AWS WAF cannot be applied directly to EC2 instances. It must be associated with an ALB, CloudFront distribution, API Gateway, or AppSync. Blocking the SQL port does not prevent SQL injection attacks.

References

1. AWS Documentation. (2024). How AWS WAF works. AWS WAF Developer Guide. Retrieved from https://docs.aws.amazon.com/waf/latest/developerguide/how-aws-waf-works.html (Section: "AWS resources that you can protect with AWS WAF")

2. AWS Documentation. (2024). AWS Managed Rules rule groups list. AWS WAF Developer Guide. Retrieved from https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-list.html (Table entry for "SQL database")

3. AWS Documentation. (2024). What is an Application Load Balancer? Elastic Load Balancing User Guide. Retrieved from https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html

Scroll to Top