คำตอบ: Firewall (กำแพงไฟ)
Firewall คือ Network Security Control หลักที่ป้องกันข้อมูล/การเชื่อมต่อ ไม่ให้เคลื่อนที่ระหว่าง 2 เครือข่าย (หรือ Zone) ที่มีระดับความไว้วางใจต่างกัน (Trust Zones) โดยวิเคราะห์ Traffic และบังคับใช้ Security Policy (Allow/Deny)
Firewall ทำงานอย่างไร?
- Inspect Traffic: ตรวจสอบ Packet/Header (Layer 3/4) หรือ Payload (Layer 7)
- Match Rules: จับคู่กับ Rule Base (Source IP, Dest IP, Port, Protocol, App, User, Time)
- Action: Allow / Deny / Drop / Reject / Log / Rate-limit
- Stateful Inspection: จำสถานะ Connection (TCP Handshake) → อนุญาต Return Traffic อัตโนมัติ
ประเภท Firewall (Evolution)
| Generation | Type | Capability | Example |
|---|---|---|---|
| 1st | Packet Filtering (Stateless) | Header only (IP, Port), Fast, No Context | Router ACL, Linux iptables (basic) |
| 2nd | Stateful Inspection | Connection State Table, TCP Flags | Check Point FW-1, Cisco PIX |
| 3rd | Application Proxy / ALG | Layer 7 Inspection (FTP, SIP, DNS) | Blue Coat, Microsoft ISA |
| 4th | Next-Gen Firewall (NGFW) | App-ID, User-ID, IPS, SSL Decrypt, Threat Intel, Sandbox | Palo Alto, FortiGate, Check Point Quantum, Cisco Firepower, Sophos XGS |
| 5th | Cloud-Native / SASE / FWaaS | Distributed, Identity-centric, API-driven | Zscaler, Cloudflare, Palo Alto Prisma, Netskope |
Deployment Modes
- Perimeter/Edge: Internet ↔ DMZ ↔ Internal (North-South Traffic)
- Internal Segmentation: בין Segments (East-West Traffic): IT/OT, PCI, Crown Jewels
- Data Center / Cloud: Micro-segmentation (VM/Container Level)
- Host-based / Endpoint FW: Windows Defender Firewall, iptables/nftables, PF (BSD)
Firewall Rules Best Practices
- Default Deny (Implicit Deny): บล็อกทุกอย่าง → Allow เฉพาะที่จำเป็น
- Least Privilege: เปิด Port/IP/App ขั้นต่ำที่จำเป็น
- Rule Order: Specific Rules ก่อน, General Rules หลัง (Top-down Processing)
- Logging: Log Denied + Allowed (Critical) → SIEM
- Naming Convention:
FW_(เช่น FW_DMZ_WEB_ALLOW_001)_ _ _ - Documentation: Business Justification, Owner, Review Date
- Regular Review: Quarterly: Remove Unused, Shadowed, Expired Rules
- Change Management: Request → Approve → Test → Deploy → Verify → Document
Firewall vs อื่นๆ
| Control | Function | Layer |
|---|---|---|
| Firewall | Allow/Deny Traffic between Zones | L3/L4/L7 |
| Router ACL | Basic Packet Filtering | L3/L4 |
| Switch Port Security / VLAN | L2 Segmentation, MAC Control | L2 |
| IDS/IPS | Detect/Prevent Attack Patterns | L3-L7 |
| WAF | Protect Web Apps (OWASP Top 10) | L7 |
| DLP | Prevent Data Exfiltration | L7 + Content |
| NAC | Control Network Admission | L2/L3 + Posture |
ทำไมเรียกว่า "Firewall" (กำแพงไฟ)?
มาจากสถาปัตยกรรม: Firewall (Fire-rated Wall) เป็นกำแพงกันไฟระหว่างอาคาร/ห้อง เพื่อป้องกันไฟไหม้แพร่กระจาย ในคอมพิวเตอร์: ป้องกัน "ไฟไหม้" (Threats, Attacks) แพร่กระจายจาก Network Zone หนึ่งไปอีก Zone (เช่น Internet → Internal)
ตัวอย่าง Firewall Rules
# Allow Web Traffic to DMZ Web Server
Rule 100: Allow TCP 192.168.10.0/24 → 10.0.1.10:443 (HTTPS) Log
# Allow DNS to Internal DNS
Rule 200: Allow UDP 192.168.10.0/24 → 10.0.0.5:53 (DNS) Log
# Block All Other from User VLAN to Server VLAN
Rule 300: Deny Any 192.168.10.0/24 → 10.0.0.0/16 Log
# Allow Internet Access for Users
Rule 400: Allow TCP/UDP 192.168.10.0/24 → Internet:80,443,53 Log
# Implicit Deny All (Final Rule - Automatic)
Rule 65500: Deny Any Any Any Any
Advanced: Zero Trust Network Access (ZTNA) - Evolution Beyond Firewall
- ไม่เชื่อมต่อ Network Level (VPN) แต่เชื่อมต่อ Application Level
- Verify Identity + Device Posture + Context ทุก Request
- Micro-segmentation: 1 User ↔ 1 App (No Lateral Movement)
- Vendors: Zscaler ZPA, Palo Alto Prisma Access, Cloudflare Access, Cisco Duo, Twingate
สรุป
Firewall คือ Network Security Control หลักที่ป้องกันข้อมูล/การเชื่อมต่อ ไม่ให้เคลื่อนที่ระหว่างเครือข่าย 2 ตัว (Zone) โดยใช้ Rule-based Allow/Deny รุ่นปัจจุบันคือ Next-Gen Firewall (NGFW) ที่รวม App-ID, User-ID, IPS, SSL Inspection, Threat Intelligence และเป็นหัวใจของ Zero Trust Architecture