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.
// A remote syslog server is configured (logging server)#[must_match_regex]/^logging server \S+/mlogging server 192.0.2.20 5 use-vrf managementlogging server 192.0.2.21 5 use-vrf managementlogging source-interface mgmt0logging timestamp millisecondsWhy: Two syslog servers are set.
boot nxos bootflash:/nxos64-cs.10.3.4a.M.bin sup-1logging source-interface mgmt0logging console 6Why: There is no logging server line.
Expected result in rConfig, with this rule as the only rule in a definition:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config | pass | PASS |
| Failing config | fail | FAIL |
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.
// Log timestamps use milliseconds or microseconds (logging timestamp milliseconds)#[must_match_regex]/^logging timestamp (milliseconds|microseconds)$/mlogging server 192.0.2.20 5 use-vrf managementlogging server 192.0.2.21 5 use-vrf managementlogging source-interface mgmt0logging timestamp millisecondsWhy: Timestamps use milliseconds.
boot nxos bootflash:/nxos64-cs.10.3.4a.M.bin sup-1logging source-interface mgmt0logging console 6Why: 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:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config | pass | PASS |
| Failing config | fail | FAIL |
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.
// Console logging is not more verbose than critical (fails on logging console 3 to 7)#[must_not_match_regex]/^logging console [3-7]$/mlogging server 192.0.2.20 5 use-vrf managementlogging server 192.0.2.21 5 use-vrf managementlogging source-interface mgmt0logging timestamp millisecondsWhy: No logging console line.
boot nxos bootflash:/nxos64-cs.10.3.4a.M.bin sup-1logging source-interface mgmt0logging console 6Why: Level 6 (informational) is too verbose.
Expected result in rConfig, with this rule as the only rule in a definition:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config | pass | PASS |
| Failing config | fail | FAIL |
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.
Related reference
- Cisco NX-OS policy templates: every rule in
nxos-logging.policy, its references and known limitations. - Policy Definitions: the definition file format and every method.
- Policy Assignments: run a definition against your devices.
- Policy Compliance Results: read the pass and fail results.