Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Sample Syslog Server Configuration on a Linux System

A secure Junos OS environment requires auditing of events and storing them in a local audit file. The recorded events are simultaneously sent to an external syslog server. A syslog server receives the syslog messages streamed from the device. The syslog server must have an SSH client with NETCONF support configured to receive the streamed syslog messages.

Configuring Event Logging to a Local File

The administrator can configure storing of messages to a local file and the level of detail to be recorded with the syslog statement. This example stores logs in a file named syslog:

Configuring Event Logging to a Remote Server

Configure the export of audit information to a secure, remote server by setting up an event trace monitor that sends event log messages by using NETCONF over SSHv2 to the remote system event logging server. The following procedures show the configuration needed to send system log messages to a secure external server by using NETCONF over SSHv2. Junos OS supports NETCONF implemention as defined by RFC6241 (NETCONF) and RFC6242 - Using NETCONF protocol over SSH.

Configuring Event Logging to a Remote Server when Initiating the Connection from the Remote Server

The following procedure describes the steps to configure event logging to a remote server when the SSH connection to the TOE is initiated from the remote system log server.

The config example below shows an rsa key, alternately an ecdsa key or password based session can be created.

  1. Generate an RSA public key on the remote syslog server.

    The administrator will be prompted to enter the desired passphrase. The storage location for the syslog-monitor key pair is displayed.

  2. On the TOE, create a class named monitor that has permission to trace events.
  3. Create a user named syslog-mon with the class security-admin, and with authentication that uses the syslog-monitor key pair from the key pair file located on the remote syslog server.
  4. Set up NETCONF with SSH.
    Note:

    To disable netconf, use the below command:

  5. Configure syslog to log all the messages at /var/log/messages.
  6. On the remote system log server, start up the SSH agent. The start up is required to simplify the handling of the syslog-monitor key.
  7. On the remote syslog server, add the syslog-monitor key pair to the SSH agent.

    The administrator will be prompted to enter the desired passphrase. Enter the same passphrase used in Step 1.

  8. After logging in to the external_syslog_server session, establish a tunnel to the device and start NETCONF.
  9. If the session becomes disconnected, first verify and restore physical and network connectivity with the syslog server. Then, repeat the command in Step 8 to re-establish the NETCONF connection.
  10. After NETCONF is established, configure a system log events message stream. This RPC will cause the NETCONF service to start transmitting messages over the SSH connection that is established.
  11. The examples for syslog messages are listed below. Monitor the event log generated for admin actions on TOE as received on the syslog server. Examine the traffic that passes between the audit server and the TOE, observing that these data are not viewed during this transfer, and that they are successfully received by the audit server. Match the logs between local event and the remote event logged in a syslog server and record the particular software (such as name, version, and so on) used on the audit server during testing.

The following output shows test log results for syslog server.

The following output shows event logs generated on the TOE that are received on the syslog server.

The following output shows that the local syslogs and remote syslogs received are similar.