Skip to content

Firewalls & Network Security in Practice

A concise, pragmatic guide to designing, deploying, and operating firewalls and adjacent controls—complete with ASCII diagrams you can reuse in proposals and runbooks.

Start with Fundamentals

Firewall Fundamentals

Concepts

What a Firewall Does

  • Policy enforcement: Allow/deny flows based on tuples (src/dst IP, port, protocol) and context.
  • Segmentation: Boundaries between zones (e.g., Corp, Guest, DMZ) to reduce blast radius.
  • Observability: Produce logs/metrics for investigation and tuning.
Types

Common Firewall Types

  • Packet-filtering: Stateless; matches individual packets.
  • Stateful: Tracks connection state (SYN/ACK/FIN) and higher-level flows.
  • Application/Proxy (L7): Understands protocols (HTTP/HTTPS), can enforce headers, methods, or content rules.
  • Next-Gen (NGFW): App ID, user ID, threat intel, and integrated IPS features.
  • Host firewall: Local OS controls (e.g., Windows Defender Firewall, iptables/nftables).
Policy

Policy Strategy

  • Default deny, explicit allowlists.
  • Zone-to-zone matrices (who may talk to whom, on what ports).
  • Separate inbound, outbound, and inter-VLAN/inter-subnet rule sets.
  • Change control with testing and time-boxed maintenance windows.

Placement & Common Patterns

Typical Edge + DMZ

Internet
   │
[ Edge Router + Stateful FW ]
   │
   ├──►  [ DMZ ] ──► [ Reverse Proxy / WAF ] ──► [ App Tier ] ──► [ DB ]
   │
   └──►  [ Inside / Corp LAN ] ──► VLAN10 (Corp), VLAN20 (Guest), VLAN30 (IoT)

DMZ hosts public-facing services behind a reverse proxy or WAF. Inside networks are segmented by VLANs with inter-VLAN rules.

Internal Segmentation (East/West)

[ L3 Core Switch ]
      │
  ┌───┴────┬─────────┐
VLAN10  VLAN20    VLAN30
(Corp)  (Guest)    (IoT)
  │        │          │
[ACL/FW] [ACL/FW]  [ACL/FW]

Deploy firewalls/ACLs between internal segments to limit lateral movement and isolate sensitive systems.

Microsegmentation (Host/Workload)

             
             ┌────────────┐       ┌────────────┐
Workload A ─▶│ Host FW /  │◀────▶│ Host FW /  │◀─ Workload B
             │ Agent PDP  │       │ Agent PDP  │
             └────────────┘       └────────────┘
       Policies enforced per-process / per-label; identity-aware.

Host-based policies enforce fine-grained rules close to workloads (on servers or containers).

WAF, IDS, and IPS

Web Layer

Web Application Firewall (WAF)

  • Inspects HTTP/S to mitigate OWASP Top 10 risks (injection, auth issues, etc.).
  • Applies request/response policies (methods, headers, size limits, rate limits).
  • Often deployed with a reverse proxy and TLS termination.
Detection

IDS / IPS

  • IDS: Detects suspicious patterns; sends alerts to SIEM/SOAR.
  • IPS: Active prevention (drops/blocks) inline.
  • Signature, behavior, and anomaly detection models; tune to reduce false positives.
Egress

Outbound Controls

  • Deny-by-default for server egress; allow only required destinations/ports.
  • DNS filtering and DoH/DoT strategy; block known-malicious domains.
  • Alert on unexpected protocols (e.g., outbound SMB, IRC, TOR).

TLS Inspection: Benefits & Risks

When to Consider It

  • High-risk environments needing malware/phishing inspection inside HTTPS.
  • DLP, threat intel, or policy checks that need plaintext content visibility.

Risks & Mitigations

  • Privacy and legal considerations; document scope and consent.
  • Certificate management complexity; pinning exceptions for sensitive apps.
  • Performance overhead; size and place inspection capacity carefully.
  • Prefer bypass for health/financial portals; log minimally and protect keys.

Cloud & Container Environments

Cloud (IaaS/PaaS)

  • Use security groups / NACLs for least-privilege flows.
  • Centralize ingress with managed gateways; apply WAF at the edge.
  • Private subnets for app/DB; egress via NAT gateways with allowlists.
  • Log flow logs, WAF events, and gateway access logs to centralized storage.

Containers & Kubernetes

  • NetworkPolicies to restrict pod-to-pod traffic.
  • Ingress controllers + WAF; mutual TLS within the mesh if using a service mesh.
  • Limit hostPath mounts, run as non-root; image scanning in CI/CD.

Logging, Monitoring, and Response

What to Log

  • Accept/deny decisions with rule IDs, zones, src/dst, ports, and usernames (if available).
  • Config changes, admin auth events, firmware updates.
  • WAF rulings, IDS/IPS alerts, DNS queries/blocks.

How to Use the Logs

  • Forward to SIEM; create alert rules for high-risk events.
  • Correlate firewall data with endpoint detections and identity logs.
  • Practice investigations and maintain an incident runbook.

Practical Checklists

Baseline Hardening

  • Change defaults; unique admin creds; MFA on management access.
  • Restrict management plane (out-of-band or jump host, IP allowlists).
  • Time sync (NTP), backups of configs, and tested restore.
  • Disable unused services; lock down SNMP; rotate keys/certs.

Policy & Rules Hygiene

  • Document zone matrix; default deny; narrow allowlists.
  • Review rules quarterly; remove stale/temporary entries.
  • Separate inbound, outbound, inter-zone policies; avoid “any-any.”
  • Tag rules with owners/tickets; require peer review for changes.

Zero Trust Alignment

  • Strong identity (MFA, device posture) at access points.
  • Continuous evaluation (context, risk) for sensitive flows.
  • Prefer application-layer access (ZTNA/SDP) over broad network VPNs.

Sources Used (APA)

  1. Scarfone, K., & Hoffman, P. (2009). Guidelines on Firewalls and Firewall Policy (NIST SP 800-41 Rev. 1). National Institute of Standards and Technology.
  2. Joint Task Force. (2020). Security and Privacy Controls for Information Systems and Organizations (NIST SP 800-53 Rev. 5). National Institute of Standards and Technology.
  3. Rose, S., Borchert, O., Mitchell, S., & Connelly, S. (2020). Zero Trust Architecture (NIST SP 800-207). National Institute of Standards and Technology.
  4. OWASP Foundation. (2021). OWASP Top Ten. OWASP.
  5. Bejtlich, R. (2013). The Practice of Network Security Monitoring. No Starch Press.
  6. Braden, R. (Ed.). (1989). Requirements for Internet Hosts — Communication Layers (RFC 1122). Internet Engineering Task Force.
  7. Braden, R. (Ed.). (1989). Requirements for Internet Hosts — Application and Support (RFC 1123). Internet Engineering Task Force.
  8. Internet Security Research Group. (n.d.). Let’s Encrypt & ACME Client Documentation.
  9. Center for Internet Security. (2021). CIS Critical Security Controls v8. Center for Internet Security.
  10. SANS Institute. (2018). Incident Handler’s Handbook. SANS.

Notes: Firewalls are most effective as part of a layered defense, combined with identity, endpoint controls, secure configurations, and continuous monitoring.