<def-group>
  <definition class="compliance" id="at_system_accounts" version="1">
    <metadata>
      <title>Files /etc/at.allow And /etc/at.deny Must Exist</title>
      <affected family="unix">
        <platform>CentOS 4</platform>
		<platform>CentOS 5</platform>
		<platform>Red Hat Enterprise Linux 4</platform>
		<platform>Red Hat Enterprise Linux 5</platform>
      </affected>
      <description>Group owner for /etc/at.allow and /etc/at.deny must exist.</description>
    </metadata>
    <criteria>
      <criterion test_ref="test_at_system_accounts_at_allow_exists" />
      <criterion test_ref="test_at_system_accounts_at_allow" />
    </criteria>
  </definition>

  <unix:file_test check="all" check_existence="all_exist" comment="Testing /etc/at.allow existence" id="test_at_system_accounts_at_allow_exists" version="1">
    <unix:object object_ref="object_at_system_accounts_at_allow_exists" />
  </unix:file_test>
  <unix:file_object comment="/etc/at.allow" id="object_at_system_accounts_at_allow_exists" version="1">
    <unix:filepath>/etc/at.allow</unix:filepath>
  </unix:file_object>

  <local_variable id="var_at_system_accounts_allow_list" comment="Accounts Allowed" datatype="string" version="1">
	<object_component item_field="subexpression" object_ref="object_at_system_accounts_allow_list" />
  </local_variable>
  <ind:textfilecontent54_object comment="/etc/at.allow" id="object_at_system_accounts_allow_list" version="1">
    <ind:filepath>/etc/at.allow</ind:filepath>
    <ind:pattern operation="pattern match">^(.*)$</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">0</ind:instance>
  </ind:textfilecontent54_object>
  <unix:password_test check="all" check_existence="none_exist" comment="Testing system accounts in /etc/at.allow" id="test_at_system_accounts_at_allow" version="1">
    <unix:object object_ref="object_at_system_accounts_at_allow" />
  </unix:password_test>
  <unix:password_object id="object_at_system_accounts_at_allow" version="1">
    <unix:username operation="equals" var_ref="var_at_system_accounts_allow_list" var_check="at least one" datatype="string" />
    <filter action="include">state_at_system_accounts_at_allow_root</filter>
    <filter action="include">state_at_system_accounts_at_allow_uid</filter>
  </unix:password_object>
  <unix:password_state id="state_at_system_accounts_at_allow_root" version="1">
    <unix:username operation="not equal">root</unix:username>
  </unix:password_state>
  <unix:password_state id="state_at_system_accounts_at_allow_uid" version="1">
    <unix:user_id datatype="int" operation="less than">500</unix:user_id>
  </unix:password_state>

</def-group>
