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

อุปกรณ์ควบคุมแพ็กเก็ตเข้า-ออกเครือข่าย: Firewall คืออะไร? ทำงานอย่างไร? ประเภทใดบ้าง?

Firewall: อุปกรณ์ควบคุมトラฟฟิกเข้า-ออกเครือข่าย (Network Traffic Control)

Firewall คือระบบความปลอดภัยเครือข่าย (Hardware, Software, หรือ Cloud Service) ที่ ตรวจสอบและควบคุมการไหลของแพ็กเก็ตข้อมูล (Network Traffic) ระหว่างโซนที่ไว้ใจได้ (Trusted/Internal) และโซนที่ไม่ไว้ใจ (Untrusted/External/Internet) ตาม Security Policies/Kernels ที่กำหนดไว้ล่วงหน้า

Firewall ทำงานอย่างไร? (Core Functions)

  1. Packet Inspection: ตรวจสอบ Header (L3/L4: IP, Port, Protocol) และ Payload (L7: App Data)
  2. Policy Enforcement: ตัดสินใจ Allow / Deny / Drop / Reject / Log / Alert ตาม Rule Base
  3. Stateful Inspection: จำสถานะ Connection (TCP Handshake, Session) ไม่ใช่แค่ดู Packet เดี่ยว (Stateless)
  4. Logging & Auditing: บันทึก Event (Allowed, Blocked, Suspicious) สำหรับ SIEM/Analysis
  5. NAT (Network Address Translation): ซ่อน Internal IP (Source NAT) / Publish Service (Destination NAT)

3 ประเภท Firewall หลัก (Generations)

Generationประเภทการทำงานข้อดี/ข้อจำกัด
1st GenPacket Filtering (Stateless)ดู Header (Src/Dst IP, Port, Protocol) ตาม ACL/Rule ไม่จำ State⚡ เร็ว, 💰 ถูก / 🚫 ไม่เห็น Context, แตกง่าย (IP Spoof, Fragment)
2nd GenStateful Inspectionจำ State Table (TCP SYN/SYN-ACK/ACK, UDP Timeout) ตัดสินใจจาก Context✅ มาตรฐานปัจจุบัน, 🛡️ กัน Spoof/Fragment / 🚫 ไม่ดู Layer 7
3rd GenApplication Layer / Proxy FirewallTerminate Connection, Inspect Payload (HTTP, DNS, SMTP, FTP), Deep Packet Inspection (DPI)🛡️ ดู Layer 7, Block App Attacks / 🐢 ช้ากว่า, ต้อง Proxy ทุก Protocol
Next-GenNGFW (Next-Generation Firewall)Stateful + App-ID (App Control), User-ID, IPS/IDS, SSL Decrypt, Threat Intel, Sandbox, Cloud Delivered🌟 ครบครัน, Context-Aware / 💰 แพง, Complex, ต้อง Subscription

NGFW (Next-Generation Firewall) - ความสามารถสำคัญ

  • App-ID (Application Identification): ระบุแอปพลิเคชัน (Facebook, BitTorrent, SSH, SQL, RDP) ไม่ใช่แค่ Port
  • User-ID: Map IP ↔ User (AD/LDAP/SAML) → Policy Based on User/Group
  • Content-ID: IPS (Signature/Anomaly), Anti-Virus, Anti-Spyware, URL Filtering, File Blocking, WildFire/Sandbox
  • SSL/TLS Decryption (Inbound/Outbound): ถอดรหัส HTTPS เพื่อ Inspect Malware/Data Leak (Privacy/Legal Considerations)
  • Threat Intelligence Feed: Auto-update IOC (IP, Domain, Hash, URL) จาก Cloud
  • Automation/API/Integration: SOAR, SIEM, XDR, Terraform, Ansible

Firewall Deployment Architectures

Firewall Rules Best Practices

  1. Default Deny (Implicit Deny All): บล็อกทั้งหมด เปิดเฉพาะที่จำเป็น (Least Privilege)
  2. Top-Down Processing: Specific Rules บน, General Rules ล่าง
  3. Naming Convention: FW_RULE____ (เช่น FW_RULE_IN_WEB_ALLOW_001)
  4. Documentation (Description/Comment): Requestor, Ticket, Business Justification, Review Date
  5. Regular Rule Review: Shadowed Rules, Unused Rules (No Hits 90 days), Expired Rules, Risky Rules (Any/Any/Allow)
  6. Change Management: Request → Risk Assessment → Approval → Implement → Verify → Document

Firewall vs อื่นๆ

ArchitectureคำอธิบายUse Case
Perimeter (Edge)Internet ↔ Firewall ↔ DMZ ↔ Internal Firewall ↔ LANTraditional, On-prem DC
Distributed / Micro-segmentationFirewall ต่อ Host/Workload (Host-based, VMware NSX, Cisco ACI, Illumio)Zero Trust, Cloud, Container
Cloud / FWaaSFirewall as a Service (Zscaler, Palo Alto Prisma, FortiGate Cloud, Check Point CloudGuard)Remote User, Branch, SaaS, SASE
Internal SegmentationFirewall ระหว่าง VLAN/Zone (IT, OT, Server, Guest, Mgmt)Defense in Depth, Compliance
เทคโนโลยีความแตกต่างหลัก
Router ACLStateless, L3/L4 Only, No App Awareness, No Threat Prevention, Performance Oriented
WAF (Web App Firewall)Layer 7 Only (HTTP/HTTPS), OWASP Top 10 Focus, ไม่ใช่ Network Firewall
IPS/IDSDetection/Prevention Focus, ในระหว่าง Traffic Flow (Inline/TAP), ไม่ทำ NAT/Routing
ProxyTerminate Connection, Forward แทน Client, Cache, Auth, Filter (Forward/Reverse)
UTM (Unified Threat Management)All-in-one Box (Firewall + AV + IPS + VPN + Web Filter) - SMB Focus, NGFW = Enterprise Grade

สรุป

Firewall = ประตูรักษาประตูเครือข่าย ควบคุม Traffic ตาม Policy จาก Stateless Packet Filter → Stateful Inspection → Application Proxy → NGFW (App-ID, User-ID, Content-ID, SSL Decrypt, Threat Intel) เลือก Architecture ให้ตรง Use Case (Perimeter, Distributed, Cloud/SASE, Internal) และจัดการ Rule Base ด้วย Best Practices (Default Deny, Documentation, Review, Change Mgmt)