Skip to content

Cisco IOS stock definitions

Stock definitions for Cisco IOS and IOS XE, from the cisco/ folder. They check the running configuration as returned by show running-config. This page documents release v1.2.0. See importing a stock template to load one into rConfig.

For tested worked examples of IOS-XE rules, with passing and failing configs, see the Cisco IOS-XE platform pages.

ios-management-access.policy · 6 rules · minimum rConfig 8.3.0 · Lab tested

SSH version 2, no Telnet on any line, an exec-timeout of 1 to 10 minutes on the console and every VTY line, and MOTD and login banners.

RuleMethodWhat it checks
SSH version 2 is enabled (ip ssh version 2)must_match_single_stringA line reads exactly ip ssh version 2.
No transport input line permits Telnet (telnet or all)must_not_match_regexNo transport input line, on any line block, includes telnet or all. transport input telnet ssh and transport input all both fail.
No VTY line block sets an exec-timeout outside 1 to 10 minutes (no line means the 10 0 default)evaluate_blockEach line vty block is checked on its own. A block passes with an exec-timeout of 1 to 9 minutes and 0 to 59 seconds, or exactly 10 0, and with no exec-timeout line, because 10 minutes is the default and IOS does not print it. 0 0 (no timeout), any other value under one minute and anything over 10 minutes fail.
The console line does not set an exec-timeout outside 1 to 10 minutes (no line means the 10 0 default)evaluate_blockThe same check for the line con block.
A MOTD banner is configured (banner motd)must_match_regexA line starts with banner motd followed by banner text.
A login banner is configured (banner login)must_match_regexA line starts with banner login followed by banner text.

Published references recorded in the sidecar. A rule provides evidence towards a control; it does not make a device compliant with it.

RuleNIST SP 800-53HIPAA (45 CFR)
SSH version 2 is enabled (ip ssh version 2)AC-17164.312(a)(1)
No transport input line permits Telnet (telnet or all)AC-17164.312(a)(1)
No VTY line block sets an exec-timeout outside 1 to 10 minutes (no line means the 10 0 default)AC-3None
The console line does not set an exec-timeout outside 1 to 10 minutes (no line means the 10 0 default)AC-3None
  • The Telnet rule uses a regex because must_not_match_single_string compares whole lines, so transport input telnet would not catch transport input telnet ssh.
  • exec-timeout 10 0 is the IOS default and is not printed, so a line block with no exec-timeout line passes.
  • A seconds value of 60 or more fails, even when the total is 10 minutes or less (for example exec-timeout 0 300).

ios-aaa.policy · 4 rules · minimum rConfig 8.0.2 · Lab tested

AAA enabled, a hashed enable secret, password encryption and no plaintext local passwords.

RuleMethodWhat it checks
AAA is enabled (aaa new-model)must_match_single_stringA line reads exactly aaa new-model.
The enable secret is set with a hash type (enable secret <type> …)must_match_regexA line starts with enable secret, then a numeric hash type, then the hash.
Password encryption is enabled (service password-encryption)must_match_single_stringA line reads exactly service password-encryption.
No local user has a type 0 plaintext password (username … password 0)must_not_match_regexNo username line stores its password as password 0, which is plaintext.

Published references recorded in the sidecar. A rule provides evidence towards a control; it does not make a device compliant with it.

RuleNIST SP 800-53HIPAA (45 CFR)
AAA is enabled (aaa new-model)AC-2164.312(a)(1)
The enable secret is set with a hash type (enable secret <type> …)IA-5None
Password encryption is enabled (service password-encryption)CM-6None
No local user has a type 0 plaintext password (username … password 0)IA-5None
  • No rule checks login authentication default on the console or VTY lines. It is the default method list, so IOS does not print it, and a rule that required it failed on compliant configs. Release v1.2.0 removed those two rules.

ios-snmp.policy · 2 rules · minimum rConfig 8.0.2 · Lab tested

No SNMPv1 or SNMPv2c communities, and an SNMPv3 authPriv group.

RuleMethodWhat it checks
No SNMPv1 or SNMPv2c community is configured (line snmp-server community is absent)must_not_match_regexNo line starts with snmp-server community.
An SNMPv3 group uses authPriv (snmp-server group … v3 priv)must_match_regexAn snmp-server group line uses v3 priv, which is authentication with encryption.

Published references recorded in the sidecar. A rule provides evidence towards a control; it does not make a device compliant with it.

RuleNIST SP 800-53HIPAA (45 CFR)
No SNMPv1 or SNMPv2c community is configured (line snmp-server community is absent)SC-12164.312(e)(1)
An SNMPv3 group uses authPriv (snmp-server group … v3 priv)SC-12164.312(e)(1)
  • SNMPv3 users (snmp-server user) are not shown in the running config, so no rule checks them.

ios-logging.policy · 5 rules · minimum rConfig 8.0.2 · Lab tested

Remote syslog host, millisecond log timestamps (with or without localtime, show-timezone or year), no console logging, buffered logging and a trap severity level.

