System Security Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

PDF

System Security Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

AAA password security for FIPS compliance

Want to summarize with AI?

Log in

Explains password security requirements for FIPS compliance, highlighting configuration attributes, mandatory password lengths, secret policies, enforcement order, user authentication feedback, and consecutive-character restrictions, with guidance for configuring compliant password policies.


A AAA password security mechanism is a local user password policy that

  • stores, retrieves, and validates passwords against administrator-defined security rules

  • applies only to local users, not to remote users whose profiles are maintained in third-party AAA servers, and

  • supports Cisco IOS XR 64-bit platforms only on XR VM.

Additional reference information

Cisco IOS XR Software introduces advanced AAA password strengthening policies and security mechanisms to store, retrieve, and provide policy rules for user passwords. These policies are applicable only to local users, not to remote users whose profile information is stored in a third-party AAA server. The policy does not apply to user secrets unless user secret policy support is configured separately. If both a secret and a password are configured for a user, the secret takes precedence, and password security policy does not affect authentication or password changes for such users.

The AAA password policy and username configurations persist across RP failovers or process restarts. However, operational data such as password lifetime and user lockout time are not stored in the system database or on disk, so these settings are not restored after failovers or restarts. As a result, users who were previously locked out can log in immediately after an RP failover or process restart.

To configure AAA password policy, see Configure AAA password policy.


AAA password security configuration attributes

  • AAA password security for FIPS compliance consists of policies that control password composition, length, lifetime, expiry, change behavior, service provisioning, re-authentication, lockout, and policy lifecycle operations.

  • Use this reference to choose the policy attributes that a local user password must satisfy and to understand how policy changes affect users.

Here are the key policy attributes and behaviors for AAA password security (FIPS compliance):

Password composition policy

  • Passwords can include any combination of uppercase and lowercase letters, numbers, and special characters: "!", "@", "#", "$", "%", "^", "&", "*", "(", and ")".

  • Administrators may specify the types and the number of required characters, allowing flexible composition rules.

  • The default minimum character change between passwords is 4.

  • No restriction applies to the maximum number of uppercase, lowercase, numeric, or special characters.

Password length policy

  • Administrators can set minimum and maximum password length.

  • The minimum length is 2 characters; the maximum is 253 characters.

Password lifetime policy

  • Password maximum lifetime can be specified in years, months, days, hours, minutes, or seconds.

  • If no lifetime is configured, the password never expires.

  • Configuration persists after system reload; password creation time updates upon reboot.

  • If a password's lifetime expires, action is taken per the expiry policy.

Password expiry policy

If a user's password has expired:

  • The user is prompted to set a new password after successfully entering the expired password.

  • The new password is validated against the security policy.

  • If compliant, the AAA database updates, and authentication completes with the new password

  • If not compliant, the authentication fails and the user is prompted again to set a compliant password; maximum attempts are controlled by login clients (AAA has no restrictions).

  • If a lifetime is newly configured for an existing user, it is set in the database and checked during the user's next authentication.

  • Expiry is checked only during authentication.

    If a password expires after login, no immediate action is taken; user is prompted at next authentication.

  • Debug logs and syslog entries appear only when a login attempt is made.

Example syslog (password expired):

Router: Jun 21 09:13:34.241 : locald_DSC[308]: %SECURITY-LOCALD-5-USER_PASSWD_EXPIRED :
Password for user 'user12' has expired.

Password change policy

Users cannot change passwords at will; changes occur when:

  • The security administrator changes the password.

  • The user is authenticating with an expired profile password.

  • The administrator modifies a user's associated password policy, but does not immediately change the password.

  • The command show configuration failed displays error messages for passwords that do not comply with policy configurations.

  • If the policy changes and an existing profile doesn't meet rules, no action is taken for logged in users; the user is prompted to change password at next authentication.

  • When a password changes, the new password's lifetime matches the previously set lifetime.

  • Password expiry for non-interactive clients (e.g., dot1x) triggers error messages; such clients must contact the security administrator for renewal.

Service provision after authentication

No service is performed before authenticating a user (basic AAA local authentication feature).

User re-authentication policy

When changing the password (especially on expiry), the user is authenticated with the new password. The authentication uses the previous credential, and the new password updates in the database.

