Authentication is the action of determining who a user (or entity) is. Authentication can take many forms. Traditional authentication employs a name and a fixed password. However, fixed passwords are vulnerable security, so many modern authentication mechanisms utilize "one-time" passwords or a challenge-response query. TACACS+ is designed to support all of these and be flexible enough to handle any future mechanisms. Authentication generally takes place when the user first logs in to a machine or requests a service of it.
Authentication is not mandatory; it is a site-configured option. Some sites do not require it. Others require it only for certain services (see "Authorization" (
Section 6)). Authentication may also take place when a user attempts to gain extra privileges and must identify himself or herself as someone who possesses the required information (passwords, etc.) for those privileges.
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
+----------------+----------------+----------------+----------------+
| action | priv_lvl | authen_type | authen_service |
+----------------+----------------+----------------+----------------+
| user_len | port_len | rem_addr_len | data_len |
+----------------+----------------+----------------+----------------+
| user ...
+----------------+----------------+----------------+----------------+
| port ...
+----------------+----------------+----------------+----------------+
| rem_addr ...
+----------------+----------------+----------------+----------------+
| data...
+----------------+----------------+----------------+----------------+
Packet fields are as follows:
action
-
This indicates the authentication action.
Valid values are:
-
TAC_PLUS_AUTHEN_LOGIN := 0x01
-
TAC_PLUS_AUTHEN_CHPASS := 0x02
-
TAC_PLUS_AUTHEN_SENDAUTH := 0x04
priv_lvl
-
This indicates the privilege level that the user is authenticating as. Please refer to "Privilege Levels" (Section 9).
authen_type
-
The type of authentication. Please see "Common Authentication Flows" (Section 5.4.2).
-
Valid values are:
-
TAC_PLUS_AUTHEN_TYPE_ASCII := 0x01
-
TAC_PLUS_AUTHEN_TYPE_PAP := 0x02
-
TAC_PLUS_AUTHEN_TYPE_CHAP := 0x03
-
TAC_PLUS_AUTHEN_TYPE_MSCHAP := 0x05
-
TAC_PLUS_AUTHEN_TYPE_MSCHAPV2 := 0x06
authen_service
-
This is the service that is requesting the authentication.
-
Valid values are:
-
TAC_PLUS_AUTHEN_SVC_NONE := 0x00
-
TAC_PLUS_AUTHEN_SVC_LOGIN := 0x01
-
TAC_PLUS_AUTHEN_SVC_ENABLE := 0x02
-
TAC_PLUS_AUTHEN_SVC_PPP := 0x03
-
TAC_PLUS_AUTHEN_SVC_PT := 0x05
-
TAC_PLUS_AUTHEN_SVC_RCMD := 0x06
-
TAC_PLUS_AUTHEN_SVC_X25 := 0x07
-
TAC_PLUS_AUTHEN_SVC_NASI := 0x08
-
TAC_PLUS_AUTHEN_SVC_FWPROXY := 0x09
-
The TAC_PLUS_AUTHEN_SVC_NONE option is intended for the authorization application of this field that indicates that no authentication was performed by the device.
The TAC_PLUS_AUTHEN_SVC_LOGIN option indicates regular login (as opposed to ENABLE) to a client device.
-
The TAC_PLUS_AUTHEN_SVC_ENABLE option identifies the ENABLE authen_service, which refers to a service requesting authentication in order to grant the user different privileges. This is comparable to the Unix "su(1)" command, which substitutes the current user's identity with another. An authen_service value of NONE is only to be used when none of the other authen_service values are appropriate. ENABLE may be requested independently; no requirements for previous authentications or authorizations are imposed by the protocol.
-
Other options are included for legacy/backwards compatibility.
user, user_len
-
The username is optional in this packet, depending upon the class of authentication. If it is absent, the client MUST set user_len to 0. If included, the user_len indicates the length of the user field, in bytes.
port, port_len
-
The name of the client port on which the authentication is taking place. The value of this field is free-format text and is client specific. Examples of this argument include "tty10" to denote the tenth tty line, and "async10" to denote the tenth async interface. The client documentation SHOULD define the values and their meanings for this field. For details of text encoding, see "Treatment of Text Strings" (Section 3.7). The port_len indicates the length of the port field, in bytes.
rem_addr, rem_addr_len
-
A string indicating the remote location from which the user has connected to the client. For details of text encoding, see "Treatment of Text Strings" (Section 3.7).
-
When TACACS+ was used for dial-up services, this value contained the caller ID.
-
When TACACS+ is used for Device Administration, the user is normally connected via a network, and in this case, the value is intended to hold a network address, IPv4 or IPv6. For IPv6 address text representation defined, please see [RFC 5952].
-
This field is optional (since the information may not be available). The rem_addr_len indicates the length of the user field, in bytes.
data, data_len
-
The data field is used to send data appropriate for the action and authen_type. It is described in more detail in "Common Authentication Flows" (Section 5.4.2). The data_len field indicates the length of the data field, in bytes.
The TACACS+ server sends only one type of authentication packet (a REPLY packet) to the client.
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
+----------------+----------------+----------------+----------------+
| status | flags | server_msg_len |
+----------------+----------------+----------------+----------------+
| data_len | server_msg ...
+----------------+----------------+----------------+----------------+
| data ...
+----------------+----------------+
status
-
The current status of the authentication.
-
Valid values are:
-
TAC_PLUS_AUTHEN_STATUS_PASS := 0x01
-
TAC_PLUS_AUTHEN_STATUS_FAIL := 0x02
-
TAC_PLUS_AUTHEN_STATUS_GETDATA := 0x03
-
TAC_PLUS_AUTHEN_STATUS_GETUSER := 0x04
-
TAC_PLUS_AUTHEN_STATUS_GETPASS := 0x05
-
TAC_PLUS_AUTHEN_STATUS_RESTART := 0x06
-
TAC_PLUS_AUTHEN_STATUS_ERROR := 0x07
-
TAC_PLUS_AUTHEN_STATUS_FOLLOW := 0x21
flags
-
Bitmapped flags that modify the action to be taken.
-
The following values are defined:
-
TAC_PLUS_REPLY_FLAG_NOECHO := 0x01
server_msg, server_msg_len
-
A message to be displayed to the user. This field is optional. The server_msg_len indicates the length of the server_msg field, in bytes. For details of text encoding, see "Treatment of Text Strings" (Section 3.7).
data, data_len
-
A field that holds data that is a part of the authentication exchange and is intended for client processing, not the user. It is not a printable text encoding. Examples of its use are shown in "Common Authentication Flows" (Section 5.4.2). The data_len indicates the length of the data field, in bytes.
This packet is sent from the client to the server following the receipt of a REPLY packet.
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
+----------------+----------------+----------------+----------------+
| user_msg len | data_len |
+----------------+----------------+----------------+----------------+
| flags | user_msg ...
+----------------+----------------+----------------+----------------+
| data ...
+----------------+
user_msg, user_msg_len
-
A field that is the string that the user entered, or the client provided on behalf of the user, in response to the server_msg from a REPLY packet. The user_len indicates the length of the user field, in bytes.
data, data_len
-
This field carries information that is specific to the action and the authen_type for this session. Valid uses of this field are described below. It is not a printable text encoding. The data_len indicates the length of the data field, in bytes.
flags
-
This holds the bitmapped flags that modify the action to be taken.
-
The following values are defined:
-
TAC_PLUS_CONTINUE_FLAG_ABORT := 0x01
The action, authen_type, and authen_service fields (described above) combine to indicate what kind of authentication is to be performed. Every authentication START, REPLY, and CONTINUE packet includes a data field. The use of this field is dependent upon the kind of authentication.
This document defines a core set of authentication flows to be supported by TACACS+. Each authentication flow consists of a START packet. The server responds either with a request for more information (GETDATA, GETUSER, or GETPASS) or a termination PASS, FAIL, ERROR, or RESTART. The actions and meanings when the server sends a RESTART or ERROR are common and are described further below.
When the REPLY status equals TAC_PLUS_AUTHEN_STATUS_GETDATA, TAC_PLUS_AUTHEN_STATUS_GETUSER, or TAC_PLUS_AUTHEN_STATUS_GETPASS, authentication continues and the server
SHOULD provide server_msg content for the client to prompt the user for more information. The client
MUST then return a CONTINUE packet containing the requested information in the user_msg field.
The client should interpret TAC_PLUS_AUTHEN_STATUS_GETUSER as a request for a username and TAC_PLUS_AUTHEN_STATUS_GETPASS as a request for a password. The TAC_PLUS_AUTHEN_STATUS_GETDATA is the generic request for more information to flexibly support future requirements.
If the information being requested by the server from the client is sensitive, then the server should set the TAC_PLUS_REPLY_FLAG_NOECHO flag. When the client queries the user for the information, the response
MUST NOT be reflected in the user interface as it is entered.
The data field is only used in the REPLY where explicitly defined below.
The TACACS+ protocol is versioned to allow revisions while maintaining backwards compatibility. The version number is in every packet header. The changes between minor_version 0 and 1 apply only to the authentication process, and all deal with the way that Challenge Handshake Authentication Protocol (CHAP) and Password Authentication Protocol (PAP) authentications are handled. minor_version 1 may only be used for authentication kinds that explicitly call for it in the table below:
|
LOGIN |
CHPASS |
SENDAUTH |
ASCII |
v0 |
v0 |
- |
PAP |
v1 |
- |
v1 |
CHAP |
v1 |
- |
v1 |
MS-CHAPv1/2 |
v1 |
- |
v1 |
Table 1: TACACS+ Protocol Versioning
The '-' symbol represents that the option is not valid.
All authorization and accounting and ASCII authentication use minor_version 0.
PAP, CHAP, and MS-CHAP login use minor_version 1. The normal exchange is a single START packet from the client and a single REPLY from the server.
The removal of SENDPASS was prompted by security concerns and is no longer considered part of the TACACS+ protocol.
This section describes common authentication flows. If the server does not implement an option, it
MUST respond with TAC_PLUS_AUTHEN_STATUS_FAIL.
action = TAC_PLUS_AUTHEN_LOGIN
authen_type = TAC_PLUS_AUTHEN_TYPE_ASCII
minor_version = 0x0
This is a standard ASCII authentication. The START packet
MAY contain the username. If the user does not include the username, then the server
MUST obtain it from the client with a CONTINUE TAC_PLUS_AUTHEN_STATUS_GETUSER. If the user does not provide a username, then the server can send another TAC_PLUS_AUTHEN_STATUS_GETUSER request, but the server
MUST limit the number of retries that are permitted; the recommended limit is three attempts. When the server has the username, it will obtain the password using a continue with TAC_PLUS_AUTHEN_STATUS_GETPASS. ASCII login uses the user_msg field for both the username and password. The data fields in both the START and CONTINUE packets are not used for ASCII logins; any content
MUST be ignored. The session is composed of a single START followed by zero or more pairs of REPLYs and CONTINUEs, followed by a final REPLY indicating PASS, FAIL, or ERROR.
action = TAC_PLUS_AUTHEN_LOGIN
authen_type = TAC_PLUS_AUTHEN_TYPE_PAP
minor_version = 0x1
The entire exchange
MUST consist of a single START packet and a single REPLY. The START packet
MUST contain a username and the data field
MUST contain the PAP ASCII password. A PAP authentication only consists of a username and password [
RFC 1334] (Obsolete). The REPLY from the server
MUST be either a PASS, FAIL, or ERROR.
action = TAC_PLUS_AUTHEN_LOGIN
authen_type = TAC_PLUS_AUTHEN_TYPE_CHAP
minor_version = 0x1
The entire exchange
MUST consist of a single START packet and a single REPLY. The START packet
MUST contain the username in the user field, and the data field is a concatenation of the PPP id, the challenge, and the response.
The length of the challenge value can be determined from the length of the data field minus the length of the id (always 1 octet) and the length of the response field (always 16 octets).
To perform the authentication, the server calculates the PPP hash as defined in PPP Authentication [
RFC 1334] and then compares that value with the response. The MD5 algorithm option is always used. The REPLY from the server
MUST be a PASS, FAIL, or ERROR.
The selection of the challenge and its length are not an aspect of the TACACS+ protocol. However, it is strongly recommended that the client/endstation interaction be configured with a secure challenge. The TACACS+ server can help by rejecting authentications where the challenge is below a minimum length (minimum recommended is 8 bytes).
action = TAC_PLUS_AUTHEN_LOGIN
authen_type = TAC_PLUS_AUTHEN_TYPE_MSCHAP
minor_version = 0x1
The entire exchange
MUST consist of a single START packet and a single REPLY. The START packet
MUST contain the username in the user field, and the data field will be a concatenation of the PPP id, the MS-CHAP challenge, and the MS-CHAP response.
The length of the challenge value can be determined from the length of the data field minus the length of the id (always 1 octet) and the length of the response field (always 49 octets).
To perform the authentication, the server will use a combination of MD4 and DES on the user's secret and the challenge, as defined in [
RFC 2433], and then compare the resulting value with the response. The REPLY from the server
MUST be a PASS or FAIL.
For best practices, please refer to [
RFC 2433]. The TACACS+ server
MUST reject authentications where the challenge deviates from 8 bytes as defined in the RFC.
action = TAC_PLUS_AUTHEN_LOGIN
authen_type = TAC_PLUS_AUTHEN_TYPE_MSCHAPV2
minor_version = 0x1
The entire exchange
MUST consist of a single START packet and a single REPLY. The START packet
MUST contain the username in the user field, and the data field will be a concatenation of the PPP id, the MS-CHAP challenge, and the MS-CHAP response.
The length of the challenge value can be determined from the length of the data field minus the length of the id (always 1 octet) and the length of the response field (always 49 octets).
To perform the authentication, the server will use the algorithm specified [
RFC 2759] on the user's secret and challenge, and then compare the resulting value with the response. The REPLY from the server
MUST be a PASS or FAIL.
For best practices for MS-CHAP v2, please refer to [
RFC 2759]. The TACACS+ server
MUST reject authentications where the challenge deviates from 16 bytes as defined in the RFC.
action = TAC_PLUS_AUTHEN_LOGIN
priv_lvl = implementation dependent
authen_type = not used
service = TAC_PLUS_AUTHEN_SVC_ENABLE
This is an "ENABLE" request, used to change the current running privilege level of a user. The exchange
MAY consist of multiple messages while the server collects the information it requires in order to allow changing the principal's privilege level. This exchange is very similar to an ASCII login (
Section 5.4.2.1).
In order to readily distinguish "ENABLE" requests from other types of request, the value of the authen_service field
MUST be set to TAC_PLUS_AUTHEN_SVC_ENABLE when requesting an ENABLE. It
MUST NOT be set to this value when requesting any other operation.
action = TAC_PLUS_AUTHEN_CHPASS
authen_type = TAC_PLUS_AUTHEN_TYPE_ASCII
This exchange consists of multiple messages while the server collects the information it requires in order to change the user's password. It is very similar to an ASCII login. The status value TAC_PLUS_AUTHEN_STATUS_GETPASS
MUST only be used when requesting the "new" password. It
MAY be sent multiple times. When requesting the "old" password, the status value
MUST be set to TAC_PLUS_AUTHEN_STATUS_GETDATA.
The client may prematurely terminate a session by setting the TAC_PLUS_CONTINUE_FLAG_ABORT flag in the CONTINUE message. If this flag is set, the data portion of the message may contain a text explaining the reason for the abort. This text will be handled by the server according to the requirements of the deployment. For details of text encoding, see "Treatment of Text Strings" (
Section 3.7). For more details about session termination, refer to "Session Completion" (
Section 4.4).
In cases of PASS, FAIL, or ERROR, the server can insert a message into server_msg to be displayed to the user.
"The Draft" [
THE-DRAFT] defined a mechanism to direct authentication requests to an alternative server. This mechanism is regarded as insecure, is deprecated, and is not covered here. The client should treat TAC_PLUS_AUTHEN_STATUS_FOLLOW as TAC_PLUS_AUTHEN_STATUS_FAIL.
If the status equals TAC_PLUS_AUTHEN_STATUS_ERROR, then the host is indicating that it is experiencing an unrecoverable error and the authentication will proceed as if that host could not be contacted. The data field may contain a message to be printed on an administrative console or log.
If the status equals TAC_PLUS_AUTHEN_STATUS_RESTART, then the authentication sequence is restarted with a new START packet from the client, with a new session Id and seq_no set to 1. This REPLY packet indicates that the current authen_type value (as specified in the START packet) is not acceptable for this session. The client may try an alternative authen_type.
If a client does not implement the TAC_PLUS_AUTHEN_STATUS_RESTART option, then it
MUST process the response as if the status was TAC_PLUS_AUTHEN_STATUS_FAIL.