<def-group>
  <definition class="compliance" id="file_groupowner_audit_log" version="1">
    <metadata>
      <title>Audit Log Files Group Owner</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 audit log files must be root.</description>
    </metadata>
    <criteria operator="OR">
      <criteria>
        <criteria operator="OR">
	      <extend_definition comment="CentOS 4 is installed" definition_ref="installed_OS_is_centos4" />
	      <extend_definition comment="RedHat 4 is installed" definition_ref="installed_OS_is_rhel4" />
        </criteria>
       <criterion test_ref="test_file_groupowner_audit_log_el4" />
      </criteria>
      <criteria>
        <criteria operator="OR">
	      <extend_definition comment="CentOS 5 is installed" definition_ref="installed_OS_is_centos5" />
	      <extend_definition comment="RedHat 5 is installed" definition_ref="installed_OS_is_rhel5" />
        </criteria>
       <criterion test_ref="test_file_groupowner_audit_log_el5" />
      </criteria>
    </criteria>
  </definition>

  <local_variable id="var_file_groupowner_audit_log_list_el4" comment="List of audit log files" datatype="string" version="1">
		<object_component item_field="subexpression" object_ref="object_file_groupowner_audit_log_list_el4" />
  </local_variable>
  <ind:textfilecontent54_object id="object_file_groupowner_audit_log_list_el4" version="1">
    <ind:filepath>/etc/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^log_file\s.*\s(/.*)$</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  
  <unix:file_test check="all" check_existence="all_exist" comment="Testing audit log file group owner" id="test_file_groupowner_audit_log_el4" version="1">
    <unix:object object_ref="object_file_groupowner_audit_log_el4" />
    <unix:state state_ref="state_file_groupowner_audit_log" />
  </unix:file_test>
  <unix:file_object comment="List of audit log files" id="object_file_groupowner_audit_log_el4" version="1">
    <unix:filepath var_ref="var_file_groupowner_audit_log_list_el4" var_check="at least one" />
  </unix:file_object>

  <local_variable id="var_file_groupowner_audit_log_list_el5" comment="List of audit log files" datatype="string" version="1">
		<object_component item_field="subexpression" object_ref="object_file_groupowner_audit_log_list_el5" />
  </local_variable>
  <ind:textfilecontent54_object id="object_file_groupowner_audit_log_list_el5" version="1">
    <ind:filepath>/etc/audit/auditd.conf</ind:filepath>
    <ind:pattern operation="pattern match">^log_file\s.*\s(/.*)$</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  
  <unix:file_test check="all" check_existence="all_exist" comment="Testing audit log file group owner" id="test_file_groupowner_audit_log_el5" version="1">
    <unix:object object_ref="object_file_groupowner_audit_log_el5" />
    <unix:state state_ref="state_file_groupowner_audit_log" />
  </unix:file_test>
  <unix:file_object comment="List of audit log files" id="object_file_groupowner_audit_log_el5" version="1">
    <unix:filepath var_ref="var_file_groupowner_audit_log_list_el5" var_check="at least one" />
  </unix:file_object>

  <unix:file_state id="state_file_groupowner_audit_log" version="1">
    <unix:group_id datatype="int">0</unix:group_id>
  </unix:file_state>

</def-group>
