MarzleyTech Learn

Home / Learn / Networking / Network security basics: threats, defence in depth, segmentation, firewalls, hardening devices and monitoring

Network security basics: threats, defence in depth, segmentation, firewalls, hardening devices and monitoring

Every network connected to the internet is probed by attackers within minutes: bots scan for open ports, try default passwords on routers and cameras, and look for unpatched systems. Kenyan businesses, schools, SACCOs, hospitals and county offices have suffered ransomware, data theft, defaced websites and fraud. Network security isn't only for specialists: every technician who installs a router, switch or Wi-Fi should know the basics, because most breaches exploit simple mistakes.

The CIA triad

GoalMeaningExample threat
ConfidentialityOnly authorised people see dataSomeone sniffing unencrypted Wi-Fi traffic
IntegrityData isn't changed without permissionAn attacker altering payment details
AvailabilitySystems work when neededA DDoS taking down a website; ransomware

In Kenya, the Data Protection Act (2019) requires organisations handling personal data to protect it and report breaches to the Office of the Data Protection Commissioner (ODPC). Poor security can mean fines as well as lost trust.

Common threats

ThreatWhat happens
Malware and ransomwareMalicious software encrypts files and demands payment, often spreading across the network
PhishingFake emails/messages trick users into giving passwords or running malware: the most common entry point
Default and weak passwordsAttackers log in to routers, cameras and admin panels with "admin/admin"
Unpatched devicesKnown vulnerabilities in old firmware are exploited automatically
Exposed servicesRDP (3389), databases, camera interfaces open to the internet
Man-in-the-middleTraffic intercepted on public Wi-Fi or by ARP spoofing
Rogue devicesUnauthorised routers, APs or laptops plugged into the network
DoS / DDoSFloods of traffic overwhelm a server or link
Insider threatsStaff misuse access, intentionally or by mistake
Brute forceAutomated guessing of passwords on SSH, email, VPN

Defence in depth

No single control is enough. Use layers, so if one fails, others still protect you:

Policies & training → Perimeter firewall → Segmentation (VLANs) → Device hardening
→ Strong authentication (MFA) → Endpoint protection & patching → Encryption → Monitoring → Backups

Segmentation

Put different kinds of devices in different VLANs/subnets and control traffic between them with a firewall or ACLs:

SegmentAllowed to reach
StaffInternet, servers, printers
ServersOnly what they need (e.g. database from app server)
CCTV/IoTNVR only; no internet except for updates if needed
GuestsInternet only, client isolation on
Management (switch/AP admin)Only IT admin PCs

If ransomware infects a guest phone or a camera is hacked, segmentation stops it spreading to staff PCs and servers.

Firewalls

A firewall allows or blocks traffic based on rules: source/destination IP, port, protocol, and (in next-generation firewalls) application and user.

Principles:

  • Default deny for incoming traffic: block everything, then allow only what's needed.
  • Least privilege: allow the minimum (e.g. SSH only from the IT office IP).
  • Rules are read top to bottom; the first match wins, so put specific rules first.
  • Review rules regularly and remove ones nobody needs.

Example rule set for a small office with a web server:

#SourceDestinationPortAction
1AnyWeb serverTCP 80, 443Allow
2IT office IPWeb serverTCP 22Allow
3Guest VLANInternal networksAnyDeny
4Staff VLANInternetAnyAllow
5AnyAnyAnyDeny (and log)

The firewalls and VPN lesson covers types of firewalls and configuration in depth.

Hardening network devices

ActionWhy
Change default usernames and passwordsBots try defaults constantly
Update firmware regularlyFixes known vulnerabilities
Disable remote management from the internet (or restrict by IP/VPN)Admin pages are a common target
Use SSH and HTTPS for management, disable Telnet and HTTPEncrypts admin credentials
Disable unused services and ports (UPnP, WPS, unused switch ports)Smaller attack surface
Use a management VLANAdmin interfaces not reachable from user networks
Backup configurationsFast recovery after failure or attack
Set accurate time (NTP) and loggingLogs are useless without correct timestamps

Switch security features

  • Port security: limit MAC addresses per port.
  • DHCP snooping: only trusted ports may send DHCP offers (stops rogue DHCP).
  • Dynamic ARP Inspection: stops ARP spoofing.
  • BPDU Guard: shuts ports where an unexpected switch is connected.
  • 802.1X: devices must authenticate before the port allows traffic.
  • Shut down unused ports and place them in an unused VLAN.

