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+7sryFrCRRCdpWSh72zMcNOqdMY6sUwFs=
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+7sryFrCRRCcpKQxzhVz3A/C9KuRnl5yo=

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 U2FsdGVkX19hiyZvw6+hgprEqPdefYgNOOlJqPrEmM8=

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

Show output
Jun 24 12:40:31.000312 osdx systemd-timedated[141552]: Changed local time to Tue 2025-06-24 12:40:31 UTC
Jun 24 12:40:31.002764 osdx systemd-journald[1663]: Time jumped backwards, rotating.
Jun 24 12:40:31.003431 osdx OSDxCLI[127378]: User 'admin' executed a new command: 'set date 2025-06-24 12:40:31'.
Jun 24 12:40:31.401205 osdx sudo[144733]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Jun 24 12:40:31.404684 osdx systemd-journald[1663]: Runtime Journal (/run/log/journal/a9c8f5b24ca148a6b10e0198640df300) is 2.0M, max 15.3M, 13.3M free.
Jun 24 12:40:31.406155 osdx systemd-journald[1663]: Received client request to rotate journal, rotating.
Jun 24 12:40:31.406216 osdx systemd-journald[1663]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a9c8f5b24ca148a6b10e0198640df300.
Jun 24 12:40:31.409035 osdx sudo[144732]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Jun 24 12:40:31.417207 osdx OSDxCLI[127378]: User 'admin' executed a new command: 'system journal clear'.
Jun 24 12:40:31.732688 osdx OSDxCLI[127378]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 24 12:40:31.998363 osdx OSDxCLI[127378]: User 'admin' entered the configuration menu.
Jun 24 12:40:32.059475 osdx OSDxCLI[127378]: User 'admin' added a new cfg line: 'set system console log-level info'.
Jun 24 12:40:32.160787 osdx OSDxCLI[127378]: User 'admin' added a new cfg line: 'set system strong-password level 0'.
Jun 24 12:40:32.238422 osdx OSDxCLI[127378]: User 'admin' added a new cfg line: 'set system strong-password display'.
Jun 24 12:40:32.375656 osdx OSDxCLI[127378]: User 'admin' added a new cfg line: 'show working'.
Jun 24 12:40:32.456509 osdx ubnt-cfgd[144754]: inactive
Jun 24 12:40:32.477740 osdx INFO[144762]: FRR daemons did not change
Jun 24 12:40:32.478872 osdx modulelauncher[1283]: + Received data: ['127378', 'osdx.utils.xos', 'set_console_log_level', 'info']
Jun 24 12:40:32.500089 osdx OSDxCLI[127378]: Signal 10 received
Jun 24 12:40:32.513137 osdx cfgd[1460]: [127378]Completed change to active configuration
Jun 24 12:40:32.515022 osdx OSDxCLI[127378]: User 'admin' committed the configuration.
Jun 24 12:40:32.533272 osdx OSDxCLI[127378]: User 'admin' left the configuration menu.
Jun 24 12:40:32.717580 osdx OSDxCLI[127378]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 24 12:40:32.718175 osdx OSDxCLI[127378]: pam_unix(cli:session): session closed for user admin
Jun 24 12:40:32.718513 osdx OSDxCLI[127378]: User 'admin' entered the configuration menu.
Jun 24 12:40:32.804984 osdx OSDxCLI[127378]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 24 12:40:32.805396 osdx cfgd[1460]: Execute action [syntax] for node [system ntp authentication-key 1]
Jun 24 12:40:32.817954 osdx OSDxCLI[127378]: pam_unix(cli:session): session closed for user admin
Jun 24 12:40:32.818332 osdx OSDxCLI[127378]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 ******'.
Jun 24 12:40:32.871920 osdx OSDxCLI[127378]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 24 12:40:32.880495 osdx OSDxCLI[127378]: pam_unix(cli:session): session closed for user admin
Jun 24 12:40:32.880809 osdx OSDxCLI[127378]: User 'admin' added a new cfg line: 'show changes'.
Jun 24 12:40:32.980032 osdx OSDxCLI[127378]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)
Jun 24 12:40:32.993221 osdx ubnt-cfgd[144788]: inactive
Jun 24 12:40:33.065039 osdx cfgd[1460]: [127378]must validation for [system strong-password] was skipped
Jun 24 12:40:33.065231 osdx cfgd[1460]: [127378]must validation for [system login user admin role] was skipped
Jun 24 12:40:33.082270 osdx WARNING[144794]: Short keyboard patterns are easy to guess.
Jun 24 12:40:33.082690 osdx INFO[144794]: Suggestions:
Jun 24 12:40:33.082793 osdx INFO[144794]:   Add another word or two. Uncommon words are better.
Jun 24 12:40:33.082869 osdx INFO[144794]:   Use a longer keyboard pattern with more turns.
Jun 24 12:40:33.082941 osdx INFO[144794]: Crack times (passwords per time):
Jun 24 12:40:33.083007 osdx INFO[144794]:   100 per hour:              centuries
Jun 24 12:40:33.083068 osdx INFO[144794]:   10 per second:             3 months
Jun 24 12:40:33.083173 osdx INFO[144794]:   10.000 per second:         3 hours
Jun 24 12:40:33.083246 osdx INFO[144794]:   10.000.000.000 per second: less than a second
Jun 24 12:40:33.088501 osdx INFO[144796]: FRR daemons did not change
Jun 24 12:40:33.088946 osdx cfgd[1460]: Execute action [end] for node [system ntp]
Jun 24 12:40:33.118448 osdx systemd[1]: Starting ntpsec.service - Network Time Service...
Jun 24 12:40:33.126122 osdx ntpd[144803]: INIT: ntpd ntpsec-1.2.2+1-gc8a7dda: Starting
Jun 24 12:40:33.126403 osdx ntp-systemd-wrapper[144803]: 2025-06-24T12:40:33 ntpd[144803]: INIT: ntpd ntpsec-1.2.2+1-gc8a7dda: Starting
Jun 24 12:40:33.126459 osdx ntpd[144803]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Jun 24 12:40:33.126503 osdx ntp-systemd-wrapper[144803]: 2025-06-24T12:40:33 ntpd[144803]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Jun 24 12:40:33.127195 osdx systemd[1]: Started ntpsec.service - Network Time Service.
Jun 24 12:40:33.128102 osdx cfgd[1460]: [127378]Completed change to active configuration
Jun 24 12:40:33.129736 osdx ntpd[144805]: INIT: precision = 0.065 usec (-24)
Jun 24 12:40:33.129840 osdx OSDxCLI[127378]: pam_unix(cli:session): session closed for user admin
Jun 24 12:40:33.130105 osdx OSDxCLI[127378]: User 'admin' committed the configuration.
Jun 24 12:40:33.130334 osdx ntpd[144805]: INIT: successfully locked into RAM
Jun 24 12:40:33.130350 osdx ntpd[144805]: CONFIG: readconfig: parsing file: /etc/ntpsec/ntp.conf
Jun 24 12:40:33.130383 osdx ntpd[144805]: AUTH: authreadkeys: reading /etc/ntp.keys
Jun 24 12:40:33.130562 osdx ntpd[144805]: AUTH: authreadkeys: added 1 keys
Jun 24 12:40:33.130602 osdx ntpd[144805]: INIT: Using SO_TIMESTAMPNS(ns)
Jun 24 12:40:33.130612 osdx ntpd[144805]: IO: Listen and drop on 0 v6wildcard [::]:123
Jun 24 12:40:33.130624 osdx ntpd[144805]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123
Jun 24 12:40:33.130958 osdx ntpd[144805]: IO: Listen normally on 2 lo 127.0.0.1:123
Jun 24 12:40:33.130972 osdx ntpd[144805]: IO: Listen normally on 3 lo [::1]:123
Jun 24 12:40:33.130987 osdx ntpd[144805]: IO: Listening on routing socket on fd #20 for interface updates
Jun 24 12:40:33.130992 osdx ntpd[144805]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes
Jun 24 12:40:33.131041 osdx ntpd[144805]: INIT: Built with OpenSSL 3.0.14 4 Jun 2024, 300000e0
Jun 24 12:40:33.131043 osdx ntpd[144805]: INIT: Running with OpenSSL 3.0.16 11 Feb 2025, 30000100
Jun 24 12:40:33.131446 osdx ntpd[144805]: NTSc: Using system default root certificates.
Jun 24 12:40:33.181122 osdx OSDxCLI[127378]: User 'admin' left the configuration menu.
Jun 24 12:40:33.320405 osdx OSDxCLI[127378]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)