To improve the security of your web applications in the AWS cloud, ensure that the Web Application Firewall version 2 (WAFv2) service is in use. WAFv2 protects your applications from common security exploits that could impact their availability, compromise their security, or consume excessive resources through attacks like resource starvation. As a web application firewall service, AWS WAFv2 enables you to monitor all HTTP(S) requests forwarded to AWS resources, such as Amazon CloudFront distributions, Amazon API Gateway REST APIs, Application Load Balancers, AWS AppSync GraphQL APIs, AWS Amplify applications, and AWS Verified Access instances. To enable WAFv2 protection, you must first create web Access Control Lists (ACLs). These ACLs define rules that reference one or more conditions and specify the actions to take when each rule is met. Once created, these WAF ACLs can be attached to the supported cloud resources in your AWS account.
Using the AWS WAFv2 service can significantly enhance the security and availability of websites and web applications in your AWS cloud environment. The main benefits of using AWS WAFv2 include:
- Robust protection against common web attacks: WAFv2 safeguards your web applications from threats like SQL injection (SQLi), Cross-Site Scripting (XSS), Cross-Site Request Forgery (CSRF), and HTTP Flood (DDoS) attacks. It does this by filtering incoming traffic based on the custom firewall rules you create.
- Improved web traffic visibility: the service provides real-time insights into your web traffic. This data can be used to create custom rules and set up alerts within AWS CloudWatch, giving you better control and awareness of your application's security posture.
- Ease of deployment and maintenance: WAFv2 is easy to deploy without the need for additional software. It also offers a full-featured API that you can use to automate the creation, deployment, and maintenance of your web security rules, streamlining your operations.
- Seamless integration with the development process: WAFv2 allows you to define application-specific rules, which helps to increase security as you develop and update your web applications.
- Cost-effectiveness: You only pay for what you use, as pricing is based on the number of rules you create and the number of requests your applications receive. There are no upfront commitments or minimum fees.
Audit
To determine if AWS WAFv2 is used as web application firewall service within your AWS cloud account, perform the following operations:
Remediation / Resolution
To use AWS WAFv2 as a web application firewall, you must create one or more protection packs (web ACLs). Each ACL contains rules and actions that are performed when a rule is satisfied. After defining the necessary rules and actions, you can assign the new web ACL to an AWS cloud resource. To deploy your first AWS WAFv2 protection pack (web ACL), perform the following operations:
As an example, this KB guide demonstrates how AWS WAFv2 can be configured to protect a web application served by a global Amazon CloudFront distribution. The new web ACL blocks exploits from a range of malicious IP addresses, including those operated by spammers, botnets, and malware distributors.References
- AWS Documentation
- How AWS WAF works
- Configuring protection in AWS WAF
- AWS WAF rules
- Using AWS WAF with Amazon CloudFront
- AWS Command Line Interface (CLI) Documentation
- list-web-acls
- create-web-acl
- update-distribution