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-10-10 08:52:52 UTC, end at Thu 2024-10-10 08:52:54 UTC. --
Oct 10 08:52:52.296930 osdx systemd-journald[14746]: Runtime journal (/run/log/journal/0478719b9ca24dfc881db6c3460ca916) is 2.0M, max 16.0M, 14.0M free.
Oct 10 08:52:52.316000 osdx OSDxCLI[16525]: User 'admin' executed a new command: 'system journal clear'.
Oct 10 08:52:52.776982 osdx osdx-coredump[17881]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Oct 10 08:52:52.783356 osdx OSDxCLI[16525]: User 'admin' executed a new command: 'system coredump delete all'.
Oct 10 08:52:53.336168 osdx OSDxCLI[16525]: User 'admin' entered the configuration menu.
Oct 10 08:52:53.389379 osdx OSDxCLI[16525]: User 'admin' added a new cfg line: 'set system console log-level info'.
Oct 10 08:52:53.488849 osdx OSDxCLI[16525]: User 'admin' added a new cfg line: 'set system strong-password level 0'.
Oct 10 08:52:53.541202 osdx OSDxCLI[16525]: User 'admin' added a new cfg line: 'set system strong-password display'.
Oct 10 08:52:53.647513 osdx modulelauncher[1139]: + Received data: ['16525', 'osdx.utils.xos', 'set_console_log_level', 'info']
Oct 10 08:52:53.654276 osdx OSDxCLI[16525]: Signal 10 received
Oct 10 08:52:53.659699 osdx ifmon[1186]: Changed log-level to info
Oct 10 08:52:53.660220 osdx cfgd[1323]: [16525]Completed change to active configuration
Oct 10 08:52:53.663742 osdx OSDxCLI[16525]: User 'admin' committed the configuration.
Oct 10 08:52:53.682172 osdx OSDxCLI[16525]: User 'admin' left the configuration menu.
Oct 10 08:52:53.872293 osdx OSDxCLI[16525]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Oct 10 08:52:53.872957 osdx OSDxCLI[16525]: pam_unix(cli:session): session closed for user admin
Oct 10 08:52:53.873106 osdx OSDxCLI[16525]: User 'admin' entered the configuration menu.
Oct 10 08:52:53.924098 osdx OSDxCLI[16525]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Oct 10 08:52:53.924435 osdx cfgd[1323]: Execute action [syntax] for node [(null)]
Oct 10 08:52:53.924489 osdx cfgd[1323]: Execute action [syntax] for node [(null)]
Oct 10 08:52:53.935986 osdx OSDxCLI[16525]: pam_unix(cli:session): session closed for user admin
Oct 10 08:52:53.936209 osdx OSDxCLI[16525]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 qwER43@!'.
Oct 10 08:52:54.014345 osdx OSDxCLI[16525]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)
Oct 10 08:52:54.018207 osdx cfgd[1323]: [16525]must validation for [system login user admin role] was skipped
Oct 10 08:52:54.032779 osdx WARNING[17929]: Short keyboard patterns are easy to guess.
Oct 10 08:52:54.033022 osdx INFO[17929]: Suggestions:
Oct 10 08:52:54.033074 osdx INFO[17929]:   Add another word or two. Uncommon words are better.
Oct 10 08:52:54.033120 osdx INFO[17929]:   Use a longer keyboard pattern with more turns.
Oct 10 08:52:54.033180 osdx INFO[17929]: Crack times (passwords per time):
Oct 10 08:52:54.033220 osdx INFO[17929]:   100 per hour:              centuries
Oct 10 08:52:54.033262 osdx INFO[17929]:   10 per second:             3.0 months
Oct 10 08:52:54.033306 osdx INFO[17929]:   10.000 per second:         3.0 hours
Oct 10 08:52:54.033353 osdx INFO[17929]:   10.000.000.000 per second: less than a second
Oct 10 08:52:54.036128 osdx cfgd[1323]: Execute action [end] for node [system ntp]
Oct 10 08:52:54.048324 osdx systemd[1]: Starting Network Time Service...
Oct 10 08:52:54.051239 osdx ntpd[17937]: INIT: ntpd ntpsec-1.2.0+ 2024-04-15T12:00:00Z (git rev c695a58): Starting
Oct 10 08:52:54.051490 osdx ntp-systemd-wrapper[17936]: 2024-10-10T08:52:54 ntpd[17937]: INIT: ntpd ntpsec-1.2.0+ 2024-04-15T12:00:00Z (git rev c695a58): Starting
Oct 10 08:52:54.051490 osdx ntp-systemd-wrapper[17936]: 2024-10-10T08:52:54 ntpd[17937]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Oct 10 08:52:54.051258 osdx ntpd[17937]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
Oct 10 08:52:54.051640 osdx systemd[1]: ntpsec.service: Can't open PID file /run/ntpd.pid (yet?) after start: No such file or directory
Oct 10 08:52:54.053428 osdx ntpd[17939]: INIT: precision = 0.051 usec (-24)
Oct 10 08:52:54.053643 osdx systemd[1]: Started Network Time Service.
Oct 10 08:52:54.054089 osdx ntpd[17939]: INIT: successfully locked into RAM
Oct 10 08:52:54.054104 osdx ntpd[17939]: CONFIG: readconfig: parsing file: /etc/ntpsec/ntp.conf
Oct 10 08:52:54.054136 osdx ntpd[17939]: AUTH: authreadkeys: reading /etc/ntp.keys
Oct 10 08:52:54.054152 osdx ntpd[17939]: AUTH: authreadkeys: added 1 keys
Oct 10 08:52:54.054193 osdx ntpd[17939]: INIT: Using SO_TIMESTAMPNS
Oct 10 08:52:54.054203 osdx ntpd[17939]: IO: Listen and drop on 0 v6wildcard [::]:123
Oct 10 08:52:54.054221 osdx ntpd[17939]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123
Oct 10 08:52:54.054709 osdx ntpd[17939]: IO: Listen normally on 2 lo 127.0.0.1:123
Oct 10 08:52:54.054737 osdx ntpd[17939]: IO: Listen normally on 3 lo [::1]:123
Oct 10 08:52:54.054762 osdx ntpd[17939]: IO: Listening on routing socket on fd #20 for interface updates
Oct 10 08:52:54.054772 osdx ntpd[17939]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes
Oct 10 08:52:54.054783 osdx cfgd[1323]: [16525]Completed change to active configuration
Oct 10 08:52:54.054865 osdx ntpd[17939]: INIT: OpenSSL 1.1.1n  15 Mar 2022, 101010ef
Oct 10 08:52:54.055023 osdx ntpd[17939]: NTSc: Using system default root certificates.
Oct 10 08:52:54.058444 osdx OSDxCLI[16525]: pam_unix(cli:session): session closed for user admin
Oct 10 08:52:54.058811 osdx OSDxCLI[16525]: User 'admin' committed the configuration.
Oct 10 08:52:54.083543 osdx OSDxCLI[16525]: User 'admin' left the configuration menu.
Oct 10 08:52:54.200131 osdx OSDxCLI[16525]: pam_unix(cli:session): session opened for user admin by admin(uid=1000)