Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Network Management and Monitoring Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Configure Syslog over TLS

date_range 22-Nov-24

Learn how to configure your device to transport system log messages (also known as syslog messages) securely over the Transport Layer Security (TLS) protocol.

Control Plane Logs

Control plane logs, also called system logs, include events that occur on the routing platform. The system sends control plane events to the eventd process on the Routing Engine, which then handles the events by using Junos OS policies, by generating system log messages, or by doing both. You can choose to send control plane logs to a file, user terminal, routing platform console, or remote machine. To generate control plane logs, use the syslog statement at the [system] hierarchy level.

Example: Configure Syslog over TLS

This example shows how to configure a Juniper Networks device to transport syslog messages (control plane logs) securely over TLS.

Requirements

This example uses the following hardware and software components:

  • Junos OS Release 21.2R1 or later

  • Junos OS Evolved Release 23.4R1 or later

  • Device running Junos OS or Junos OS Evolved (syslog client)

  • Syslog server

Overview

You use the TLS protocol to enable secure transportation of system log messages (control plane logs) from the syslog client to the syslog server. TLS uses certificates to authenticate and encrypt the communication.

  • Server authentication (or one-way TLS)—Client verifies the identify of the server and trusts the server.
  • Mutual authentication—Both the server and client trust each other.

You can choose either server authentication or mutual authentication depending on your network. To quickly access the information you need, click the links in Table 1.

Table 1: TLS Authentication Modes

Authentication Mode

Procedure

Section Where the Information Is Located

Server authentication

Configure PKI

Configure the device

Server Authentication

Configuration

In the following example, we use the TLS protocol to securely transport syslog messages (control plane logs) from the Juniper device to the remote syslog server. Figure 1 shows the basic topology used in this example.

Figure 1: Syslog over TLSSyslog over TLS
Public Key Infrastructure (PKI) Configuration Overview

To configure PKI on the device:

  1. Create a certification authority (CA) profile, and associate a CA identifier with the CA profile. See Example: Configuring a CA Profile.
  2. (Optional) Create a revocation check to specify a method for validating the certificate. You can use either certificate revocation lists (CRLs) or the Online Certificate Status Protocol (OCSP). See Certificate Revocation.
  3. (Optional) Create a trusted CA group, and add the CA profile to the trusted group. See Configuring a Trusted CA Group.
  4. Load the CA certificate on the device. You can load the certificate manually. See Example: Loading CA and Local Certificates Manually. Based on your deployment environment, you can use either Certificate Management Protocol version 2 (CMPv2) or Simple Certificate Enrollment Protocol (SCEP) for online certificate enrollment. See Enrolling a CA Certificate Online Using SCEP and Understanding Certificate Enrollment with CMPv2.
  5. (Optional for mutual authentication) Load the local certificate on the device. You can load the local certificate manually. Based on your deployment environment, you can use either CMPv2 or SCEP for online certificate enrollment. See Enrolling a Local Certificate Online Using SCEP and Understanding Certificate Enrollment with CMPv2.
  6. Verify that the certificates are loaded successfully. Use the request security pki ca-certificate verify command to check whether the CA certificate has loaded successfully. Use the request security pki local-certificate verify command to verify that the local certificate has loaded successfully.
Configure Server Authentication on Your Device
Step-by-Step Procedure

The following procedure requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode.

To configure the device:

  1. Specify the syslog server that receives the system log messages. You can specify the IP address of the syslog server or a fully qualified hostname. In this example, use 10.102.70.233 as the IP address of the syslog server.

    content_copy zoom_out_map
    [edit]
    user@host# set system syslog host 10.102.70.223 any any
  2. Specify the port number of the syslog server.

    content_copy zoom_out_map
    [edit]
    user@host# set system syslog host 10.102.70.223 port 10514
  3. Specify the syslog transport protocol for the device. In this example, use TLS as the transport protocol.

    content_copy zoom_out_map
    [edit]
    user@host# set system syslog host 10.102.70.223 transport tls 
  4. Specify the name of the trusted certificate authority (CA) group or specify the name of the CA profile to be used. In this example, use example-ca as the CA profile.

    content_copy zoom_out_map
    [edit]
    user@host# set system syslog host 10.102.70.223 tlsdetails trusted-ca-group trusted-ca-group-name ca-profiles example-ca
  5. Configure the device to send all log messages.

    content_copy zoom_out_map
    [edit]
    user@host# set system syslog file messages any any
  6. Commit the configuration.

    content_copy zoom_out_map
    [edit]
    user@host# commit
Results

In configuration mode, confirm your configuration by using the show system syslog command.