RuleMethodWhat it checks
A remote syslog host is configured (logging host)must_match_regexA line starts with logging host followed by a host.
Log timestamps use datetime msec, with or without other options (service timestamps log datetime msec …)must_match_regexA service timestamps log datetime line includes msec, with or without other options such as localtime show-timezone or year. A datetime line without msec, or uptime, fails.
Console logging is off (no logging console line at any level)must_not_match_regexNo line starts with logging console, at any severity level. no logging console still passes.
Buffered logging is configured (logging buffered)must_match_regexA line starts with logging buffered followed by a size or level.
The logging trap severity level is set (logging trap <level>)must_match_regexA logging trap line names one of the severity keywords, from emergencies to informational. debugging is not accepted.

Published references recorded in the sidecar. A rule provides evidence towards a control; it does not make a device compliant with it.

RuleNIST SP 800-53HIPAA (45 CFR)
A remote syslog host is configured (logging host)AU-2164.312(b)
Log timestamps use datetime msec, with or without other options (service timestamps log datetime msec …)AU-3164.312(b)
Console logging is off (no logging console line at any level)AU-6164.312(b)
Buffered logging is configured (logging buffered)AU-2None
The logging trap severity level is set (logging trap <level>)AU-3None

ios-l2-security.policy · 2 rules · minimum rConfig 8.3.0 · Lab tested

Proxy ARP disabled on every interface with an IP address, and every interface shut down or described.

RuleMethodWhat it checks
Every interface with an IP address has proxy ARP disabled (no ip proxy-arp)evaluate_blockEach interface block is checked on its own. A block with an ip address line must also contain no ip proxy-arp. Interfaces without an IP address, such as switch ports, pass.
Every interface is shut down or has a descriptionevaluate_blockEach interface block must contain a shutdown line or a description. An interface with neither, which is likely unused, fails. no shutdown does not count as shut down.

Published references recorded in the sidecar. A rule provides evidence towards a control; it does not make a device compliant with it.

RuleNIST SP 800-53
Every interface with an IP address has proxy ARP disabled (no ip proxy-arp)SC-7
Every interface is shut down or has a descriptionSI-4
  • Proxy ARP is checked only on interfaces with an IP address, and an interface with a description counts as in use.

ios-routing-authentication.policy · 2 rules · minimum rConfig 8.3.0 · Lab tested

OSPF message-digest area authentication on every OSPF process, and a BGP neighbor password.

RuleMethodWhat it checks
Every OSPF process enables message-digest authentication for an area (area … authentication message-digest)evaluate_blockEach router ospf block must contain an area ... authentication message-digest line.
At least one BGP neighbor has a password (neighbor … password)must_match_regexAt least one neighbor line sets a password. Other neighbors without a password are not checked.
  • A scoped rule fails when no config block matches its scope, so a config with no OSPF process fails the OSPF rule.

ios-services.policy · 11 rules · minimum rConfig 8.0.2 · Lab tested

HTTP and HTTPS servers, finger (service finger or ip finger), TCP and UDP small servers, identd and directed broadcast are not enabled; BOOTP, source routing, CDP and PAD are disabled with their no lines.

RuleMethodWhat it checks
The HTTP server is not enabled (line ip http server is absent)must_not_match_single_stringNo line reads ip http server.
The HTTPS server is not enabled (line ip http secure-server is absent)must_not_match_single_stringNo line reads ip http secure-server.
The finger service is not enabled (fails on a service finger or ip finger line)must_not_match_regexNo line starts with service finger or ip finger. IOS 12.1 and later use ip finger.
The BOOTP server is disabled (no ip bootp server)must_match_single_stringA line reads exactly no ip bootp server. BOOTP is on by default, so the config shows only the no form when it is disabled.
TCP small servers are not enabled (line service tcp-small-servers is absent)must_not_match_single_stringNo line reads service tcp-small-servers.
UDP small servers are not enabled (line service udp-small-servers is absent)must_not_match_single_stringNo line reads service udp-small-servers.
The PAD service is disabled (no service pad)must_match_single_stringA line reads exactly no service pad. PAD is on by default, so the config shows only the no form when it is disabled.
IP source routing is disabled (no ip source-route)must_match_single_stringA line reads exactly no ip source-route. Source routing is on by default, so the config shows only the no form when it is disabled.
The identd service is not enabled (line ip identd is absent)must_not_match_single_stringNo line reads ip identd.
CDP is disabled globally (no cdp run)must_match_single_stringA line reads exactly no cdp run. CDP is on by default, so the config shows only the no form when it is disabled.
Directed broadcast is not enabled on any interface (fails on any ip directed-broadcast line)must_not_match_regexNo interface has an ip directed-broadcast line, with or without an access list. Directed broadcast is off by default and no ip directed-broadcast is not printed, so a config without the line passes.

Published references recorded in the sidecar. A rule provides evidence towards a control; it does not make a device compliant with it.

