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

Network Security Control ที่ป้องกันข้อมูลไม่ให้เคลื่อนที่ระหว่าง 2 เครือข่าย: Firewall

คำตอบ: 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)

GenerationTypeCapabilityExample
1stPacket Filtering (Stateless)Header only (IP, Port), Fast, No ContextRouter ACL, Linux iptables (basic)
2ndStateful InspectionConnection State Table, TCP FlagsCheck Point FW-1, Cisco PIX
3rdApplication Proxy / ALGLayer 7 Inspection (FTP, SIP, DNS)Blue Coat, Microsoft ISA
4thNext-Gen Firewall (NGFW)App-ID, User-ID, IPS, SSL Decrypt, Threat Intel, SandboxPalo Alto, FortiGate, Check Point Quantum, Cisco Firepower, Sophos XGS
5thCloud-Native / SASE / FWaaSDistributed, Identity-centric, API-drivenZscaler, 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

  1. Default Deny (Implicit Deny): บล็อกทุกอย่าง → Allow เฉพาะที่จำเป็น
  2. Least Privilege: เปิด Port/IP/App ขั้นต่ำที่จำเป็น
  3. Rule Order: Specific Rules ก่อน, General Rules หลัง (Top-down Processing)
  4. Logging: Log Denied + Allowed (Critical) → SIEM
  5. Naming Convention: FW____ (เช่น FW_DMZ_WEB_ALLOW_001)
  6. Documentation: Business Justification, Owner, Review Date
  7. Regular Review: Quarterly: Remove Unused, Shadowed, Expired Rules
  8. Change Management: Request → Approve → Test → Deploy → Verify → Document

Firewall vs อื่นๆ

ControlFunctionLayer
FirewallAllow/Deny Traffic between ZonesL3/L4/L7
Router ACLBasic Packet FilteringL3/L4
Switch Port Security / VLANL2 Segmentation, MAC ControlL2
IDS/IPSDetect/Prevent Attack PatternsL3-L7
WAFProtect Web Apps (OWASP Top 10)L7
DLPPrevent Data ExfiltrationL7 + Content
NACControl Network AdmissionL2/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