Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบเครือข่าย >> ความปลอดภัยเครือข่าย

DMZ (Demilitarized Zone) ในความปลอดภัยเครือข่าย: หน้าที่และความสำคัญ

DMZ (Demilitarized Zone) ในเครือข่ายคืออะไร?

DMZ (Demilitarized Zone / เขตปลวก) เป็น เครือข่ายย่อย (Subnetwork) ที่อยู่ระหว่างเครือข่ายภายในองค์กร (Internal Network / LAN - Trusted) และเครือข่ายภายนอก (Internet - Untrusted) ทำหน้าที่เป็น Buffer Zone (เขตบ퍼) ที่วางบริการที่ต้องเปิดให้เข้าถึงจากภายนอก (Public-facing Services) เพื่อปกป้องเครือข่ายภายใน

🏗️ สถาปัตยกรรม DMZ (Typical Architecture)

Internet (Untrusted)
      │
      ▼
[External Firewall] ──► DMZ (Web Server, Mail Server, DNS, VPN Gateway, Proxy, API Gateway)
      │
      ▼
[Internal Firewall] ──► Internal Network (LAN) (Database, AD, File Server, Workstations, OT/ICS)

• External Firewall: กรองトラฟฟิกจาก Internet เข้า DMZ (Allow เฉพาะ Port ที่จำเป็น: 80, 443, 25, 53, 443/VPN)
• Internal Firewall: ควบคุมトラฟฟิกจาก DMZ เข้า Internal (Allow เฉพาะที่จำเป็นจริง: App Server → DB Port 1433/3306)

🛡️ ทำไม DMZ จึงสำคัญ? (Benefits)

  • Defense in Depth (การป้องกันหลายชั้น): โจมตีต้องผ่าน External FW → DMZ Host → Internal FW จึงจะถึง LAN
  • Isolation (การแยก隔离): หาก Server ใน DMZ ถูกบุก (Compromised) โจมตียังไม่เข้าถึง LAN โดยตรง
  • Access Control แบบละเอียด: กฎไฟร์วอลล์ระหว่าง DMZ ↔ LAN จำกัดเฉพาะ Port/IP/Protocol ที่จำเป็น
  • Monitoring & Logging: จุดตรวจสอบ (Choke Point) ตรวจสอบトラฟฟิกน่าสงสัยระหว่างโซน
  • Compliance: มาตรฐานหลายอย่าง (PCI DSS, NIST, ISO 27001) กำหนดให้แยก Public-facing Systems

🌐 บริการที่วางใน DMZ (Typical DMZ Hosts)

  • Web Servers (HTTP/HTTPS), Reverse Proxies, Load Balancers
  • Email Servers (SMTP/IMAP/POP3 - MTA), Spam Filters
  • DNS Servers (Authoritative DNS)
  • VPN Gateways / Remote Access Servers
  • FTP/SFTP Servers, API Gateways
  • VoIP/SBC (Session Border Controllers)
  • Certificate Authorities (Public CA)

⚠️ ความเสี่ยงและข้อจำกัดของ DMZ

  • DMZ Hosts เป็นเป้าหมายหลัก: ถูกโจมตีโดยตรงจาก Internet ต้อง Harden อย่างเข้มข้น (Patch, Minimal Services, WAF, HIDS/HIPS)
  • Pivot Attack: หาก DMZ Host ถูกครอบครอง อาจใช้เป็นจุดกระโดด (Pivot) โจมตี Internal FW/LAN
  • Complexity & Cost: ต้องการ Firewall 2 ตัว (หรือ 1 ตัวมี 3 Interface), IP Public เพิ่ม, การจัดการซับซ้อน
  • Not a Silver Bullet: DMZ ไม่ป้องกันโจมตีระดับแอปพลิเคชัน (SQLi, XSS, RCE) บน Web Server เอง → ต้องมี WAF, Secure Coding, DAST/SAST
  • Cloud/Modern Architecture: ใน Cloud ใช้ Security Groups, NACLs, Subnets (Public/Private) แทน DMZ ทางกายภาพ แนวคิดเดียวกันแต่ Virtualized

🔥 DMZ vs Firewall: ต่างอย่างไร?

☁️ DMZ ในยุค Cloud & Zero Trust

  • Cloud (AWS/Azure/GCP): ใช้ Public Subnets (มี Internet Gateway/NAT Gateway) แทน DMZ Physical ใช้ Security Groups + NACLs ควบคุมトラฟฟิก
  • Zero Trust: ไม่มี "Trusted Network" ทุก Request ต้อง Verify → Micro-segmentation แทน DMZ แบบเดิม แต่แนวคิด "Isolate Public Services" ยังคงใช้ (Identity-based Perimeter)
  • Container/Kubernetes: Ingress Controller + Network Policies + Service Mesh (Istio/Linkerd) ทำหน้าที่คล้าย DMZ ระดับ Application

✅ แนวทางปฏิบัติที่ดี (DMZ Best Practices)

  1. ใช้ Dual Firewall Architecture (External + Internal) แทน Single Firewall 3-legged
  2. Harden DMZ Hosts: Minimal OS, Remove unused services, Patch management, Host-based Firewall, HIDS, File Integrity Monitoring (FIM)
  3. Strict Firewall Rules: Default Deny, Allow เฉพาะ Port/IP/Protocol ที่จัดทำเอกสาร (Change Control)
  4. No Direct Management from Internet: จัดการ DMZ Hosts ผ่าน Jump Host/Bastion Host ใน Management Network แยก หรือ VPN
  5. Monitor & Alert: SIEM รับ Log จาก Firewalls, DMZ Servers, WAF, IDS/IPS
  6. Regular Penetration Testing: ทดสอบ DMZ จากมุมมองภายนอกและภายใน (Pivot)
  7. Document Data Flows: ระบุว่า DMZ Server ใด ติดต่อ Internal Server ใด Port อะไร Protocol อะไร

📋 สรุป

DMZ เป็น สถาปัตยกรรมเครือข่าย (Network Architecture) ไม่ใช่แค่อุปกรณ์เดียว สร้างโดย Firewall เพื่อ แยกบริการสาธารณะ (Public Services) ออกจากเครือข่ายภายใน (Internal Network) ลดพื้นที่โจมตี (Attack Surface) และจำกัดความเสียหายหาก Public Server ถูกบุก แม้ในยุค Cloud/Zero Trust แนวคิด核心 (Isolation, Least Privilege, Monitoring) ยังคงนำไปใช้ต่อในรูปแบบ Virtualized/Identity-based

คุณสมบัติFirewallDMZ
คืออะไรอุปกรณ์/ซอฟต์แวร์กรองトラฟฟิกโซนเครือข่าย (Network Segment/Architecture)
หน้าที่Enforce Policies (Allow/Deny)Isolate Public Services from Internal Network
ตำแหน่งEdge (Perimeter) หรือระหว่างโซนระหว่าง External FW และ Internal FW
ความสัมพันธ์เป็นเครื่องมือสร้าง/บังคับ DMZเป็นผลลัพธ์ของการออกแบบด้วย Firewall