Skip to content
Guides & References

IOS XR SNMP

Worked examples for the IOS XR SNMP template: no SNMPv1 or v2c communities, SNMPv3 users with SHA and AES, and an authPriv group.

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

IOS XR SNMP

Rules that keep SNMP encrypted: no community strings, SNMPv3 users with strong authentication and privacy, and a group that needs both. They come from the iosxr-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 iosxr-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 IOS XR templates page lists the file’s known limitations. Run the rules against show running-config.

Rule Method Since
No SNMPv1 or v2c communities must_not_match_regex 8.0.2
SNMPv3 users with SHA and AES evaluate_block 8.3.0
SNMPv3 group with authPriv must_match_regex 8.0.0

No SNMPv1 or v2c communities

SNMPv1 and v2c send the community string in clear text, and it works like a shared password. This rule fails on any snmp-server community line.

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 ASR 9901 sample (IOS XR 7.9.2, synthetic)
snmp-server vrf MGMT
host 192.0.2.60 traps version 3 priv nms
!
snmp-server user nms NMS v3 auth sha encrypted 935E7CD3115894E84E10 priv aes 128 encrypted 33078F6308E54B746F42 SystemOwner
snmp-server view NMS-VIEW iso included
snmp-server group NMS v3 priv read NMS-VIEW notify NMS-VIEW

Why: SNMP uses a v3 user only.

failFailing config: Unhardened ASR 9901 sample (IOS XR 7.9.2, synthetic)
snmp-server community public RO
snmp-server vrf MGMT
host 192.0.2.60 traps version 3 priv nms
!
snmp-server user nms NMS v3 auth md5 encrypted 935E7CD3115894E84E10 priv des56 encrypted 33078F6308E54B746F42 SystemOwner
snmp-server view NMS-VIEW iso included

Why: A read-only community 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
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 IOS XR 7.9.2 (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.


SNMPv3 users with SHA and AES

IOS XR prints SNMP users in the running config, so the rule can check them. It needs at least one v3 user with auth sha and priv aes. It fails if any user is v1, v2c or remote, uses MD5, uses DES or 3DES, or has no privacy at all.

Definition
// Every SNMP user is v3 with SHA authentication and AES privacy, and none uses v1, v2c, MD5, DES or 3DES (snmp-server user)
#[evaluate_block]
all:
- regex: '/^snmp-server user \S+ \S+ v3 auth sha\S* .*\bpriv aes /m'
- not:
regex: '/^snmp-server user \S+ \S+ (v1|v2c|remote)\b/m'
- not:
regex: '/^snmp-server user \S+ \S+ v3 auth md5\b/m'
- not:
regex: '/^snmp-server user \S+ \S+ v3 .*\bpriv (des56|3des)\b/m'
- not:
regex: '/^snmp-server user \S+ \S+ v3(?!.*\bpriv\b)/m'
passPassing config: Hardened ASR 9901 sample (IOS XR 7.9.2, synthetic)
snmp-server user nms NMS v3 auth sha encrypted 935E7CD3115894E84E10 priv aes 128 encrypted 33078F6308E54B746F42 SystemOwner
snmp-server view NMS-VIEW iso included

Why: The user has SHA authentication and AES privacy.

failFailing config: Unhardened ASR 9901 sample (IOS XR 7.9.2, synthetic)
snmp-server user nms NMS v3 auth md5 encrypted 935E7CD3115894E84E10 priv des56 encrypted 33078F6308E54B746F42 SystemOwner
snmp-server view NMS-VIEW iso included

Why: The user has MD5 authentication and DES privacy.

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 IOS XR 7.9.2 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.


SNMPv3 group with authPriv

An SNMPv3 group sets the security level its users must meet. v3 priv means authentication and encryption (authPriv). This rule passes when at least one snmp-server group line is v3 priv.

Definition
// An SNMPv3 group uses authPriv (snmp-server group ... v3 priv)
#[must_match_regex]
/^snmp-server group \S+ v3 priv\b/m
passPassing config: Hardened ASR 9901 sample (IOS XR 7.9.2, synthetic)
snmp-server view NMS-VIEW iso included
snmp-server group NMS v3 priv read NMS-VIEW notify NMS-VIEW

Why: The NMS group needs authPriv.

failFailing config: Unhardened ASR 9901 sample (IOS XR 7.9.2, synthetic)
snmp-server view NMS-VIEW iso included
snmp-server group NMS v3 auth read NMS-VIEW notify NMS-VIEW

Why: The group needs authentication only, not encryption.

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 IOS XR 7.9.2 (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.


Type to search.