AAA là gì?
AAA (Authentication, Authorization, Accounting) - Khung.framework kiểm soát truy cập mạng tiêu chuẩn. "Ba A" đại diện cho:
- Authentication (Xác thực): "Bạn là ai?" - Xác minh danh tính (User, Device, Process). Credentials: Username/Password, Certificate, Token, Biometric, MFA.
- Authorization (Uỷ quyền): "Bạn được làm gì?" - Cấp quyền truy cập tài nguyên, lệnh, lệnh CLI, VLAN, ACL, Dải IP, Dịch vụ dựa trên Policy/Role/Group.
- Accounting (Kế toán/Ghi log): "Bạn đã làm gì?" - Ghi lại hoạt động: Thời gian đăng nhập/đăng xuất, Lệnh thực thi (CLI), Lượng dữ liệu (Bytes/Packets), Session duration, Billing.
Giao thức AAA chuẩn
| Giao thức | Port | Đặc điểm | Dùng cho |
|---|---|---|---|
| RADIUS (Remote Authentication Dial-In User Service) | UDP 1812 (Auth), 1813 (Acct) | IETF Standard. Combine Auth+Authz trong 1 request. Attribute-Value Pairs (AVP). Hỗ trợ EAP (802.1X). Không mã hóa toàn gói tin (chỉ Password). | Wi-Fi Enterprise (802.1X), VPN, Dial-up, ISP, Network Device Admin (ít dùng). |
| TACACS+ (Terminal Access Controller Access-Control System Plus) | TCP 49 | Cisco Proprietary (mở rộng). Tách biệt Auth, Authz, Acct. Mã hóa TOÀN BỘ payload (Header + Body). Hỗ trợ Command Authorization chi tiết (per-command). Reliable (TCP). | Quản trị thiết bị mạng (Router, Switch, Firewall CLI) - Phân quyền lệnh chi tiết. AAA cho Network Admin. |
| Diameter | TCP/SCTP 3868 | Thế hệ sau RADIUS. Hỗ trợ roaming, proxy, reliability, capacity lớn. 3G/4G/5G IMS, LTE, WiMAX. | Telecom, Mobile Core, Large Scale AAA. |
Triển khai AAA trên thiết bị Cisco (IOS/IOS-XE/NX-OS)
! 1. Bật AAA
aaa new-model
! 2. Định nghĩa Server Group (RADIUS/TACACS+)
aaa group server radius ISE_RADIUS
server name ISE_PRIMARY
server name ISE_SECONDARY
!
aaa group server tacacs+ ISE_TACACS
server name ISE_TACACS_PRI
server name ISE_TACACS_SEC
!
! 3. Cấu hình Method Lists (Thứ tự thử)
! Login (VTY, Console, SSH)
aaa authentication login DEFAULT group ISE_RADIUS local
aaa authentication login CONSOLE_NONE none ! Console không cần auth (cẩn thận!)
! Enable (Privilege 15)
aaa authentication enable default group ISE_TACACS enable
! Command Authorization (Chỉ TACACS+ hỗ trợ tốt)
aaa authorization commands 0 default group ISE_TACACS none ! User mode
aaa authorization commands 1 default group ISE_TACACS none
aaa authorization commands 15 default group ISE_TACACS none ! Privilege 15
! Exec Authorization (Shell access)
aaa authorization exec default group ISE_TACACS local
! Network Authorization (VPN, 802.1X, Per-user ACL/VLAN)
aaa authorization network default group ISE_RADIUS local
! Accounting
aaa accounting exec default start-stop group ISE_TACACS
aaa accounting commands 15 default stop-only group ISE_TACACS
aaa accounting network default start-stop group ISE_RADIUS
aaa accounting connection default start-stop group ISE_RADIUS
! 4. Áp dụng cho Line VTY/Console
line vty 0 15
login authentication DEFAULT
authorization exec DEFAULT
authorization commands 15 DEFAULT
accounting exec DEFAULT
transport input ssh
!
line console 0
login authentication CONSOLE_NONE ! Hoặc DEFAULT nếu muốn auth console
Cisco ISE (Identity Services Engine) - AAA Server hàng đầu
- Hỗ trợ RADIUS (802.1X, MAB, VPN, Guest) & TACACS+ (Device Admin).
- Policy Sets: Conditions (AD Group, Device Type, Posture, Time, Location) → Results (VLAN, dACL, SGT, Profile, Authorization Policy).
- Profiling: Nhận diện thiết bị (DHCP, HTTP, NMAP, NetFlow, CDP/LLDP) → Gán Endpoint Identity Group.
- Posture/Compliance: Kiểm tra AV, Patch, Disk Encryption, Registry trước khi cho truy cập mạng (AnyConnect/NAC Agent).
- Guest/Portal: Self-registration, Sponsor approval, AUP, CWA (Central Web Auth).
- TrustSec/SGT: Security Group Tag - Micro-segmentation không cần ACL phức tạp.
- PIA (Passive Identity): Học Identity từ AD Logon, VPN, DHCP, Syslog, NetFlow.
So sánh RADIUS vs TACACS+ cho Device Admin
| Tiêu chí | RADIUS | TACACS+ |
|---|---|---|
| Mã hóa | Chỉ Password (AVP) | Toàn bộ Payload |
| Command Authorization | Yếu (Chỉ Privilege Level) | Mạnh (Per-command, RegEx) |
| Transport | UDP (Unreliable) | TCP (Reliable) |
| Multi-vendor | Chuẩn mở (Tốt) | Cisco (Hỗ trợ một số vendor khác) |
| Accounting | Tốt (Session, Data volume) | Tốt (Command logging chi tiết) |
| Khuyến nghị | 802.1X, VPN, Wireless | Network Device Admin (CLI) |
AAA trong Zero Trust Architecture
- Identity Provider (IdP): Azure AD, Okta, Ping - làm Authentication (SAML/OIDC).
- Policy Decision Point (PDP): Làm Authorization (Policy Engine: OPA, Cedar, Cloud Vendor).
- Policy Enforcement Point (PEP): Proxy, Gateway, Sidecar, Agent - Enforce quyết định.
- Logging/Audit: Làm Accounting (SIEM, Cloud Audit Logs).
- AAA truyền thống (RADIUS/TACACS+) vẫn cốt lõi cho Network Infrastructure Access (Router/Switch/Fireless Controller/Firewall CLI).
Best Practices AAA
- Luôn dùng TACACS+ cho Device Admin (CLI), RADIUS cho 802.1X/VPN.
- Bật Accounting (Command Accounting quan trọng cho Audit/Forensics).
- Dùng Method Lists riêng cho từng Line/Service (không dùng DEFAULT cho tất cả).
- Cấu hình Fallback Local (local database) nếu AAA Server down.
- Bảo mật kênh AAA: Key mạnh, Source Interface Loopback, ACL cho phép chỉ AAA Server IP.
- Monitor & Alert: AAA Server unreachable, Failed auth spike, Privilege escalation.
- Review log Accounting định kỳ (Compliance, Insider Threat).
Kết luận
AAA là xương sống kiểm soát truy cập hạ tầng mạng. Hiểu rõ Authentication/Authorization/Accounting, RADIUS vs TACACS+, cấu hình Cisco `aaa new-model`, và tích hợp với Cisco ISE/IdP hiện đại là kỹ năng bắt buộc cho Network Security Engineer và Network Engineer cấp cao.