User authentication lockout policy

  • The authen-max-attempts option restricts the maximum permissible failed authentication attempts.

  • If the limit is exceeded, the user is locked out until the lockout timer (lockout-time ) expires.

  • Attempted logins during lockout extend the lockout timer from the last attempted login.

Example syslog (user locked out):

Router: Jun 21 09:21:28.226 : locald_DSC[308]: %SECURITY-LOCALD-5-USER_PASSWD_LOCKED :
User 'user12' is temporarily locked out for exceeding maximum unsuccessful logins.
  

Example syslog (user unlocked):

Router: Jun 21 09:14:24.633 : locald_DSC[308]: %SECURITY-LOCALD-5-USER_PASSWD_UNLOCKED :
User 'user12' is unlocked for authentications.

Password policy lifecycle: creation, modification, and deletion

  • Administrators with AAA write permission can create password policies.

  • Modification can occur at any time, even when the policy is associated with a user.

  • Deletion is only permitted if the policy is un-configured from all users.

  • After modifying an associated password policy:

    • If the administrator configures the password, the user is not prompted to change password at next login.

    • If not, the user is prompted to change password at next login.

    • In all cases, at each password expiry interval, users are prompted to change passwords at next login.

    • Debug messages are printed for policy creation, modification, and deletion.


Requirement: Use a six-character password for the first user

You must configure a password with at least six characters when creating the first user on a Cisco router. This applies in the following situations:

  • When the Cisco Router is booted for the very first time.

  • When the router is reloaded with no username configuration.

  • When the already existing username configurations are deleted.

By default, the minimum length for passwords in a Cisco router is limited to two characters. Due to noise on the console, there is a possibility of the router being blocked out. Therefore, the minimum length for password has been increased to six characters for a first user created on the box, in each of the situations described above. This reduces the probability of the router being blocked out. It avoids the security risks that are caused due to very small password length. For all other users created after the first one, the default minimum length for password is still two characters.

For more information about how to configure a first user, see Configure First User on Cisco Routers.


User secret policies

A user secret policy is a user-authentication policy that

  • validates both local and remote user secrets against the same policy used for the user's password

  • supports a range of secret types including Type 5 (MD5), Type 8 (SHA256), Type 9 (sCrypt), and Type 10 (SHA512), and

  • uses irreversible hashed secrets to prevent modules on the device from retrieving cleartext secrets.

Additional reference information

