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 Mon 2024-06-24 11:37:42 UTC, end at Mon 2024-06-24 11:37:45 UTC. --
Jun 24 11:37:42.415708 osdx systemd-journald[1503]: Runtime journal (/run/log/journal/9a819f3302304ea795867ea7c248068f) is 2.0M, max 16.0M, 14.0M free.
Jun 24 11:37:42.445136 osdx OSDxCLI[16711]: User 'admin' executed a new command: 'system journal clear'.
Jun 24 11:37:43.079383 osdx osdx-coredump[19755]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Jun 24 11:37:43.087342 osdx OSDxCLI[16711]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 24 11:37:43.944746 osdx OSDxCLI[16711]: User 'admin' entered the configuration menu.
Jun 24 11:37:44.065054 osdx OSDxCLI[16711]: User 'admin' added a new cfg line: 'set system console log-level info'.
Jun 24 11:37:44.153451 osdx OSDxCLI[16711]: User 'admin' added a new cfg line: 'set system strong-password level 0'.
Jun 24 11:37:44.242838 osdx OSDxCLI[16711]: User 'admin' added a new cfg line: 'set system strong-password display'.
Jun 24 11:37:44.353766 osdx modulelauncher[972]: + Received data: ['16711', 'osdx.utils.xos', 'set_console_log_level', 'info']
Jun 24 11:37:44.367251 osdx OSDxCLI[16711]: Signal 10 received
Jun 24 11:37:44.375648 osdx ifmon[980]: Changed log-level to info
Jun 24 11:37:44.376226 osdx cfgd[1115]: [16711]Completed change to active configuration
Jun 24 11:37:44.379266 osdx OSDxCLI[16711]: User 'admin' committed the configuration.
Jun 24 11:37:44.412194 osdx OSDxCLI[16711]: User 'admin' left the configuration menu.
Jun 24 11:37:44.612488 osdx OSDxCLI[16711]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Jun 24 11:37:44.613277 osdx OSDxCLI[16711]: pam_unix(cli:session): session closed for user admin
Jun 24 11:37:44.613498 osdx OSDxCLI[16711]: User 'admin' entered the configuration menu.
Jun 24 11:37:44.704013 osdx OSDxCLI[16711]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Jun 24 11:37:44.704594 osdx cfgd[1115]: Execute action [syntax] for node [(null)]
Jun 24 11:37:44.704838 osdx cfgd[1115]: Execute action [syntax] for node [(null)]
Jun 24 11:37:44.730124 osdx OSDxCLI[16711]: pam_unix(cli:session): session closed for user admin
Jun 24 11:37:44.730447 osdx OSDxCLI[16711]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 qwER43@!'.
Jun 24 11:37:44.833084 osdx OSDxCLI[16711]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Jun 24 11:37:44.842632 osdx cfgd[1115]: [16711]must validation for [system login user admin role] was skipped
Jun 24 11:37:44.860343 osdx WARNING[19803]: Short keyboard patterns are easy to guess.
Jun 24 11:37:44.860406 osdx INFO[19803]: Suggestions:
Jun 24 11:37:44.860473 osdx INFO[19803]:   Add another word or two. Uncommon words are better.
Jun 24 11:37:44.860524 osdx INFO[19803]:   Use a longer keyboard pattern with more turns.
Jun 24 11:37:44.860555 osdx INFO[19803]: Crack times (passwords per time):
Jun 24 11:37:44.860588 osdx INFO[19803]:   100 per hour:              centuries
Jun 24 11:37:44.860620 osdx INFO[19803]:   10 per second:             3.0 months
Jun 24 11:37:44.860651 osdx INFO[19803]:   10.000 per second:         3.0 hours
Jun 24 11:37:44.860682 osdx INFO[19803]:   10.000.000.000 per second: less than a second
Jun 24 11:37:44.864912 osdx cfgd[1115]: Execute action [end] for node [system ntp]
Jun 24 11:37:44.896756 osdx systemd[1]: Starting Network Time Service...
Jun 24 11:37:44.901068 osdx ntpd[19811]: INIT: ntpd ntpsec-1.2.0+ 2024-04-15T12:00:00Z (git rev c695a58): Starting
Jun 24 11:37:44.901368 osdx ntp-systemd-wrapper[19810]: 2024-06-24T11:37:44 ntpd[19811]: INIT: ntpd ntpsec-1.2.0+ 2024-04-15T12:00:00Z (git rev c695a58): Starting
Jun 24 11:37:44.901368 osdx ntp-systemd-wrapper[19810]: 2024-06-24T11:37:44 ntpd[19811]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Jun 24 11:37:44.901112 osdx ntpd[19811]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Jun 24 11:37:44.901663 osdx systemd[1]: ntpsec.service: Can't open PID file /run/ntpd.pid (yet?) after start: No such file or directory
Jun 24 11:37:44.903870 osdx ntpd[19813]: INIT: precision = 0.054 usec (-24)
Jun 24 11:37:44.904064 osdx systemd[1]: Started Network Time Service.
Jun 24 11:37:44.904578 osdx ntpd[19813]: INIT: successfully locked into RAM
Jun 24 11:37:44.904593 osdx ntpd[19813]: CONFIG: readconfig: parsing file: /etc/ntpsec/ntp.conf
Jun 24 11:37:44.904625 osdx ntpd[19813]: AUTH: authreadkeys: reading /etc/ntp.keys
Jun 24 11:37:44.904641 osdx ntpd[19813]: AUTH: authreadkeys: added 1 keys
Jun 24 11:37:44.904682 osdx ntpd[19813]: INIT: Using SO_TIMESTAMPNS
Jun 24 11:37:44.904694 osdx ntpd[19813]: IO: Listen and drop on 0 v6wildcard [::]:123
Jun 24 11:37:44.904708 osdx ntpd[19813]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123
Jun 24 11:37:44.905158 osdx ntpd[19813]: IO: Listen normally on 2 lo 127.0.0.1:123
Jun 24 11:37:44.905183 osdx ntpd[19813]: IO: Listen normally on 3 lo [::1]:123
Jun 24 11:37:44.905202 osdx ntpd[19813]: IO: Listening on routing socket on fd #20 for interface updates
Jun 24 11:37:44.905210 osdx ntpd[19813]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes
Jun 24 11:37:44.905269 osdx ntpd[19813]: INIT: OpenSSL 1.1.1n  15 Mar 2022, 101010ef
Jun 24 11:37:44.905432 osdx ntpd[19813]: NTSc: Using system default root certificates.
Jun 24 11:37:44.905525 osdx cfgd[1115]: [16711]Completed change to active configuration
Jun 24 11:37:44.908632 osdx OSDxCLI[16711]: pam_unix(cli:session): session closed for user admin
Jun 24 11:37:44.908925 osdx OSDxCLI[16711]: User 'admin' committed the configuration.
Jun 24 11:37:44.948055 osdx OSDxCLI[16711]: User 'admin' left the configuration menu.
Jun 24 11:37:45.093397 osdx OSDxCLI[16711]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)