PadhaikoAll subjects

Network Security Measures

Network and Cyber Security (ENCT 463)

Open in the Padhaiko app

3.1 Transport Layer Security (TLS/SSL)

Transport Layer Security (TLS)—the modern successor to Secure Sockets Layer (SSL)—provides end-to-end confidentiality, integrity, and endpoint authentication over TCP (e.g., HTTPS on port , SMTPS, IMAPS). All SSL versions (SSL 2.0/3.0) and early TLS (TLS 1.0/1.1) are deprecated due to attacks such as POODLE, BEAST, and weak ciphers; TLS 1.2 and TLS 1.3 (RFC 8446) are the current standards.

Architecture of TLS

  1. TLS Record Protocol: Fragments application data, applies AEAD (Authenticated Encryption with Associated Data, such as AES-GCM or ChaCha20-Poly1305) using the negotiated symmetric session keys, and prepends a TLS record header.
  2. TLS Handshake Protocol: Runs before encrypted application traffic to:
    • Negotiate protocol version and cipher suite.
    • Authenticate the server (and optionally the client in mTLS) via X.509 certificates.
    • Establish shared session secrets using Ephemeral Diffie–Hellman (ECDHE) key exchange.

Key Improvements in TLS 1.3


3.2 Virtual Private Networks (VPNs)

A Virtual Private Network (VPN) creates an encrypted, authenticated tunnel across an untrusted public network (such as the Internet) so remote users or branch offices can communicate as if connected directly to a private LAN.

IPsec Architecture

IPsec operates at the Network Layer (Layer 3) to protect IP packets natively:

AspectIPsec Transport ModeIPsec Tunnel Mode
Header EncapsulationProtects only the IP payload (TCP/UDP segment); keeps the original IP headerEncrypts and encapsulates the entire original IP packet inside a new outer IP header
Endpoint TypeEnd-to-end between two hosts (Host ↔ Host)Gateway-to-gateway or remote client-to-gateway (Gateway ↔ Gateway / Host ↔ Gateway)
Address HidingOriginal source/destination IPs remain visible in transitPrivate internal IPs are hidden behind public gateway IPs
Typical UseHost-level encrypted traffic inside an already-routable networkSite-to-site and remote-access VPNs

SSL/TLS VPNs and WireGuard


3.3 Network Traffic Analysis, Packet Capture

Network Traffic Analysis (NTA) inspects captured packets and flow metadata to troubleshoot connectivity, baseline normal behavior, and detect intrusions or data exfiltration.

Packet Capture Mechanics

Useful tcpdump Capture Commands for Security AnalystsText
# Capture TCP SYN packets on interface eth0 to spot port scans
tcpdump -i eth0 -n 'tcp[tcpflags] & (tcp-syn) != 0 and tcp[tcpflags] & (tcp-ack) == 0'

# Save all DNS and HTTP traffic for host 192.168.10.25 to a pcap file
tcpdump -i eth0 -w incident.pcap 'host 192.168.10.25 and (port 53 or port 80)'

Security Indicators in Traffic Analysis

Analysts inspect captures for cleartext credentials (Telnet, FTP, HTTP Basic Auth), half-open SYN flood storms, sequential port probes (RST replies), DNS tunneling (unusually long subdomains/TXT payloads), and periodic outbound C2 beaconing.


3.4 DNS Security

Standard DNS (port , mostly UDP) translates domain names into IP addresses without encryption or cryptographic authentication. This exposes users to:

Defensive Extensions

  1. DNSSEC (DNS Security Extensions): Authenticates DNS records using public-key digital signatures (RRSIG signs each RRset, verified by the zone's DNSKEY, whose hash is vouched for by the parent zone's DS record all the way up to the root .). Prevents cache poisoning and spoofing, but provides no privacy (queries remain plaintext).
  2. DoT (DNS over TLS, TCP port ): Wraps stub-to-recursive DNS queries inside a dedicated TLS tunnel for confidentiality and server authentication.
  3. DoH (DNS over HTTPS, TCP port ): Sends DNS queries inside standard HTTPS requests, providing encryption while blending into normal web traffic.
Comparison of DNS Security Standards
StandardPrimary Security GoalTransport / PortProtects Against
DNSSECData integrity & origin authenticationUDP/TCP 53Cache poisoning, forged DNS records (no confidentiality)
DoT (DNS over TLS)Confidentiality of DNS queries/responsesTLS over TCP 853Passive sniffing and on-path injection between stub and resolver
DoH (DNS over HTTPS)Confidentiality + firewall traversalHTTPS over TCP 443Sniffing, local manipulation; blends with HTTPS web traffic

3.5 Network Access Control (NAC), Router Access Control List (ACLs)

1. Network Access Control (NAC)

