IOS-XE AAA and local accounts
Rules for who can log in and how their passwords are stored. The first four come from the ios-aaa policy template. The last one, approved local accounts, comes from an rConfig Pro test.
Every example on this page was checked with rConfig Pro's policy engine on Each of the 10 configs below was run through rConfig Pro’s evaluator with the rule above it, and gave the result shown. The first eight are sanitised excerpts of the sample configs that come with the template. The last two were written for an rConfig Pro test. A card marked changed has one line edited to show a failure.
The first four rules come from ios-aaa.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 |
|---|---|---|
| AAA is on | must_match_single_string |
8.0.0 |
| Enable secret with a hash | must_match_regex |
8.0.0 |
| Password encryption | must_match_single_string |
8.0.0 |
| No plaintext local passwords | must_not_match_regex |
8.0.2 |
| Only approved local accounts | must_match_regex |
8.0.0 |
AAA is on
aaa new-model turns on the AAA framework, so logins can use RADIUS or TACACS+ and fall back to local accounts. Without it, each line uses its own password. IOS prints no aaa new-model when it is off.
// AAA is enabled (aaa new-model)#[must_match_single_string]aaa new-modelenable secret 9 $9$EXAMPLEONLYFAKE$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH00!aaa new-modelWhy: The exact line aaa new-model is there.
enable secret 5 $1$EXAM$ExampleHashNotReal0000enable password example-enable!no aaa new-modelWhy: AAA is off. no aaa new-model is not the same line as aaa new-model.
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 | AC-2 |
| HIPAA (45 CFR) | 164.312(a)(1) |
| ISO/IEC 27001:2022 Annex A | A.8.5 |
Tested with: sample excerpts from IOS 15.7 (lab) and IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.0 (must_match_single_string). Editions: Pro, Vector, Enterprise.
Enable secret with a hash
enable secret stores the privileged-mode password as a hash. The older enable password stores it in clear text, or with weak type 7 encoding. This rule passes when an enable secret line with a hash type number is there.
// The enable secret is set with a hash type (enable secret <type> ...)#[must_match_regex]/^enable secret [0-9]+ .+$/menable secret 9 $9$EXAMPLEONLYFAKE$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH00Why: enable secret 9 is a hashed secret.
hostname router1!enable password example-enable!no aaa new-modelWhy: Only enable password is set. There is no enable secret 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 | IA-5 |
| ISO/IEC 27001:2022 Annex A | A.5.17 |
Tested with: sample excerpts from IOS 15.7 (lab) and IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise.
Password encryption
service password-encryption hides passwords that would otherwise show in clear text in the config, such as line passwords. It is weak encoding, not real security, but it stops passwords being read over someone’s shoulder or from a printed config.
// Password encryption is enabled (service password-encryption)#[must_match_single_string]service password-encryptionno service padservice timestamps debug datetime msec localtime show-timezoneservice timestamps log datetime msecservice password-encryptionservice call-homeno service dhcpWhy: The exact line service password-encryption is there.
service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryptionno service dhcpWhy: Password encryption is turned off.
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 | CM-6 |
| ISO/IEC 27001:2022 Annex A | A.5.17 |
Tested with: sample excerpts from IOS 15.7 (lab) and IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.0 (must_match_single_string). Editions: Pro, Vector, Enterprise.
No plaintext local passwords
username ... password 0 stores a local password in clear text. Anyone who can read the config, including a backup, can read it. Use secret instead. This rule fails on any username line with password 0.
// No local user has a type 0 plaintext password (username ... password 0)#[must_not_match_regex]/^username .* password 0 .+/musername admin privilege 15 secret 9 $9$EXAMPLEONLY001$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH12345username netops privilege 15 secret 9 $9$EXAMPLEONLY002$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH67890Why: Both users have a type 9 secret.
username cisco privilege 15 password 0 ExamplePass1username labuser1 password 0 ExamplePass2username labuser2 password 0 ExamplePass3Why: All three users have a type 0 (plain text) password.
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 | IA-5 |
| ISO/IEC 27001:2022 Annex A | A.5.17 |
Tested with: sample excerpts from IOS 15.7 (lab) and IOS-XE 17.9 (synthetic). Minimum rConfig 8.0.2 (must_not_match_regex). Editions: Pro, Vector, Enterprise.
Only approved local accounts
Local accounts are the fallback when AAA servers cannot be reached, which makes them a favourite place for forgotten or shared logins. This rule needs a fixed set of local accounts and fails if any other username line exists. It is not part of the template. It comes from a customer use case in the rConfig Pro test suite.
The rule is one regular expression. Three lookaheads need the approved names, and a negative lookahead rejects any other name. \b stops a near miss such as netadmin1 from counting as netadmin.
// Only the approved local accounts exist: netadmin, netops and auditor#[must_match_regex]/^(?=.*^username netadmin\b)(?=.*^username netops\b)(?=.*^username auditor\b)(?!.*^username (?!netadmin\b|netops\b|auditor\b).+)/msReplace the three names with your own, in both places they appear: the lookaheads at the start and the list inside the negative lookahead.
username netadmin privilege 15 secret 9 $9$EXAMPLEONLYhash000000001username netops secret 9 $9$EXAMPLEONLYhash000000002username auditor secret 9 $9$EXAMPLEONLYhash000000003Why: The three approved accounts are there, and no others.
username netadmin privilege 15 secret 9 $9$EXAMPLEONLYhash000000001username netops secret 9 $9$EXAMPLEONLYhash000000002username auditor secret 9 $9$EXAMPLEONLYhash000000003username netadmin1 secret 9 $9$EXAMPLEONLYhash000000004username temp secret 9 $9$EXAMPLEONLYhash000000005Why: netadmin1 and temp are not approved. netadmin1 does not count as netadmin.
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. None recorded. See Compliance frameworks.
Tested with: configs written for the test in IOS-XE syntax, not captured from a device. Minimum rConfig 8.0.0 (must_match_regex). Editions: Pro, Vector, Enterprise. Source: CustomerUseCases/UsernamePolicyMethodsTest::test_must_match_regex_usernames_passes_only_valid_users and test_must_match_regex_usernames_fails_with_extra_users.
Related reference
- Cisco IOS policy templates: every rule in
ios-aaa.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.