Skip to content
Guides & References

IOS-XE SNMP

Worked examples for Cisco IOS-XE SNMP: no SNMPv1 or v2c community strings, and an SNMPv3 group that uses authentication and encryption.

Policy LibraryUpdated
Platform
Cisco IOS-XE
Minimum version
rConfig 8.0.2
Editions
Pro, Vector, Enterprise
On this page

IOS-XE SNMP

Rules for SNMP, the protocol monitoring tools use to poll the device. SNMPv1 and v2c send a shared community string in clear text. SNMPv3 with priv authenticates and encrypts. They come from the ios-snmp policy template.

Every example on this page was checked with rConfig Pro's policy engine on

Each of the 4 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. A card marked changed has one line edited to show a failure.

All the rules come from ios-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 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 with encryption must_match_regex 8.0.0

No SNMPv1 or v2c communities

A community string is a shared password sent in clear text with every poll. A read-write community can change the config. This rule fails on any snmp-server community line, whatever its name or access.

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 Catalyst 9500 sample (IOS-XE 17.9, synthetic)
snmp-server group NMS-GROUP v3 priv
snmp-server location Example site
snmp-server contact noc@example.net
snmp-server host 192.0.2.60 version 3 priv nms-poller

Why: There is no snmp-server community line.

failFailing config: Catalyst 9500 sample (IOS-XE 17.9, synthetic)
snmp-server community EXAMPLECOMM-RO RO MGMT-ACCESS
snmp-server location Example site
snmp-server contact noc@example.net

Why: A community is set. Limiting it with an access list does not change the result.

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-XE 17.9 (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.


SNMPv3 with encryption

SNMPv3 has three security levels: noauth, auth and priv. Only priv encrypts the traffic as well as checking who sent it. This rule passes when at least one snmp-server group uses v3 priv.

Definition
// An SNMPv3 group uses authPriv (snmp-server group ... v3 priv)
#[must_match_regex]
/^snmp-server group .+ v3 priv/m
passPassing config: Hardened Catalyst 9500 sample (IOS-XE 17.9, synthetic)
snmp-server group NMS-GROUP v3 priv
snmp-server group SNMPV3GROUP v3 priv

Why: Both groups use v3 priv.

failFailing config: Hardened Catalyst 9500 sample (IOS-XE 17.9, synthetic), changed: v3 auth instead of v3 priv
snmp-server group NMS-GROUP v3 auth

Why: v3 auth checks the sender but does not encrypt.

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


Type to search.