NX-OS operational standards
Rules that check a switch against your own standard, not a security baseline: the right NTP and syslog servers, a banner, a hostname that fits your naming pattern, and an SNMP location. They come from the nxos-operational-standards policy template.
Every example on this page was checked with rConfig Pro's policy engine on Each of the 10 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-operational-standards.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 |
|---|---|---|
| NTP servers | evaluate_block |
8.3.0 |
| Syslog servers | evaluate_block |
8.3.0 |
| MOTD banner | must_match_regex |
8.0.0 |
| Hostname pattern | must_match_regex |
8.0.0 |
| SNMP location | must_match_regex |
8.0.0 |
NTP servers
Every switch should take time from the same servers. This rule needs an ntp server line for each of 192.0.2.10 and 192.0.2.11. Text after the address, such as use-vrf management, is allowed.
// NTP servers are set to your standard (replace 192.0.2.10 and 192.0.2.11)#[evaluate_block]all: - regex: '/^ntp server 192\.0\.2\.10(?= |$)/m' - regex: '/^ntp server 192\.0\.2\.11(?= |$)/m'ntp server 192.0.2.10 use-vrf managementntp server 192.0.2.11 use-vrf managementntp source-interface mgmt0Why: Both standard NTP servers are set.
ntp server 192.0.2.1 use-vrf managementntp server 192.0.2.2 use-vrf managementntp source-interface mgmt0Why: The servers are not the standard ones.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Syslog servers
Every switch should log to the same servers. This rule needs a logging server line for each of 192.0.2.20 and 192.0.2.21.
// Syslog servers are set to your standard (replace 192.0.2.20 and 192.0.2.21)#[evaluate_block]all: - regex: '/^logging server 192\.0\.2\.20(?= |$)/m' - regex: '/^logging server 192\.0\.2\.21(?= |$)/m'logging server 192.0.2.20 5 use-vrf managementlogging server 192.0.2.21 5 use-vrf managementlogging source-interface mgmt0logging timestamp millisecondsWhy: Both standard syslog servers are set.
boot nxos bootflash:/nxos64-cs.10.3.4a.M.bin sup-1logging source-interface mgmt0logging console 6Why: Neither standard syslog server is set.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
MOTD banner
The same banner check as the management access template, kept here so a standards file stands on its own. Any text after banner motd passes.
// A MOTD banner is set (banner motd, any text; nothing to replace)#[must_match_regex]/^banner motd \S/mbanner motd #Authorised access only. This system is the property of Example Ltd.Disconnect now if you are not an authorised user. All activity is logged.#Why: A banner motd line is present.
interface mgmt0 description OOB management vrf member management ip address 198.51.100.42/24
icam monitor scaleWhy: There is no banner motd 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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
Hostname pattern
A naming pattern makes devices easy to find and sort. The example pattern is three letters, a dash, rtr or sw, and two digits, such as dub-sw01.
// The hostname follows your naming pattern (replace the example pattern [a-z]{3}-(rtr|sw)[0-9]{2}, for example dub-sw01)#[must_match_regex]/^hostname [a-z]{3}-(rtr|sw)[0-9]{2}$/mversion 10.3(4a) Bios:version 05.47hostname dub-sw01vdc dub-sw01 id 1Why: dub-sw01 fits the pattern.
version 10.3(4a) Bios:version 05.47hostname dub-dc1-nx02vdc dub-dc1-nx02 id 1Why: dub-dc1-nx02 does not fit the pattern.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
SNMP location
An SNMP location tells monitoring tools where the device is. Any text after snmp-server location passes.
// An SNMP location is set (snmp-server location, any text; nothing to replace)#[must_match_regex]/^snmp-server location \S/msnmp-server contact noc@example.comsnmp-server location Dublin DC1, row Csnmp-server source-interface traps mgmt0Why: A location is set.
snmp-server contact noc@example.comsnmp-server source-interface traps mgmt0Why: There is no snmp-server location 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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
Related reference
- Cisco NX-OS policy templates: every rule in
nxos-operational-standards.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.