{{{ oval_metadata("The requirement for a password to boot into single-user mode should be configured correctly.") }}} {{%- if product not in ["ol8", "rhel8"] -%}} {{%- endif -%}}
<ind:textfilecontent54_test check="all" check_existence="all_exist" comment="Tests that {{% if product in ["fedora", "ol8", "ol9", "rhel8", "rhel9", "rhcos4", "sle12", "sle15"] -%}} /usr/lib/systemd/systemd-sulogin-shell {{%- else -%}} /sbin/sulogin {{%- endif %}} was not removed from the default systemd rescue.service to ensure that a password must be entered to access single user mode" id="test_require_rescue_service" version="1"> /usr/lib/systemd/system/rescue.service {{%- if product in ["fedora", "ol8", "ol9", "rhel8", "rhel9", "rhcos4", "sle12", "sle15"] -%}} ^ExecStart=\-.*/usr/lib/systemd/systemd-sulogin-shell[ ]+rescue {{%- else -%}} ^ExecStart=\-/bin/sh[\s]+-c[\s]+\"(/usr)?/sbin/sulogin;[\s]+/usr/bin/systemctl[\s]+--fail[\s]+--no-block[\s]+default\" {{%- endif -%}} 1

{{%- if product not in ["ol8", "rhel8"] -%}} /usr/lib/systemd/system/runlevel1.target ^Requires=.*rescue\.service 1

/etc/systemd/system
^rescue.service$
/etc/systemd/system
^runlevel1.target$
{{%- endif -%}}