aws network firewall rules examples

AWS Network Firewall Rules: Top 5 Examples & Best Practices

By Melissa Jackson
AD

In today's digital landscape, securing network resources is paramount, and AWS Network Firewall plays a critical role in this. It's a fully managed,-cloud native service that makes it easy to protect your AWS VPC. Let's explore AWS Network Firewall rules with practical examples.

Before delving into specific examples, it's crucial to understand that AWS Network Firewall rules operate on deep packet inspection (DPI) and stateful filtering. This allows for precise, application-layer protection.

Understanding AWS Network Firewall Rule Syntax

AWS Network Firewall rules use a structured syntax to define actions, match criteria, and more. Familiarizing yourself with this syntax is the first step towards creating effective rules.

AD
Home Network Firewall Rules: Minimal Allow/Block List That Still Works
Home Network Firewall Rules: Minimal Allow/Block List That Still Works
the diagram shows how firewall works and what it is like to work with an internet network
the diagram shows how firewall works and what it is like to work with an internet network
the info sheet for how to configure aws security best practices?
the info sheet for how to configure aws security best practices?

Here's a simple example of a rule syntax:

< valamazonSimpleXml>{ "RuleNumber": 1, "Protocol": "6", // TCP "Source": {"Address": "192.0.2.0/24"}, "Destination": {"Address": "10.0.0.0/16"}, "SourcePort": "*", "DestinationPort": "22", // SSH "Direction": "ANY", "Action": "ALLOW", "Log": true }

Rule Parameters

Each rule contains several parameters defining its behavior. Let's explore some key parameters with examples.

Firewall use cases
Firewall use cases
the firewall diagram is shown with different types of devices and their functions in it
the firewall diagram is shown with different types of devices and their functions in it
AWS Security Groups vs Network ACL ๐Ÿ” | What's the Difference?
AWS Security Groups vs Network ACL ๐Ÿ” | What's the Difference?

Protocol: Defines the transport protocol. Permitted values are protocol numbers (e.g., 6 for TCP, 17 for UDP) or names (e.g., "tcp", "udp").

Rule Actions

Actions determine the outcome when a rule matches network traffic. Here are two primary actions with examples:

AD

ALLOW: Permits traffic matching the rule. Example: Allow inbound SSH connections from a trusted network.

Firewalls
Firewalls
the firewall diagram is shown in red and blue, with instructions on how to use it
the firewall diagram is shown in red and blue, with instructions on how to use it
What is a Firewall? Definition, Types & Basic Errors - Techopedia
What is a Firewall? Definition, Types & Basic Errors - Techopedia
Understanding Firewalls: Network Security Basics | Rahil Irshad posted on the topic | LinkedIn
Understanding Firewalls: Network Security Basics | Rahil Irshad posted on the topic | LinkedIn
AWS Roles vs Policies Explained Simply ๐Ÿ” | IAM Basics for Beginners
AWS Roles vs Policies Explained Simply ๐Ÿ” | IAM Basics for Beginners
the different types of firewalls and how to use them in this info sheet
the different types of firewalls and how to use them in this info sheet

DROP: Blocks traffic and logs it. Example: Block outbound traffic to a known malicious domain.

Practical AWS Network Firewall Rule Examples

Now, let's consider some practical examples showcasing use cases and AWS Network Firewall's versatility.

AD

Allowing Web Traffic

To allow only HTTP and HTTPS traffic from a trusted network to the internet:

What All Do We Have Under IAM in AWS? ๐Ÿ” | AWS IAM Explained Simply
What All Do We Have Under IAM in AWS? ๐Ÿ” | AWS IAM Explained Simply
the different types of firewalls are shown in this info sheet, which includes information about
the different types of firewalls are shown in this info sheet, which includes information about
Firewall Explained ๐Ÿ”ฅ๐Ÿ›ก๏ธ | How It Protects Your Computer & Network
Firewall Explained ๐Ÿ”ฅ๐Ÿ›ก๏ธ | How It Protects Your Computer & Network
how firewall works info sheet
how firewall works info sheet
firewalls in 2055 your network's first and last line of defense
firewalls in 2055 your network's first and last line of defense
firewall vs nfw info sheet
firewall vs nfw info sheet
6.1K views ยท 44 reactions | ๐Ÿ”ฅ One Firewall Is NOT Enough in 2026๐Ÿšจ Packet-Filtering, Stateful, NGFW, Proxy, Cloud, Hardwareโ€ฆ Do you know which firewall actually protects you? Most cyber attacks succeed because companies rely on the wrong type of firewall. Each firewall has a specific roleโ€”from basic packet filtering to deep inspection, cloud protection, and enterprise perimeter security. ๐Ÿ’ก Real cybersecurity = choosing the right firewall for the right job. ๐Ÿ‘ Like to support cybersecurity awareness ๐Ÿ” Share with IT & non-IT friends โž• Follow Cyber Security For Computer & AI Hub for daily security knowledge #CyberSecurity #Firewall #NetworkSecurity #ukreels #uk #CloudSecurity #usa #viralreelsfacebook #viralreelschallenge #CyberDefense | Cyber Security For Computer & AI Hub | Facebook
6.1K views ยท 44 reactions | ๐Ÿ”ฅ One Firewall Is NOT Enough in 2026๐Ÿšจ Packet-Filtering, Stateful, NGFW, Proxy, Cloud, Hardwareโ€ฆ Do you know which firewall actually protects you? Most cyber attacks succeed because companies rely on the wrong type of firewall. Each firewall has a specific roleโ€”from basic packet filtering to deep inspection, cloud protection, and enterprise perimeter security. ๐Ÿ’ก Real cybersecurity = choosing the right firewall for the right job. ๐Ÿ‘ Like to support cybersecurity awareness ๐Ÿ” Share with IT & non-IT friends โž• Follow Cyber Security For Computer & AI Hub for daily security knowledge #CyberSecurity #Firewall #NetworkSecurity #ukreels #uk #CloudSecurity #usa #viralreelsfacebook #viralreelschallenge #CyberDefense | Cyber Security For Computer & AI Hub | Facebook
how to configure a firewall on windows? infographical poster
how to configure a firewall on windows? infographical poster
How Firewalls Work: The Visual Guide Firewalls Explained (In Under 60 Seconds)
How Firewalls Work: The Visual Guide Firewalls Explained (In Under 60 Seconds)
What is Azure Firewall?
What is Azure Firewall?
Understanding Firewall Technolgies - InfosecTrain
Understanding Firewall Technolgies - InfosecTrain
< valamazonSimpleXml>{ "RuleNumber": 1, "Protocol": "6", "Source": {"Address": "10.0.0.0/16"}, "Destination": {"Address": "0.0.0.0/0"}, // Internet "SourcePort": "*", "DestinationPort": {"Port": 80, "PortRange": 443}, "Direction": "OUTBOUND", "Action": "ALLOW" }

Preventing Data Exfiltration

Prevent outbound traffic to an exfiltration destination:

< valamazonSimpleXml>{ "RuleNumber": 2, "Protocol": "6", "Source": {"Address": "10.0.0.0/16"}, "Destination": {"Address": "1.2.3.4/32"}, "SourcePort": "*", "DestinationPort": "*", "Direction": "OUTBOUND", "Action": "DROP" }

AWS Network Firewall offers a powerful way to protect your AWS environment. With its ability to filter at the application layer, it provides an additional layer of security beyond traditional stateful firewalls. Start exploring AWS Network Firewall today and stay ahead in the evolving threat landscape.

AD
AD