Computer >> Hướng Dẫn Máy Tính >  >> Kết Nối Mạng >> An Ninh Mạng

DMZ (Demilitarized Zone) trong bảo mật mạng: Kiến trúc, chức năng, rủi ro và triển khai hiện đại

DMZ (Demilitarized Zone) là gì?

DMZ (Khu phi quân sự hóa) là một mạng con (subnetwork) nằm giữa mạng nội bộ tin cậy (Internal Network/LAN) và mạng không tin cậy (Internet/External Network). Mục đích: Cô lập các dịch vụ phải công khai ra Internet (Web server, Mail server, DNS, VPN Gateway, API Gateway) để nếu bị tấn công, kẻ xâm nhập không thể trực tiếp truy cập mạng nội bộ nhạy cảm.

Kiến trúc DMZ - 3 Mô hình phổ biến

1. Single Firewall (Three-legged) - Phổ biến SMB

Internet
   │
   ▼
[Firewall] ←── 3 Interface: Outside (Internet), DMZ, Inside (LAN)
   │
   ├── Outside: Untrust
   ├── DMZ: Web Server, Mail Server, DNS, VPN Gateway (Public IP hoặc NAT)
   └── Inside: LAN nội bộ (Database, AD, File Server, Workstation)
  • Ưu: Đơn giản, rẻ, dễ quản trị
  • Nhược: Single point of failure, firewall phải xử lý toàn bộ traffic

2. Dual Firewall (Screened Subnet) - Tiêu chuẩn Enterprise

Internet
   │
   ▼
[External Firewall] ←── Chỉ cho phép traffic đến DMZ (Port 80/443, 25, 53...)
   │
   ▼
[DMZ Network] ←── Web, Mail, DNS, Proxy, VPN, API Gateway
   │
   ▼
[Internal Firewall] ←── Chỉ cho phép DMZ → Inside traffic cụ thể (App→DB, Management)
   │
   ▼
[Internal LAN] ←── Database, AD, ERP, HR, Workstation (Private IP)
  • Ưu: Defense in depth, cô lập lớp, external FW chặn tải lớn, internal FW enforce least privilege
  • Nhược: Chi phí cao, phức tạp, latency thêm 1 hop

3. Cloud/Modern DMZ (AWS/Azure/GCP)

  • Public Subnet (DMZ equivalent): ALB/NLB, NAT Gateway, Bastion Host, API Gateway, WAF, CloudFront
  • Private Subnet (Internal): App Server (EC2/ECS/EKS), Database (RDS), Cache (ElastiCache)
  • Security Groups + NACL thay thế firewall vật lý
  • AWS Network Firewall / Azure Firewall / GCP Cloud Armor: Managed L3-L7 inspection
  • Zero Trust: Không còn DMZ truyền thống → Identity-based micro-segmentation (ZTNA, BeyondCorp, Verified Access)

Chức năng & Lợi ích của DMZ

Chức năngMô tả
Buffer ZoneHấp thụ tấn công từ Internet, bảo vệ Internal LAN
Service ExposureCho phép Public service (Web, Email, DNS, VPN) truy cập được mà không mở port thẳng vào LAN
Traffic InspectionExternal FW inspect inbound, Internal FW inspect outbound từ DMZ (Data exfiltration detection)
CompliancePCI DSS, NIST 800-53, ISO 27001 yêu cầu tách biệt hệ thống công khai và nội bộ
Failover/HADMZ service có thể failover độc lập với Internal

Dịch vụ thường đặt trong DMZ

  • Web Server / Reverse Proxy: Nginx, Apache, IIS, Cloudflare/WAF origin
  • Mail Server / Mail Gateway: Exchange Edge, Postfix, Proofpoint, Mimecast
  • DNS Authoritative: BIND, PowerDNS, Cloudflare, Route53
  • VPN Gateway / ZTNA Connector: Cisco AnyConnect, Pulse Secure, Zscaler ZPA, Tailscale
  • API Gateway: Kong, Apigee, AWS API Gateway, Azure API Management
  • FTP/SFTP Gateway: File transfer với partner
  • Proxy / Forward Proxy: Squid, Blue Coat, Zscaler (outbound inspection)
  • Honeypot / Deception: Canary tokens, Thinkst Canary

Rủi ro & Thách thức bảo mật DMZ

