Access Control List (ACL) คืออะไร?
Access Control List (ACL) คือรายการกฎ (Rules) ที่ใช้ควบคุมการไหลของแพ็กเก็ตข้อมูลผ่านอุปกรณ์เครือข่าย (Router, Switch, Firewall) โดยตัดสินจากข้อมูลใน Header เช่น:
- Source IP Address / Destination IP Address
- Protocol Number (TCP=6, UDP=17, ICMP=1, ฯลฯ)
- Source Port / Destination Port
- Action: Permit (อนุญาต) หรือ Deny (ปฏิเสธ)
ประเภทของ ACL
| ประเภท | หมายเลข/ช่วง | ความสามารถ |
|---|---|---|
| Standard ACL | 1-99, 1300-1999 | กรองแค่ Source IP |
| Extended ACL | 100-199, 2000-2699 | กรอง Source/Dest IP, Protocol, Port, ICMP Type, DSCP, Time-range |
| Named ACL | ชื่อที่กำหนดเอง | อ่านง่าย จัดการง่าย รองรับ Sequence Number (แก้ไขได้) |
| IPv6 ACL | - | สำหรับトラฟฟิก IPv6 |
บทบาทของ ACL ใน Layered Security Strategy (กลยุทธ์ป้องกันแบบหลายชั้น)
Layered Security (Defense in Depth) ใช้ ACL ที่หลายจุดในเครือข่าย:
1. Perimeter Layer (ขอบเครือข่าย) - Border Router / Edge Firewall
- บล็อก IP ที่รู้จักว่าเป็นภัยคุกคาม (Threat Intelligence Feeds)
- จำกัดการเข้าถึงบริการสาธารณะเฉพาะที่จำเป็น (Port 80/443 Web, 25/587 Mail)
- Anti-spoofing: บล็อก Private RFC1918 จากอินเทอร์เน็ต, บล็อก Source = Internal IP จากภายนอก
2. Network Segmentation Layer (การแบ่งส่วนเครือข่าย) - Core/Distribution Switch, Internal Firewall
- ควบคุมトラฟฟิกระหว่าง VLAN/Zone (DMZ, Server, User, Management, IoT, Guest)
- ตัวอย่าง: User VLAN → Server VLAN: Allow เฉพาะ Port 80/443/1433 ต่อ App Server เท่านั้น
- Management VLAN: Allow เฉพาะ Jump Host/Bastion IP
3. Endpoint/Host Layer - Host-based Firewall, Cloud Security Groups
- Windows Firewall / iptables / nftables / AWS Security Groups / Azure NSG
- จำกัด Inbound/Outbound เฉพาะที่จำเป็นสำหรับ Role ของเซิร์ฟเวอร์
4. Application Layer - WAF, API Gateway, Proxy
- ACL แบบ Layer 7: URL Path, HTTP Method, Header, User-Agent, GeoIP
- Rate Limiting, Bot Protection
วิธีที่ ACL ช่วยปรับปรุงความปลอดภัยเครือข่าย
- Traffic Filtering - กรองトラฟฟิกไม่พึงประสงค์/อันตราย ก่อนเข้าสู่ระบบสำคัญ
- Least Privilege Network Access - ให้สิทธิ์เฉพาะที่จำเป็น (Zero Trust Network)
- Lateral Movement Prevention - ป้องกันการเคลื่อนที่ข้าม Zone หากโดนเจาะ
- DDoS Mitigation - Rate limiting, Block known bad actors
- Compliance & Audit - มีหลักฐานการควบคุมトラฟฟิก ตาม PCI-DSS, HIPAA, NIST
- Visibility - Log การ Match ACL (Hit Count) ช่วยวิเคราะห์พฤติกรรม
ข้อดีของ ACL
- ป้องกันเซิร์ฟเวอร์ที่ Exposed ไปสู่อินเทอร์เน็ตได้ดีขึ้น
- การควบคุมการเข้าถึงแบบรวมศูนย์ (Centralized)
- ควบคุมトラฟฟิก Internal ได้ละเอียดขึ้น
- ควบคุมสิทธิ์ระดับ User และ Group ได้ละเอียด (บน Host/Cloud FW)
- ต้นทุนต่ำ (Built-in Router/Switch) ประสิทธิภาพสูง (Hardware-accelerated)
Best Practices สำหรับ ACL
- Implicit Deny All - กฎสุดท้ายต้องเป็น Deny All (Default Action)
- Specific Permit First - กฎ Allow เฉพาะเจาะจง ขึ้นบน กฎ Deny กว้างอยู่ล่าง
- Use Named ACLs - อ่านง่าย จัดการง่าย รองรับ Remarks
- Document Everything - Remark ทุกกฎ (Remark "Allow Web to App Server")
- Test Before Apply - ใช้
access-list compileหรือ Lab Test - Monitor Hit Counts - ลบกฎที่ไม่มี Hit (Stale Rules)
- Regular Review - ทบทวนทุกไตรมาส/ครึ่งปี
ACL vs Firewall vs Security Group
| คุณสมบัติ | ACL (Router/Switch) | Stateful Firewall | Cloud Security Group |
|---|---|---|---|
| Stateful | ไม่ใช่ (Stateless)* | ใช่ | ใช่ |
| Layer | L3/L4 | L3-L7 | L3/L4 (+L7 บางตัว) |
| Performance | สูงมาก (ASIC) | ปานกลาง-สูง | สูง (Hypervisor/HW) |
| Granularity | IP/Port/Proto | App/User/Content | IP/Port/Proto/SG Ref |
| ใช้สำหรับ | High-speed filtering, Edge, Segmentation | Perimeter, App inspection | Cloud workload isolation |
* บางแพลตฟอร์มรองรับ Reflexive ACL / Established bit แต่ไม่ใช่ Stateful จริง
สรุป
ACL เป็น **บล็อกก่อสร้างพื้นฐาน (Building Block)** ของ Layered Network Security ใช้กรองトラฟฟิกที่ L3/L4 อย่างรวดเร็ว ประหยัดทรัพยากร ทำงานร่วมกับ Firewall (Stateful, L7), IPS, Segmentation, Zero Trust ให้ความปลอดภัยแบบครอบคลุม ต้องออกแบบ จัดการ และทบทวนอย่างต่อเนื่อง