LDAP over TLS Authentication
The Junos OS supports LDAP over TLS (LDAPS) authentication and authorization for Junos OS user login with TLS security between the device running Junos OS (which is the LDAPS client) and the LDAPS server. For more information, read this topic.
LDAP Authentication over TLS
- Junos OS User Authentication Overview
- Benefits of LDAP Authentication over TLS
- Supported and Unsupported Features
- LDAP Overview
- Transport Layer Security (TLS) Overview
- How LDAPS Authentication Works
Junos OS User Authentication Overview
Junos OS authenticates users trying to log in either locally or by using a centralized database. Local authentication or authorization is possible for users whose username and password are configured using the Junos OS CLI or RPCs. In Junos OS Release 20.2R1, Junos OS supports LDAP with TLS security (LDAPS) support for user login and ensures secure transmission of data between the LDAPS client and the LDAPS server.
In releases before Junos OS Release 20.2R1, Junos OS supports centralized user authentication and authorization through standard RADIUS and TACACS protocols.

Junos OS supports these methods of user authentication:
Local password authentication
LDAP over TLS (LDAPS)
RADIUS
TACACS+
Benefits of LDAP Authentication over TLS
Encryption and data integrity—LDAPS ensures that user credentials are encrypted, thereby maintaining privacy of communications. The user encrypts the data using the private key and only the intended recipient that possesses the private key can decrypt the signed data using the signer's public key. This ensures data integrity.
Enhanced security—The TLS protocol ensures the data is securely sent and received over the network. TLS uses certificates to authenticate and encrypt the communication that provides advanced security.
Scalability—LDAPS provides greater performance and scalability without loss of reliability. There is no limit to the number of users who can be supported using this feature as users maintain their own certificates, and certificate authentication involves exchange of data between client and server only.
Supported and Unsupported Features
Junos OS supports LDAPS for user authentication and authorization only. Junos OS does not support accounting. over LDAPS.
The LDAPS client is implemented and integrated as part of Junos OS. However, implementation of the LDAPS server on Junos OS is not supported. Instead, this feature is implemented using the OpenLdap 2.4.46 server.
LDAP Overview
Lightweight Directory Access Protocol (LDAP) is a standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. You can accomplish authentication and authorization using the following rich set of LDAP security functions such as:
Search
Retrieve
Directory content manipulation
Transport Layer Security (TLS) Overview
TLS is an application-level protocol that provides encryption technology for the Internet. It is the most widely used security protocol for applications that require data to be securely exchanged over a network, such as file transfers, VPN connections, instant messaging, and voice over IP (VoIP). TLS relies on certificates and private-public key exchange pairs to secure the transmission of data between the LDAPS client and the LDAPS server. LDAPS uses local certificates that are dynamically acquired from the Junos public key infrastructure (PKI) .
TLS ensures secure transmission of data between a client and a server effectively and ensures privacy of communications, authentication, confidentiality, and data integrity. You can use the TLS protocol for certificate exchange, mutual authentication, and cipher negotiation to secure the stream from potential tampering and ethical hacking.
How LDAPS Authentication Works
To provide secure LDAPS support for Junos OS operator login, user credentials and configurations are stored in either the LDAPS server or the LDAP-supported databases. An LDAPS client on the device running Junos OS communicates with a configured LDAPS server. To achieve this, the LDAPS client is implemented and integrated as part of the device running Junos OS.
Figure 2 shows the LDAPS authentication process.

