Skip to content
Guides & References

NX-OS logging

Worked examples for the NX-OS logging template: a remote syslog server, millisecond timestamps, and console logging no more verbose than critical.

Policy LibraryUpdated
Platform
cisco-nx-os
Minimum version
rConfig 8.0.2
Editions
Pro, Vector, Enterprise
On this page

NX-OS logging

Rules for where logs go and how they look: a remote syslog server, precise timestamps, and a quiet console. They come from the nxos-logging policy template.

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

Each of the 6 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.

All the rules come from nxos-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 Cisco NX-OS templates page lists the file’s known limitations. Run the rules against show running-config.

Rule Method Since
Remote syslog server must_match_regex 8.0.0
Millisecond timestamps must_match_regex 8.0.0
Console logging no more verbose than critical must_not_match_regex 8.0.2

Remote syslog server

Logs kept only on the switch are lost on a reload and can be wiped by an attacker. This rule passes when the config has at least one logging server line.

Definition
// A remote syslog server is configured (logging server)
#[must_match_regex]
/^logging server \S+/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
logging server 192.0.2.20 5 use-vrf management
logging server 192.0.2.21 5 use-vrf management
logging source-interface mgmt0
logging timestamp milliseconds

Why: Two syslog servers are set.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
boot nxos bootflash:/nxos64-cs.10.3.4a.M.bin sup-1
logging source-interface mgmt0
logging console 6

Why: There is no logging server line.

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-2
HIPAA (45 CFR) 164.312(b)
ISO/IEC 27001:2022 Annex A A.8.15

Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.


Millisecond timestamps

Fine timestamps let you line up events across devices. This rule passes on logging timestamp milliseconds or logging timestamp microseconds.

Definition
// Log timestamps use milliseconds or microseconds (logging timestamp milliseconds)
#[must_match_regex]
/^logging timestamp (milliseconds|microseconds)$/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
logging server 192.0.2.20 5 use-vrf management
logging server 192.0.2.21 5 use-vrf management
logging source-interface mgmt0
logging timestamp milliseconds

Why: Timestamps use milliseconds.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
boot nxos bootflash:/nxos64-cs.10.3.4a.M.bin sup-1
logging source-interface mgmt0
logging console 6

Why: There is no logging timestamp line, so the default (seconds) is used.

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 NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.


Console logging no more verbose than critical

Sending lots of messages to the console slows the switch down. This rule fails on logging console with a level from 3 to 7. Levels 0 to 2, or no line at all, pass.

Definition
// Console logging is not more verbose than critical (fails on logging console 3 to 7)
#[must_not_match_regex]
/^logging console [3-7]$/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
logging server 192.0.2.20 5 use-vrf management
logging server 192.0.2.21 5 use-vrf management
logging source-interface mgmt0
logging timestamp milliseconds

Why: No logging console line.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
boot nxos bootflash:/nxos64-cs.10.3.4a.M.bin sup-1
logging source-interface mgmt0
logging console 6

Why: Level 6 (informational) is too verbose.

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-6
HIPAA (45 CFR) 164.312(b)

Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.


Type to search.