Strong Password

Test suite to check the OSDx password strong-password level

Test Strong Password

Description

A password strength level and a strong password are configured and then attempting to configure a weak password fails.

Scenario

Step 1: Set the following configuration in DUT0:

set system strong-password level 2
set system ntp authentication-key 1 md5 a<dqaz!3?sv

Note

This password has a score of 4.

Step 2: Expect a failure in the following command: Set the following configuration in DUT0:

set system ntp authentication-key 1 md5 12345678

Note

This password has a score of 0, which is lower than the strong-password level.


Test Password Display

Description

Check that additional information from the strong-password is displayed correctly

Scenario

Step 1: Set the following configuration in DUT0:

set system console log-level info
set system strong-password level 0
set system strong-password display

Step 2: Set the following configuration in DUT0:

set system ntp authentication-key 1 md5 qwER43@!

Step 3: Run command system journal show | tail -n 1000 at DUT0 and expect this output:

Show output
-- Logs begin at Mon 2023-10-30 13:32:02 UTC, end at Mon 2023-10-30 13:32:03 UTC. --
Oct 30 13:32:02.407281 osdx systemd-journald[629]: Runtime journal (/run/log/journal/3d151f703f7748e3bca150e5e3f65077) is 2.0M, max 16.0M, 14.0M free.
Oct 30 13:32:02.422413 osdx OSDxCLI[4505]: User 'admin' executed a new command: 'system journal clear'.
Oct 30 13:32:02.797137 osdx OSDxCLI[4505]: User 'admin' entered the configuration menu.
Oct 30 13:32:02.922751 osdx OSDxCLI[4505]: User 'admin' added a new cfg line: 'set system console log-level info'.
Oct 30 13:32:03.024231 osdx OSDxCLI[4505]: User 'admin' added a new cfg line: 'set system strong-password level 0'.
Oct 30 13:32:03.154978 osdx OSDxCLI[4505]: User 'admin' added a new cfg line: 'set system strong-password display'.
Oct 30 13:32:03.262925 osdx modulelauncher[935]: + Received data: ['4505', 'osdx.utils.xos', 'set_console_log_level', 'info']
Oct 30 13:32:03.275615 osdx OSDxCLI[4505]: Signal 10 received
Oct 30 13:32:03.276430 osdx cfgd[1093]: [4505]Completed change to active configuration
Oct 30 13:32:03.281337 osdx OSDxCLI[4505]: User 'admin' committed the configuration.
Oct 30 13:32:03.309472 osdx OSDxCLI[4505]: User 'admin' left the configuration menu.
Oct 30 13:32:03.516458 osdx OSDxCLI[4505]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Oct 30 13:32:03.517204 osdx OSDxCLI[4505]: pam_unix(cli:session): session closed for user admin
Oct 30 13:32:03.517492 osdx OSDxCLI[4505]: User 'admin' entered the configuration menu.
Oct 30 13:32:03.611763 osdx OSDxCLI[4505]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Oct 30 13:32:03.635652 osdx OSDxCLI[4505]: pam_unix(cli:session): session closed for user admin
Oct 30 13:32:03.635913 osdx OSDxCLI[4505]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 qwER43@!'.
Oct 30 13:32:03.704779 osdx OSDxCLI[4505]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Oct 30 13:32:03.728305 osdx ERROR[11029]: {'display': None, 'level': '0'}
Oct 30 13:32:03.742863 osdx WARNING[11029]: Short keyboard patterns are easy to guess.
Oct 30 13:32:03.743023 osdx INFO[11029]: Suggestions:
Oct 30 13:32:03.743131 osdx INFO[11029]:   Add another word or two. Uncommon words are better.
Oct 30 13:32:03.743233 osdx INFO[11029]:   Use a longer keyboard pattern with more turns.
Oct 30 13:32:03.743338 osdx INFO[11029]: Crack times (passwords per time):
Oct 30 13:32:03.743441 osdx INFO[11029]:   100 per hour:              centuries
Oct 30 13:32:03.743538 osdx INFO[11029]:   10 per second:             3.0 months
Oct 30 13:32:03.743634 osdx INFO[11029]:   10.000 per second:         3.0 hours
Oct 30 13:32:03.743730 osdx INFO[11029]:   10.000.000.000 per second: less than a second
Oct 30 13:32:03.776015 osdx systemd[1]: Starting Network Time Service...
Oct 30 13:32:03.786852 osdx ntpd[11036]: ntpd 4.2.8p12@1.3728-o (1): Starting
Oct 30 13:32:03.787196 osdx ntpd[11036]: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 109:112
Oct 30 13:32:03.787749 osdx systemd[1]: Started Network Time Service.
Oct 30 13:32:03.790370 osdx cfgd[1093]: [4505]Completed change to active configuration
Oct 30 13:32:03.793638 osdx ntpd[11042]: proto: precision = 0.073 usec (-24)
Oct 30 13:32:03.795611 osdx ntpd[11042]: Listen and drop on 0 v6wildcard [::]:123
Oct 30 13:32:03.795728 osdx ntpd[11042]: Listen and drop on 1 v4wildcard 0.0.0.0:123
Oct 30 13:32:03.796452 osdx ntpd[11042]: Listen normally on 2 lo 127.0.0.1:123
Oct 30 13:32:03.796574 osdx ntpd[11042]: Listen normally on 3 lo [::1]:123
Oct 30 13:32:03.796715 osdx ntpd[11042]: Listening on routing socket on fd #20 for interface updates
Oct 30 13:32:03.796813 osdx ntpd[11042]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Oct 30 13:32:03.796909 osdx ntpd[11042]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
Oct 30 13:32:03.798451 osdx OSDxCLI[4505]: pam_unix(cli:session): session closed for user admin
Oct 30 13:32:03.798703 osdx OSDxCLI[4505]: User 'admin' committed the configuration.
Oct 30 13:32:03.823059 osdx OSDxCLI[4505]: User 'admin' left the configuration menu.
Oct 30 13:32:03.968170 osdx OSDxCLI[4505]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)