Skip to content

Commit 00743a8

Browse files
committed
Fix(accounts_tmout): OVAL check incorrectly passes for TMOUT=0
1 parent c6325ff commit 00743a8

File tree

1 file changed

+11
-1
lines changed
  • linux_os/guide/system/accounts/accounts-session/accounts_tmout/oval

1 file changed

+11
-1
lines changed

linux_os/guide/system/accounts/accounts-session/accounts_tmout/oval/shared.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{% set system_configuration_using_etc_bashrc_expected = true %}}
55
{{%- endif -%}}
66
<def-group>
7-
<definition class="compliance" id="accounts_tmout" version="3">
7+
<definition class="compliance" id="accounts_tmout" version="4">
88
{{{ oval_metadata("Checks interactive shell timeout", rule_title=rule_title) }}}
99
<criteria operator="AND">
1010
{{% if "ubuntu" in product %}}
@@ -16,6 +16,7 @@
1616
{{% if system_configuration_using_etc_bashrc_expected %}}
1717
<criterion comment="TMOUT value in /etc/bashrc &lt;= var_accounts_tmout" test_ref="test_etc_bashrc_tmout" />
1818
{{% endif %}}
19+
<criterion comment="All configured TMOUT values must be >= 1" test_ref="test_accounts_tmout_lower_bound" />
1920
</criteria>
2021
</definition>
2122

@@ -106,5 +107,14 @@
106107
<ind:subexpression datatype="int" operation="less than or equal" var_check="all" var_ref="var_accounts_tmout" />
107108
</ind:textfilecontent54_state>
108109

110+
<ind:textfilecontent54_state id="state_etc_profile_tmout_lower_bound" version="1">
111+
<ind:subexpression datatype="int" operation="greater than or equal">1</ind:subexpression>
112+
</ind:textfilecontent54_state>
113+
114+
<ind:textfilecontent54_test check="all" check_existence="any_exist" comment="All TMOUT values must be greater than or equal to 1" id="test_accounts_tmout_lower_bound" version="1">
115+
<ind:object object_ref="object_accounts_tmout_all_tmout_instances" />
116+
<ind:state state_ref="state_etc_profile_tmout_lower_bound" />
117+
</ind:textfilecontent54_test>
118+
109119
<external_variable comment="external variable for TMOUT" datatype="int" id="var_accounts_tmout" version="1" />
110120
</def-group>

0 commit comments

Comments
 (0)