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 Thu 2023-11-23 23:38:46 UTC, end at Thu 2023-11-23 23:38:47 UTC. -- Nov 23 23:38:46.355710 osdx systemd-journald[619]: Runtime journal (/run/log/journal/1b38b2114cf0481baed8058b17ed7ac1) is 2.0M, max 16.0M, 14.0M free. Nov 23 23:38:46.374166 osdx OSDxCLI[10718]: User 'admin' executed a new command: 'system journal clear'. Nov 23 23:38:46.767558 osdx OSDxCLI[10718]: User 'admin' entered the configuration menu. Nov 23 23:38:46.885843 osdx OSDxCLI[10718]: User 'admin' added a new cfg line: 'set system console log-level info'. Nov 23 23:38:46.974758 osdx OSDxCLI[10718]: User 'admin' added a new cfg line: 'set system strong-password level 0'. Nov 23 23:38:47.092794 osdx OSDxCLI[10718]: User 'admin' added a new cfg line: 'set system strong-password display'. Nov 23 23:38:47.207578 osdx modulelauncher[934]: + Received data: ['10718', 'osdx.utils.xos', 'set_console_log_level', 'info'] Nov 23 23:38:47.218396 osdx OSDxCLI[10718]: Signal 10 received Nov 23 23:38:47.219186 osdx cfgd[1092]: [10718]Completed change to active configuration Nov 23 23:38:47.223434 osdx OSDxCLI[10718]: User 'admin' committed the configuration. Nov 23 23:38:47.248666 osdx OSDxCLI[10718]: User 'admin' left the configuration menu. Nov 23 23:38:47.455595 osdx OSDxCLI[10718]: pam_unix(cli:session): session opened for user admin by admin(uid=1000) Nov 23 23:38:47.456341 osdx OSDxCLI[10718]: pam_unix(cli:session): session closed for user admin Nov 23 23:38:47.456623 osdx OSDxCLI[10718]: User 'admin' entered the configuration menu. Nov 23 23:38:47.551813 osdx OSDxCLI[10718]: pam_unix(cli:session): session opened for user admin by admin(uid=1000) Nov 23 23:38:47.578766 osdx OSDxCLI[10718]: pam_unix(cli:session): session closed for user admin Nov 23 23:38:47.579031 osdx OSDxCLI[10718]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 qwER43@!'. Nov 23 23:38:47.647549 osdx OSDxCLI[10718]: pam_unix(cli:session): session opened for user admin by admin(uid=1000) Nov 23 23:38:47.666648 osdx ERROR[15147]: {'display': None, 'level': '0'} Nov 23 23:38:47.679606 osdx WARNING[15147]: Short keyboard patterns are easy to guess. Nov 23 23:38:47.679774 osdx INFO[15147]: Suggestions: Nov 23 23:38:47.679891 osdx INFO[15147]: Add another word or two. Uncommon words are better. Nov 23 23:38:47.679995 osdx INFO[15147]: Use a longer keyboard pattern with more turns. Nov 23 23:38:47.680095 osdx INFO[15147]: Crack times (passwords per time): Nov 23 23:38:47.680196 osdx INFO[15147]: 100 per hour: centuries Nov 23 23:38:47.680309 osdx INFO[15147]: 10 per second: 3.0 months Nov 23 23:38:47.680406 osdx INFO[15147]: 10.000 per second: 3.0 hours Nov 23 23:38:47.680503 osdx INFO[15147]: 10.000.000.000 per second: less than a second Nov 23 23:38:47.711393 osdx systemd[1]: Starting Network Time Service... Nov 23 23:38:47.719223 osdx ntpd[15154]: ntpd 4.2.8p12@1.3728-o (1): Starting Nov 23 23:38:47.719482 osdx ntpd[15154]: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 109:112 Nov 23 23:38:47.719867 osdx systemd[1]: Started Network Time Service. Nov 23 23:38:47.721758 osdx cfgd[1092]: [10718]Completed change to active configuration Nov 23 23:38:47.724934 osdx ntpd[15160]: proto: precision = 0.043 usec (-24) Nov 23 23:38:47.725459 osdx ntpd[15160]: Listen and drop on 0 v6wildcard [::]:123 Nov 23 23:38:47.725545 osdx ntpd[15160]: Listen and drop on 1 v4wildcard 0.0.0.0:123 Nov 23 23:38:47.726094 osdx ntpd[15160]: Listen normally on 2 lo 127.0.0.1:123 Nov 23 23:38:47.726187 osdx ntpd[15160]: Listen normally on 3 lo [::1]:123 Nov 23 23:38:47.726270 osdx ntpd[15160]: Listening on routing socket on fd #20 for interface updates Nov 23 23:38:47.726342 osdx ntpd[15160]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Nov 23 23:38:47.726413 osdx ntpd[15160]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Nov 23 23:38:47.727594 osdx OSDxCLI[10718]: pam_unix(cli:session): session closed for user admin Nov 23 23:38:47.727833 osdx OSDxCLI[10718]: User 'admin' committed the configuration. Nov 23 23:38:47.752253 osdx OSDxCLI[10718]: User 'admin' left the configuration menu. Nov 23 23:38:47.894481 osdx OSDxCLI[10718]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)