Skip to content
Guides & References

IOS-XE AAA and local accounts

Worked examples for Cisco IOS-XE AAA and local accounts: AAA on, a hashed enable secret, password encryption, no plaintext passwords, and approved users only.

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

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.

Definition
// AAA is enabled (aaa new-model)
#[must_match_single_string]
aaa new-model
passPassing config: Hardened Catalyst 9500 sample (IOS-XE 17.9, synthetic)
enable secret 9 $9$EXAMPLEONLYFAKE$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH00
!
aaa new-model

Why: The exact line aaa new-model is there.

failFailing config: Cisco 1921 lab sample (IOS 15.7)
enable secret 5 $1$EXAM$ExampleHashNotReal0000
enable password example-enable
!
no aaa new-model

Why: 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:

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 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.

Definition
// The enable secret is set with a hash type (enable secret <type> ...)
#[must_match_regex]
/^enable secret [0-9]+ .+$/m
passPassing config: Hardened Catalyst 9500 sample (IOS-XE 17.9, synthetic)
enable secret 9 $9$EXAMPLEONLYFAKE$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH00

Why: enable secret 9 is a hashed secret.

failFailing config: Cisco 1921 lab sample (IOS 15.7), changed: enable secret line removed
hostname router1
!
enable password example-enable
!
no aaa new-model

Why: 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:

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 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.

Definition
// Password encryption is enabled (service password-encryption)
#[must_match_single_string]
service password-encryption
passPassing config: Hardened Catalyst 9500 sample (IOS-XE 17.9, synthetic)
no service pad
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec
service password-encryption
service call-home
no service dhcp

Why: The exact line service password-encryption is there.

failFailing config: Cisco 1921 lab sample (IOS 15.7)
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
no service dhcp

Why: Password encryption is turned off.

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 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.

Definition
// No local user has a type 0 plaintext password (username ... password 0)
#[must_not_match_regex]
/^username .* password 0 .+/m
passPassing config: Hardened Catalyst 9500 sample (IOS-XE 17.9, synthetic)
username admin privilege 15 secret 9 $9$EXAMPLEONLY001$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH12345
username netops privilege 15 secret 9 $9$EXAMPLEONLY002$EXAMPLEONLYFAKEHASHEXAMPLEONLYFAKEHASH67890

Why: Both users have a type 9 secret.

failFailing config: Cisco 1921 lab sample (IOS 15.7)
username cisco privilege 15 password 0 ExamplePass1
username labuser1 password 0 ExamplePass2
username labuser2 password 0 ExamplePass3

Why: All three users have a type 0 (plain text) password.

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 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.

Definition
// 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).+)/ms

Replace the three names with your own, in both places they appear: the lookaheads at the start and the list inside the negative lookahead.

passPassing config: written for the Pro test
username netadmin privilege 15 secret 9 $9$EXAMPLEONLYhash000000001
username netops secret 9 $9$EXAMPLEONLYhash000000002
username auditor secret 9 $9$EXAMPLEONLYhash000000003

Why: The three approved accounts are there, and no others.

failFailing config: written for the Pro test
username netadmin privilege 15 secret 9 $9$EXAMPLEONLYhash000000001
username netops secret 9 $9$EXAMPLEONLYhash000000002
username auditor secret 9 $9$EXAMPLEONLYhash000000003
username netadmin1 secret 9 $9$EXAMPLEONLYhash000000004
username temp secret 9 $9$EXAMPLEONLYhash000000005

Why: 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:

ConfigRule resultOverall result
Passing configpassPASS
Failing configfailFAIL

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.


Type to search.