CCTV and IoT

Cameras and recorders are notoriously insecure: change default passwords, update firmware, put them in their own VLAN, and don't port-forward the NVR to the internet; use the vendor's secure app/cloud service or a VPN for remote viewing.

Securing remote access

  • Never expose RDP (3389) or SSH with passwords directly to the internet.
  • Use a VPN with multi-factor authentication (MFA), or zero-trust remote access services.
  • For servers: SSH keys only, Fail2ban, non-root logins (see the Linux SSH lesson).

Wi-Fi security recap

WPA3 or WPA2-AES, strong passphrase, WPS off, separate guest network with isolation, 802.1X for organisations (see the Wi-Fi lesson).

Monitoring and logging

You can't protect what you can't see:

  • Keep logs from firewalls, routers, servers and VPNs, ideally sent to a central log server (syslog/SIEM).
  • Monitor devices and bandwidth with tools like SNMP-based monitoring (Zabbix, LibreNMS, PRTG) to spot unusual traffic.
  • IDS/IPS (intrusion detection/prevention, e.g. Suricata or features in next-gen firewalls) detect known attack patterns.
  • Review logs for repeated failed logins, new devices, traffic at odd hours.

Backups: the last line of defence

Follow the 3-2-1 rule: 3 copies of data, on 2 different types of storage, 1 off-site (or offline). Ransomware often deletes or encrypts backups on the same network, so keep at least one copy offline or immutable, and test restores.

Users: the human layer

Most attacks start with a person clicking a link. Train staff to:

  • Recognise phishing (urgent requests, odd sender addresses, unexpected attachments, fake M-Pesa/bank messages).
  • Use strong unique passwords and a password manager; enable MFA.
  • Report suspicious emails and lost devices immediately.

Small office security checklist

  1. Router/firewall: default password changed, firmware updated, remote admin off, default deny inbound.
  2. Wi-Fi: WPA2/WPA3, strong passphrase, WPS off, guest network isolated.
  3. VLANs for staff, guests, CCTV/IoT, servers.
  4. No RDP/camera/database ports forwarded to the internet; VPN with MFA for remote access.
  5. All PCs patched with antivirus/EDR; admin rights limited.
  6. Backups 3-2-1, tested.
  7. Logs kept; someone reviews alerts.
  8. Staff phishing awareness training; incident contact list.
  9. Asset list: know every device on the network.
Think about it: A clinic's receptionist PC got ransomware from an email attachment. Within an hour, the shared patient-records server was also encrypted. Which controls could have prevented or limited this?Show answer

Email filtering and phishing training (prevention); endpoint protection and patching; least-privilege accounts (the receptionist shouldn't have write access to everything); segmentation and firewall rules limiting PC-to-server access; offline/immutable backups for fast recovery; monitoring to detect mass file changes early. Under the Data Protection Act, the clinic may also need to report the breach.

Summary

  • Security protects confidentiality, integrity and availability; Kenya's Data Protection Act adds legal duties.
  • Common threats: phishing, ransomware, default passwords, unpatched and exposed devices, rogue devices, DDoS.
  • Use defence in depth: firewalls (default deny, least privilege), segmentation, hardening, MFA, encryption, monitoring, backups.
  • Harden devices: change defaults, update, disable unused services, SSH/HTTPS management, switch security features.
  • Secure remote access with VPN + MFA; keep 3-2-1 backups; train users.

Check yourself

  1. What should a firewall's default policy for incoming traffic be?

    Show answer

    deny

  2. Which type of VPN joins two office networks together?

    Show answer

    site-to-site

  3. Which switch feature stops fake DHCP servers?

    Show answer

    DHCP snooping

  4. Which Windows remote desktop port should never be open directly to the internet?

    Show answer

    3389

  5. What does DDoS stand for? (four words)

    Show answer

    distributed denial of service

  6. In the 3-2-1 backup rule, how many copies should be off-site?

    Show answer

    1

  7. What does the A in the CIA triad stand for?

    Show answer

    Availability

Learn more: Cloudflare: What is a firewall? · Cisco NetAcad: Network Security

Lesson 21 of 24 in Networking · Written by · Course notes