Skip to content
Guides & References

OcNOS logging

Worked examples for the OcNOS logging template: a remote syslog server, and log timestamps not set to seconds or none.

Policy LibraryUpdated
Platform
ip-infusion-ocnos
Minimum version
rConfig 8.0.2
Editions
Pro, Vector, Enterprise
On this page

OcNOS logging

Rules that keep a record of what happens on the router: logs sent to a remote syslog server, with timestamps precise enough to line events up. They come from the ocnos-logging policy template.

Every example on this page was checked with rConfig Pro's policy engine on

Each of the 5 configs below was run through rConfig Pro’s evaluator with the rule above it, and gave the result shown. The configs are sanitised excerpts of the sample configs that come with the template. A card marked changed has one line edited to show a failure (two lines on the remote syslog rule, because the sample has two servers).

All the rules come from ocnos-logging.policy in the policy templates (v1.5.0). Import the whole file with Import Templates (see importing a policy template), or copy one rule into your own definition. The IP Infusion OcNOS templates page lists the file’s known limitations. Run the rules against show running-config.

Rule Method Since
A remote syslog server is configured must_match_regex 8.0.0
Log timestamps are not set to seconds or none must_not_match_regex 8.0.2

A remote syslog server is configured

Logs kept only on the router are lost when it reboots, and an attacker on the box can clear them. The rule passes when there is at least one logging remote server line, with any address, severity, port or VRF.

Definition
// A remote syslog server is configured (logging remote server)
#[must_match_regex]
/^logging remote server \S+/m
passPassing config: Hardened S9510-28DC-B sample (OcNOS-SP 7.0.0, edited copy of the lab router sample)
feature rsyslog
logging remote server 192.0.2.20 5 port 1514 vrf management
logging remote server 192.0.2.21 5 port 1514 vrf management

Why: Two remote syslog servers are set.

passPassing config: S9510-28DC-B lab router sample (OcNOS-SP 7.0.0, sanitised)
feature ntp vrf management
feature rsyslog
logging remote server 198.51.100.217 5 port 1514 vrf management

Why: One remote syslog server is set. The address is sanitised.

failFailing config: Hardened S9510-28DC-B sample (OcNOS-SP 7.0.0, edited copy of the lab router sample), changed: both logging remote server lines removed
feature ntp vrf management
feature rsyslog
lldp run

Why: rsyslog is on, but there is no remote server. One line removed is not enough here, because the hardened sample has two servers.

Expected result in rConfig, with this rule as the only rule in a definition:

ConfigRule resultOverall result
Passing config 1passPASS
Passing config 2passPASS
Failing configfailFAIL

Framework mapping. The rule provides evidence towards these controls. It does not certify anything.

Framework Reference
NIST SP 800-53 AU-2
HIPAA (45 CFR) 164.312(b)
ISO/IEC 27001:2022 Annex A A.8.15

Tested with: sample excerpts from OcNOS-SP 7.0.0. Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.


Log timestamps are not set to seconds or none

Timestamps in seconds, or none at all, make it hard to put events from several devices in order. The rule fails only on logging timestamp seconds or logging timestamp none. No sample sets a timestamp line, so both samples pass.

Definition
// Log timestamps are not set to seconds or none (fails on logging timestamp seconds or none)
#[must_not_match_regex]
/^logging timestamp (seconds|none)[ \t]*$/m
passPassing config: Hardened S9510-28DC-B sample (OcNOS-SP 7.0.0, edited copy of the lab router sample)
service password-encryption
!
logging level nsm 4
logging level cmm 4

Why: There is no logging timestamp line. These two lines end with a space, as OcNOS prints them.

failFailing config: Hardened S9510-28DC-B sample (OcNOS-SP 7.0.0, edited copy of the lab router sample), changed: logging timestamp seconds added
service password-encryption
!
logging timestamp seconds
logging level nsm 4
logging level cmm 4

Why: Timestamps are set to seconds.

Expected result in rConfig, with this rule as the only rule in a definition:

ConfigRule resultOverall result
Passing configpassPASS
Failing configfailFAIL

Framework mapping. The rule provides evidence towards these controls. It does not certify anything.

Framework Reference
NIST SP 800-53 AU-3
HIPAA (45 CFR) 164.312(b)
ISO/IEC 27001:2022 Annex A A.8.15

Tested with: sample excerpts from OcNOS-SP 7.0.0. Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.


Type to search.