Lesson 2 of 4 AWS Security Services

Protecting Applications with AWS WAF, AWS Shield and Network Firewalls

This lesson explains how applications on AWS are protected from web exploits and distributed denial-of-service (DDoS) attacks by layers of network and application security services.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe what AWS WAF protects against.
  • Distinguish AWS Shield Standard from AWS Shield Advanced.
  • Distinguish security groups, network ACLs and AWS WAF.
  • Describe how AWS Firewall Manager and AWS Marketplace tools support central management.

AWS WAF

AWS WAF, a web application firewall, protects apps served through CloudFront, Application Load Balancers, API Gateway and more. It blocks SQL injection and cross-site scripting (XSS), filters by IP address, country, headers or request rate, and offers managed rule groups.

AWS Shield

A distributed denial-of-service (DDoS) attack floods an application with traffic from many sources to make it unavailable. AWS Shield Standard protects every AWS customer automatically and at no cost against the most common DDoS attacks. AWS Shield Advanced is a paid service for applications that need more: it protects against larger and more sophisticated attacks, gives visibility of attacks as they happen, provides access to the AWS Shield Response Team at any time, and offers DDoS cost protection, which credits charges caused by scaling during an attack. The following table summarises the two tiers.

Shield Standard
CostFree, automatic for every customer
Protects againstThe most common DDoS attacks
Extras—
Shield Advanced
CostPaid
Protects againstLarger, more sophisticated attacks
Extras24/7 Shield Response Team, attack visibility, DDoS cost protection
Sort into groups

Shield Standard or Advanced?

Exam skills 2.4.1 · 2.2.3

Decide which tier of AWS Shield each statement describes.

Log in to try this activity Interactive activities are free with an account.

Security groups, network ACLs and AWS WAF

AWS provides firewall controls at three levels. A security group protects individual resources, such as an EC2 instance. It contains only allow rules, and it is stateful: if a request is allowed in, the reply is allowed out automatically. A network ACL protects a whole subnet. It can allow or deny traffic, which makes it useful for blocking a specific address, and it is stateless, so replies need their own rules. At the application layer, AWS WAF inspects the content of web requests, which neither security groups nor network ACLs can do. The following table summarises the three controls.

ControlApplies toBehaviour
Security groupInstancesStateful; allow rules only
Network ACLSubnetsStateless; allow and deny rules
AWS WAFWeb requests to CloudFront, load balancers and API GatewayInspects request content; blocks SQL injection, XSS, IPs and countries

The following diagram places each control on the path from the internet to an instance.

Three levels of network and application protection. AWS WAF inspects the content of web requests to CloudFront, load balancers and API Gateway, blocking attacks such as SQL injection and cross-site scripting. A network ACL protects a whole subnet with allow and deny rules and is stateless, so replies need their own rules. A security group protects individual instances with allow rules only and is stateful, so replies are allowed automatically.
Security works in layers.
Sort into groups

Security group, network ACL or WAF?

Exam skills 3.5.2 · 2.4.1

Decide which firewall control each statement describes.

Log in to try this activity Interactive activities are free with an account.

Central management and third-party tools

Security controls can be managed centrally and supplemented with third-party tools. The following list describes the available options.

  • AWS Firewall Manager centrally manages WAF rules, Shield Advanced and security groups across many accounts, applying them to new accounts automatically.
  • Third-party firewalls, antivirus and monitoring tools are available in AWS Marketplace, billed through your AWS account.
True or false

Central security management

Exam skills 2.4.1 · 2.4.2

Check how security controls are managed centrally and extended.

Log in to try this activity Interactive activities are free with an account.
Worked example

Layers of protection for a web shop

An online shop wants to protect itself from several kinds of attack. Each layer uses a different service:

ThreatProtection
A flood of traffic trying to knock the site offline (DDoS)AWS Shield Standard, automatically and at no cost; Shield Advanced for more protection and expert help
Attackers trying SQL injection in the search boxAWS WAF in front of the load balancer or CloudFront
Direct connections to the database from the internetA security group on the database that allows only the web servers
A specific malicious IP address rangeA network ACL deny rule on the subnet, or a WAF IP block rule
Consistent rules across the shop's ten AWS accountsAWS Firewall Manager

No single service stops everything; security works in layers, from the edge of the network to the database.

Check yourself

What does AWS WAF protect against?

Show answer

Common web attacks, such as SQL injection and cross-site scripting, by filtering HTTP requests to applications behind services such as CloudFront and Application Load Balancers.

Exam Tips

Remember for the exam

  • To block SQL injection or cross-site scripting, use AWS WAF.
  • DDoS protection that is free for every customer is Shield Standard.
  • A DDoS response team and cost protection come with Shield Advanced.
  • To manage firewall rules across many accounts, use Firewall Manager.
  • An instance-level virtual firewall is a security group; a subnet-level one is a network ACL.