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 U2FsdGVkX1+R/RW/HJkA+He+s73NmzNUjsNsLAvEbMs=
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 U2FsdGVkX1+R/RW/HJkA+Mc+BifmADgsxJnteclE3PI=

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 U2FsdGVkX1/xeECzlkyhRvSHdLC4F8yToSJH0E2VCyI=

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

Show output
Oct 30 13:14:16.296918 osdx systemd-journald[1923]: Runtime Journal (/run/log/journal/877522c656344df9b9ad28416f5f036f) is 2.3M, max 15.3M, 12.9M free.
Oct 30 13:14:16.297371 osdx systemd-journald[1923]: Received client request to rotate journal, rotating.
Oct 30 13:14:16.297406 osdx systemd-journald[1923]: Vacuuming done, freed 0B of archived journals from /run/log/journal/877522c656344df9b9ad28416f5f036f.
Oct 30 13:14:16.306270 osdx zebra[1601]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
Oct 30 13:14:16.306407 osdx OSDxCLI[339852]: User 'admin' executed a new command: 'system journal clear'.
Oct 30 13:14:16.644585 osdx osdx-coredump[341196]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Oct 30 13:14:16.653188 osdx OSDxCLI[339852]: User 'admin' executed a new command: 'system coredump delete all'.
Oct 30 13:14:17.150024 osdx OSDxCLI[339852]: User 'admin' entered the configuration menu.
Oct 30 13:14:17.213706 osdx OSDxCLI[339852]: User 'admin' added a new cfg line: 'set system console log-level info'.
Oct 30 13:14:17.313533 osdx OSDxCLI[339852]: User 'admin' added a new cfg line: 'set system strong-password level 0'.
Oct 30 13:14:17.376280 osdx OSDxCLI[339852]: User 'admin' added a new cfg line: 'set system strong-password display'.
Oct 30 13:14:17.476075 osdx ERROR[341204]: unexpected
                                           Traceback (most recent call last):
                                             File "osdx/bin/op/fan_control.py", line 23, in _send_fan_control_cmd
                                           FileNotFoundError: [Errno 2] No such file or directory