A remote user logs in to a device running Junos OS through SSH, TELNET or any other login utility.
The LDAPS client (which is the device running Junos OS) establishes a TCP connection with the LDAPS authorization server using a TLS protocol request.
After the client receives the TLS response, the client and server authenticate their identities.
The LDAPS client authenticates itself using the proxy account that is preconfigured on the LDAPS server using the bind request (
binddn
andbindpw
).If the bind operation is successful, the LDAPS server sends an acknowledgment to the LDAPS client.
The LDAPS client then sends an authentication request to the LDAPS server with the login credentials of the user trying to log in.
After successful authorization, the LDAPS client notifies the user of the successful login. The authorization data of the user is saved into a file that is used later to enforce authorization.
The client closes the connection with the LDAPS server.
Configure LDAP Authentication over TLS
LDAP over TLS (LDAPS) is a method of authenticating users who attempt to access the device running Junos OS with TLS security between the LDAPS client and the LDAPS server. This topic includes the following tasks:
- Configure the Order of Authentication
- Configure LDAPS Client
- Configure LDAPS Server
- Configure TLS Parameters
- Configure System Administrative Parameters for LDAPS Authentication
Configure the Order of Authentication
Junos OS supports the following methods of user authentication: local password authentication, LDAP over TLS (LDAPS), RADIUS, TACACS+.
You can use the authentication-order
statement to
prioritize the order in which Junos OS uses the different authentication
methods when verifying user access to a device running Junos OS. If
you do not set an authentication order, by default Junos OS verifies
users based on their configured passwords.
If a user tries to log in and if authentication-order
has the ldaps
option configured, the user’s credentials
are passed to the external LDAP server for user validation.
To configure the authentication order, include the authentication-order
statement at the [edit system]
hierarchy level:
[edit system] authentication-order [ method1 method2...];
For example:
[edit system] user@host# set authentication-order [ldaps radius password];
The following are the possible authentication order entry options:
ldaps
—Verify the user using secure LDAP authentication servers.password
—Verify the user using the username and password configured locally by including theauthentication-order
statement at the[edit system login user]
hierarchy level.radius
—Verify the user using RADIUS authentication servers.tacplus
—Verify the user using TACACS+ authentication servers.
Configure LDAPS Client
To configure LDAP authentication on the client:
Configure LDAPS Server
OpenLDAP server is one of the open-source implementations of LDAP and LDAPS. We’ve implemented the LDAP over TLS authentication and authorization feature using the OpenLDAP 2.4.46 server.
You can configure a maximum of two LDAPS servers.
To configure a typical OpenLDAP server:
After you complete the preceding steps, any client can log in with the username and password mentioned in the LDIF file.
Configure TLS Parameters
The TLS protocol ensures that data is securely sent and received over the network. TLS uses certificates to authenticate and encrypt the communication. The client authenticates the server by requesting its certificate and public key. Optionally, the server can also request a certificate from the client, thus ensuring mutual authentication.
For TLS handshake to be successful, the client must have the server certificate authority (CA) profile to validate the server certificate. The server may or may not have the client CA based on the settings. However, if the server mandates client certificate, the server must have the client CA to validate the certificate. Later, the public key is used to encrypt and private key to decrypt the data respectively.
The CA profile defines every parameter associated with a specific certificate to establish secure connection between two endpoints. For more information about configuring CA profiles, see Certificate Authority.
To configure TLS parameters, you need to perform the following tasks:
Configure security public key infrastructure (PKI) traceoptions.
Create a CA profile.
Create a revocation check to specify a method for checking certificate revocation.
Configure System Administrative Parameters for LDAPS Authentication
As part of this configuration, you’re creating administrative parameters for LDAP-authenticated users.
You can assign different user templates and login classes to
LDAPS-authenticated users. This allows LDAPS-authenticated users to
be granted different administrative permissions on the device running
Junos OS. By default, LDAPS-authenticated users use the remote
user template, if it is configured, and the LDAPS-authenticated
users are assigned to the associated class that is specified in the remote
user template.
The username remote
is a special case in Junos OS.
It acts as a template for users that are authenticated by a remote
server, but do not have a locally configured user account on the device.
In this method, Junos OS applies the permissions of the remote template
to those authenticated users without a locally defined account. All
users mapped to the remote template are of the same login class.
In the Junos OS configuration, a user template is configured in the same way as a regular local user account, except that no local authentication password is configured because the authentication is remotely performed on the LDAPS server.
To assign login classes, permissions, and encrypted password for LDAPS-authenticated users, perform the following steps:
Juniper Networks Vendor-Specific RADIUS and LDAP Attributes
Junos OS supports configuring Juniper Networks RADIUS and LDAP vendor-specific attributes (VSAs) on the authentication server. These VSAs are encapsulated in a RADIUS or LDAP vendor-specific attribute with the vendor ID set to the Juniper Networks ID number, 2636.
Table 1 lists the Juniper Networks VSAs that you can configure.
Some of the attributes accept extended regular expressions, as defined in POSIX 1003.2. If the regular expression contains any spaces, operators, or wildcard characters, enclose it in quotation marks. For more information, see:
Name |
Description |
Type |
Length |
String |
---|---|---|---|---|
Juniper-Local-User-Name |
Indicates the name of the user template assigned to this user when the user logs in to a device. This attribute is used only in Access-Accept packets. |
1 |
≥3 |
One or more octets containing printable ASCII characters. |
Juniper-Allow-Commands |
Contains an extended regular expression that enables the user to run commands in addition to those commands authorized by the user’s login class permission bits. This attribute is used only in Access-Accept packets. |
2 |
≥3 |
One or more octets containing printable ASCII characters, in the form of an extended regular expression. |
Juniper-Deny-Commands |
Contains an extended regular expression that denies the user permission to run commands authorized by the user’s login class permission bits. This attribute is used only in Access-Accept packets. |
3 |
≥3 |
One or more octets containing printable ASCII characters, in the form of an extended regular expression. |
Juniper-Allow-Configuration |
Contains an extended regular expression that enables the user to view and modify configuration statements in addition to those statements authorized by the user’s login class permission bits. This attribute is used only in Access-Accept packets. |
4 |
≥3 |
One or more octets containing printable ASCII characters, in the form of an extended regular expression. |
Juniper-Deny-Configuration |
Contains an extended regular expression that denies the user permission to view or modify configuration statements authorized by the user’s login class permission bits. This attribute is used only in Access-Accept packets. |
5 |
≥3 |
One or more octets containing printable ASCII characters, in the form of an extended regular expression. |
Juniper-Interactive-Command |
Indicates the interactive command entered by the user. This attribute is used only in Accounting-Request packets. |
8 |
≥3 |
One or more octets containing printable ASCII characters. |
Juniper-Configuration-Change |
Indicates the interactive command that results in a configuration (database) change. This attribute is used only in Accounting-Request packets. |
9 |
≥3 |
One or more octets containing printable ASCII characters. |
Juniper-User-Permissions |
Contains information the server uses to specify user permissions. This attribute is used only in Access-Accept packets. Note:
When the RADIUS or LDAP server defines the
|
10 |
≥3 |
One or more octets containing printable ASCII characters. The string is a list of permission flags separated by a space. The exact name of each flag must be specified in its entirety. |
Juniper-Authentication-Type |
Indicates the authentication method (local database, LDAP or RADIUS server) used to authenticate a user. If the user is authenticated using a local database, the attribute value shows 'local'. If the user is authenticated using a RADIUS or LDAP server, the attribute value shows 'remote'. |
11 |
≥5 |
One or more octets containing printable ASCII characters. |
Juniper-Session-Port |
Indicates the source port number of the established session. |
12 |
size of integer |
Integer |
Juniper-Allow-Configuration-Regexps |
Contains an extended regular expression that enables the user to view and modify configuration statements in addition to those statements authorized by the user’s login class permission bits. This attribute is used only in Access-Accept packets. |
13 |
≥3 |
One or more octets containing printable ASCII characters, in the form of an extended regular expression. |
Juniper-Deny-Configuration-Regexps |
Contains an extended regular expression that denies the user permission to view or modify configuration statements authorized by the user’s login class permission bits. This attribute is used only in Access-Accept packets. |
14 |
≥3 |
One or more octets containing printable ASCII characters, in the form of an extended regular expression. |
For more information about the VSAs, see RFC 2138, Remote Authentication Dial In User Service (RADIUS).