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 SSHv2 client with NETCONF 1.0 support configured to receive the streamed syslog messages. Junos OS supports NETCONF implemention as defined by RFC6241 (NETCONF) and RFC6242 (Using NETCONF protocol over SSH).
Use the configuration details and establish a session between the target of evaluation (TOE) and the audit server. Examine the traffic that passes between the audit server and the TOE during several activities, and the generated audit data to be transferred to the audit server.
To configure event logging to a remote server when the SSH connection to the ToE is initiated from the remote system log server.
Generate an RSA public key on the remote syslog server. You can also use ECDSA keys on the syslog server.
$ ssh-keygen -b 2048 -t rsa -C 'syslog-monitor key pair' -f ~/.ssh/syslog-monitor
You will be prompted to enter the desired pass phrase. The storage locations for the
syslog-monitorkey pair is displayed.On the TOE, create a class named
monitorthat has permission to trace events.[edit system login] security-administrator@host:fips# set class monitor permissions trace
Create a user named
syslog-monwith the classmonitor, and with public key–based or password-based authentication.For public key–based authentication:
[edit system login] security-administrator@host:fips# set user syslog-mon class monitor authentication ssh-rsa "public-key"
For password-based authentication:
[edit system login] security-administrator@host:fips# set user syslog-mon class monitor authentication (plain-text-password | encrypted-password)
Set up NETCONF with SSH.
[edit system services] security-administrator@host:fips# set netconf ssh
Configure syslog to log all the messages at /var/log/file-name..
[edit system] security-administrator@host:fips# set syslog file file-name any any commit
To configure syslog in year format:
[edit system] security-administrator@host:fips# syslog time-format year commit
On the remote system log server, start up the SSH agent
ssh-agent. The start up is required to simplify the handling of the syslog-monitor key.$ eval `ssh-agent -s`
On the remote syslog server, add the
syslog-monitorkey pair to thessh-agent.$ ssh-add ~/.ssh/syslog-monitor
You will be prompted to enter the desired passphrase. Enter the same passphrase used in Step 1.
After logging in to the
external_syslog_serversession, establish a tunnel to the device and start NETCONF.security-administrator@host:fips# $ssh syslog-mon@NDcPP_TOE -s netconf > test.out
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.
<rpc><get-syslog-events><stream>messages</stream></get-syslog-events></rpc>
The examples for syslog messages are listed below. Monitor the event log generated for admin actions on TOE are received on 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 logging and remote event logged in syslog server and record the particular software (name, version) used on the audit server during testing.
The following output shows test log results for syslog-server.
root@host:~ #ssh-keygen -t ecdsa -f $HOME/.ssh/id_ssh_toby_ecdsa_521 -N "" -b 521 Generating public/private ecdsa key pair. /root/.ssh/id_ssh_toby_ecdsa_521 already exists. Overwrite (y/n)? Your identification has been saved in /root/.ssh/id_ssh_toby_ecdsa_521. Your public key has been saved in /root/.ssh/id_ssh_toby_ecdsa_521.pub. The key fingerprint is: SHA256:QotJZkrdOAXn9VCpDc/2S1rF+KPJW239WfQhj9sEhVA root@host.englab.juniper.net The key's randomart image is: +---[ECDSA 521]---+ | ..o o..o.E | | . * ..o. . . | | . B + *. + . | | . = = .. = . + | | . o o S. . = ..| | . + Bo+| | = =.+*| | . =.+.+| | .o o.| +----[SHA256]-----+ [root@host ~]# cat $HOME/.ssh/id_ssh_toby_ecdsa_521.pub ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAC2+AZ7GkIcl8Y9PZNZosY7vUnSR+WyS11CGpqA23toyiVcd0H7ivFsgmztwxgaM7Qla1bU2A1yEPw7tmqlR5k8FQAKsbSHzzRsVGXO24wg9gpu/Mxu5l3aXMtodhIYns66WwI7U/rjQsKosqwkvizep2wUtQ49DuQIXO0vc3mPNAa1DA== root@host.englab.juniper.net [root@host ~]# eval `ssh-agent -s` Agent pid 5978 [root@host ~]# ssh-add ~/ .ssh/id_ssh_toby_ecdsa_521 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0755 for '/root/' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Identity added: .ssh/id_ssh_toby_ecdsa_521 (.ssh/id_ssh_toby_ecdsa_521)
Net configuration channel
[root@host ~]# ssh syslog-mon@nms-mx10003-a -s netconf
<!-- No zombies were killed during the creation of this user interface -->
<!-- user syslog-mon, class j-super-user -->
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
<capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-yang-metadata?module=ietf-yang-metadata&revision=2016-08-05</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring</capability>
<capability>http://xml.juniper.net/netconf/junos/1.0</capability>
<capability>http://xml.juniper.net/dmi/system/1.0</capability>
<capability>http://yang.juniper.net/junos/jcmd?module=junos-configuration-metadata&revision=2021-09-01&…
</capabilities>
<session-id>80506</session-id>
</hello>
]]>]]>
<rpc><get-syslog-events><stream>messages</stream></get-syslog-events></rpc>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/26.1I-20251125_dev_common.0.1234/junos">
<syslog-events>
<syslog>
Dec 4 13:49:03 2025 nms-mx10003-a-test mgd[65827]: UI_COMMIT: User 'root' requested 'commit' operation (comment: none)
</syslog>
<syslog>
Dec 4 13:49:03 2025 nms-mx10003-a-test ffp: "dynamic-profiles": No change to profiles
</syslog>
<syslog>
Dec 4 13:49:04 2025 nms-mx10003-a-test mgd[65827]: UI_CONFIGURATION_REVISION_UPDATED: New database revision 're0-1764836343-29' and old database revision 're0-1764835976-28'
</syslog>
<syslog>
Dec 4 13:49:04 2025 nms-mx10003-a-test mgd[65827]: UI_COMMIT_COMPLETED: : commit complete
</syslog>The following output shows event logs generated on the TOE that are received on the syslog server.
<190>1 2025-12-04T13:04:42.472+05:30 nms-mx10003-a-test mgd 72697 UI_AUTH_EVENT [junos@2636.1.1.1.2.139 username="syslog-mon" authentication-level="j-super-user"] Authenticated user 'syslog-mon' assigned to class 'j-super-user' <190>1 2025-12-04T13:04:42.472+05:30 nms-mx10003-a-test mgd 72697 UI_LOGIN_EVENT [junos@2636.1.1.1.2.139 username="syslog-mon" class-name="j-super-user" local-peer="" pid="72697" ssh-connection="10.56.212.248 37647 10.209.6.136 22" client-mode="cli"] User 'syslog-mon' login, class 'j-super-user' [72697], ssh-connection '10.56.212.248 37647 10.209.6.136 22', client-mode 'cli'
The following output shows that the local syslogs and remote syslogs received.
Local:
<38>1 2025-12-04T14:41:44.514+05:30 nms-mx10003-a-test sshd 83264 - - Accepted publickey for syslog-mon from 10.56.212.248 port 24927 ssh2: ECDSA SHA256:QotJZkrdOAXn9VCpDc/2S1rF+KPJW239WfQhj9sEhVA <190>1 2025-12-04T14:41:45.461+05:30 nms-mx10003-a-test mgd 83268 UI_AUTH_EVENT [junos@2636.1.1.1.2.139 username="syslog-mon" authentication-level="j-super-user"] Authenticated user 'syslog-mon' assigned to class 'j-super-user' <190>1 2025-12-04T14:41:45.461+05:30 nms-mx10003-a-test mgd 83268 UI_LOGIN_EVENT [junos@2636.1.1.1.2.139 username="syslog-mon" class-name="j-super-user" local-peer="" pid="83268" ssh-connection="10.56.212.248 24927 10.209.6.136 22" client-mode="cli"] User 'syslog-mon' login, class 'j-super-user' [83268], ssh-connection '10.56.212.248 24927 10.209.6.136 22', client-mode 'cli' <190>1 2025-12-04T14:41:47.549+05:30 nms-mx10003-a-test mgd 83268 UI_CMDLINE_READ_LINE [junos@2636.1.1.1.2.139 username="syslog-mon" command="edit "] User 'syslog-mon', command 'edit ' <189>1 2025-12-04T14:41:47.550+05:30 nms-mx10003-a-test mgd 83268 UI_DBASE_LOGIN_EVENT [junos@2636.1.1.1.2.139 username="syslog-mon"] User 'syslog-mon' entering configuration mode <190>1 2025-12-04T14:41:51.753+05:30 nms-mx10003-a-test mgd 83268 UI_CMDLINE_READ_LINE [junos@2636.1.1.1.2.139 username="syslog-mon" command="commit "] User 'syslog-mon', command 'commit ' <189>1 2025-12-04T14:41:51.754+05:30 nms-mx10003-a-test mgd 83268 UI_COMMIT [junos@2636.1.1.1.2.139 username="syslog-mon" command="commit" message="none"] User 'syslog-mon' requested 'commit' operation (comment: none) <190>1 2025-12-04T14:42:50.331+05:30 nms-mx10003-a-test mgd 83251 UI_CMDLINE_READ_LINE [junos@2636.1.1.1.2.139 username="root" command="show log abc | grep syslog-mon "] User 'root', command 'show log abc | grep syslog-mon '
Remote:
[root@host ~]# ssh syslog-mon@nms-mx10003-a -s netconf
<!-- No zombies were killed during the creation of this user interface -->
<!-- user syslog-mon, class j-super-user -->
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
<capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-yang-metadata?module=ietf-yang-metadata&revision=2016-08-05</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring</capability>
<capability>http://xml.juniper.net/netconf/junos/1.0</capability>
<capability>http://xml.juniper.net/dmi/system/1.0</capability>
<capability>http://yang.juniper.net/junos/jcmd?module=junos-configuration-metadata&revision=2021-09-01&…
</capabilities>
<session-id>80506</session-id>
</hello>
]]>]]>
<rpc><get-syslog-events><stream>messages</stream></get-syslog-events></rpc>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/26.1I-20251125_dev_common.0.1234/junos">
<syslog-events>
<syslog>
Dec 4 13:49:03 2025 nms-mx10003-a-test mgd[65827]: UI_COMMIT: User 'syslog-mon' requested 'commit' operation (comment: none)
</syslog>
<syslog>
Dec 4 13:49:03 2025 nms-mx10003-a-test ffp: "dynamic-profiles": No change to profiles
</syslog>
<syslog>
Dec 4 13:49:04 2025 nms-mx10003-a-test mgd[65827]: UI_CONFIGURATION_REVISION_UPDATED: New database revision 're0-1764836343-29' and old database revision 're0-1764835976-28'
</syslog>
<syslog>
Dec 4 13:49:04 2025 nms-mx10003-a-test mgd[65827]: UI_COMMIT_COMPLETED: : commit complete
</syslog>