Lesson 11 — Firewalls
Lesson 11 — Firewalls
Section titled “Lesson 11 — Firewalls”Lesson Overview
Section titled “Lesson Overview”Imagine a large office building.
Before anyone can enter, security guards verify identities, inspect visitors, and determine whether they are authorized to access the building.
Computer networks work in a similar way.
Instead of protecting buildings, Firewalls protect networks by inspecting traffic entering and leaving systems.
Every enterprise, cloud platform, bank, hospital, and government organization relies on firewalls to prevent unauthorized access while allowing legitimate communication.
Whether you’re becoming a Cloud Engineer, Cybersecurity Professional, DevOps Engineer, or Network Engineer, understanding firewalls is a fundamental skill.
Learning Objectives
Section titled “Learning Objectives”After completing this lesson, you will be able to:
- Explain what a firewall is.
- Understand how firewalls inspect network traffic.
- Differentiate between different firewall types.
- Learn how firewall rules work.
- Understand cloud firewall services.
- Apply firewall best practices.
What is a Firewall?
Section titled “What is a Firewall?”A Firewall is a security device or software that monitors, filters, and controls network traffic based on predefined security rules.
Its primary purpose is to:
- Allow legitimate traffic
- Block unauthorized traffic
- Protect systems from cyber attacks
- Enforce security policies
A firewall acts as the first line of defense between trusted and untrusted networks.
Why Firewalls Matter
Section titled “Why Firewalls Matter”Without a firewall:
- Attackers could directly access internal systems.
- Malware could spread across networks.
- Unauthorized users could exploit vulnerable services.
- Sensitive business data would be exposed.
Firewalls significantly reduce these risks by controlling network communication.
How a Firewall Works
Section titled “How a Firewall Works”A firewall examines every packet attempting to pass through it.
It compares each packet against configured security rules.
Internet
↓
Firewall
↓
Allowed?
↓
YES → Internal Network
NO → BlockedOnly traffic matching approved rules is allowed to continue.
Firewall Placement
Section titled “Firewall Placement”Firewalls are commonly deployed at network boundaries.
Internet
↓
Router
↓
Firewall
↓
Switch
↓
Servers
↓
UsersLarge organizations often deploy multiple firewalls throughout their infrastructure.
Types of Firewalls
Section titled “Types of Firewalls”There are several different firewall technologies.
Packet Filtering Firewall
Section titled “Packet Filtering Firewall”The simplest firewall type.
Examines:
- Source IP
- Destination IP
- Port Number
- Protocol
Advantages:
- Fast
- Lightweight
Limitations:
- Cannot inspect application data.
Stateful Firewall
Section titled “Stateful Firewall”Stateful firewalls track active network connections.
They understand whether traffic belongs to an existing session.
Advantages:
- Better security
- More intelligent filtering
- Widely used in enterprise environments
Most enterprise firewalls today are stateful.
Next-Generation Firewall (NGFW)
Section titled “Next-Generation Firewall (NGFW)”Modern organizations commonly deploy NGFWs.
Features include:
- Deep Packet Inspection (DPI)
- Application Awareness
- Intrusion Prevention (IPS)
- Malware Detection
- URL Filtering
- SSL/TLS Inspection
- User-Based Policies
Examples:
- Palo Alto Networks
- Fortinet FortiGate
- Cisco Firepower
- Check Point
- Sophos XGS
Web Application Firewall (WAF)
Section titled “Web Application Firewall (WAF)”A Web Application Firewall protects web applications rather than entire networks.
It filters HTTP and HTTPS traffic.
Common protections include:
- SQL Injection
- Cross-Site Scripting (XSS)
- Cross-Site Request Forgery (CSRF)
- Malicious Bots
- OWASP Top 10 attacks
Cloud providers offer managed WAF services.
Firewall Rules
Section titled “Firewall Rules”Firewalls make decisions using rules.
Example:
| Source | Destination | Port | Action |
|---|---|---|---|
| Any | Web Server | 443 | Allow |
| Any | Web Server | 22 | Deny |
| Internal | Database | 3306 | Allow |
| Any | Any | Any | Deny |
Rules are processed from top to bottom.
The first matching rule is applied.
Allow vs Deny
Section titled “Allow vs Deny”Firewalls perform two basic actions.
Permits traffic.
Example:
HTTPS
Port 443
AllowedBlocks traffic.
Example:
RDP
Port 3389
BlockedOrganizations generally follow a Default Deny strategy.
Inbound vs Outbound Traffic
Section titled “Inbound vs Outbound Traffic”Inbound
Section titled “Inbound”Traffic entering the network.
Examples:
- Website visitors
- VPN users
- Public APIs
Outbound
Section titled “Outbound”Traffic leaving the network.
Examples:
- Web browsing
- Software updates
- Cloud service access
Both directions should be monitored and controlled.
Firewall Policies
Section titled “Firewall Policies”Well-designed firewall policies follow security principles such as:
- Least Privilege
- Default Deny
- Network Segmentation
- Controlled Administrative Access
- Continuous Monitoring
A strong firewall policy reduces the attack surface.
Firewalls in Enterprise Networks
Section titled “Firewalls in Enterprise Networks”Large organizations deploy firewalls at multiple locations.
Internet
↓
Perimeter Firewall
↓
DMZ
↓
Internal Firewall
↓
Application Servers
↓
Database Firewall
↓
Sensitive SystemsLayered firewalls improve overall security.
Firewalls in Cloud Computing
Section titled “Firewalls in Cloud Computing”Cloud providers offer virtual firewalls.
- Security Groups
- Network ACLs
- AWS Network Firewall
- AWS WAF
Microsoft Azure
Section titled “Microsoft Azure”- Azure Firewall
- Network Security Groups (NSGs)
- Azure WAF
Google Cloud
Section titled “Google Cloud”- VPC Firewall Rules
- Cloud Armor
Although implemented differently, they perform the same fundamental role as traditional firewalls.
Firewalls in Cybersecurity
Section titled “Firewalls in Cybersecurity”Security teams use firewalls to:
- Block malicious traffic.
- Restrict administrative access.
- Segment networks.
- Prevent lateral movement.
- Protect Internet-facing services.
- Enforce compliance requirements.
Firewalls are one of the most important security controls in modern enterprise environments.
Common Firewall Ports
Section titled “Common Firewall Ports”Administrators frequently configure firewall rules for services such as:
| Port | Service |
|---|---|
| 22 | SSH |
| 53 | DNS |
| 80 | HTTP |
| 123 | NTP |
| 443 | HTTPS |
| 445 | SMB |
| 3389 | RDP |
Understanding ports is essential when creating firewall policies.
Common Troubleshooting Commands
Section titled “Common Troubleshooting Commands”Windows
Section titled “Windows”Test-NetConnection google.com -Port 443netstat -anoss -tulnsudo iptables -Lsudo ufw statusThese commands help verify firewall configurations and open ports.
Real-World Example
Section titled “Real-World Example”Imagine a company hosts a customer portal.
Only HTTPS should be accessible from the Internet.
Internet
↓
Firewall
↓
Allow
Port 443
↓
Web Server
↓
DatabaseSSH access is restricted to administrators from trusted IP addresses.
The database is never exposed directly to the Internet.
This layered approach significantly improves security.
Best Practices
Section titled “Best Practices”As an IT professional:
- Follow the Principle of Least Privilege.
- Allow only required ports.
- Use “Default Deny” wherever possible.
- Regularly review firewall rules.
- Remove unused rules.
- Monitor firewall logs.
- Enable Intrusion Prevention where available.
- Document all firewall changes.
Effective firewall management reduces security risks and simplifies troubleshooting.
Key Takeaways
Section titled “Key Takeaways”After completing this lesson, you should understand:
- What a firewall is.
- How firewalls inspect traffic.
- Different firewall technologies.
- Firewall rules and policies.
- Cloud firewall services.
- Enterprise firewall best practices.
Summary
Section titled “Summary”Firewalls are one of the most important security controls in modern IT.
They protect enterprise networks, cloud environments, applications, and users by filtering network traffic based on security policies.
As you continue through GoHackersCloud Academy, you’ll configure AWS Security Groups, Azure NSGs, Kubernetes Network Policies, Web Application Firewalls, and enterprise firewall solutions in hands-on labs.
A strong understanding of firewall concepts will prepare you for careers in Cloud Computing, Cybersecurity, DevOps, and Enterprise Networking.
Next Lesson
Section titled “Next Lesson”➡️ Lesson 12 — Virtual Private Networks (VPNs)
In the next lesson, you’ll learn how Virtual Private Networks (VPNs) create secure encrypted connections across untrusted networks, explore remote access and site-to-site VPNs, and understand how organizations securely connect users, branch offices, and cloud environments.