NX-OS management access
Rules for how people log in to a Nexus switch: no Telnet, SSH left on, idle sessions closed, and a warning banner. They come from the nxos-management-access 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-management-access.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 |
|---|---|---|
| No Telnet | must_not_match_regex |
8.0.2 |
| SSH not disabled | must_not_match_regex |
8.0.2 |
| VTY exec-timeout of 1 to 10 minutes | evaluate_block |
8.3.0 |
| Console exec-timeout of 1 to 10 minutes | evaluate_block |
8.3.0 |
| MOTD banner | must_match_regex |
8.0.0 |
No Telnet
Telnet sends logins in clear text. Telnet is off by default, so the switch only prints a line when someone turns it on. This rule fails if the config has feature telnet at the start of a line.
// Telnet is not enabled (fails on feature telnet)#[must_not_match_regex]/^feature telnet$/mfeature tacacs+feature password encryption aesfeature interface-vlanfeature lacpfeature vpcfeature lldpWhy: No feature telnet line.
feature tacacs+feature telnetno feature sshfeature interface-vlanfeature lacpfeature vpcfeature lldpWhy: feature telnet turns the Telnet server on.
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 | AC-17 |
| HIPAA (45 CFR) | 164.312(a)(1) |
| ISO/IEC 27001:2022 Annex A | A.8.5 |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.
SSH not disabled
SSH is on by default and is not printed. This rule fails only if someone has turned it off with no feature ssh.
// SSH is not disabled (fails on no feature ssh)#[must_not_match_regex]/^no feature ssh$/mfeature tacacs+feature password encryption aesfeature interface-vlanfeature lacpfeature vpcfeature lldpWhy: No no feature ssh line, so SSH stays on.
feature tacacs+feature telnetno feature sshfeature interface-vlanfeature lacpfeature vpcfeature lldpWhy: no feature ssh turns the SSH server off.
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 | AC-17 |
| HIPAA (45 CFR) | 164.312(a)(1) |
| ISO/IEC 27001:2022 Annex A | A.8.24 |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.
VTY exec-timeout of 1 to 10 minutes
An idle remote session should close on its own. The default timeout is not printed and is too long (30 minutes on 10.5, none on older releases), so this rule needs an explicit exec-timeout of 1 to 10 under line vty. NX-OS takes minutes only.
// The VTY line sets an exec-timeout of 1 to 10 minutes (line vty, exec-timeout)#[evaluate_block]scope: ^line vty$all: - regex: '/^\s+exec-timeout ([1-9]|10)$/m'line console exec-timeout 10line vty exec-timeout 5 session-limit 8 access-class MGMT-ACCESS inWhy: line vty has exec-timeout 5.
line console exec-timeout 15line vty exec-timeout 15 session-limit 8 access-class MGMT-ACCESS inWhy: 15 minutes is longer than 10.
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 | AC-3 |
| ISO/IEC 27001:2022 Annex A | A.8.5 |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Console exec-timeout of 1 to 10 minutes
The same check for the console port. Someone who leaves a console cable plugged in should not leave a logged-in session behind. The rule looks only inside line console.
// The console line sets an exec-timeout of 1 to 10 minutes (line console, exec-timeout)#[evaluate_block]scope: ^line console$all: - regex: '/^\s+exec-timeout ([1-9]|10)$/m'line console exec-timeout 10line vty exec-timeout 5 session-limit 8 access-class MGMT-ACCESS inWhy: line console has exec-timeout 10.
line console exec-timeout 15line vty exec-timeout 15 session-limit 8 access-class MGMT-ACCESS inWhy: 15 minutes is longer than 10.
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 | AC-3 |
| ISO/IEC 27001:2022 Annex A | A.8.5 |
Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
MOTD banner
A banner tells people the switch is private before they log in. This rule passes when the config has a banner motd line with any text after it.
// A MOTD banner is configured (banner motd)#[must_match_regex]/^banner motd \S/minterface mgmt0 description OOB management vrf member management ip address 198.51.100.41/24banner 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 |
|---|---|
| ISO/IEC 27001:2022 Annex A | A.8.5 |
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-management-access.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.