Skip to content

Commit

Permalink
Do not require existence of /var/tmp/tmp-inst
Browse files Browse the repository at this point in the history
We will not require the parent directory to exist, the OVAL test will
pass also if the directory doesn't exist.  It isn't mandatory to create
the parent directory because when the directory doesn't exist, it gets
created automatically by pam. However, if the parent directory exists,
it must have correct mode, otherwise the polyinstantiation will fail.

This change is very similar to the change that we have done to the
sister rule accounts_polyinstantiated_tmp in 13d2d86.

More context:
RHSecurityCompliance/contest#129 (comment)
  • Loading branch information
jan-cerny committed Mar 27, 2024
1 parent 68a116b commit 8f0e767
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# platform = multi_platform_fedora,Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,multi_platform_sle
# platform = multi_platform_fedora,multi_platform_rhel,multi_platform_sle
# reboot = false
# strategy = restrict
# complexity = low
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<definition class="compliance" id="accounts_polyinstantiated_var_tmp" version="1">
{{{ oval_metadata("") }}}
<criteria operator="AND" comment="Check Polyinstantiation of /tmp Directories">
<criterion comment="Check that /var/tmp/tmp-inst exists and has mode 000" test_ref="test_var_tmp_tmp_inst" />
<criterion comment="Check that /var/tmp/tmp-inst doesn't exist or it exists and has mode 000" test_ref="test_var_tmp_tmp_inst" />
<criterion comment="Check configuration of /var/tmp in /etc/security/namespace.conf file" test_ref="test_var_tmp_in_namespace_conf" />
</criteria>
</definition>

<unix:file_test comment="Check that /tmp-inst exists and has mode 000" check="all" check_existence="only_one_exists" id="test_var_tmp_tmp_inst" version="1">
<unix:file_test comment="Check that /var/tmp/tmp-inst doesn't exist or it exists and has mode 000" check="all" check_existence="any_exist" id="test_var_tmp_tmp_inst" version="1">
<unix:object object_ref="obj_var_tmp_tmp_inst" />
<unix:state state_ref="state_var_tmp_tmp_inst" />
</unix:file_test>
Expand Down

0 comments on commit 8f0e767

Please sign in to comment.