Skip to content
Guides & References

NX-OS management access

Worked examples for the NX-OS management access template: no Telnet, SSH left on, exec-timeouts on the VTY and console lines, and a MOTD banner.

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

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.

Definition
// Telnet is not enabled (fails on feature telnet)
#[must_not_match_regex]
/^feature telnet$/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
feature tacacs+
feature password encryption aes
feature interface-vlan
feature lacp
feature vpc
feature lldp

Why: No feature telnet line.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
feature tacacs+
feature telnet
no feature ssh
feature interface-vlan
feature lacp
feature vpc
feature lldp

Why: feature telnet turns the Telnet server on.

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

Definition
// SSH is not disabled (fails on no feature ssh)
#[must_not_match_regex]
/^no feature ssh$/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
feature tacacs+
feature password encryption aes
feature interface-vlan
feature lacp
feature vpc
feature lldp

Why: No no feature ssh line, so SSH stays on.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
feature tacacs+
feature telnet
no feature ssh
feature interface-vlan
feature lacp
feature vpc
feature lldp

Why: no feature ssh turns the SSH server off.

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

Definition
// 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'
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
line console
exec-timeout 10
line vty
exec-timeout 5
session-limit 8
access-class MGMT-ACCESS in

Why: line vty has exec-timeout 5.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
line console
exec-timeout 15
line vty
exec-timeout 15
session-limit 8
access-class MGMT-ACCESS in

Why: 15 minutes is longer than 10.

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

Definition
// 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'
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
line console
exec-timeout 10
line vty
exec-timeout 5
session-limit 8
access-class MGMT-ACCESS in

Why: line console has exec-timeout 10.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
line console
exec-timeout 15
line vty
exec-timeout 15
session-limit 8
access-class MGMT-ACCESS in

Why: 15 minutes is longer than 10.

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

Definition
// A MOTD banner is configured (banner motd)
#[must_match_regex]
/^banner motd \S/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
interface mgmt0
description OOB management
vrf member management
ip address 198.51.100.41/24
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
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.


Type to search.