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 Tue 2024-04-23 17:24:43 UTC, end at Tue 2024-04-23 17:24:44 UTC. -- Apr 23 17:24:43.291771 osdx systemd-journald[567]: Runtime journal (/run/log/journal/6df91b3cebc34c1981199ddec73128ac) is 2.0M, max 16.0M, 14.0M free. Apr 23 17:24:43.300106 osdx OSDxCLI[12455]: User 'admin' executed a new command: 'system journal clear'. Apr 23 17:24:43.522736 osdx OSDxCLI[12455]: User 'admin' entered the configuration menu. Apr 23 17:24:43.582595 osdx OSDxCLI[12455]: User 'admin' added a new cfg line: 'set system console log-level info'. Apr 23 17:24:43.689646 osdx OSDxCLI[12455]: User 'admin' added a new cfg line: 'set system strong-password level 0'. Apr 23 17:24:43.747792 osdx OSDxCLI[12455]: User 'admin' added a new cfg line: 'set system strong-password display'. Apr 23 17:24:43.798197 osdx zebra[1124]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Apr 23 17:24:43.847383 osdx modulelauncher[888]: + Received data: ['12455', 'osdx.utils.xos', 'set_console_log_level', 'info'] Apr 23 17:24:43.853304 osdx OSDxCLI[12455]: Signal 10 received Apr 23 17:24:43.853663 osdx cfgd[1182]: [12455]Completed change to active configuration Apr 23 17:24:43.855766 osdx OSDxCLI[12455]: User 'admin' committed the configuration. Apr 23 17:24:43.872267 osdx OSDxCLI[12455]: User 'admin' left the configuration menu. Apr 23 17:24:44.036322 osdx OSDxCLI[12455]: pam_unix(cli:session): session opened for user admin by admin(uid=1000) Apr 23 17:24:44.036724 osdx OSDxCLI[12455]: pam_unix(cli:session): session closed for user admin Apr 23 17:24:44.036869 osdx OSDxCLI[12455]: User 'admin' entered the configuration menu. Apr 23 17:24:44.097392 osdx OSDxCLI[12455]: pam_unix(cli:session): session opened for user admin by admin(uid=1000) Apr 23 17:24:44.107297 osdx OSDxCLI[12455]: pam_unix(cli:session): session closed for user admin Apr 23 17:24:44.107449 osdx OSDxCLI[12455]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 qwER43@!'. Apr 23 17:24:44.199010 osdx OSDxCLI[12455]: pam_unix(cli:session): session opened for user admin by admin(uid=1000) Apr 23 17:24:44.217175 osdx WARNING[18125]: Short keyboard patterns are easy to guess. Apr 23 17:24:44.217467 osdx INFO[18125]: Suggestions: Apr 23 17:24:44.217528 osdx INFO[18125]: Add another word or two. Uncommon words are better. Apr 23 17:24:44.217576 osdx INFO[18125]: Use a longer keyboard pattern with more turns. Apr 23 17:24:44.217622 osdx INFO[18125]: Crack times (passwords per time): Apr 23 17:24:44.217670 osdx INFO[18125]: 100 per hour: centuries Apr 23 17:24:44.217714 osdx INFO[18125]: 10 per second: 3.0 months Apr 23 17:24:44.217765 osdx INFO[18125]: 10.000 per second: 3.0 hours Apr 23 17:24:44.217813 osdx INFO[18125]: 10.000.000.000 per second: less than a second Apr 23 17:24:44.238959 osdx systemd[1]: Starting Network Time Service... Apr 23 17:24:44.244453 osdx ntpd[18132]: ntpd 4.2.8p12@1.3728-o (1): Starting Apr 23 17:24:44.244637 osdx ntpd[18132]: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 109:112 Apr 23 17:24:44.244896 osdx systemd[1]: Started Network Time Service. Apr 23 17:24:44.246313 osdx cfgd[1182]: [12455]Completed change to active configuration Apr 23 17:24:44.248711 osdx ntpd[18138]: proto: precision = 0.039 usec (-25) Apr 23 17:24:44.249035 osdx ntpd[18138]: Listen and drop on 0 v6wildcard [::]:123 Apr 23 17:24:44.249084 osdx ntpd[18138]: Listen and drop on 1 v4wildcard 0.0.0.0:123 Apr 23 17:24:44.249378 osdx ntpd[18138]: Listen normally on 2 lo 127.0.0.1:123 Apr 23 17:24:44.249426 osdx ntpd[18138]: Listen normally on 3 lo [::1]:123 Apr 23 17:24:44.249466 osdx ntpd[18138]: Listening on routing socket on fd #20 for interface updates Apr 23 17:24:44.249501 osdx ntpd[18138]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Apr 23 17:24:44.249536 osdx ntpd[18138]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized Apr 23 17:24:44.250495 osdx OSDxCLI[12455]: pam_unix(cli:session): session closed for user admin Apr 23 17:24:44.250685 osdx OSDxCLI[12455]: User 'admin' committed the configuration. Apr 23 17:24:44.271825 osdx OSDxCLI[12455]: User 'admin' left the configuration menu. Apr 23 17:24:44.399337 osdx OSDxCLI[12455]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)