Skip to content
Guides & References

NX-OS SNMP

Worked examples for the NX-OS SNMP template: no SNMPv1 or v2c communities, no MD5 SNMP users, and encryption enforced for every SNMP user.

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

NX-OS SNMP

Rules for SNMP on a Nexus switch: no clear-text communities, no MD5 users, and encryption for every user. They come from the nxos-snmp 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-snmp.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 SNMPv1 or v2c community must_not_match_regex 8.0.2
No SNMP user with MD5 must_not_match_regex 8.0.2
Encryption enforced for every SNMP user must_match_single_string 8.0.0

No SNMPv1 or v2c community

A community string is a clear-text password. This rule fails if any line starts with snmp-server community.

Definition
// No SNMPv1 or SNMPv2c community is configured (line snmp-server community is absent)
#[must_not_match_regex]
/^snmp-server community /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
snmp-server host 192.0.2.60 traps version 3 priv netmon
snmp-server host 192.0.2.60 use-vrf management
snmp-server enable traps link
snmp-server enable traps vpc
snmp-server globalEnforcePriv

Why: No snmp-server community line.

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
snmp-server host 192.0.2.60 traps version 2c dc1-ro
snmp-server host 192.0.2.60 use-vrf management
snmp-server enable traps link
snmp-server enable traps vpc
snmp-server community dc1-ro group network-operator

Why: A v2c community is configured.

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 SC-12
HIPAA (45 CFR) 164.312(e)(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.


No SNMP user with MD5

MD5 is too weak for SNMPv3 authentication. This rule fails on any snmp-server user line with auth md5. Use auth sha instead.

Definition
// No SNMP user uses MD5 authentication (fails on snmp-server user ... auth md5)
#[must_not_match_regex]
/^snmp-server user \S+ .*\bauth md5\b/m
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
snmp-server user admin network-admin auth sha 0xcc46e4ba8cbe8cf82d43dd6dc0275564 priv aes-128 0x54dece4b157150d7165ae38d03a2f97b localizedkey
snmp-server user netmon network-operator auth sha 0xcc46e4ba8cbe8cf82d43dd6dc0275564 priv aes-128 0x54dece4b157150d7165ae38d03a2f97b localizedkey

Why: Both users authenticate with SHA.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
snmp-server user admin network-admin auth md5 0xcc46e4ba8cbe8cf82d43dd6dc0275564 priv 0x54dece4b157150d7165ae38d03a2f97b localizedkey
snmp-server user netmon network-operator auth md5 0xcc46e4ba8cbe8cf82d43dd6dc0275564 priv aes-128 0x54dece4b157150d7165ae38d03a2f97b localizedkey

Why: Both users authenticate with MD5.

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 SC-12
HIPAA (45 CFR) 164.312(e)(1)
ISO/IEC 27001:2022 Annex A A.8.5, 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.


Encryption enforced for every SNMP user

snmp-server globalEnforcePriv makes every SNMP user encrypt its messages, so a user set up without privacy cannot read data in the clear. This rule looks for that exact line.

Definition
// SNMP message encryption is enforced for all users (snmp-server globalEnforcePriv)
#[must_match_single_string]
snmp-server globalEnforcePriv
passPassing config: Hardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
snmp-server host 192.0.2.60 traps version 3 priv netmon
snmp-server host 192.0.2.60 use-vrf management
snmp-server enable traps link
snmp-server enable traps vpc
snmp-server globalEnforcePriv

Why: Encryption is enforced.

failFailing config: Unhardened Nexus 93180YC-FX sample (NX-OS 10.3(4a), synthetic)
snmp-server host 192.0.2.60 traps version 2c dc1-ro
snmp-server host 192.0.2.60 use-vrf management
snmp-server enable traps link
snmp-server enable traps vpc
snmp-server community dc1-ro group network-operator

Why: There is no globalEnforcePriv 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
NIST SP 800-53 SC-12
HIPAA (45 CFR) 164.312(e)(1)
ISO/IEC 27001:2022 Annex A A.8.5, A.8.24

Tested with: sample excerpts from NX-OS 10.3(4a) (synthetic). Minimum rConfig 8.0.0 (must_match_single_string). Editions: Pro, Vector, Enterprise.


Type to search.