
Network Segmentation: แบ่ง Network เพื่อความปลอดภัยด้วย VLAN และ Firewall
Network Segmentation คือการแบ่ง network ออกเป็นส่วนย่อยๆ (segments) เพื่อจำกัดการเข้าถึงและลดผลกระทบเมื่อเกิด security incident ถ้า network เป็น flat (ทุกอย่างอยู่ VLAN เดียว subnet เดียว) เมื่อ attacker หรือ malware เข้ามาได้ จะ spread ไปทั้ง network ได้ทันที
การ segment network ด้วย VLANs + Firewall rules เป็น defense-in-depth strategy ที่สำคัญที่สุด ทำให้ lateral movement ยากขึ้น จำกัด blast radius ของ security incidents และทำให้ comply กับ regulations (PCI-DSS, HIPAA) บทความนี้จะอธิบายหลักการและวิธี implement
ทำไมต้อง Segment
| Flat Network | Segmented Network |
|---|---|
| Malware spread ทั้ง network ในไม่กี่นาที | Malware ถูกจำกัดอยู่ใน segment เดียว |
| ทุกคนเข้าถึง servers ทุกตัวได้ | เข้าถึงได้เฉพาะ segments ที่ได้รับอนุญาต |
| Broadcast storm กระทบทั้ง network | Broadcast จำกัดอยู่ใน VLAN |
| ไม่ผ่าน compliance audit | ผ่าน PCI-DSS, HIPAA requirements |
| Troubleshoot ยาก (traffic ปนกัน) | Troubleshoot ง่าย (traffic แยกชัดเจน) |
หลักการ Segmentation
Zones
แบ่ง network เป็น zones ตามความไว้วางใจ (trust level): Untrusted Zone: Internet (ไม่ไว้ใจเลย) DMZ: Web servers, email servers ที่ต้อง expose ต่อ internet Internal Zone: Staff workstations, printers Restricted Zone: Servers, databases, financial systems Management Zone: Network devices management interfaces ระหว่างแต่ละ zone มี firewall rules ควบคุม traffic
VLAN Design
ตัวอย่าง VLAN Layout
| VLAN | Name | Subnet | Purpose | Trust Level |
|---|---|---|---|---|
| 10 | Management | 10.0.10.0/24 | Switch/Router/AP management | High (restricted) |
| 20 | Servers | 10.0.20.0/24 | Production servers | High (restricted) |
| 30 | Staff | 10.0.30.0/22 | Staff workstations | Medium |
| 40 | VoIP | 10.0.40.0/24 | IP phones | Medium |
| 50 | BYOD | 10.0.50.0/24 | Personal devices | Low |
| 60 | IoT | 10.0.60.0/24 | Printers, cameras, sensors | Low |
| 70 | Guest | 10.0.70.0/24 | Guest WiFi | Untrusted |
| 80 | DMZ | 10.0.80.0/24 | Public-facing servers | Low |
Firewall Rules ระหว่าง Segments
ตัวอย่าง Rules
| Source | Destination | Service | Action | เหตุผล |
|---|---|---|---|---|
| Staff VLAN | Server VLAN | HTTP, HTTPS, RDP | Allow | Staff เข้าใช้ servers |
| Staff VLAN | Internet | HTTP, HTTPS, DNS | Allow | Staff เข้า internet |
| Guest VLAN | Internet | HTTP, HTTPS | Allow | Guest เข้า internet เท่านั้น |
| Guest VLAN | Any Internal | Any | Deny | Guest ห้ามเข้า internal |
| IoT VLAN | Internet | NTP, specific cloud | Allow | IoT ต้อง update + cloud |
| IoT VLAN | Any Internal | Any | Deny | IoT isolate จาก internal |
| Any | Management VLAN | Any | Deny (except IT) | Management access จำกัด |
Default Deny
กฎสำคัญ: Default policy = Deny ทุก traffic ที่ไม่ได้ explicitly allow จะถูก deny เปิดเฉพาะ traffic ที่จำเป็น (least privilege)
Inter-VLAN Routing
วิธี Route ระหว่าง VLANs
Option 1: L3 Switch (Router-on-a-Stick): Core switch ทำ inter-VLAN routing ด้วย SVIs (Switch Virtual Interfaces) เร็ว แต่ ACLs บน switch มีข้อจำกัด (stateless) Option 2: Firewall as Default Gateway: ทุก VLAN ใช้ firewall เป็น default gateway firewall ทำ inter-VLAN routing + stateful inspection ช้ากว่า L3 switch แต่ security ดีกว่ามาก แนะนำ: ใช้ firewall เป็น default gateway สำหรับ security-sensitive segments ใช้ L3 switch สำหรับ segments ที่ต้องการ performance
Micro-Segmentation
ขั้นกว่าของ Segmentation
Micro-Segmentation ควบคุม traffic ระดับ workload (VM, container) ไม่ใช่แค่ระดับ VLAN: ตัวอย่าง: Web Server ใน Server VLAN คุยกับ Database Server ใน Server VLAN เดียวกัน ด้วย traditional segmentation traffic ภายใน VLAN ไม่ถูก inspect ด้วย micro-segmentation ทุก traffic ถูก inspect แม้อยู่ VLAN เดียวกัน เครื่องมือ: VMware NSX, Cisco ACI, Illumio
Implementation Steps
Phase 1: Assessment
สำรวจ network ปัจจุบัน: อุปกรณ์ทั้งหมด, traffic flows, applications ทำ network map + data flow diagram ระบุ segments ที่ต้องการ + rules
Phase 2: VLAN Design
ออกแบบ VLANs: กำหนด VLAN IDs, subnets, naming convention ออกแบบ IP addressing plan กำหนด default gateways (L3 switch หรือ firewall)
Phase 3: Implementation
สร้าง VLANs บน switches assign ports ตั้ง firewall rules (start with allow all + logging เพื่อดู traffic patterns) ค่อยๆ tighten rules จนเหลือเฉพาะ traffic ที่จำเป็น
Phase 4: Monitoring
Monitor firewall logs ดู traffic ที่ถูก deny ปรับ rules ถ้ามี legitimate traffic ถูก block review rules ทุก quarter
ทิ้งท้าย: Segmentation คือ Security Fundamental
Network Segmentation ลดผลกระทบจาก security incidents, จำกัด lateral movement, ช่วย compliance เริ่มจากแยก Guest, IoT ออกจาก Internal แล้วค่อยเพิ่ม segments ใช้ firewall rules default deny อย่าปล่อยให้ network เป็น flat
อ่านเพิ่มเติมเกี่ยวกับ DHCP Snooping DAI และ Network Access Control NAC ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com