Skip to content
Guides & References

NX-OS operational standards

Worked examples for the NX-OS operational standards template: your NTP and syslog servers, a MOTD banner, a hostname pattern and an SNMP location.

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

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.

Definition
// 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'
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
ntp server 192.0.2.10 use-vrf management
ntp server 192.0.2.11 use-vrf management
ntp source-interface mgmt0

Why: Both standard NTP servers are set.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
ntp server 192.0.2.1 use-vrf management
ntp server 192.0.2.2 use-vrf management
ntp source-interface mgmt0

Why: The servers are not the standard ones.

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
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.

Definition
// 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'
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: Both standard 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: Neither standard syslog server is set.

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
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.

Definition
// A MOTD banner is set (banner motd, any text; nothing to replace)
#[must_match_regex]
/^banner motd \S/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
banner 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.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
interface mgmt0
description OOB management
vrf member management
ip address 198.51.100.42/24
icam monitor scale

Why: There is no banner motd 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
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.

Definition
// 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}$/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
version 10.3(4a) Bios:version 05.47
hostname dub-sw01
vdc dub-sw01 id 1

Why: dub-sw01 fits the pattern.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
version 10.3(4a) Bios:version 05.47
hostname dub-dc1-nx02
vdc dub-dc1-nx02 id 1

Why: dub-dc1-nx02 does not fit the pattern.

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
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.

Definition
// An SNMP location is set (snmp-server location, any text; nothing to replace)
#[must_match_regex]
/^snmp-server location \S/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
snmp-server contact noc@example.com
snmp-server location Dublin DC1, row C
snmp-server source-interface traps mgmt0

Why: A location is set.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
snmp-server contact noc@example.com
snmp-server source-interface traps mgmt0

Why: There is no snmp-server location 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
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.


Type to search.