Find a course

Module 4: Networks and EncryptionLesson 8 of 1212 min

Network Defenses

See how firewalls, segmentation, intrusion detection, VPNs and Wi-Fi security work together, and where each one helps or falls short.

Step 1 of 12Learn

Firewalls

A firewall decides which network traffic is allowed through, based on rules. Rules typically look at the source and destination IP address, the port and the protocol: "allow TCP from anywhere to the web server on port 443", "block everything from the internet to the database server".

The safest design is default deny: block everything, then allow only what is specifically needed. The opposite, allowing everything and blocking known bad things, always leaves gaps, because attackers can use something you didn't think to block.

Firewalls come in several forms:

  • Network firewalls sit between networks, such as between the internet and an office.
  • Host-based firewalls run on each computer and control what that one machine accepts. Windows and macOS include one; it should stay on, especially on laptops that join café and hotel networks.
  • Stateful firewalls remember connections, so replies to traffic you started are allowed back in automatically, while unsolicited incoming connections are dropped.
  • Next-generation firewalls also inspect which application is being used and can block known attack patterns.
  • Web application firewalls (WAFs) sit in front of websites and filter malicious requests such as SQL injection attempts.

A firewall can't stop an attack that arrives through an allowed path. If port 443 to the web server is open, as it must be, a vulnerable web application behind it is still exposed. Firewalls are one layer, not a force field.

Step 2 of 12Practice · Spot the mistake

A junior admin wrote these firewall rules for a small office. The policy should be default deny, with only public web traffic and admin SSH from the office allowed in. Tap the three rules that break the policy.

Step 3 of 12Diagram

How a firewall decides

This is why rule order matters so much in the exercise you just did: one rule in the wrong place silently changes the whole policy.

How a firewall decidesProcess diagram: Packet arrives → Check rules top-down → First match wins → No match: default rule.PacketarrivesCheck rulestop-downFirst matchwinsNo match:default rule

Tap a shape with to see more.

Packet arrives

Source and destination address, port and protocol are read from the headers.

Check rules top-down
First match wins

A broad "allow any" placed early overrides every rule below it.

No match: default rule

A secure policy ends with "deny everything else".

Step 4 of 12Learn

Segmentation and monitoring

Imagine a ship built as one big open hull: one hole and the whole ship floods. Ships use watertight compartments. Networks should too.

Network segmentation splits a network into zones with controlled traffic between them. A typical office might separate staff laptops, servers, guest Wi-Fi, payment systems, security cameras and printers. If an attacker compromises a smart TV on the guest network, segmentation keeps them from reaching the finance server. A DMZ (demilitarized zone) is a segment for public-facing servers, such as the web server, that sit between the internet and the internal network.

Inside and between segments, defenders watch for trouble:

  • An intrusion detection system (IDS) analyzes traffic and raises alerts on suspicious patterns. An intrusion prevention system (IPS) can also block it automatically.
  • Endpoint detection and response (EDR) software on each computer watches process behavior, such as a word processor suddenly launching a command shell, and can isolate an infected machine.
  • A SIEM collects logs from firewalls, servers, endpoints and cloud services in one place, so analysts can correlate events that look harmless alone.

Detection matters because prevention eventually fails. Industry studies have repeatedly found that intruders often stay inside networks for weeks or months before being discovered. The faster you detect, the less time an attacker has to steal data or plant ransomware.

Step 5 of 12Practice · Choose one

An attacker takes over a smart thermostat on an office network. What control most directly stops them from reaching the HR file server?

Step 6 of 12Diagram

A segmented office network

Traffic between zones passes through the firewall, which only allows what each zone needs.

A segmented office networkHierarchy diagram: Internet, Firewall, DMZ: web server, Staff laptops, Internal servers, Payment systems, Cameras, TVs, thermostats, Guest Wi-Fi.InternetFirewallDMZ: web serverStaff laptopsInternal serversPayment systemsCameras, TVs, thermostatsGuest Wi-Fi

Tap a shape with to see more.

Internet
Firewall
DMZ: web server

Public-facing; cannot open connections into internal zones.

Staff laptops
Internal servers

Reachable only from staff devices on specific ports.

Payment systems

Isolated tightly; card rules require it.

Cameras, TVs, thermostats

Internet access only; no route to staff or servers.

Guest Wi-Fi

Step 7 of 12Learn

VPNs and Wi-Fi security

A VPN (virtual private network) creates an encrypted tunnel between your device and a VPN server. Companies use VPNs so remote employees can reach internal systems securely. Consumers use commercial VPNs mainly to hide their traffic from the local network, for example on public Wi-Fi, and to change their apparent location.

Know the limits. A VPN protects data between your device and the VPN server; after that, traffic continues normally to its destination. It doesn't block malware, phishing, or tracking by sites you log into. And you're shifting trust from your local network to the VPN provider, which can see your traffic metadata. Corporate VPN gateways themselves have become a favorite target; several of the most exploited vulnerabilities in recent years were in VPN appliances, so they must be patched fast.

Wi-Fi security depends on the encryption standard:

  • WEP is broken and can be cracked in minutes. Never use it.
  • WPA2 with a strong passphrase is still common and acceptable.
  • WPA3 is the current standard and resists offline password-guessing attacks better. Use it when all your devices support it.

Also change the router's default admin password, keep its firmware updated, turn off WPS (a push-button pairing feature with known weaknesses), and put guests and smart devices on a separate network.

On public Wi-Fi, HTTPS already encrypts the content of most of what you do. The bigger risks are fake hotspots with familiar names and unpatched devices, so turn off auto-join for open networks.

Step 8 of 12Practice · True or false

Using a VPN protects you from phishing emails and malware downloads.

Step 9 of 12Practice · Sort into groups

Rate each home Wi-Fi setup.

Tap an item, then tap its group (or drag it there).

Step 10 of 12Note

Step 11 of 12Practice · Diagram

The remote employee’s layers, outside in

Her password is phished. Which layer most directly stops the attacker logging in?

Tap the shape that answers the question, then press Check.

The remote employee’s layers, outside inLayer diagram: VPN login with MFA, Gateway allows 3 apps only, Host firewall, EDR on the laptop, Central logging (SIEM).VPN login with MFAGateway allows 3 apps onlyHost firewallEDR on the laptopCentral logging (SIEM)
VPN login with MFA
Gateway allows 3 apps only

Least privilege at the network level.

Host firewall

Blocks unsolicited inbound connections to the laptop.

EDR on the laptop

Watches process behavior and can isolate the device.

Central logging (SIEM)

Every connection is recorded so anomalies can be correlated.

Step 12 of 12Practice · Select all that apply

Which statements about firewalls are true? Select all that apply.

Select all that apply.