Rủi roMô tảGiảm thiểu
DMZ CompromiseServer trong DMZ bị hack → làm điểm đệm tấn công InternalHardening CIS Benchmark, Patch management, EDR, Network segmentation, Internal FW egress control
Lateral MovementTừ DMZ pivot vào Internal qua trust relationship, shared credential, vulnZero Trust: No implicit trust, micro-segmentation, mTLS, Just-in-Time access
Data ExfiltrationKẻ tấn công dùng DMZ server làm trung chuyển dữ liệu đánh cắpInternal FW deny all egress từ DMZ trừ cần thiết, DLP, TLS Inspection, DNS monitoring
MisconfigurationRule quá rộng (Any-Any), port mở không cần, default credentialIaC (Terraform/Ansible), Policy as Code (OPA), Continuous compliance (CSPM)
DDoSDMZ là mặt tiền hứng chịu DDoSCloud DDoS (Shield, Cloudflare, Akamai), Rate limiting, Anycast, Scrubbing center
Supply ChainCode/Container image trong DMZ bị inject malicious codeSBOM, SLSA, Sigstore, Image signing, Admission controller (Kyverno, OPA Gatekeeper)

Triển khai DMZ an toàn - Best Practice 2024

  1. Network Segmentation chặt chẽ: VLAN/VXLAN riêng cho DMZ, Internal, Mgmt, Backup. Không route trực tiếp DMZ ↔ Internal
  2. Dual Firewall (hoặc FW + Cloud FW): External FW (Internet→DMZ), Internal FW (DMZ→Internal)
  3. Least Privilege Rule:
    • External→DMZ: Chỉ port/service cần thiết (80/443, 25, 53, 443/1194 VPN)
    • DMZ→Internal: Chỉ App Server→DB Server (port cụ thể), Management→Jump Host
    • DMZ→Internet: Chỉ update/repo, DNS, NTP, threat intel feed. Block all else
    • Internal→DMZ: Chỉ admin/management, CI/CD deploy
  4. Server Hardening: CIS Benchmark, Minimal OS, No unnecessary service, SSH key only, Auditd, File Integrity Monitoring (AIDE/Tripwire/Wazuh)
  5. Encryption Everywhere: TLS 1.3 (External→DMZ, DMZ→Internal), mTLS service-to-service, Encrypt at rest (LUKS, EBS encryption)
  6. Monitoring & Detection:
    • VPC Flow Logs / NetFlow → SIEM
    • Traffic Mirroring → NDR (Zeek/Suricata/Corelight)
    • EDR trên mọi DMZ host
    • WAF logs, API Gateway logs → SIEM
    • UEBA: Phát hiện behavior bất thường (beaconing, data staging, unusual port)
  7. Automation & Response: SOAR playbook isolate compromised DMZ host, block IP, revoke cert, rotate key
  8. Regular Penetration Test & BAS: Red team DMZ, Breach & Attack Simulation liên tục
  9. Immutable Infrastructure: Cattle not pets. Deploy mới thay vì patch live. Blue/Green, Canary

DMZ vs Zero Trust Network Access (ZTNA)

Đặc điểmTraditional DMZZero Trust / ZTNA
Trust ModelNetwork-based (IP/Zone)Identity-based (User+Device+Context)
Access ControlFirewall Rule (IP/Port)Policy Engine (PDP) + PEP (Proxy/Agent)
VisibilityL3/L4 (some L7)L7 Application-aware, Data-aware
Remote AccessVPN → DMZ → InternalZTNA Connector → App trực tiếp (No network access)
Lateral MovementDễ dàng nếu compromise DMZKhó khăn: No network adjacency, micro-segment
Cloud NativeKhó (cần VM/FW appliance)Native (Identity Provider + Proxy/Connector)

Xu hướng: DMZ vẫn cần cho public-facing service (Web, DNS, Email), nhưng truy cập quản trị và nội bộ chuyển sang ZTNA. Kết hợp: DMZ cho ingress public, ZTNA cho egress/management.

Kết luận

DMZ là kiến trúc bảo mật mạng cơ bản để cô lập dịch vụ công khai. Triển khai đúng đòi hỏi: Dual firewall/Cloud FW, least privilege rule, server hardening, encryption, monitoring (NDR/SIEM), automation, regular testing. Trong kỷ nguyên Cloud/Zero Trust, DMZ vật lý chuyển thành Public Subnet + Security Groups + Network Firewall + ZTNA, nhưng nguyên tắc cốt lõi "cô lập, kiểm soát, giám sát" vẫn không đổi.