NAC enforces security policy before or as a device joins a wired or wireless network:

2. Router Access Control Lists (ACLs)

A Router ACL is an ordered list of permit and deny rules applied inbound or outbound on a router interface to filter packets at Layer 3/4.

AspectStandard ACLExtended ACL
Filter CriteriaSource IP address onlySource IP, Destination IP, Protocol (tcp, udp, icmp, ip), and TCP/UDP port numbers
GranularityCoarse (all-or-nothing per source host/subnet)Fine-grained (e.g., allow HTTPS but block Telnet)
Best PlacementClose to the destination (to avoid blocking legitimate traffic to other subnets)Close to the source (to drop unwanted traffic before it consumes backbone bandwidth)
Example 1

Designing an Extended Router ACL with Wildcard Masks (6 marks)

A campus engineering subnet 192.168.16.0/22 accesses a web server at 10.10.5.20. Write an Extended ACL (access-list 110) to:

  1. Deny Telnet (TCP port ) from any host in 192.168.16.0/22 to 10.10.5.20.
  2. Permit HTTPS (TCP port ) from 192.168.16.0/22 to 10.10.5.20.
  3. Deny all other IP traffic between that subnet and 10.10.5.20, while permitting other general traffic (permit ip any any).

Compute the wildcard mask for /22 and state where the ACL should be applied.

Convert the /22 prefix mask to a wildcard mask: A /22 subnet mask has leading 1 bits: 255.255.252.0. Subtract each octet from 255:

(This spans addresses: 192.168.16.0 through 192.168.19.255.) For a single host 10.10.5.20, use keyword host 10.10.5.20 (equivalent to wildcard 0.0.0.0).

Order the Extended ACL rules from most specific to most general:

Extended ACL 110Text
access-list 110 deny   tcp 192.168.16.0 0.0.3.255 host 10.10.5.20 eq 23
access-list 110 permit tcp 192.168.16.0 0.0.3.255 host 10.10.5.20 eq 443
access-list 110 deny   ip  192.168.16.0 0.0.3.255 host 10.10.5.20
access-list 110 permit ip  any any

Placing deny tcp ... eq 23 before any broader permit ensures Telnet is blocked on first match, and permit ip any any prevents the implicit deny any from blocking unrelated campus traffic.

Determine optimal placement: Because this is an Extended ACL, place it inbound on the router interface closest to the source (192.168.16.0/22) so blocked Telnet and unauthorized packets are dropped immediately before crossing the core network.

Answer:

Wildcard mask for /22: 0.0.3.255. Apply access-list 110 inbound on the interface closest to 192.168.16.0/22 with the explicit Telnet deny, HTTPS permit, server-specific deny, and permit ip any any.


3.6 Firewalls and Proxy Servers

1. Evolution of Firewalls

A firewall enforces an access-control boundary between trusted internal networks and untrusted external networks (or between segmented internal zones):

Firewall Architectures Compared
Firewall TypeOSI Layer(s)MechanismStrength / Limitation
Stateless Packet FilterNetwork / Transport (L3–L4)Evaluates each packet independently against static IP/port rulesVery fast; cannot track connection state or handle dynamic return ports safely
Stateful Inspection FirewallNetwork / Transport (L3–L4 + state)Maintains a state table of active TCP/UDP connections (SYN, ESTABLISHED)Automatically permits valid return packets for outbound sessions; blocks unsolicited inbound traffic
Application-Layer (Proxy) FirewallApplication (L7)Terminates client TCP session and opens a separate session to the server; inspects HTTP/SMTP/DNS payloadsStrong payload validation and IP hiding; higher latency and per-protocol complexity
Next-Generation Firewall (NGFW)L3–L7Stateful firewall + Deep Packet Inspection (DPI), application identity, TLS inspection, and integrated IPSGranular control (e.g., allow Slack chat but block file uploads); heavier CPU cost

2. DMZ (Demilitarized Zone) Architecture

Publicly reachable services (web, mail, public DNS) should never reside on the internal corporate LAN. Instead, they sit in a DMZ (screened subnet) between an external perimeter firewall and an internal firewall:

3. Forward vs. Reverse Proxy Servers


3.7 Intrusion Detection and Prevention Systems (IDS/IPS)

While firewalls enforce who may connect, an IDS/IPS inspects packet payloads and host activity to identify malicious behavior (exploits, malware callbacks, privilege escalation).

AspectIDS (Intrusion Detection System)IPS (Intrusion Prevention System)
PlacementOut-of-band (passive) via SPAN/TAPInline (active) directly in the traffic path
ActionMonitors, logs, and generates alertsActively drops/blocks malicious packets, resets TCP connections, or updates firewall rules
Failure ImpactIf IDS crashes, network traffic continues uninterruptedMisconfiguration or failure can drop legitimate traffic (requires fail-open/bypass design)

