Computer >> Hướng Dẫn Máy Tính >  >> Kết Nối Mạng >> An Ninh Mạng

Mục đích của ACL (Access Control List) trong an ninh mạng

ACL là gì?

Access Control List (ACL – Danh sách kiểm soát truy cập) là tập hợp các quy tắc (rules) được áp dụng trên thiết bị mạng (router, switch, firewall) để lọc gói tin (packet filtering) dựa trên thông tin header: IP nguồn/đích, Port nguồn/đích, Protocol (TCP/UDP/ICMP), DSCP, VLAN, Interface...

Mục đích chính (Purpose)

  1. Kiểm soát truy cập mạng (Network Access Control): Cho phép/Chặn traffic giữa các zone (Untrust→DMZ, User→Server, Mgmt→All).
  2. Giảm thiểu bề mặt tấn công (Attack Surface Reduction): Chặn traffic không cần thiết (ví dụ: chặn SMB/NetBIOS ra Internet, chặn Telnet/SSH từ Internet vào Management plane).
  3. Phòng chống DoS/DDoS cơ bản: Rate-limit ICMP, SYN flood, amplify reflection (NTP, DNS, Memcached) qua ACL + uRPF.
  4. Traffic Classification & QoS: Đánh dấu (mark) traffic quan trọng (Voice, Video, Routing Protocol) để ưu tiên hàng đợi.
  5. Policy Enforcement Point (PEP): Thực thi chính sách bảo mật do nhóm Security định nghĩa (Zero Trust segmentation).
  6. Logging & Forensics: Log hit-count, syslog/NetFlow cho SIEM correlation (detect port scan, lateral movement, C2 beaconing).

Loại ACL phổ biến

LoạiPhạm vi khớp (Match criteria)Ứng dụng điển hình
Standard ACL (Cisco 1-99, 1300-1999)Chỉ Source IPFilter đơn giản near destination (ví dụ: chặn host A truy cập server B).
Extended ACL (Cisco 100-199, 2000-2699)Source IP, Dest IP, Protocol, Source Port, Dest Port, TCP flags, ICMP type, DSCP, TTL...Chi tiết, áp dụng near source (best practice). Hỗ trợ established (TCP ACK/RST) cho stateful-like.
Named ACLGiống Extended nhưng dùng tên (dễ quản lý, cho phép edit line-by-line, remark).Khuyến nghị production.
IPv6 ACLIPv6 Src/Dst, Next Header, Flow Label, Port...Filter traffic IPv6.
MAC ACL (Layer 2)Src/Dst MAC, EtherType, VLAN ID, CoSSwitch port security, VLAN ACL (VACL), Port ACL (PACL).
Object-Group ACLSử dụng network-object, port-object, service-object groupDễ bảo trì, giảm số dòng rule, tái sử dụng.

Ví dụ Extended ACL Cisco (Best Practice: Near Source)

! Allow HTTP/HTTPS từ User VLAN (10.10.10.0/24) đến Web Server DMZ (172.16.10.10)
ip access-list extended USER_TO_DMZ_WEB
 remark Allow Web Access
 permit tcp 10.10.10.0 0.0.0.255 host 172.16.10.10 eq 80
 permit tcp 10.10.10.0 0.0.0.255 host 172.16.10.10 eq 443
 remark Allow DNS to Internal DNS
 permit udp 10.10.10.0 0.0.0.255 host 10.10.1.10 eq 53
 remark Deny & Log all other to DMZ
 deny ip 10.10.10.0 0.0.0.255 172.16.10.0 0.0.0.255 log
 permit ip any any  ! implicit permit for other traffic (adjust per policy)

! Apply inbound trên interface User VLAN SVI
interface Vlan10
 ip access-group USER_TO_DMZ_WEB in

ACL vs Firewall (Stateful vs Stateless)

  • ACL (Stateless): Kiểm tra mỗi gói tin độc lập, không nhớ trạng thái kết nối (connection state). Nhanh, ít tài nguyên, phù hợp high-throughput core router/switch.
  • Stateful Firewall: Duy trì state table (session), tự động allow return traffic, inspection L7 (App-ID, IPS, AV, SSL Decrypt). Dùng tại perimeter, DMZ, segmentation gateway.

Kết hợp: ACL trên Core/Distribution switch cho coarse filtering + Firewall tại chokepoint cho deep inspection.

ACL trên Cloud (AWS/Azure/GCP)

  • AWS Network ACL (NACL): Stateless, áp dụng ở Subnet level, rule số thứ tự (1-32766), Allow/Deny cả inbound/outbound. Dùng cho subnet-level guardrail.
  • AWS Security Group (SG): Stateful, áp dụng ở ENI/Instance level, chỉ Allow rules. Dùng cho application-level.
  • Azure NSG: Stateful, áp dụng Subnet/NIC, rule priority, Allow/Deny, Service Tag, Application Security Group.
  • GCP Firewall Rules: Stateful, áp dụng VPC network, target tags/service accounts, allow/deny, priority.

Quản trị vòng đời ACL (Lifecycle Management)

  1. Document: Mỗi rule có remark mô tả lý do, ticket change request, owner, review date.
  2. Automation: IaC (Terraform, Ansible, Cisco ACI, Meraki Dashboard API) – không config manual CLI.
  3. Review định kỳ (Quarterly): Dọn rule unused (hit-count=0 > 90 ngày), shadowed, overly permissive (permit ip any any).
  4. Change Control: Mọi thay đổi qua Change Advisory Board (CAB), test lab/staging trước production.
  5. Version Control: Git repo cho ACL config (rendered từ template).