AAA认证(Authentication, Authorization, and Accounting)是一个网络安全框架,用于管理用户如何访问网络资源。具体来说:
-
认证(Authentication):确认用户的身份。这通常涉及用户名和密码,但也可以包括生物识别技术(如指纹或面部识别)、一次性密码(OTP)等。
-
授权(Authorization):确定已认证的用户可以访问哪些资源或执行哪些操作。这可能涉及到权限级别、角色或职责等。
-
审计(Accounting):记录用户活动,例如登录时间、使用的资源、数据传输量等。这有助于审计和计费。
配置示例:
1. AAA基础配置
aaa authentication-scheme default # 默认认证方案
aaa authorization-scheme default # 默认授权方案
aaa accounting-scheme default # 默认计费方案
aaa accounting-scheme audit # 启用操作日志记录accounting log information # 记录详细操作server 192.168.1.100 # 审计服务器IP
作用:启用AAA框架,使用默认的认证、授权和审计策略。
2. 域配置
domain ceshi # 创建域名"ceshi"(可选,用于分组管理)
3. 本地用户配置
管理员(权限15)
local-user admin password cipher %$%$A1B2C3D4E5F6%$%$
local-user admin privilege level 15
local-user admin service-type ssh telnet terminal
运维人员(权限3)
local-user op password cipher %$%$12345678%$%$
local-user op privilege level 3
local-user op service-type telnet terminal
审计员(权限1,仅查看)
local-user audit password cipher %$%$abcdefg%$%$
local-user audit privilege level 1
local-user audit service-type ssh
4. 接口配置
控制台接口(con 0)
user-interface con 0authentication-mode aaaidle-timeout 15 # 超时15分钟
远程登录接口(VTY 0-4)
user-interface vty 0 4authentication-mode aaaprotocol inbound ssh # 仅允许SSHauthorization-attribute user-role level 3 # 默认权限级别3
SSH配置
ssh user admin authentication-type password
ssh user audit authentication-type password
rsa local-key-pair create # 生成RSA密钥对
应用到VTY接口
user-interface vty 0 4accounting-scheme audit
5. 安全增强
禁用Telnet(不安全协议)
telnet server disable
限制SSH尝试次数
ssh authentication-retries 3
密码策略
password-policy min-length 8 # 最小密码长度8位
检查审计日志:
display aaa accounting
动态密码:
local-user admin dynamic-password # 启用动态密码(如OTP)
多因素认证:
aaa authentication-scheme radius # 集成RADIUS服务器进行双因素认证