Deployment & Detection Methods

Alert Metrics (Confusion Matrix)

In evaluating an IDS, events fall into four outcomes: True Positive () (attack alerted), False Positive () (benign flagged as attack), True Negative () (benign ignored), and False Negative () (missed attack):

Example 2

Evaluating IDS Alert Accuracy, Precision, Recall, and FPR (5 marks)

During a -flow test, a NIDS raises alerts, of which correspond to real attacks () and are benign false alarms (). It misses real attacks () and correctly ignores benign flows (). Compute the Accuracy, Precision, Detection Rate (Recall), and False Positive Rate (FPR), and explain why accuracy alone can mislead a SOC analyst.

Compute Accuracy:

Compute Precision and Detection Rate (Recall):

Compute False Positive Rate (FPR) and interpret Accuracy:

Because benign flows vastly outnumber attacks ( vs. ), a trivial IDS that alerts on nothing would still score accuracy while missing of attacks. Therefore Precision, Recall, and FPR are far more informative than raw accuracy.

Answer:

, , , . Class imbalance makes accuracy misleading compared to Precision/Recall/FPR.


3.8 System Protection (User Accounts, Access Permissions, Least Privilege, Multifactor Authentication, Secure Configuration and Patch Management)

Perimeter controls alone fail if internal hosts remain misconfigured or unpatched. System protection (host hardening) secures the operating system, identities, and software stack.

  1. User Accounts & Access Permissions:
    • Remove or disable unused default/guest accounts, enforce unique individual accounts (never shared root/admin logins), and store password verifiers using salted adaptive hashes (Argon2id, bcrypt).
    • Enforce OS-level permissions using Discretionary Access Control (DAC) (e.g., POSIX rwx bits for owner/group/other), Role-Based Access Control (RBAC), or Mandatory Access Control (MAC) (SELinux/AppArmor).
  2. Principle of Least Privilege (PoLP):
    • Every user, service account, and process receives only the minimum privileges and access duration strictly required to perform its job. Running web daemons as an unprivileged service user rather than root limits blast radius if the service is exploited.
  3. Multifactor Authentication (MFA):
    • Requires at least two independent authentication factors from different categories:
      • Knowledge: Something you know (password, PIN).
      • Possession: Something you have (FIDO2/WebAuthn hardware key, TOTP app, smartcard).
      • Inherence: Something you are (fingerprint, facial geometry).
    • Hardware-bound FIDO2/WebAuthn resists phishing, unlike SMS OTPs which are vulnerable to SIM swapping.
  4. Secure Configuration (Hardening):
    • Apply vendor/CIS hardening baselines: disable unnecessary daemons and open ports, disable insecure legacy protocols (Telnet, SMBv1, SSH password auth where keys are required), enable host-based firewalls, and configure centralized audit logging.
  5. Patch Management:
    • A structured lifecycle: Asset Inventory Vulnerability Monitoring Risk Prioritization (CVSS + exposure) Staging/Regression Testing Scheduled/Emergency Rollout Verification Scan. Timely patching closes known CVEs before automated exploit kits weaponize them.
Example 3

Hardening a Public Web Application Infrastructure (Exam Model) (6 marks)

A startup hosts a customer web portal and an internal finance database on a cloud network. Explain how to layer DMZ segmentation, TLS 1.3, Least Privilege, MFA, and Patch Management to protect the system end-to-end.

Segment the network with a DMZ and Reverse Proxy: Place the public web server (behind a reverse proxy/WAF) inside a DMZ subnet. Configure the internal firewall so the DMZ can reach the finance database only on the specific database port from the app server's IP, denying direct Internet-to-database connections.

Secure data in transit and access paths: Enforce TLS 1.3 on the public reverse proxy for HTTPS confidentiality and forward secrecy, and require an IPsec/WireGuard VPN plus MFA (e.g., FIDO2 hardware key) for administrators connecting over SSH.

Harden hosts with Least Privilege and Patch Management: Run the web server under a non-privileged system account (www-data) with read-only permissions on static assets, restrict the database user to only the required SQL schema permissions (PoLP), disable unused OS ports, and run a weekly patch management cycle prioritizing critical remote-code-execution CVEs.

Answer:

Layering DMZ isolation, TLS 1.3 encryption, VPN + MFA admin access, Least Privilege service/DB accounts, and prioritized patching prevents both external eavesdropping and lateral movement from a compromised web tier.


Exercises

Question 1

Compute the wildcard mask for subnet 172.16.40.128/26 and write Extended ACL 120 rules to permit HTTP (port ) and HTTPS (port ) from that subnet to server 172.16.10.50, deny SSH (port ) from that subnet to 172.16.10.50, and allow all other IP traffic.