Oct 30 13:14:17.477754 osdx OSDxCLI[339852]: User 'admin' added a new cfg line: 'show working'.
Oct 30 13:14:17.543933 osdx modulelauncher[1476]: + Received data: ['339852', 'osdx.utils.xos', 'set_console_log_level', 'info']
Oct 30 13:14:17.558495 osdx OSDxCLI[339852]: Signal 10 received
Oct 30 13:14:17.567248 osdx ifmon[1478]: Changed log-level to info
Oct 30 13:14:17.567843 osdx cfgd[1636]: [339852]Completed change to active configuration
Oct 30 13:14:17.569719 osdx OSDxCLI[339852]: User 'admin' committed the configuration.
Oct 30 13:14:17.600512 osdx OSDxCLI[339852]: User 'admin' left the configuration menu.
Oct 30 13:14:17.765157 osdx OSDxCLI[339852]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Oct 30 13:14:17.765881 osdx OSDxCLI[339852]: pam_unix(cli:session): session closed for user admin
Oct 30 13:14:17.766330 osdx OSDxCLI[339852]: User 'admin' entered the configuration menu.
Oct 30 13:14:17.827014 osdx OSDxCLI[339852]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Oct 30 13:14:17.827401 osdx cfgd[1636]: Execute action [syntax] for node [system ntp authentication-key 1]
Oct 30 13:14:17.841473 osdx OSDxCLI[339852]: pam_unix(cli:session): session closed for user admin
Oct 30 13:14:17.841824 osdx OSDxCLI[339852]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 qwER43@!'.
Oct 30 13:14:17.926987 osdx OSDxCLI[339852]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Oct 30 13:14:17.931815 osdx OSDxCLI[339852]: pam_unix(cli:session): session closed for user admin
Oct 30 13:14:17.932170 osdx OSDxCLI[339852]: User 'admin' added a new cfg line: 'show changes'.
Oct 30 13:14:17.985965 osdx OSDxCLI[339852]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Oct 30 13:14:17.990516 osdx cfgd[1636]: [339852]must validation for [system strong-password] was skipped
Oct 30 13:14:17.990573 osdx cfgd[1636]: [339852]must validation for [system login user admin role] was skipped
Oct 30 13:14:18.004220 osdx WARNING[341238]: Short keyboard patterns are easy to guess.
Oct 30 13:14:18.004262 osdx INFO[341238]: Suggestions:
Oct 30 13:14:18.004289 osdx INFO[341238]:   Add another word or two. Uncommon words are better.
Oct 30 13:14:18.004307 osdx INFO[341238]:   Use a longer keyboard pattern with more turns.
Oct 30 13:14:18.004324 osdx INFO[341238]: Crack times (passwords per time):
Oct 30 13:14:18.004341 osdx INFO[341238]:   100 per hour:              centuries
Oct 30 13:14:18.004357 osdx INFO[341238]:   10 per second:             3 months
Oct 30 13:14:18.004403 osdx INFO[341238]:   10.000 per second:         3 hours
Oct 30 13:14:18.004422 osdx INFO[341238]:   10.000.000.000 per second: less than a second
Oct 30 13:14:18.009490 osdx cfgd[1636]: Execute action [end] for node [system ntp]
Oct 30 13:14:18.041441 osdx systemd[1]: Starting ntpsec.service - Network Time Service...
Oct 30 13:14:18.046814 osdx ntpd[341246]: INIT: ntpd ntpsec-1.2.2+2-ga54c8dd: Starting
Oct 30 13:14:18.047029 osdx ntp-systemd-wrapper[341246]: 2024-10-30T13:14:18 ntpd[341246]: INIT: ntpd ntpsec-1.2.2+2-ga54c8dd: Starting
Oct 30 13:14:18.047064 osdx ntpd[341246]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Oct 30 13:14:18.047093 osdx ntp-systemd-wrapper[341246]: 2024-10-30T13:14:18 ntpd[341246]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Oct 30 13:14:18.047646 osdx systemd[1]: Started ntpsec.service - Network Time Service.
Oct 30 13:14:18.048323 osdx cfgd[1636]: [339852]Completed change to active configuration
Oct 30 13:14:18.050008 osdx OSDxCLI[339852]: pam_unix(cli:session): session closed for user admin
Oct 30 13:14:18.050227 osdx OSDxCLI[339852]: User 'admin' committed the configuration.
Oct 30 13:14:18.050719 osdx ntpd[341248]: INIT: precision = 0.052 usec (-24)
Oct 30 13:14:18.051176 osdx ntpd[341248]: INIT: successfully locked into RAM
Oct 30 13:14:18.051190 osdx ntpd[341248]: CONFIG: readconfig: parsing file: /etc/ntpsec/ntp.conf
Oct 30 13:14:18.051228 osdx ntpd[341248]: AUTH: authreadkeys: reading /etc/ntp.keys
Oct 30 13:14:18.051362 osdx ntpd[341248]: AUTH: authreadkeys: added 1 keys
Oct 30 13:14:18.051407 osdx ntpd[341248]: INIT: Using SO_TIMESTAMPNS(ns)
Oct 30 13:14:18.051420 osdx ntpd[341248]: IO: Listen and drop on 0 v6wildcard [::]:123
Oct 30 13:14:18.051432 osdx ntpd[341248]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123
Oct 30 13:14:18.051771 osdx ntpd[341248]: IO: Listen normally on 2 lo 127.0.0.1:123
Oct 30 13:14:18.051788 osdx ntpd[341248]: IO: Listen normally on 3 lo [::1]:123
Oct 30 13:14:18.051804 osdx ntpd[341248]: IO: Listening on routing socket on fd #20 for interface updates
Oct 30 13:14:18.051810 osdx ntpd[341248]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes
Oct 30 13:14:18.051861 osdx ntpd[341248]: INIT: Built with OpenSSL 3.0.11 19 Sep 2023, 300000b0
Oct 30 13:14:18.051864 osdx ntpd[341248]: INIT: Running with OpenSSL 3.0.14 4 Jun 2024, 300000e0
Oct 30 13:14:18.052260 osdx ntpd[341248]: NTSc: Using system default root certificates.
Oct 30 13:14:18.086697 osdx OSDxCLI[339852]: User 'admin' left the configuration menu.
Oct 30 13:14:18.231150 osdx OSDxCLI[339852]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)