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.
// No SNMPv1 or SNMPv2c community is configured (line snmp-server community is absent)#[must_not_match_regex]/^snmp-server community /msnmp-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 SystemOwnersnmp-server view NMS-VIEW iso includedsnmp-server group NMS v3 priv read NMS-VIEW notify NMS-VIEWWhy: SNMP uses a v3 user only.
snmp-server community public ROsnmp-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 SystemOwnersnmp-server view NMS-VIEW iso includedWhy: A read-only community is set.
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 | 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.
// 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'snmp-server user nms NMS v3 auth sha encrypted 935E7CD3115894E84E10 priv aes 128 encrypted 33078F6308E54B746F42 SystemOwnersnmp-server view NMS-VIEW iso includedWhy: The user has SHA authentication and AES privacy.
snmp-server user nms NMS v3 auth md5 encrypted 935E7CD3115894E84E10 priv des56 encrypted 33078F6308E54B746F42 SystemOwnersnmp-server view NMS-VIEW iso includedWhy: The user has MD5 authentication and DES privacy.
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 | 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.
// An SNMPv3 group uses authPriv (snmp-server group ... v3 priv)#[must_match_regex]/^snmp-server group \S+ v3 priv\b/msnmp-server view NMS-VIEW iso includedsnmp-server group NMS v3 priv read NMS-VIEW notify NMS-VIEWWhy: The NMS group needs authPriv.
snmp-server view NMS-VIEW iso includedsnmp-server group NMS v3 auth read NMS-VIEW notify NMS-VIEWWhy: The group needs authentication only, not encryption.
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 | 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.
Related reference
- Cisco IOS XR policy templates: every rule in
iosxr-snmp.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.