Compute the subnet mask and wildcard mask for /26: A /26 prefix has network bits: subnet mask 255.255.255.192 ( addresses per subnet: 172.16.40.128 to 172.16.40.191). Subtract from 255.255.255.255:

Write Extended ACL 120 in top-down evaluation order:

Extended ACL 120Text
access-list 120 permit tcp 172.16.40.128 0.0.0.63 host 172.16.10.50 eq 80
access-list 120 permit tcp 172.16.40.128 0.0.0.63 host 172.16.10.50 eq 443
access-list 120 deny   tcp 172.16.40.128 0.0.0.63 host 172.16.10.50 eq 22
access-list 120 permit ip  any any
Answer:

Wildcard mask is 0.0.0.63; ACL 120 permits ports 80 and 443, denies port 22 to host 172.16.10.50, and ends with permit ip any any.

Question 2

An inline IPS evaluates network connections and records , , , and . Calculate Precision, Detection Rate (Recall), and False Positive Rate.

Compute Precision and Detection Rate (Recall):

Compute False Positive Rate (FPR):

Answer:

Precision , Detection Rate (Recall) , False Positive Rate .

Question 3

Explain how TLS 1.3 improves both performance and security over TLS 1.2, and define Perfect Forward Secrecy (PFS).

Performance and security improvements in TLS 1.3:

  • Faster Handshake (1-RTT): By bundling the client's ECDHE key_share directly in ClientHello, TLS 1.3 completes key agreement and server authentication in one round trip instead of TLS 1.2's two round trips.
  • Hardened Cryptography: TLS 1.3 removes legacy weak ciphers (RC4, 3DES, SHA-1, CBC-mode encryption) and mandates modern AEAD cipher suites (AES-GCM, ChaCha20-Poly1305) while encrypting handshake certificates after ServerHello.

Define Perfect Forward Secrecy (PFS): PFS guarantees that compromising a server's long-term private signing key cannot decrypt past recorded TLS sessions, because each session derives its symmetric encryption key from fresh, ephemeral Diffie–Hellman (ECDHE) parameters that are erased once the session ends.

Answer:

TLS 1.3 reduces handshake latency to 1-RTT, eliminates legacy weak ciphers in favor of AEAD suites, and mandates ephemeral ECDHE for Perfect Forward Secrecy so past captured traffic remains safe even if the server's private key leaks later.

Question 4

Compare IPsec AH vs. ESP, and explain the structural difference between IPsec Transport Mode and Tunnel Mode.

Compare AH and ESP:

  • AH (Authentication Header): Authenticates and protects integrity of the IP payload and immutable IP header fields, but provides no confidentiality (encryption) and breaks across NAT because it signs outer IP addresses.
  • ESP (Encapsulating Security Payload): Encrypts the payload (confidentiality) and provides integrity/authentication (excluding the outer IP header in tunnel mode), working cleanly with NAT-Traversal (UDP 4500).

Compare Transport vs. Tunnel Mode: In Transport Mode, only the upper-layer payload is protected and the original IP header remains intact (used host-to-host). In Tunnel Mode, the entire original IP packet (header + payload) is encrypted and encapsulated inside a brand-new outer IP header between VPN gateways, concealing internal private IP addresses.

Answer:

AH authenticates without encryption; ESP provides both encryption and authentication. Transport mode protects only the IP payload between end hosts, while Tunnel mode encapsulates the entire original IP packet inside a new outer header for gateway-to-gateway VPNs.

Question 5

Why does DNSSEC not replace DoT or DoH? Also explain how Least Privilege, Multifactor Authentication, and Patch Management work together in system protection.

Distinguish DNSSEC from DoT/DoH: DNSSEC cryptographically signs DNS records so resolvers can detect forged or poisoned responses (integrity and origin authentication), but queries and answers still travel in plaintext. DoT (TCP 853) and DoH (TCP 443) encrypt the transport channel between client and resolver to provide confidentiality against eavesdropping, without themselves validating zone-wide cryptographic chains unless the resolver performs DNSSEC. Together, they cover both authenticity and privacy.

Explain Least Privilege, MFA, and Patch Management:

  • MFA blocks stolen-password logins by requiring an independent possession or biometric factor.
  • Least Privilege ensures that even if a user account or daemon is compromised, it holds minimal permissions and cannot access administrative resources or unrelated files.
  • Patch Management systematically discovers, prioritizes, tests, and applies vendor security updates to close software vulnerabilities before attackers exploit them.
Answer:

DNSSEC authenticates DNS data (integrity) in plaintext, whereas DoT/DoH encrypt the transport channel (confidentiality). In system protection, MFA hardens authentication, Least Privilege limits blast radius after compromise, and Patch Management eliminates known exploitable flaws.

← CryptographySecuring Wireless and Mobile Networks →