Authentication:用於驗證用戶的訪問,如login access,ppp network access等。
Authorization:在Autentication成功驗證後,Authorization用於限制用戶能夠執行什麼操做,能夠訪問什麼服務。
Accouting:記錄Authentication及Authorization的行爲。
Part I. 安全協議
1>Terminal Access Controller Access Control System Plus (TACACS+)
Cisco私有的協議。加密整個發給tacacs+ server的消息,用戶的keys。
支持模塊化AAA,能夠將不一樣的AAA功能分佈於不一樣的AAA Server甚至不一樣的安全協議,從而能夠實現不一樣的AAA Server/安全協議實現不一樣的AAA功能。
配置命令:
Router(config)# tacacs-server host IP_address [single-connection] [port {port_#}] [timeout {seconds}] [key {encryption_key}]
Router(config)# tacacs-server key {encryption_key} 注:
(1)single-connection:爲Router與AAA Server的會話始終保留一條TCP連接,而不是默認的每次會話都打開/關閉TCP連接。
(2)配置兩個tacacs-server host命令能夠實現tacacs+的冗餘,若是第一個server fail了,第二個server能夠接管相應的服務。第一個tacacs-server host命令指定的server爲主,其它爲備份。
(3)配置inbound acl時須要permit tacacs+的TCP port 49。
(4)若是兩個tacacs-server使用不一樣的key,則須要在tacacs-server host命令中指定不一樣的encryption_key,不然可使用tacacs-server key統必定製。但tacacs-server host命令中的key定義優先於tacacs-server key命令。
Troubleshooting:
命令:
#show tacacs
#debug tacacs 關於TACACS+的操做信息。
#debug tacacs events 比debug tacacs更詳細的信息,包括router上運行的 TACACS+ processes消息。
Router# show tacacs
Tacacs+ Server : 10.0.0.10/49
Socket opens: 3
Socket closes: 3
Socket aborts: 0
Socket errors: 0
Socket Timeouts: 0
Failed Connect Attempts: 0
Total Packets Sent: 42
Total Packets Recv: 41
Expected Replies: 0
No current connection
2>Remote Authentication Dial-In User Service (RADIUS)
RADIUS是一個開放的標準,定義於RFC 2865和2865。
RADIUS使用一個共享的密鑰,而且只加密用戶的keys,而不是TACACS+的整個AAA消息。用戶的keys不會明文在網絡上傳遞。
RADIUS應用範圍:
(1)使用multiple vendors設備,而且須要一個單獨的安全協議用於AAA。
(2)須要實現資源記錄,如跟蹤用戶登陸router多長時間及用戶訪問網絡多長時間。
(3)smart card authentication systems只支持RADIUS。
(4)在用戶初始化訪問一個設備時,對他進行preauthentication。
RADIUS的使用限制:
(1)不支持Apple Talk's Remote Access Protocol(ARAP),the NetBIOS Frame Control Protocol(NBFCP),NetWare's Asynchronous Serveices Interface(NASI)及X.25 PAD連接。
(2)RAIUDS不支持模塊化AAA操做,即只可使用RADIUS來完成所有的AAA操做。
(3)只支持one-way authentication.不支持two-way authentication(如:兩個router之間的PPP CHAP Authentication).
(4)RADIUS將Authentication及Authorization功能集成爲"Authentication"。
配置命令:
Router(config)# radius-server host IP_address [auth-port {port_#}] [acct-port {port_#}] [timeout {seconds}] [retransmit {retries}] [key {key_value}] [alias {hostname | IP_address}]
Router(config)# radius-server timeout {seconds}
Router(config)# radius-server retransmit {retries}
Router(config)# radius-server key {key_value}
注:
(1)RADIUS Server daemon監聽Authentication消息默認使用UDP 1645.Authorization消息默認使用UDP 1646.
(2)配置inbound acl以permit UDP 1645/1646。
(3)RFC 2026中指出,RADIUS也可能使用UDP 1812/1813,一些新的RADIUS Server同時監聽UDP 1645/1646及UDP 1812/1813。因此配置router inbound acl以permit相應的端口。
(4)RADIUS默認timeout爲5s,retransmit爲3.
Troubleshooting:
show radius statistics
debug radius [brief]
加上brief參數功能相似於debug tacacs命令,不加則相似於debug tacacs event命令。
Router# show radius statistics
Auth. Acct. Both
Maximum inQ length: NA NA 1
Maximum waitQ length: NA NA 1
Maximum doneQ length: NA NA 1
Total responses seen: 5 0 5
Packets with responses: 5 0 5
Packets without responses: 0 0 0
Average response delay(ms): 1880 0 1880
Maximum response delay(ms): 6540 0 6540
Number of Radius timeouts: 0 0 0
Duplicate ID detects: 0 0 0
3>Kerberos
其中TACACS+及RADIUS全面支持AAA。Kerberos只支持Authentication。
Item
|
TACACS+
|
RADIUS
|
Comparison
|
Connection
|
TCP
|
UDP
|
UDP has less overhead; however, with TCP, TACACS+ more quickly can detect a failed server and switch over to a backup. TCP can do this by having the router look for an RST (closed connection) message or by using TCP keepalives.
|
Encryption
|
Payload
|
Passwords
|
TACACS+ is more secure because it encrypts the entire payload, which includes all user and AAA message information; RADIUS encrypts only passwords, so everything else, including usernames and other account information, is sent in clear text.
|
Authentication and authorization
|
Separate
|
Combined
|
RADIUS combines authentication and authorization functions, which means that you must use the same server or group for these functions. TACACS+ separates them, giving you more control over the server that handles these functions.
|
WAN protocols
|
PPP, ARAP, NetBIOS, NASI, and X.25 PAD
|
PPP and SLIP
|
TACACS+ is better suited for remote-access situations that involve multiple dialup protocols, whereas RADIUS supports only PPP and SLIP.
|
Router command authorization
|
|
No
|
TACACS+ enables you to control what commands an authenticated user can execute on a router; RADIUS does not.
|
|
Basic
|
Advanced
|
The one big advantage that RADIUS has over TACACS+ is its robust accounting, which is why many ISPs use it to monitor PPP connections.
|
Part II. Server Groupings
默認使用tacacs-server host或radius-server host命令配置的AAA Server都是按命令出現的順序分爲主/備服務器,可使用aaa group server radius/tacacs+命令覆蓋實現部分配置的host作爲驗證server。同時能夠實現不一樣的aaa group實現不一樣的AAA功能,如group1實現Authentication,group2實現Authorization等。
配置命令:
Router(config)# aaa group server radius | tacacs+ {group_name}
Router(config-sg)# server {IP_address | hostname} [auth-port {port_#}] [acct-port {port_#}]
注:
(1)不能在aaa group server中混合使用多種安全協議。
Part III. Authentication
router支持authentication如下兩種基本的訪問模式。
1>Character mode:用戶經過console, auxiliary, TTY, or VTY線路得到到router的 user或privileged EXEC訪問。
2>Packet mode:用戶經過使用 PPP, SLIP, ARAP, NASI, NetBIOS, or X.25 PAD等遠程訪問協議創建一個data-link layer連接。
Method lists:
指定一系列的認證方式。如group tacacs+,group radius,local,none等。
每一個authentication命令最多隻能同時使用4種認證methods。
認證的結果:
Success:此method可達,且用戶經過驗證。
Fail:此mothod可達,但用戶驗證失敗。
Error:有兩種狀況
(1)此mothod中指定的aaa server group中的一個AAA Server不可達,第二個AAA Server被嘗試。
(2)此mothod指定的方式不存在,或AAA group中的全部的servers都不可達。
注:
1>若是router試圖訪問的全部mothods結果都是unsuccessful,則router acl會自動deny之後的authentication request。
2>若是指定的mothod是local,且沒有與用戶提供的用戶名相匹配的username,則驗證結果爲Error。
Authtication Command Syntax:
aaa authtication login {認證列表名稱} {驗證方法}
{認證列表名稱}
default:默認的authentication認證方式。
name:指定特定的認證方式列表,實現更具體的認證。
{驗證方法}
enable使用enable賬號密碼驗證
group:使用Server Group驗證
krb5:使用kerberos V驗證
krb5-telnet:使用kerberos V驗證telnet
line:使用線路密碼驗證
local:使用本地賬號密碼驗證
local-case:使用本地賬號密碼驗證(區分大小寫)
none:不進行驗證
aaa authentication enable default {驗證方法}
{驗證方法}
enable
group
line
none
aaa authentication ppp {認證列表名稱} {驗證方法}
{認證列表名稱}
default:默認的authentication認證方式。
name:指定特定的認證方式列表,實現更具體的認證。
{驗證方法}
group
if-needed:若是用戶已經經過tty線路身份驗證,則在此不驗證用戶身份,直接經過
krb5
local-case
local
none
Authtication Configuration:
Router(config)# aaa new-model
Router(config)# aaa authentication login {default | list_name} method1 [method2...]
Router(config)# aaa authentication enable default method1 [method2...]
Router(config)# line [aux | console | tty | vty] start_line_# [end_line_#]
Router(config-line)# login authentication {default | list_name}
Router(config-line)# timeout login response {seconds}
Method Keyword
|
Description
|
enable
|
The password in the
enable secret or
enable password commands is used to perform the authentication.
|
line
|
The line
password command, on the line that the user is trying to access, is used to perform authentication.
|
local
|
The
username commands are used to perform authentication.
|
local-case
|
The
username commands are used to perform authentication. However, the username that the user enters is treated as case sensitive.
|
none
|
No authentication is performed.
|
group radius
|
All configured RADIUS servers can be used to perform authentication.
|
group tacacs+
|
All configured TACACS+ servers can be used to perform authentication.
|
group
group_name
|
Only servers in the specified
aaa group server command are used to perform authentication.
|
注:
1>aaa authentication login:User EXEC Authentication
2>aaa authentication enable:Privileged EXEC Authentication
3>timeout值爲cisco router等待多長時間將此認證method認爲是error。默認timeout爲30s,取值範圍1~300s。
4>上圖列出的methods,aaa authentication enable不支持local和local-case。
Username and Password Prompts:
默認用戶登陸時,cisco會給出這樣的提示符:
Username:
Password:
可使用如下命令修改這些默認的提示:
Router(config)# aaa authentication username-prompt {prompt_string} Router(config)# aaa authentication password-prompt {prompt_string}
注:
TACACS+/RADIUS Server也支持修改默認的提示符,若是同時配置aaa authentication username-prompt/password-prompt命令和TACACS+/RADIUS Server配置,則cisco優先使用TACACS+/RADIUS Server配置的prompt。
Login Banners:
可使用aaa來代替默認用banner命令配置的登陸提示消息:
Router(config)# aaa authentication banner {stop_character message stop_character} 注:最多支持2996個字符。
也能夠修改用戶在輸入無效的用戶名/密碼時的提示:
Router(config)# aaa authentication fail-message {stop_character message stop_character}
注:最多支持2996個字符。
Login Attempts:
默認cisco router容許用戶嘗試3次登陸,最後disconnect用戶的連接。可使用如下命令修改容許嘗試的次數:
Router(config)# aaa authentication attempts login {#_of_attempts} 注:
1>可配置的次數爲1~25。
2>推薦將網絡外接設備的login attempts次數修改成1,這樣能夠減小對密碼暴力破解的機會。
Authentication Troubleshooting:
Router# debug aaa authentication
Part IV. Authorization
Authorization Command Syntax:
aaa authorization {受權類型} {受權列表名稱} {受權方法}
{受權類型}
auth-proxy:當用戶成功經過authentication後,此method容許用戶經過router/firewall創建到連接的其它網絡的多個連接,具體的的連接數在AAA Server端配置實現。
commands:限制用戶能夠在router上執行的命令。
config-commands:限制用戶能夠在router上執行的配置命令。
exec:限制用戶到router的EXEC訪問。其主要用於dialup環境,用戶使用PPP的PAP/CHAP認證方式,在經過認證後經過router訪問網絡,此處能夠限制其在經過認證後,只能實現網絡訪問,而不能EXEC到router。
network:當用戶經過authentication並得到一個EXEC,其就能夠在一個dailup接口上創建一個PPP/SLIP鏈接。此method用於限制此種行爲。
reverse-access:在經過authentication後,此method能夠限制用戶使用router的虛擬終端反向telnet到其它設備上。
ipmobile:配置對mobile連接的受權。
configuration:限制對AAA服務的配置。
{受權列表名稱}
default:默認的authentication認證方式。
name:指定特定的認證方式列表,實現更具體的認證。
{受權方法}
group
if-authtication:若是用戶經過了authentication,則容許它執行相應的操做。
local
none
Authorization Configuration:
Router(config)# aaa authorization commands {level_#} {default | list_name} [method1 [method2...]]
Router(config)# line [aux | console | tty | vty] start_line_# [end_line_#]
Router(config-line)# authorization commands {level_#} {default | list_name}
Method Keyword
|
Description
|
local
|
The
username commands are used to perform authorization.
|
none
|
No authorization is performed. This parameter is typically not used.
|
group radius
|
All configured RADIUS servers can be used to perform authorization.
|
group tacacs+
|
All configured TACACS+ servers can be used to perform authorization.
|
group
group_name
|
Only servers in the specified
aaa group server command are used to perform authorization.
|
Configuration Mode Command Authorization:
通常狀況使用aaa authorization後,用戶執行的每一個命令都被aaa限制執行,這可能對configure termianl模式的命令有一些影響,可使用下面命令使aaa authorization忽略對configure termianl模式的命令的限制:
Router(config)# no aaa authorization config-commands
Authorization Troubleshooting:
Router# debug aaa authorization
Part V. Accounting
配置accouting主要有兩部分:
1>type of accouting:記錄哪些信息。
2>method:將記錄的信息發送到哪。
Accouting Command Syntax:
aaa accouting
{統計類型} {統計列表名稱} {統計記錄方式} {統計方法}
{統計類型}
commands {level}:記錄用戶執行的全部的命令,包括privilege/configuration mode命令。
connection:記錄router經過Telnet, LAT, TN32760, PAD, and rlogin等方式創建的到其它設備的連接信息。信息包括創建連接的用戶名,日期/時間及在創建的連接上執行的命令。
exec:記錄router的EXEC會話信息。信息包括用戶名,會話起始日期和時間,用戶設備的IP。
network:記錄dialup連接的信息,如PPP/SLIP。信息包括相應連接的packets數目及bytes數目。
resource:記錄dialup連接信息及phone call的資源信息。
system:記錄system-level事件。如接口up/down,router reload,accouting被啓用/禁止。
{統計列表名稱}
default:默認的authentication認證方式。
name:指定特定的認證方式列表,實現更具體的認證。
{統計記錄方式}
start-stop:在事件開始和結束時都創建相應的記錄。先執行後記錄。
stop-only:只在事件結束時創建相應的記錄。
none:禁用對特定服務的記錄。
wait-start:相似於start-stop,在事件開始和結束時都創建相應的記錄。不一樣的是此模式只在成功連接到AAA Server並能實現記錄時才容許用戶執行相應的事件,不然等待。即:先記錄後執行。(此模式在Cisco IOS 12.1及之後的版本中被移除,並再也不支持)
{統計方法}
group
Methods of Accounting:
RADIUS
TACACS+
注:
1>只能使用以上兩種method在aaa accouting中。
2>Cisco的RADIUS實現不能實現aaa accouting,只能使用TACACS+。
Accouting Configuration:
Router(config)# aaa accounting {system | network | exec | connection | commands level_#} {default | list_name} {start-stop | stop-only | none} [method1 [method2...]]
Router(config)# line [aux | console | tty | vty] line_# [ending_line_#]
Router(config-line)# accounting {arap | commands level_# | connection | exec} {default | list_name}
Router(config)# interface type [slot_#/]port_#
Router(config-if)# ppp accounting {default | list_name}
Service Keyword
|
Description
|
system
|
Enables accounting to capture system-level events, such as an interface status changing or the router reloading (only the
default method list is supported for this service)
|
network
|
Enables accounting for all network services, such as SLIP, PPP, NCP, and ARAP
|
exec
|
Enables accounting for EXEC sessions, listing what users logged in and when they logged into and out of the router
|
connection
|
Enables accounting for outbound connections from the router, such as Telnet and TN3270
|
commands
level_#
|
Enables accounting for commands, listing the commands (and their privilege levels) that were executed by a user
|
resource
|
Enables accounting for dialup connections, listing resource information for them
|
Suppressing Null Username Records:
當指定多種authentication mothods,並在最後使用none,且其它mothods都不可達,用戶經過none成功登陸router時,accouting仍然會產生一個相應的登陸記錄,不過沒有相應的登陸用戶名信息,由於none method不須要提供任何登陸信息。這樣的記錄沒有太大意義,可使用如下命令來使aaa accouting不記錄這樣的事件:
Router(config)# aaa accounting suppress null-username
Enabling Broadcast Accounting:
aaa accouting初始的限制就是在使用多個AAA Accouting Server實現日誌記錄時,記錄信息只會發給Primary AAA Accouting Server,並於Primary Accouting Server發送給其它Servers。
可使用如下命令,在aaa accouting命令中加入broadcast參數,將日誌信息一次性的廣播到全部的AAA Accouting Servers:
Router(config)# aaa accounting {system | network | exec | connection | commands level_#} {default | list_name} {start-stop | stop-only | (none} <broadcast> [method1 [method2...]]
Accounting Troubleshooting:
Router# debug aaa accounting
Router# show accounting
Router# show aaa user all
Part VI. IOS命令權限
全部有IOS命令都被分爲0~15的權限級別。
默認Cisco Router只使用3個級別:
0級:包括5個命令(disable,enable,exit,help,logou),如今未用於任何線路。
1級:用戶EXEC模式,全部用戶登陸後的默認級別。
15級:特權EXEC模式。
1>全部用戶只能夠執行其權限級別如下的命令。
2>指定用戶權限級別。
username {name} privilege {level} password {password}
3>查看用戶權限級別。
show privilege
4>查看用戶當前權限級別能夠執行的命令。
?
5>修改特定命令的權限級別。 privilege {configure|exec} level {level} {command} 例: username sense privilege 7 password test privilege configure level 7 snap-server host privilege configure level 7 snap-enable traps privilege exec level 7 ping privilege exec level 7 configure terminal