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 login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system ntp authentication-key 1 encrypted-key U2FsdGVkX18gDsW9GicYMWMQes9DCaEgzAA40IVA4M0=
set system strong-password level 2

Note

This password has a score of 4.

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

set system ntp authentication-key 1 encrypted-key U2FsdGVkX18gDsW9GicYMckioSXoJbj4Jpf2yBrJMzs=

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 cli configuration logging global info
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system strong-password display
set system strong-password level 0

Step 2: Modify the following configuration lines in DUT0 :

set system ntp authentication-key 1 encrypted-key U2FsdGVkX1816rm/zlfNgyLnlR5tjVOZrlTHMGcb8zg=

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

Show output
May 13 16:14:27.300912 osdx systemd-journald[1677]: Runtime Journal (/run/log/journal/29acf74054db4c3a94b562797c4c13a9) is 2.3M, max 15.3M, 12.9M free.
May 13 16:14:27.302908 osdx systemd-journald[1677]: Received client request to rotate journal, rotating.
May 13 16:14:27.302971 osdx systemd-journald[1677]: Vacuuming done, freed 0B of archived journals from /run/log/journal/29acf74054db4c3a94b562797c4c13a9.
May 13 16:14:27.312330 osdx OSDxCLI[1792]: User 'admin' executed a new command: 'system journal clear'.
May 13 16:14:27.690433 osdx osdx-coredump[14258]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
May 13 16:14:27.700860 osdx OSDxCLI[1792]: User 'admin' executed a new command: 'system coredump delete all'.
May 13 16:14:28.190418 osdx OSDxCLI[1792]: User 'admin' entered the configuration menu.
May 13 16:14:28.251325 osdx OSDxCLI[1792]: User 'admin' added a new cfg line: 'set system console log-level info'.
May 13 16:14:28.347749 osdx OSDxCLI[1792]: User 'admin' added a new cfg line: 'set system strong-password level 0'.
May 13 16:14:28.404176 osdx OSDxCLI[1792]: User 'admin' added a new cfg line: 'set system strong-password display'.
May 13 16:14:28.517452 osdx OSDxCLI[1792]: User 'admin' added a new cfg line: 'show working'.
May 13 16:14:28.576583 osdx ubnt-cfgd[14273]: inactive
May 13 16:14:28.597110 osdx INFO[14281]: FRR daemons did not change
May 13 16:14:28.598105 osdx modulelauncher[1277]: + Received data: ['1792', 'osdx.utils.xos', 'set_console_log_level', 'info']
May 13 16:14:28.621397 osdx OSDxCLI[1792]: Signal 10 received
May 13 16:14:28.635563 osdx cfgd[1470]: [1792]Completed change to active configuration
May 13 16:14:28.637470 osdx OSDxCLI[1792]: User 'admin' committed the configuration.
May 13 16:14:28.656277 osdx OSDxCLI[1792]: User 'admin' left the configuration menu.
May 13 16:14:28.823973 osdx OSDxCLI[1792]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 13 16:14:28.824698 osdx OSDxCLI[1792]: pam_unix(cli:session): session closed for user admin
May 13 16:14:28.825237 osdx OSDxCLI[1792]: User 'admin' entered the configuration menu.
May 13 16:14:28.885680 osdx OSDxCLI[1792]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 13 16:14:28.886030 osdx cfgd[1470]: Execute action [syntax] for node [system ntp authentication-key 1]
May 13 16:14:28.898777 osdx OSDxCLI[1792]: pam_unix(cli:session): session closed for user admin
May 13 16:14:28.899117 osdx OSDxCLI[1792]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 ******'.
May 13 16:14:28.983229 osdx OSDxCLI[1792]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 13 16:14:28.991488 osdx OSDxCLI[1792]: pam_unix(cli:session): session closed for user admin
May 13 16:14:28.991789 osdx OSDxCLI[1792]: User 'admin' added a new cfg line: 'show changes'.
May 13 16:14:29.042592 osdx OSDxCLI[1792]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
May 13 16:14:29.050947 osdx ubnt-cfgd[14307]: inactive
May 13 16:14:29.061123 osdx cfgd[1470]: [1792]must validation for [system strong-password] was skipped
May 13 16:14:29.061178 osdx cfgd[1470]: [1792]must validation for [system login user admin role] was skipped
May 13 16:14:29.072949 osdx WARNING[14313]: Short keyboard patterns are easy to guess.
May 13 16:14:29.073198 osdx INFO[14313]: Suggestions:
May 13 16:14:29.073260 osdx INFO[14313]:   Add another word or two. Uncommon words are better.
May 13 16:14:29.073311 osdx INFO[14313]:   Use a longer keyboard pattern with more turns.
May 13 16:14:29.073354 osdx INFO[14313]: Crack times (passwords per time):
May 13 16:14:29.073395 osdx INFO[14313]:   100 per hour:              centuries
May 13 16:14:29.073437 osdx INFO[14313]:   10 per second:             3 months
May 13 16:14:29.073509 osdx INFO[14313]:   10.000 per second:         3 hours
May 13 16:14:29.073555 osdx INFO[14313]:   10.000.000.000 per second: less than a second
May 13 16:14:29.078005 osdx INFO[14315]: FRR daemons did not change
May 13 16:14:29.078379 osdx cfgd[1470]: Execute action [end] for node [system ntp]
May 13 16:14:29.127182 osdx systemd[1]: Starting ntpsec.service - Network Time Service...
May 13 16:14:29.134341 osdx ntpd[14322]: INIT: ntpd ntpsec-1.2.2+1-gc8a7dda: Starting
May 13 16:14:29.134528 osdx ntp-systemd-wrapper[14322]: 2025-05-13T16:14:29 ntpd[14322]: INIT: ntpd ntpsec-1.2.2+1-gc8a7dda: Starting
May 13 16:14:29.134573 osdx ntpd[14322]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
May 13 16:14:29.134606 osdx ntp-systemd-wrapper[14322]: 2025-05-13T16:14:29 ntpd[14322]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
May 13 16:14:29.135175 osdx systemd[1]: Started ntpsec.service - Network Time Service.
May 13 16:14:29.136081 osdx cfgd[1470]: [1792]Completed change to active configuration
May 13 16:14:29.137488 osdx ntpd[14324]: INIT: precision = 0.066 usec (-24)
May 13 16:14:29.138033 osdx ntpd[14324]: INIT: successfully locked into RAM
May 13 16:14:29.138046 osdx ntpd[14324]: CONFIG: readconfig: parsing file: /etc/ntpsec/ntp.conf
May 13 16:14:29.138085 osdx ntpd[14324]: AUTH: authreadkeys: reading /etc/ntp.keys
May 13 16:14:29.138274 osdx ntpd[14324]: AUTH: authreadkeys: added 1 keys
May 13 16:14:29.138317 osdx ntpd[14324]: INIT: Using SO_TIMESTAMPNS(ns)
May 13 16:14:29.138328 osdx ntpd[14324]: IO: Listen and drop on 0 v6wildcard [::]:123
May 13 16:14:29.138343 osdx ntpd[14324]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123
May 13 16:14:29.138470 osdx OSDxCLI[1792]: pam_unix(cli:session): session closed for user admin
May 13 16:14:29.138734 osdx ntpd[14324]: IO: Listen normally on 2 lo 127.0.0.1:123
May 13 16:14:29.138761 osdx ntpd[14324]: IO: Listen normally on 3 lo [::1]:123
May 13 16:14:29.138782 osdx ntpd[14324]: IO: Listening on routing socket on fd #20 for interface updates
May 13 16:14:29.138789 osdx ntpd[14324]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes
May 13 16:14:29.138838 osdx OSDxCLI[1792]: User 'admin' committed the configuration.
May 13 16:14:29.138842 osdx ntpd[14324]: INIT: Built with OpenSSL 3.0.14 4 Jun 2024, 300000e0
May 13 16:14:29.138846 osdx ntpd[14324]: INIT: Running with OpenSSL 3.0.15 3 Sep 2024, 300000f0
May 13 16:14:29.139671 osdx ntpd[14324]: NTSc: Using system default root certificates.
May 13 16:14:29.162891 osdx OSDxCLI[1792]: User 'admin' left the configuration menu.
May 13 16:14:29.286691 osdx OSDxCLI[1792]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)