Skip to content

Lesson 11 — Firewalls

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.


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.

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.


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.


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 → Blocked

Only traffic matching approved rules is allowed to continue.


Firewalls are commonly deployed at network boundaries.

Internet
Router
Firewall
Switch
Servers
Users

Large organizations often deploy multiple firewalls throughout their infrastructure.


There are several different firewall technologies.


The simplest firewall type.

Examines:

  • Source IP
  • Destination IP
  • Port Number
  • Protocol

Advantages:

  • Fast
  • Lightweight

Limitations:

  • Cannot inspect application data.

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.


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

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.


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.


Firewalls perform two basic actions.

Permits traffic.

Example:

HTTPS
Port 443
Allowed

Blocks traffic.

Example:

RDP
Port 3389
Blocked

Organizations generally follow a Default Deny strategy.


Traffic entering the network.

Examples:

  • Website visitors
  • VPN users
  • Public APIs

Traffic leaving the network.

Examples:

  • Web browsing
  • Software updates
  • Cloud service access
  • Email

Both directions should be monitored and controlled.


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.


Large organizations deploy firewalls at multiple locations.

Internet
Perimeter Firewall
DMZ
Internal Firewall
Application Servers
Database Firewall
Sensitive Systems

Layered firewalls improve overall security.


Cloud providers offer virtual firewalls.

  • Security Groups
  • Network ACLs
  • AWS Network Firewall
  • AWS WAF

  • Azure Firewall
  • Network Security Groups (NSGs)
  • Azure WAF

  • VPC Firewall Rules
  • Cloud Armor

Although implemented differently, they perform the same fundamental role as traditional firewalls.


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.


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.


Terminal window
Test-NetConnection google.com -Port 443
Terminal window
netstat -ano

Terminal window
ss -tuln
Terminal window
sudo iptables -L
Terminal window
sudo ufw status

These commands help verify firewall configurations and open ports.


Imagine a company hosts a customer portal.

Only HTTPS should be accessible from the Internet.

Internet
Firewall
Allow
Port 443
Web Server
Database

SSH access is restricted to administrators from trusted IP addresses.

The database is never exposed directly to the Internet.

This layered approach significantly improves security.


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.


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.

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.


➡️ 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.