| Loại | Đặc điểm | Ví dụ |
| 1. Packet Filtering (Stateless) | Chỉ kiểm tra Header (IP, Port, Proto). Không theo dõi state. Nhanh, ít resource. Không thấy context kết nối. Dễ bypass (IP Spoofing, Fragmentation). | Router ACL, Linux iptables (basic), Cisco ASA (chế độ stateless). |
| 2. Stateful Inspection | Theo dõi State Table. Hiểu TCP handshake, UDP flow. An toàn hơn, hiệu năng tốt. Tiêu chuẩn thập kỷ 2000-2010. | Check Point Statefull Inspection, Cisco ASA/PIX, Juniper SRX, FortiGate (base), Palo Alto (base). |
| 3. Next-Generation Firewall (NGFW) - Tiêu chuẩn hiện tại | Stateful + App-ID (L7) + User-ID + Threat Prevention (IPS, AV, Sandbox, URL, DNS, SSL Inspect) + Central Management & Automation. Single-pass architecture (parallel processing) để giữ hiệu năng. | Palo Alto Networks (Pioneer), Fortinet FortiGate, Check Point Quantum, Cisco Secure Firewall (Firepower), Sophos XGS, Hillstone, Sangfor, NSFocus. |
Lưu ý: "Proxy Firewall" / "Application Layer Gateway (ALG)" là kỹ thuật kiểm tra L7 cũ, chậm, ít dùng độc lập, thường tích hợp trong NGFW.
Phân loại theo Form Factor
- Hardware Appliance: Hộp chuyên dụng (ASIC/NPU offload). Throughput cao, HA cứng. Data Center, Perimeter, Large Branch.
- Virtual Appliance (VM-Series, vFW): Chạy trên Hypervisor (VMware, Hyper-V, KVM) / Cloud (AWS, Azure, GCP). Cho Virtualized Env, Cloud, Branch ảo.
- Cloud-Native / Cloud-Delivered (FWaaS): Zscaler Cloud Firewall, Palo Alto Cloud NGFW, FortiGate CNF, Cisco Cloud Firewall, AWS Network Firewall, Azure Firewall, Google Cloud Firewall. No hardware, elastic scale, SASE/SSE component.
- Container Firewall / Micro-segmentation: Calico, Cilium, NeuVector, Aqua, KubeArmor. East-West traffic trong K8s.
Firewall Rules - Cú pháp 5-Tuple + Extensions
Rule: Name, Description, Action (Allow/Deny/Drop/Reset), Enabled
Source: Zone/Interface, IP/Range/Group, User/Group (User-ID), Region/Geo, FQDN, ASG
Destination: Zone/Interface, IP/Range/Group, FQDN, Service Tag, Region/Geo
Application / Service: App-ID (facebook, ssl, ssh, custom) OR Service (TCP/443, UDP/53, Any)
URL Category / Profile: (Optional) URL Filtering Profile, File Blocking Profile, Spyware Profile, Vulnerability Profile, Antivirus Profile, WildFire Profile, Data Filtering Profile, SSL Decryption Profile
Logging: Start/End/Both, Send to Panorama/Log Collector/Syslog/SIEM
Schedule: Time-based enforcement
Best Practices cấu hình & vận hành
- Default Deny (Implicit Deny): Rule cuối cùng: Deny All. Chỉ Allow cái cần thiết (Least Privilege).
- Naming Convention:
FW____ (vd: FW_PROD_IN_WEB_010). Description bắt buộc.
- Zone-based Policy: Định nghĩa Zone (Trust, Untrust, DMZ, Mgmt, Server, Guest, IoT, OT). Policy giữa Zone. Không dùng Interface-based policy.
- App-ID thay vì Port: Dùng App-ID (ssl, web-browsing, ms-teams, custom-app) thay vì TCP/443, TCP/80. Kiểm soát chính xác app, bypass port hopping.
- SSL Decryption (TLS Inspection): BẮT BUỘC cho Outbound (Forward Proxy) và Inbound (Reverse Proxy/Inbound Inspection) để thấy bên trong HTTPS (95%+ traffic). Cert management, Exclusion list (Banking, Health, Privacy).
- User-ID Integration: Map IP→User (AD, Azure AD, Okta, Captive Portal, GlobalProtect). Policy theo User/Group (HR, Finance, IT, Contractor).
- High Availability (HA): Active/Passive (A/P) hoặc Active/Active (A/A). Session Sync, Config Sync, Link Monitoring, Path Monitoring. Test Failover định kỳ.
- Logging & Monitoring: Log All (Allow + Deny) → SIEM (Splunk, Sentinel, Elastic, QRadar). Alert: Deny from Internal, Allow to High-Risk Country/Category, Threat Hits, HA Failover, Config Change.
- Change Management: Request → Risk Assessment → Approval → Staging/Pre-prod Test → Implementation Window → Verification → Rollback Plan → Documentation. Automation (Terraform, Ansible, API, Panorama).
- Rule Cleanup: Định kỳ (Quarterly): Remove Unused Rules (Hit count = 0 > 90d), Shadowed Rules, Redundant Rules, Expired Rules. Optimize Order.
- Firmware/Signature Updates: Auto-update Threat Signatures (Apps, Threats, AV, WildFire). Firmware: Test lab → Staged Rollout. Vendor Support Lifecycle.
Layer 3 vs Layer 4 vs Layer 7 Firewall
- L3 Firewall: Lọc dựa trên IP Src/Dst (Routing/ACL). Không hiểu Port/Protocol sâu.
- L4 Firewall (Stateful): Lọc IP + Port + Protocol + State (TCP/UDP Session). Hiểu "Conversation".
- L7 Firewall (NGFW / Proxy / WAF): Hiểu Application Protocol (HTTP, DNS, SMTP, SQL, SSH, RDP...). Kiểm soát nội dung, hành vi, user, file, lệnh.
Kết luận
Firewall (đặc biệt NGFW) là thiết bị trung tâm kiểm soát traffic In/Out. Hiệu quả phụ thuộc vào: Chính sách Default Deny, App-ID/User-ID, SSL Decryption, HA, Logging/SIEM Integration, Change Management, Rule Hygiene, Signature/Firmware Update. Trong kiến trúc hiện đại (Zero Trust/SASE), Firewall Perimeter vẫn cần thiết nhưng phải kết hợp với ZTNA, CASB, SWG, EDR, Cloud FW, Micro-segmentation để bảo vệ toàn diện.