The Cisco IOS XR Software extends password policy support beyond Type 7 passwords, now applying the same rules to Type 5 (MD5 ), 8 (SHA256 ), 9 (sCrypt ) and 10 (SHA512 user secrets for credential validation. The policy is common to both the password and the secret for each user. By using irreversible hashed secrets, the system ensures that other modules within the device cannot access the cleartext version of these secrets, enhancing the security of user credentials. This policy applies to both local and remote users.

Classic Cisco IOS XR platforms support the policy for secrets on the XR and Admin planes. 64-bit Cisco IOS XR platforms support it only on the XR VM, not on the System Admin VM.

To configure a password policy for user secret, see Configure password policy for user secret and password.


Requirement: Configure user secret policies in the supported order

You must follow these requirements when configuring password policy for user secrets in username configurations:

  • If you have not already configured a policy, the system will not perform any policy validation for the secret. Ensure you configure the policy first and apply it to the username before configuring the secret—especially when copying and pasting username configurations.

  • When you change the user secret at login, the system applies the same hashing type as used in the username configuration. For example, if Type 5 hashing was applied, the system uses Type 5 when the secret is modified.

  • Password and secret are distinct entities. If the restrict-old-count parameter is set while changing a password, the system checks compliance only with the history of old passwords, not old secrets.

  • The system checks only old secret history when changing secrets, not old password history. If the same clear-text secret was previously used as a password, the system allows it for secret configuration, and vice versa for password configuration.

  • The restrict-old-count applies to both secrets and passwords. The new secret or password overwrites the old one in FIFO order.

  • If you try to assign a different policy to a username that already has a password or secret associated with a policy, the system rejects the configuration. You must remove the existing password or secret to apply the new policy.

  • The router does not allow configuration that requires validating the secret against the previous composition of the clear-text secret, since you cannot retrieve the clear-text secret after it has been hashed. Therefore, these parameters have no effect on secret configuration:

    • max-char-repetition

    • min-char-change

    • restrict-password-reverse

    • restrict-password-advanced

  • Because the new policy configuration for the user is common to passwords and secrets, the existing password-policy becomes redundant. These configurations must be mutually exclusive. If one is already present and you try to configure the other, the system rejects the request and reports that password-policy and policy cannot be used together.


Configure an AAA password policy

Create an AAA password security policy so that local user passwords follow the configured length, lifetime, character-change, and lockout rules.

Use the aaa password-policy command in global configuration mode to set up password policies for local users.

Before you begin

You must have write permission for AAA tasks.

Procedure

  1. Configure the AAA password policy and apply it to a user.

    Example:

    Router(config)#aaa password-policy test-policy
    Router(config-aaa)#min-length 8
    Router(config-aaa)#max-length 15
    Router(config-aaa)#lifetime months 3
    Router(config-aaa)#min-char-change 5
    Router(config-aaa)#authen-max-attempts 3
    Router(config-aaa)#lockout-time days 1
    Router(config-aaa)#commit
    
    Router(config)#username user1 password-policy test-policy password 0 pwd1

    This configures a password policy named test-policy and applies it to the user user1 using the username command with the password-policy option.

  2. Review the AAA password-policy running configuration.

    Example:

    aaa password-policy test-policy
     min-length 8
     max-length 15
     lifetime months 3
     min-char-change 5
     authen-max-attempts 3
     lockout-time days 1
     !
  3. Verify the AAA password-policy details.

    Example:

    Router#show aaa password-policy
    
    Password Policy Name : test-policy
      Number of Users : 1
      Minimum Length : 8
      Maximum Length : 15
      Special Character Len : 0
      Uppercase Character Len : 0
      Lowercase Character Len : 1
      Numeric Character Len : 0
      Policy Life Time :
        seconds : 0
        minutes : 0
        hours : 0
        days : 0
        months : 3
        years : 0
      Lockout Time :
        seconds : 0
        minutes : 0
        hours : 0
        days : 1
        months : 0
        years : 0
      Character Change Len : 5
      Maximum Failure Attempts : 3

    Use this command to get details of the AAA password policy configured in the router:

  4. Configure password masking for AAA password policies.

    To mask passwords, use the following commands:

    Example:

    Router(config)# aaa password-policy security
    Router(config)# username us6 password-policy security masked-password 0
    
    Enter password:
    Re-enter password:
    
    Router(config)#commit

    To view the encrypted password:

    Example:

    Router# show run aaa
    ..
    
    aaa password-policy security
    ..
    username us6
     password-policy security password 7 0835585A

    You can also use a password encrypted earlier:

    Example:

    Router(config)# username us6 password-policy test-policy masked-password 7
    
    Enter password:
    Re-enter password:
    
    
    Router(config)#commit

    When entering a password, use the masked-password option to ensure it is not displayed on the screen. If the two entries do not match, an error message appears.

The password policy is created, associated with the intended user, and confirmed in the password-policy verification output.


Configure a password policy for user secrets and passwords

Apply a password policy to a user profile to ensure Cisco IOS XR verifies and enforces compliance for password and secret changes.

Cisco IOS XR allows you to configure a password policy that applies to both the user's password and secret. By adding the policy option to the username command, you ensure that any changes to the password or secret are validated against the specified policy. On Cisco IOS XR 64-bit platforms, password policy enforcement exists only in XR VM; System Admin VM does not enforce password policy. The AAA configuration on System Admin VM uses a YANG model, which may lead to configuration inconsistencies during upgrades or downgrades.

Before you begin

Review Requirement: Configure user secret policies in the supported order before you apply the policy to a username configuration.

Procedure

  1. Apply the password policy to the user profile.

    Example:

    Router#configure
    Router(config)#username user1
    Router(config-un)#policy test-policy1
    Router(config-un)#secret 10 $6$dmwuW0Ajicf98W0.$y/vzynWF1/OcGxwBwHs79VAy5ZZLhoHd7TicR4mOo8IIVriYCGAKW0A.w1JvTPO7IbZry.DxHrE3SN2BBzBJe0
    Router(config-un)#commit

    This example shows how to configure a password policy for the user, that applies to both the password and the secret of the user.

  2. Review password and secret compliance examples.

    Example:

    username user1
    policy test-policy1
    secret 10 $6$dmwuW0Ajicf98W0.$y/vzynWF1/OcGxwBwHs79VAy5ZZLhoHd7TicR4mOo8IIVriYCGAKW0A.w1JvTPO7IbZry.DxHrE3SN2BBzBJe0
    !

    Example:

    username user2
    policy test-policy1
    password 7 09604F0B
    !
    username user3
    policy test-policy1
    secret 10 $6$U3GZl1VINwJ4Dl1.$8X6av2kQ.AWvMKGEz5TLvZO7OXj6DgeOqLoQKIf7XJxKayViFJNateZ0no6gO6DbbXn4bBo/Dlqitro3jlsS40
    password 7 080D4D4C
    !
    username user4
    secret 10 $6$mA465X/m/UQ5....$rSKRw9B/SBYC/N.f7A9NCntPkrHXL6F4V26/NTjWXnrSnna03FxW3bcyfDAyveOexJz7/oak0XB6tjLF5CO981
    password-policy test-policy1 password 7 0723204E
    !
    username user5
    password-policy test-policy1 password 7 09604F0B
    !

    Example:

    (1)aaa password-policy pol1
     lifetime minutes 1
     upper-case 1
     restrict-old-count 2
    !
    
    username lab2
     group root-lr
    (2) policy pol1
    (3) secret 10 $6$gphqA0RfBXOn6A0.$wRwWG1l0TIpHPdVQ66fUiIM5P46ggoGMGgFuaZd0LD2DLFYDlDPaRyXQLi8Izjb49tC7H7tkTLrc1.GELFpiK.
      password 7 1533292F200F2D
    !

    The below examples show different possible combinations to check for password or secret compliance against the policy:

    The compliance check for password or secret in the above examples works as described below:

    • When you change the secret for user1, the system checks the secret compliance against the policy, test-policy1.

    • When you change the password for user2, the system checks the password compliance against the policy, test-policy1.

    • When you change the password or secret for user3, the system checks the password or secret compliance against the policy, test-policy1.

    • When you change the secret for user4, the system does not check for compliance against any policy. Whereas, when you change the password for user4, the system checks the password compliance against the policy, test-policy1.

    • When you change the password for user5, the system checks the password compliance against the policy, test-policy1.

    If you perform configurations in a single commit (for example, via copy-and-paste), the system checks the secret compliance against the assigned policy, but not password compliance during the commit. Configurations can be entered in any order in a single commit.


Failed-authentication username display

A failed-authentication username display feature is a logging feature that

  • records the entered username in failed-authentication system logs for SSH and Telnet login attempts

  • is disabled by default, causing the system to log the username as unknown for these attempts, and

  • when enabled, displays the entered username for unsuccessful SSH and Telnet login attempts in the logs.

Feature history

Table 1. Feature History Table

Feature Name

Release Information

Feature Description

Display Username for Failed Authentication for Telnet Protocols

Release 25.4.1

Introduced in this release on: Fixed Systems (8010 [ASIC: A100])(select variants only*)

*This feature is supported on:

  • 8011-32Y8L2H2FH

  • 8011-12G12X4Y-A/D

Display Username for Failed Authentication for Telnet Protocols

Release 25.1.1

Introduced in this release on: Fixed Systems (8700 [ASIC: K100], 8010 [ASIC: A100])(select variants only*)

*This feature is supported on:

  • 8712-MOD-M

  • 8011-4G24Y4H-I

Display Username for Failed Authentication for Telnet Protocols

Release 24.4.1

Introduced in this release on: Fixed Systems (8200 [ASIC: P100], 8700 [ASIC: P100])(select variants only*); Modular Systems (8800 [LC ASIC: P100])(select variants only*)

*This feature is supported on:

  • 8212-48FH-M

  • 8711-32FH-M

  • 88-LC1-36EH

  • 88-LC1-12TH24FH-E

  • 88-LC1-52Y8H-EM

Display Username for Failed Authentication for Telnet Protocols

Release 7.10.1

With this feature, we have enhanced the security of the routers and introduced better tracking functionality to the router.

The failed authentication sys log now displays the details of users who tried to log in but failed due to authentication failure.

With this feature provisioned, the router can now display the user ID of both SSH and Telnet protocols.

In earlier releases, this feature was available only for SSH protocols.

This feature introduces the following change:

CLI: aaa display-login-failed-users .

YANG DATA Model: New XPaths for Cisco-IOS-XR-um-aaa-task-user-cfg (see Github, YANG Data Models Navigator)

Additional reference information

Effective with Cisco IOS XR Software Release 7.10.1, you can track the username of users whose login attempts failed in the failed authentication system logs. Prior to this release, the feature was only available for SSH clients; now, it is available for both SSH and Telnet clients.

Default behavior: By default, the feature is disabled. When disabled, failed authentication sys logs display the username as unknown for both SSH and Telnet. When enabled, failed authentication sys logs display the username of the users who attempted but failed to log in.

To enable this feature, use the aaa display-login-failed-users command in XR Config mode.


Enable display of username for failed authentication

Record the username in system logs when SSH or Telnet authentication fails, allowing you to identify which user attempted to log in unsuccessfully.

By default, failed-authentication logs display the username as unknown for SSH and Telnet clients.

Before you begin

Use XR Config mode to enable the username display feature.

Procedure

  1. Enable username display for failed authentication.

    Example:

    Router#conf
    Router(config)#aaa display-login-failed-users
    Router(config)#commit
  2. Review the running configuration.

    Example:

    Router# show run aaa display-login-failed-users
    !
    aaa display-login-failed-users
    !
  3. Verify the failed-authentication system logs.

    Example:

    RP/0/RP0/CPU0:Jul 18 14:46:31.590 UTC: exec[66608]:
    %SECURITY-LOGIN-4-AUTHEN_FAILED : Failed authentication attempt by
    user lab  from 'console' on 'con0_RP0_CPU0'

    Example:

    RP/0/RP0/CPU0:Jul 18 14:47:51.590 UTC: ssh_syslog_proxy[1216]:
    %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[13519]: Failed authentication/pam
    for lab  from 192.168.122.1 port 44822 ssh2

    This section shows example from sys logs where the user name is displayed for failed authentication after the configuration of this feature.

    RP/0/RP0/CPU0:Jul 18 14:46:31.590 UTC: exec[66608]:
    %SECURITY-LOGIN-4-AUTHEN_FAILED : Failed authentication attempt by
    user lab  from 'console' on 'con0_RP0_CPU0'
    RP/0/RP0/CPU0:Jul 18 14:47:51.590 UTC: ssh_syslog_proxy[1216]:
    %SECURITY-SSHD_SYSLOG_PRX-6-INFO_GENERAL : sshd[13519]: Failed authentication/pam
    for lab  from 192.168.122.1 port 44822 ssh2

Failed-authentication system logs now display the username that was entered during unsuccessful login attempts.


Consecutive-character password restrictions

A consecutive-character password policy is a AAA password policy rule that

  • rejects local user passwords and secrets containing a configured sequence length from alphabets, QWERTY keyboard characters, or numbers

  • applies only to locally configured users and not to users on remote AAA servers, and

  • can restrict cyclic wrapping sequences such as "yzab", "opqw", or "9012".

Feature history

Table 2. Feature History Table

Feature Name

Release Information

Feature Description

Password Policy to Restrict Consecutive Characters

Release 25.4.1

Introduced in this release on: Fixed Systems (8010 [ASIC: A100])(select variants only*)

*This feature is supported on:

  • 8011-32Y8L2H2FH

  • 8011-12G12X4Y-A/D

Password Policy to Restrict Consecutive Characters

Release 25.1.1

Introduced in this release on: Fixed Systems (8700 [ASIC: K100], 8010 [ASIC: A100])(select variants only*)

*This feature is supported on:

  • 8712-MOD-M

  • 8011-4G24Y4H-I

Password Policy to Restrict Consecutive Characters

Release 24.4.1

Introduced in this release on: Fixed Systems (8200 [ASIC: P100], 8700 [ASIC: P100])(select variants only*); Modular Systems (8800 [LC ASIC: P100])(select variants only*)

*This feature is supported on:

  • 8212-48FH-M

  • 8711-32FH-M

  • 88-LC1-36EH

  • 88-LC1-12TH24FH-E

  • 88-LC1-52Y8H-EM

Password Policy to Restrict Consecutive Characters

Release 7.7.1

We have enhanced the router security by enforcing a strong password policy for all users configured on the router. You can now specify a new password policy for the user that restricts the usage of a specific number of consecutive characters for the login passwords. These characters include English alphabets, the sequence of QWERTY keyboard layout, and numbers, such as, 'abcd', 'qwer', '1234', and so on. Apart from passwords, the feature is also applicable for secrets–the one-way encrypted secure login passwords that are not easy to decrypt to retrieve the original unencrypted password text.

The password policy is applicable only for the users configured on the local AAA server on the router; not those configured on the remote AAA server.

The feature introduces the restrict-consecutive-characters command.

Valid and invalid consecutive-character examples

Most users tend to create passwords or secrets using consecutive characters, making them easier to remember yet susceptible to security attacks. From Cisco IOS XR Software Release 7.7.1 and later, you can enhance user password security by defining a policy that restricts sequences of consecutive characters from English alphabets, QWERTY keyboard layout, and numbers (examples: "abcd", "qwer", "zyxw", "1234"). Cyclic wrapping, such as "yzab" or "9012," can also be restricted. You can specify the number of consecutive characters to restrict.

Key aspects:

  • The feature is disabled, by default.

  • The security administrator must have write permission for AAA tasks to create password policies.

  • Password policies are applicable only to locally configured users, not remote AAA server users.

This table depicts the examples of valid and invalid passwords and secrets when the password policy to restrict consecutive characters (say, 4 in this example) is in place.

Valid and invalid passwords

Table 3. Table

Use Case

Examples of Invalid Password or Secret

Examples of Valid Password or Secret

4 consecutive English alphabets

AbcD, ABCD, TestPQRS, DcbA, TestZYxW123, DCBA, ihgf

AbcPqR, Xyzdef,

Yzab, zabC

4 consecutive English alphabets and decimal numbers from QWERTY keyboard layout

Qwer, QWER, Mnbv, aQwerm, Test1234, TestT7890, 5678, fghj

Opas, xzLk, sapo, saqw3210, Test9012

Restrict 4 consecutive English alphabets along with cyclic wrapping

Yzab, TestYZAB, zabc

1234, Qwer, QWER, Mnbv, aQwerm, Test1234, TestT0987

Restrict 4 consecutive English alphabets and numbers from QWERTY keyboard layout along with cyclic wrapping

9012, 8901, Test3210, TestT0987, Opqw, klas, dsal, Cxzm, nmzx

AbcD, ABCD, Yzab, TestYZAB, zabc


Configure consecutive-character restrictions for user passwords and secrets

Enhance local password security by preventing passwords and secrets from using easily guessed consecutive character sequences.

Use the restrict-consecutive-characters command in AAA password policy configuration mode to restrict consecutive English-alphabet, QWERTY-keyboard, or number sequences. Optionally, include the cyclic-wrap keyword to prevent cyclic wrapping. After creating password policies, apply them explicitly to user profiles.

Before you begin

Create the password policy before you apply it to a user profile.

Procedure

  1. Configure the consecutive-character restrictions in the AAA password policy.

    Example:

    Router(config)#aaa password-policy test-policy
    Router(config-pp)#restrict-consecutive-characters english-alphabet 4
    Router(config-pp)#restrict-consecutive-characters qwerty-keyboard 5

    (Optional) Restrict cyclic wrapping of characters and numbers.

    Example:

    Router(config-pp)#restrict-consecutive-characters english-alphabet 4 cyclic-wrap
    Router(config-pp)#restrict-consecutive-characters qwerty-keyboard 5 cyclic-wrap
  2. Apply the password policy to a user profile.

    Example:

    Router(config)#username user1
    Router(config-un)#policy test-policy
    Router(config-un)#commit
  3. Review the consecutive-character restrictions in the running configuration.

    Example:

    Router(config-pp)#show running-config aaa password-policy
    Tue May 17 10:53:16.532 UTC
    
    !
    aaa password-policy test-policy
     restrict-consecutive-characters qwerty-keyboard 6
     restrict-consecutive-characters english-alphabet 4 cyclic-wrap
    !

    This is a sample running configuration that shows that you have configured a AAA password policy that restricts six consecutive characters from the QWERTY keyboard, and cyclic wrapping of four consecutive English alphabets.

  4. Verify the consecutive-character restriction.

    Example:

    Router#show aaa password-policy test-policy
    Tue May 17 10:54:24.064 UTC
    Password Policy Name : test-policy
      Number of Users : 0
      Minimum Length : 2
      Maximum Length : 253
      Special Character Len : 0
      Uppercase Character Len : 0
      Lowercase Character Len : 0
      Numeric Character Len : 0
      Policy Life Time :
        seconds : 0
        minutes : 0
        hours : 0
        days : 0
        months : 0
        years : 0
      Warning Interval :
        seconds : 0
        minutes : 0
        hours : 0
        days : 0
        months : 0
        years : 0
      Lockout Time :
        seconds : 0
        minutes : 0
        hours : 0
        days : 0
        months : 0
        years : 0
      Restrict Old Time :
        days : 0
        months : 0
        years : 0
      Character Change Len : 2
      Maximum Failure Attempts : 0
      Reference Count : 0
      Error Count : 0
      Lockout Count Attempts : 0
      Maximum char repetition : 0
      Restrict Old count : 0
      Restrict Username : 0
      Restrict Username Reverse  : 0
      Restrict Password Reverse  : 0
      Restrict Password Advanced : 0
      Restrict Consecutive Character :
        English Alphabet characters: 4
        English Alphabet Cyclic Wrap: True
        Qwerty Keyboard characters: 6
        Qwerty Keyboard Cyclic Wrap: False
    Router#

    Example:

    Router(config)#username user1
    Router(config-un)#policy test-policy
    Router(config-un)#password DEFg
    Router(config-un)#commit
    Tue Dec  7 10:17:56.843 UTC
    
    % Failed to commit and rollback one or more configuration items. Please issue 'show configuration failed [inheritance]' from this session to view the errors
    Router(config-un)#show  configuration failed
    username user1
     password 7 03205E0D01
    !!% 'LOCALD' detected the 'fatal' condition 'Password contains consecutive characters from qwerty keyboard or English alphabet'
    !
    End

    Example:

    Router(config)#username user1
    RP/0/RP0/CPU0:ios(config-un)#masked-secret
    Fri Dec  3 12:33:44.354 UTC
    
    Enter secret:
    Re-enter secret:
    
    secret is not compliant with policy to restrict consecutive letters or numbers
    RP/0/RP0/CPU0:ios(config-un)#

    Example:

    Router(config)#username user1
    Router(config-un)#policy test-policy
    Router(config-un)#secret qwerty
                                        ^
    % Invalid input detected at '^' marker.
    Router(config-un)#

    You can use the show aaa password-policy command to know if the feature to restrict consecutive characters for user passwords and secrets is applied on the password policy.

    Password or Secret Configuration Failure Scenarios:

    You notice these logs or error messages on the router console when password or secret configuration fails because of the policy violation to restrict consecutive characters or numbers:

  5. (Optional) Configure the consecutive-character restriction with the YANG data model.

    Example:

    <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
     <edit-config>
     <target>
    <candidate/>
    </target>
     <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
     <aaa xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-lib-cfg">
    <password-policies xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-locald-cfg">
    <password-policy>
         <name>test-policy</name>
         <restrict-consecutive-characters>
          <qwerty-keyboard>
           <characters>4</characters>
    	<cyclic-wrap></cyclic-wrap>
          </qwerty-keyboard>
          <english-alphabet>
           <characters>4</characters>
           <cyclic-wrap></cyclic-wrap>
          </english-alphabet>
    </restrict-consecutive-characters>
    </password-policy>
    </password-policies>
    </aaa>
    </config>
    </edit-config>
    </rpc>
    ##

    You can use the Cisco-IOS-XR-aaa-locald-cfg native YANG data model to restrict consecutive characters for user passwords and secrets. Cisco-IOS-XR-um-aaa-locald-cfg is the corresponding unified model (UM).

    The following is a sample format to enable the feature using the native YANG data model.

    To learn more about the data models and to put them to use, see the Programmability Configuration Guide for Cisco 8000 Series Routers.

The password policy rejects any password or secret values that contain the configured consecutive-character sequence, helping protect user credentials from predictable patterns.