IOS-XE logging
Rules for where logs go and how useful they are. Logs that stay on the device are lost on a reload, and logs without exact times are hard to match up across devices. They come from the ios-logging policy template.
Every example on this page was checked with rConfig Pro's policy engine on Each of the 11 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-logging.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 |
|---|---|---|
| Remote syslog host | must_match_regex |
8.0.0 |
| Millisecond log timestamps | must_match_regex |
8.0.0 |
| No console logging | must_not_match_regex |
8.0.2 |
| Buffered logging | must_match_regex |
8.0.0 |
| Trap severity level | must_match_regex |
8.0.0 |
Remote syslog host
A copy of the logs off the device survives a reload, and an attacker on the device cannot delete it. This rule passes when there is at least one logging host line. It does not check which host.
// A remote syslog host is configured (logging host)#[must_match_regex]/^logging host \S+/mlogging trap informationallogging source-interface Vlan99logging host 192.0.2.50Why: Logs are sent to 192.0.2.50.
logging trap informationallogging source-interface Vlan99Why: There is no logging host line, so logs stay on the device.
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 | AU-2 |
| HIPAA (45 CFR) | 164.312(b) |
| ISO/IEC 27001:2022 Annex A | A.8.15 |
Tested with: sample excerpts from IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
Millisecond log timestamps
Timestamps with datetime msec let you put events from many devices in the right order. This rule allows extra options such as localtime and show-timezone, in any order, as long as msec is there.
// Log timestamps use datetime msec, with or without other options (service timestamps log datetime msec ...)#[must_match_regex]/^service timestamps log datetime(?: \S+)*? msec(?: \S+)*$/mservice timestamps log datetime msecWhy: Date, time and milliseconds.
service timestamps log datetime msec localtime show-timezoneWhy: Extra options are fine.
service timestamps log uptimeWhy: uptime shows time since boot, not the date and time.
Expected result in rConfig, with this rule as the only rule in a definition:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config 1 | pass | PASS |
| Passing config 2 | 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 | AU-3 |
| HIPAA (45 CFR) | 164.312(b) |
| ISO/IEC 27001:2022 Annex A | A.8.15 |
Tested with: sample excerpts from IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
No console logging
Sending log messages to the console slows the device down when there are many, and nobody is usually watching. This rule fails on any logging console line, at any level. IOS prints no logging console when it is off.
// Console logging is off (no logging console line at any level)#[must_not_match_regex]/^logging console\b/mlogging buffered 64000 informationalno logging consoleWhy: Console logging is off.
logging buffered 64000 informationallogging console warningsWhy: Console logging is on, at warnings level.
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 | AU-6 |
| HIPAA (45 CFR) | 164.312(b) |
Tested with: sample excerpts from IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.
Buffered logging
The log buffer keeps recent messages in memory, so show logging has something to show when the syslog server cannot be reached. This rule passes when a logging buffered line sets a size or level.
// Buffered logging is configured (logging buffered)#[must_match_regex]/^logging buffered \S+/mlogging buffered 64000 informationalno logging consoleWhy: A 64000 byte buffer at informational level.
no logging consoleWhy: There is no logging buffered line.
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 | AU-2 |
| ISO/IEC 27001:2022 Annex A | A.8.15 |
Tested with: sample excerpts from IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
Trap severity level
The trap level decides which messages go to the syslog server. debugging floods the server, so this rule allows every named level except debugging. The level must be the last word on the line.
// The logging trap severity level is set (logging trap <level>)#[must_match_regex]/^logging trap (warnings|errors|informational|notifications|alerts|critical|emergencies)$/mlogging trap informationallogging source-interface Vlan99logging host 192.0.2.50Why: The trap level is informational.
logging trap debugginglogging source-interface Vlan99logging host 192.0.2.50Why: debugging is not in the allowed list.
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 | AU-3 |
| ISO/IEC 27001:2022 Annex A | A.8.15 |
Tested with: sample excerpts from IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
Related reference
- Cisco IOS policy templates: every rule in
ios-logging.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.