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/QqqyK4YfVIEHfoSnwbIWw6MGedwHuwOs= 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/QqqyK4YfVIEcdWKk1xRXGzP1LaOXZ8ug=
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+EirvM4XRHSTW3L/d91BeCtFS3z1lHhMk=
Step 3: Run command system journal show | tail -n 1000
at DUT0
and expect this output:
Show output
Dec 03 15:08:56.325216 osdx systemd-journald[1835]: Runtime Journal (/run/log/journal/d3b584433ca54f4e84c38003c593de3f) is 2.3M, max 15.3M, 13.0M free. Dec 03 15:08:56.328065 osdx systemd-journald[1835]: Received client request to rotate journal, rotating. Dec 03 15:08:56.328119 osdx systemd-journald[1835]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d3b584433ca54f4e84c38003c593de3f. Dec 03 15:08:56.334799 osdx OSDxCLI[336757]: User 'admin' executed a new command: 'system journal clear'. Dec 03 15:08:56.670861 osdx osdx-coredump[338231]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Dec 03 15:08:56.678578 osdx OSDxCLI[336757]: User 'admin' executed a new command: 'system coredump delete all'. Dec 03 15:08:56.689208 osdx zebra[1599]: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]): Dec 03 15:08:57.185649 osdx OSDxCLI[336757]: User 'admin' entered the configuration menu. Dec 03 15:08:57.243966 osdx OSDxCLI[336757]: User 'admin' added a new cfg line: 'set system console log-level info'. Dec 03 15:08:57.351912 osdx OSDxCLI[336757]: User 'admin' added a new cfg line: 'set system strong-password level 0'. Dec 03 15:08:57.431291 osdx OSDxCLI[336757]: User 'admin' added a new cfg line: 'set system strong-password display'. Dec 03 15:08:57.550002 osdx OSDxCLI[336757]: User 'admin' added a new cfg line: 'show working'. Dec 03 15:08:57.616654 osdx modulelauncher[1473]: + Received data: ['336757', 'osdx.utils.xos', 'set_console_log_level', 'info'] Dec 03 15:08:57.629707 osdx OSDxCLI[336757]: Signal 10 received Dec 03 15:08:57.638336 osdx ifmon[1475]: Changed log-level to info Dec 03 15:08:57.638685 osdx cfgd[1634]: [336757]Completed change to active configuration Dec 03 15:08:57.640689 osdx OSDxCLI[336757]: User 'admin' committed the configuration. Dec 03 15:08:57.703665 osdx OSDxCLI[336757]: User 'admin' left the configuration menu. Dec 03 15:08:57.869124 osdx OSDxCLI[336757]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Dec 03 15:08:57.869723 osdx OSDxCLI[336757]: pam_unix(cli:session): session closed for user admin Dec 03 15:08:57.870084 osdx OSDxCLI[336757]: User 'admin' entered the configuration menu. Dec 03 15:08:57.928907 osdx OSDxCLI[336757]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Dec 03 15:08:57.929213 osdx cfgd[1634]: Execute action [syntax] for node [system ntp authentication-key 1] Dec 03 15:08:57.941088 osdx OSDxCLI[336757]: pam_unix(cli:session): session closed for user admin Dec 03 15:08:57.941511 osdx OSDxCLI[336757]: User 'admin' added a new cfg line: 'set system ntp authentication-key 1 md5 ******'. Dec 03 15:08:58.027856 osdx OSDxCLI[336757]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Dec 03 15:08:58.034908 osdx OSDxCLI[336757]: pam_unix(cli:session): session closed for user admin Dec 03 15:08:58.035179 osdx OSDxCLI[336757]: User 'admin' added a new cfg line: 'show changes'. Dec 03 15:08:58.085934 osdx OSDxCLI[336757]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000) Dec 03 15:08:58.092140 osdx cfgd[1634]: [336757]must validation for [system strong-password] was skipped Dec 03 15:08:58.092214 osdx cfgd[1634]: [336757]must validation for [system login user admin role] was skipped Dec 03 15:08:58.104937 osdx WARNING[338273]: Short keyboard patterns are easy to guess. Dec 03 15:08:58.104982 osdx INFO[338273]: Suggestions: Dec 03 15:08:58.105014 osdx INFO[338273]: Add another word or two. Uncommon words are better. Dec 03 15:08:58.105037 osdx INFO[338273]: Use a longer keyboard pattern with more turns. Dec 03 15:08:58.105057 osdx INFO[338273]: Crack times (passwords per time): Dec 03 15:08:58.105084 osdx INFO[338273]: 100 per hour: centuries Dec 03 15:08:58.105106 osdx INFO[338273]: 10 per second: 3 months Dec 03 15:08:58.105172 osdx INFO[338273]: 10.000 per second: 3 hours Dec 03 15:08:58.105197 osdx INFO[338273]: 10.000.000.000 per second: less than a second Dec 03 15:08:58.109092 osdx cfgd[1634]: Execute action [end] for node [system ntp] Dec 03 15:08:58.172370 osdx systemd[1]: Starting ntpsec.service - Network Time Service... Dec 03 15:08:58.178179 osdx ntpd[338281]: INIT: ntpd ntpsec-1.2.2+2-ga54c8dd: Starting Dec 03 15:08:58.178415 osdx ntp-systemd-wrapper[338281]: 2024-12-03T15:08:58 ntpd[338281]: INIT: ntpd ntpsec-1.2.2+2-ga54c8dd: Starting Dec 03 15:08:58.178415 osdx ntp-systemd-wrapper[338281]: 2024-12-03T15:08:58 ntpd[338281]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec Dec 03 15:08:58.178193 osdx ntpd[338281]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec Dec 03 15:08:58.178669 osdx systemd[1]: Started ntpsec.service - Network Time Service. Dec 03 15:08:58.179749 osdx cfgd[1634]: [336757]Completed change to active configuration Dec 03 15:08:58.181172 osdx ntpd[338283]: INIT: precision = 0.054 usec (-24) Dec 03 15:08:58.181658 osdx ntpd[338283]: INIT: successfully locked into RAM Dec 03 15:08:58.181668 osdx ntpd[338283]: CONFIG: readconfig: parsing file: /etc/ntpsec/ntp.conf Dec 03 15:08:58.181697 osdx ntpd[338283]: AUTH: authreadkeys: reading /etc/ntp.keys Dec 03 15:08:58.181839 osdx ntpd[338283]: AUTH: authreadkeys: added 1 keys Dec 03 15:08:58.181874 osdx ntpd[338283]: INIT: Using SO_TIMESTAMPNS(ns) Dec 03 15:08:58.181885 osdx ntpd[338283]: IO: Listen and drop on 0 v6wildcard [::]:123 Dec 03 15:08:58.181906 osdx ntpd[338283]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123 Dec 03 15:08:58.182300 osdx ntpd[338283]: IO: Listen normally on 2 lo 127.0.0.1:123 Dec 03 15:08:58.182317 osdx ntpd[338283]: IO: Listen normally on 3 lo [::1]:123 Dec 03 15:08:58.182333 osdx ntpd[338283]: IO: Listening on routing socket on fd #20 for interface updates Dec 03 15:08:58.182339 osdx ntpd[338283]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes Dec 03 15:08:58.182421 osdx ntpd[338283]: INIT: Built with OpenSSL 3.0.11 19 Sep 2023, 300000b0 Dec 03 15:08:58.182423 osdx ntpd[338283]: INIT: Running with OpenSSL 3.0.14 4 Jun 2024, 300000e0 Dec 03 15:08:58.182861 osdx ntpd[338283]: NTSc: Using system default root certificates. Dec 03 15:08:58.183008 osdx OSDxCLI[336757]: pam_unix(cli:session): session closed for user admin Dec 03 15:08:58.183298 osdx OSDxCLI[336757]: User 'admin' committed the configuration. Dec 03 15:08:58.203453 osdx OSDxCLI[336757]: User 'admin' left the configuration menu. Dec 03 15:08:58.324222 osdx OSDxCLI[336757]: pam_unix(cli:session): session opened for user admin(uid=1000) by admin(uid=1000)