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 2024-06-20 18:33:25 UTC, end at Thu 2024-06-20 18:33:28 UTC. --
Jun 20 18:33:25.393113 osdx systemd-journald[1713]: Runtime journal (/run/log/journal/4bdaa9d5a32b43918ba3b0d5647305f4) is 2.0M, max 16.0M, 14.0M free.
Jun 20 18:33:25.419534 osdx OSDxCLI[22789]: User 'admin' executed a new command: 'system journal clear'.
Jun 20 18:33:26.050406 osdx osdx-coredump[1478]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Jun 20 18:33:26.061832 osdx OSDxCLI[22789]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 20 18:33:26.939925 osdx OSDxCLI[22789]: User 'admin' entered the configuration menu.
Jun 20 18:33:27.062809 osdx OSDxCLI[22789]: User 'admin' added a new cfg line: 'set system console log-level info'.
Jun 20 18:33:27.154139 osdx OSDxCLI[22789]: User 'admin' added a new cfg line: 'set system strong-password level 0'.
Jun 20 18:33:27.280980 osdx OSDxCLI[22789]: User 'admin' added a new cfg line: 'set system strong-password display'.
Jun 20 18:33:27.397293 osdx modulelauncher[1181]: + Received data: ['22789', 'osdx.utils.xos', 'set_console_log_level', 'info']
Jun 20 18:33:27.410486 osdx OSDxCLI[22789]: Signal 10 received
Jun 20 18:33:27.419700 osdx ifmon[1188]: Changed log-level to info
Jun 20 18:33:27.420267 osdx cfgd[1341]: [22789]Completed change to active configuration
Jun 20 18:33:27.425263 osdx OSDxCLI[22789]: User 'admin' committed the configuration.
Jun 20 18:33:27.457605 osdx OSDxCLI[22789]: User 'admin' left the configuration menu.
Jun 20 18:33:27.802658 osdx OSDxCLI[22789]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Jun 20 18:33:27.803377 osdx OSDxCLI[22789]: pam_unix(cli:session): session closed for user admin
Jun 20 18:33:27.803832 osdx OSDxCLI[22789]: User 'admin' entered the configuration menu.
Jun 20 18:33:27.928167 osdx OSDxCLI[22789]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Jun 20 18:33:27.928613 osdx cfgd[1341]: Execute action [syntax] for node [(null)]
Jun 20 18:33:27.928816 osdx cfgd[1341]: Execute action [syntax] for node [(null)]
Jun 20 18:33:27.945385 osdx OSDxCLI[22789]: pam_unix(cli:session): session closed for user admin
Jun 20 18:33:27.945807 osdx OSDxCLI[22789]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 qwER43@!'.
Jun 20 18:33:28.057150 osdx OSDxCLI[22789]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Jun 20 18:33:28.063149 osdx cfgd[1341]: [22789]must validation for [system login user admin role] was skipped
Jun 20 18:33:28.087663 osdx WARNING[1526]: Short keyboard patterns are easy to guess.
Jun 20 18:33:28.087749 osdx INFO[1526]: Suggestions:
Jun 20 18:33:28.087807 osdx INFO[1526]:   Add another word or two. Uncommon words are better.
Jun 20 18:33:28.087858 osdx INFO[1526]:   Use a longer keyboard pattern with more turns.
Jun 20 18:33:28.087903 osdx INFO[1526]: Crack times (passwords per time):
Jun 20 18:33:28.087952 osdx INFO[1526]:   100 per hour:              centuries
Jun 20 18:33:28.088000 osdx INFO[1526]:   10 per second:             3.0 months
Jun 20 18:33:28.088047 osdx INFO[1526]:   10.000 per second:         3.0 hours
Jun 20 18:33:28.088094 osdx INFO[1526]:   10.000.000.000 per second: less than a second
Jun 20 18:33:28.093993 osdx cfgd[1341]: Execute action [end] for node [system ntp]
Jun 20 18:33:28.115577 osdx systemd[1]: Starting Network Time Service...
Jun 20 18:33:28.119516 osdx ntpd[1534]: INIT: ntpd ntpsec-1.2.0+ 2024-04-15T12:00:00Z (git rev c695a58): Starting
Jun 20 18:33:28.119799 osdx ntp-systemd-wrapper[1533]: 2024-06-20T18:33:28 ntpd[1534]: INIT: ntpd ntpsec-1.2.0+ 2024-04-15T12:00:00Z (git rev c695a58): Starting
Jun 20 18:33:28.119799 osdx ntp-systemd-wrapper[1533]: 2024-06-20T18:33:28 ntpd[1534]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Jun 20 18:33:28.119540 osdx ntpd[1534]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Jun 20 18:33:28.120045 osdx systemd[1]: ntpsec.service: Can't open PID file /run/ntpd.pid (yet?) after start: No such file or directory
Jun 20 18:33:28.122639 osdx ntpd[1536]: INIT: precision = 0.053 usec (-24)
Jun 20 18:33:28.122905 osdx systemd[1]: Started Network Time Service.
Jun 20 18:33:28.123389 osdx ntpd[1536]: INIT: successfully locked into RAM
Jun 20 18:33:28.123405 osdx ntpd[1536]: CONFIG: readconfig: parsing file: /etc/ntpsec/ntp.conf
Jun 20 18:33:28.123438 osdx ntpd[1536]: AUTH: authreadkeys: reading /etc/ntp.keys
Jun 20 18:33:28.123454 osdx ntpd[1536]: AUTH: authreadkeys: added 1 keys
Jun 20 18:33:28.123499 osdx ntpd[1536]: INIT: Using SO_TIMESTAMPNS
Jun 20 18:33:28.123511 osdx ntpd[1536]: IO: Listen and drop on 0 v6wildcard [::]:123
Jun 20 18:33:28.123527 osdx ntpd[1536]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123
Jun 20 18:33:28.124016 osdx ntpd[1536]: IO: Listen normally on 2 lo 127.0.0.1:123
Jun 20 18:33:28.124044 osdx ntpd[1536]: IO: Listen normally on 3 lo [::1]:123
Jun 20 18:33:28.124065 osdx ntpd[1536]: IO: Listening on routing socket on fd #20 for interface updates
Jun 20 18:33:28.124073 osdx ntpd[1536]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes
Jun 20 18:33:28.124128 osdx ntpd[1536]: INIT: OpenSSL 1.1.1n  15 Mar 2022, 101010ef
Jun 20 18:33:28.124253 osdx ntpd[1536]: NTSc: Using system default root certificates.
Jun 20 18:33:28.124638 osdx cfgd[1341]: [22789]Completed change to active configuration
Jun 20 18:33:28.127894 osdx OSDxCLI[22789]: pam_unix(cli:session): session closed for user admin
Jun 20 18:33:28.128162 osdx OSDxCLI[22789]: User 'admin' committed the configuration.
Jun 20 18:33:28.168888 osdx OSDxCLI[22789]: User 'admin' left the configuration menu.
Jun 20 18:33:28.326599 osdx OSDxCLI[22789]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)