content_copy zoom_out_map
[edit]   
user@host# show system syslog 
host 10.102.70.223 {
    any any;
    port 10514;
    transport tls;
    tlsdetails {
        trusted-ca-group trusted-ca-group-name {
            ca-profiles example-ca;
        }
    }
}
Verification

To verify that the configuration is working properly, enter the show log command on the syslog server.

Data Plane Logs

Data plane logs, also called security logs, include security events that are handled inside the data plane. Security logs can be in text or binary format, and you can save them locally (event mode) or configure your device to send the logs to an external server (stream mode). You require binary format for stream mode. We recommend binary format to conserve log space in event mode.

Example: Configure the TLS Syslog Protocol on SRX Series Firewalls

This example shows how to configure the Transport Layer Security (TLS) syslog protocol on SRX Series Firewalls to receive encrypted syslog events from network devices that support TLS syslog event forwarding.

Requirements

Before you begin, enable server certificate verification and encryption or decryption capabilities.

Overview

The TLS syslog protocol enables a log source to receive encrypted syslog events from network devices that support TLS syslog event forwarding. The log source creates a listen port for incoming TLS syslog events and generates a certificate file for the network devices.

In this example, you configure a syslog collector associated with one SSL-I profile. Each SSL-I profile enables the user to specify things such as preferred ciphers suite and trusted CA certificates. You can configure multiple SSL-I profiles and associate the profiles with different collector servers.

Configuration

Procedure
CLI Quick Configuration

To quickly configure this section of the example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

content_copy zoom_out_map
set security log mode stream
set security log format sd-syslog
set security log source-interface ge-0/0/1.0
set security log transport protocol tls
set security log transport tls-profile ssl-i-tls
set security log stream server1 format sd-syslog
set security log stream server1 category all
set security log stream server1 host 192.0.2.100
set services ssl initiation profile ssl-i-tls protocol-version all
set services ssl initiation profile ssl-i-tls trusted-ca all
set services ssl initiation profile ssl-i-tls actions ignore-server-auth-failure
Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure the TLS syslog protocol:

  1. Set the log mode to stream.

    content_copy zoom_out_map
    [edit security]
    user@host# set log mode stream
    
  2. Specify the structured system log (sd-syslog) format for remote security message logging .

    content_copy zoom_out_map
    [edit security]
    user@host# set log format sd-syslog
    
  3. Set the host source interface number.

    content_copy zoom_out_map
    [edit security]
    user@host# set log source-interface ge-0/0/1.0
    
  4. Specify TLS as the security log transport protocol to be used to log the data.

    content_copy zoom_out_map
    [edit security]
    user@host# set log transport protocol tls
    
  5. Specify the TLS profile name.

    content_copy zoom_out_map
    [edit security]
    user@host# set log transport tls-profile ssl-i-tls
    
  6. Set the log stream to use the structured syslog format for sending logs to server 1.

    content_copy zoom_out_map
    [edit security]
    user@host# set log stream server1 format sd-syslog
    
  7. Set the category of server 1 logging to all.

    content_copy zoom_out_map
    [edit security]
    user@host# set log stream server1 category all
    
  8. Specify server host parameters by entering the server name or IP address.

    content_copy zoom_out_map
    [edit security]
    user@host# set log stream server1 host 192.0.2.100
    
  9. Define the protocol version all for the SSL initiation access profile.

    content_copy zoom_out_map
    [edit services]
    user@host# set ssl initiation profile ssl-i-tls protocol-version all
    
  10. Attach all CA profile groups to the SSL initiation profile to use when requesting a certificate from the peer.

    content_copy zoom_out_map
    [edit services]
    user@host# set ssl initiation profile ssl-i-tls trusted-ca all
    
  11. Configure the SSL initiation access profile to ignore the server authentication failure.

    content_copy zoom_out_map
    [edit services]
    user@host# set ssl initiation profile ssl-i-tls actions ignore-server-auth-failure
    
Results

In configuration mode, verify your configuration by using the show security log command. If the output does not display the intended configuration, then repeat the configuration instructions in this example to correct it.

content_copy zoom_out_map
[edit]
user@host# show security log
    mode stream;
        format sd-syslog;
        source-interface ge-0/0/1.0;
        transport {
            protocol tls;
            tls-profile ssl-i-tls;
        }
        stream server1 {
            format sd-syslog;
            category all;
            host {
            192.0.2.100;
            }
        }
    }
content_copy zoom_out_map
[edit]
user@host# run show configuration services ssl initiation
    profile ssl-i-tls {
        protocol-version all;
        trusted-ca all;
        actions {
            ignore-server-auth-failure;
        }
    }

If you are done configuring the device, enter commit from configuration mode.

Verification

To verify that the configuration is working properly, enter the show log command on the syslog server.

footer-navigation