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

Firewall ในความปลอดภัยเครือข่าย: ประเภท การทำงาน การเลือก และ Best Practices

Firewall คืออะไร? (Network Firewall Security)

Firewall คือ ระบบความปลอดภัย (Hardware, Software หรือ Cloud) ที่ตรวจสอบและควบคุม Network Traffic ระหว่าง Zone (เช่น Internet ↔ DMZ, DMZ ↔ Internal) ตามกฎ (Rules/Policies) ที่กำหนดไว้ล่วงหน้า เพื่อ อนุญาต (Allow), บล็อก (Block/ Drop), หรือปฏิเสธ (Reject) การเชื่อมต่อที่น่าสงสัยหรือไม่ได้รับอนุญาต

🧱 ไฟร์วอลล์ 3 รุ่นหลัก (Evolution)

GenerationTypeKey CapabilityLimitations
1st GenPacket Filter (Stateless)ตรวจ Header (IP, Port, Protocol) ต่อ Packetไม่เห็น Context/State, แฮกได้ด้วย Fragmentation, Spoofing
2nd GenStateful InspectionTrack Connection State (TCP Handshake, Session Table)ไม่เห็น Application Layer, ขยาย Scale ยาก
3rd Gen (Current)Next-Gen Firewall (NGFW)App-ID, User-ID, Content-ID (IPS, AV, Sandbox, SSL Decrypt, DNS Security)Complex, License Cost, Performance Impact (SSL Decrypt)

🔥 ประเภท Firewall ตามรูปแบบการติดตั้ง

  • Hardware Appliance: Physical Box (Palo Alto, FortiGate, Check Point, Cisco FTD) - High Performance, HA
  • Virtual Firewall (VM): Run on Hypervisor (VM-Series, FortiGate-V, vSRX) - Cloud, Multi-tenant
  • Cloud-Native / FWaaS: AWS Network Firewall, Azure Firewall, GCP Cloud Armor, Zscaler, Cloudflare
  • Host-based / Endpoint FW: Windows Defender FW, iptables/nftables, pfSense (Software)
  • Container/K8s Firewall: Calico, Cilium, CNI Plugins (Layer 3/4/7)

⚙️ การทำงาน 핵심 (How Firewall Works)

  1. Ingress Packet → Interface
  2. Ingress Processing: L2/L3 Check, NAT, Routing Lookup
  3. Policy Lookup (Top-Down): Match Source/Dest/Zone/App/User/Schedule
  4. Action: Allow / Deny / Drop / Reset / Redirect
  5. If Allow → Security Profiles: IPS, Antivirus, Anti-Spyware, URL Filtering, File Blocking, WildFire (Sandbox), SSL Decryption
  6. Egress Processing: NAT, QoS, Egress Interface

🎯 3 ฟังก์ชันหลักของ Firewall

  1. Access Control (Network Security Post): ควบคุมใครเข้าถึงอะไรได้บ้าง
  2. Threat Prevention: บล็อก Malware, Exploit, C2, Phishing, Data Exfiltration
  3. Visibility & Logging: Traffic Logs, Threat Logs, URL Logs, Data Filtering Logs → SIEM/SOAR

🛡️ Best Practices: การตั้งค่า Firewall ให้ปลอดภัย

  1. Default Deny (Implicit Deny): Block All → Allow Specific Only
  2. Least Privilege Rules: Specific Source/Dest/Port/App/User (No Any/Any)
  3. Rule Ordering: Specific Rules Top, Broad Rules Bottom, Cleanup Rule Last (Log All Denied)
  4. Enable Security Profiles: IPS, AV, URL Filtering, SSL Decrypt (Selective), DNS Security
  5. SSL Decryption (Selective): Decrypt Outbound (Exclude Finance/Health), Inbound (Own Certs)
  6. High Availability (HA): Active/Passive หรือ Active/Active + Config Sync
  7. Automated Rule Recertification: Review Unused/Shadowed/Expired Rules (Quarterly)
  8. Segment Admin Access: Management Interface บน Dedicated Mgmt Network + MFA + Jump Host
  9. Threat Intelligence Feeds: Auto-block Known Bad IPs/Domains/URLs
  10. Regular Pen Test / Firewall Audit: Annual External + Quarterly Internal

📊 Layer 3 vs Layer 4 vs Layer 7 Firewall

LayerOSI LayerInspectsExample
L3NetworkIP Src/Dst, RoutingRouter ACL, Basic Packet Filter
L4TransportPort, Protocol, State (TCP Flags)Stateful Firewall, Load Balancer
L7ApplicationApp Signature, HTTP Host/URL, User, File, TLS SNINGFW, WAF, Proxy, ZTNA

❓ คำถามพบบ่อย

Firewall ป้องกันได้ทุกอย่างไหม?
ไม่ ป้องกัน Insider Threat, Phishing Email (ต้อง Email Security), Compromised Credentials (ต้อง MFA/EDR), Zero-day (ต้อง Sandbox/Behavioral)
Hardware vs Virtual vs Cloud FW เลือกตัวไหน?On-prem DC → Hardware/VM | Cloud Native → Cloud FW/FWaaS | Hybrid → Mix + Central Mgmt (Panorama, FortiManager, Strata)
ต้องการ SSL Decrypt ไหม?แนะนำให้ทำ (Selective) เพราะ >80% Traffic เป็น HTTPS ไม่ Decrypt = Blind Spot