FortiOS SNMP
Rules for SNMP, the protocol monitoring tools use to poll the firewall. SNMPv1 and v2c send a shared community name in clear text. SNMPv3 with SHA and AES checks who is asking and encrypts the answer. They come from the fortios-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 fortios-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 Fortinet FortiOS templates page lists the file’s known limitations. Run the rules against show full-configuration.
| Rule | Method | Since |
|---|---|---|
| No SNMPv1 or v2c communities | must_not_match_regex |
8.0.2 |
| SNMPv3 users use SHA and AES | evaluate_block |
8.3.0 |
No SNMPv1 or v2c communities
A community is a shared password sent in clear text with every poll. This rule fails if there is a config system snmp community block at all.
// No SNMPv1 or SNMPv2c community is configured (config system snmp community is absent)#[must_not_match_regex]/^\s*config\s+system\s+snmp\s+community\b/mconfig system snmp sysinfo set status enable set contact-info "it@example.net" set location "Example site"endconfig system snmp user edit "nms-poller" set notify-hosts 192.0.2.60 set security-level auth-priv nextendWhy: There is an SNMPv3 user and no community block.
config system snmp community edit 1 set name "EXAMPLECOMM" config hosts edit 1 set ip 192.0.2.60 255.255.255.255 next end nextendWhy: A community is set up.
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 FortiOS 7.4.4 (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.
SNMPv3 users use SHA and AES
This rule checks every config system snmp user block. Each user must use SHA for authentication and AES for privacy, and nothing older. MD5 or DES on any user fails the rule.
// Every SNMPv3 user uses SHA authentication and AES privacy#[evaluate_block]scope: ^config system snmp user$all: - regex: '/^\s*set auth-proto sha/m' - regex: '/^\s*set priv-proto aes/m' - not: regex: '/^\s*set auth-proto (?!sha)/m' - not: regex: '/^\s*set priv-proto (?!aes)/m'config system snmp user edit "nms-poller" set notify-hosts 192.0.2.60 set security-level auth-priv set auth-proto sha256 set auth-pwd ENC EXAMPLEONLYAuthKey0001 set priv-proto aes256 set priv-pwd ENC EXAMPLEONLYPrivKey0001 nextendWhy: SHA-256 and AES-256.
config system snmp user edit "nms-poller" set notify-hosts 192.0.2.60 set security-level auth-priv set auth-proto md5 set auth-pwd ENC EXAMPLEONLYAuthKey0001 set priv-proto aes256 set priv-pwd ENC EXAMPLEONLYPrivKey0001 nextendWhy: MD5 is not SHA.
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 FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Related reference
- Fortinet FortiOS policy templates: every rule in
fortios-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.