RuleNIST SP 800-53HIPAA (45 CFR)
The HTTP server is not enabled (line ip http server is absent)CM-7None
The HTTPS server is not enabled (line ip http secure-server is absent)CM-7None
The finger service is not enabled (fails on a service finger or ip finger line)CM-7164.312(c)(1)
The BOOTP server is disabled (no ip bootp server)CM-7164.312(c)(1)
TCP small servers are not enabled (line service tcp-small-servers is absent)CM-7164.312(c)(1)
UDP small servers are not enabled (line service udp-small-servers is absent)CM-7None
IP source routing is disabled (no ip source-route)SC-5None
CDP is disabled globally (no cdp run)CM-7None
Directed broadcast is not enabled on any interface (fails on any ip directed-broadcast line)SC-7None
  • IOS does not print a setting that is at its default. BOOTP, source routing, CDP and PAD are on by default, so those rules require the no line. Directed broadcast is off by default, so that rule fails only when an ip directed-broadcast line is present.

ios-operational-standards.policy · 7 rules · minimum rConfig 8.3.0 · Synthetic tested

Checks drift from your own operational standard, not a hardening baseline: standard NTP, syslog and DNS servers, a login banner, a description on every interface that is not shut down, a hostname naming pattern and an SNMP location. Replace the example values (RFC 5737 addresses such as 192.0.2.10, and the hostname pattern) with your own before use.

RuleMethodWhat it checks
NTP servers are set to your standard (replace 192.0.2.10 and 192.0.2.11)evaluate_blockAn ntp server line exists for each address, with or without vrf <name> before it or options such as prefer after it.
Syslog servers are set to your standard (replace 192.0.2.20 and 192.0.2.21)evaluate_blockA logging host line exists for each address, with or without options after it.
DNS servers are set to your standard (replace 192.0.2.30 and 192.0.2.31)evaluate_blockEach address appears on an ip name-server line, either on one line together or on separate lines.
A login banner is set (banner login, any text; nothing to replace)must_match_regexA banner login line is present.
Every interface that is not shut down has a description (nothing to replace)evaluate_blockEvery interface block has shutdown or a non-empty description line.
The hostname follows your naming pattern (replace the example pattern [a-z]{3}-(rtr|sw)[0-9]{2}, for example dub-rtr01)must_match_regexThe hostname line matches the pattern exactly, in lower case. DUB-RTR01 and dub-rtr1 fail.
An SNMP location is set (snmp-server location, any text; nothing to replace)must_match_regexA snmp-server location line with a value is present.
  • The NTP, syslog and DNS rules check that each standard server is configured, not that no other server is.
  • Each address is matched as a whole, so 192.0.2.10 does not match 192.0.2.100.
  • The server rules are regular expressions: escape the dots when you replace an address, for example 192\.0\.2\.10.

ios-build-template.policy · 10 rules · minimum rConfig 8.0.0 · Lab tested

Starting template for a new IOS build, not a compliance check: hostname, timezone, SSH and line access, LAN interface, DHCP, DNS, NAT, ACL, NTP and logging. Replace the example values (for example hostname MyCiscoRouter and 192.168.88.0/24) with your own before use.

Every rule uses example values, so the rules fail against the samples until they are edited.

RuleMethodWhat it checks
Description: must_match_single_string Set Hostnamemust_match_single_stringA line reads exactly hostname MyCiscoRouter.
Description: must_match_single_string Set Timezonemust_match_single_stringA line reads exactly clock timezone GMT 0.
Description: must_match_all_from_array Secure Access Settingsmust_match_all_from_arrayEach listed line appears somewhere in the config: line vty 0 4, login local, transport input ssh, logging synchronous, ip domain-name example.com and the ip ssh version, time-out and retry settings.
Description: must_match_all_from_array Configure LAN Interfacemust_match_all_from_arrayEach listed line appears somewhere in the config: interface GigabitEthernet0/0, its description, the address 192.168.88.1 255.255.255.0 and no shutdown.
Description: must_match_all_from_array DHCP Server Setupmust_match_all_from_arrayEach listed line appears somewhere in the config: the excluded range, the DHCP_POOL pool, its network, default router and DNS servers.
Description: must_match_all_from_array DNS Setupmust_match_all_from_arrayBoth ip name-server lines (8.8.8.8 and 8.8.4.4) appear in the config.
Description: must_match_single_string Enable NATmust_match_single_stringA line reads exactly ip nat inside source list 1 interface GigabitEthernet0/1 overload.
Description: must_match_all_from_array Basic Firewall Rulesmust_match_all_from_arrayEach access-list 101 entry appears somewhere in the config, as do line vty 0 4 and access-class 101 in.
Description: must_match_all_from_array Enable NTP Clientmust_match_all_from_arrayBoth ntp server lines appear in the config.
Description: must_match_all_from_array Set Up Loggingmust_match_all_from_arrayEach listed line appears in the config: buffered, console and trap logging levels and logging host 192.168.88.2.

Each line of a must_match_all_from_array body is checked on its own, as text anywhere in the config. The method does not check order or which section a line sits in.