<def-group>
  <definition class="compliance" id="audit_rules_unsuccessful_file_ftruncate" version="1">
    <metadata>
      <title>Ensure auditd Collects Unauthorized Access Attempts to
      Files (unsuccessful)</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>Audit rules about the Unauthorized Access
      Attempts to Files (unsuccessful) are enabled</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>
        <criteria operator="OR">
          <criterion comment="audit file user fail - ftruncate" test_ref="test_audit_rules_unsuccessful_file_modification_fail_ftruncate_el4" />
		  <criteria operator="AND">
		    <criterion comment="audit file user eacces - ftruncate" test_ref="test_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el4" />
		    <criterion comment="audit file user eperm - ftruncate" test_ref="test_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el4" />
		  </criteria>
	    </criteria>
      </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>
        <criteria operator="OR">
          <criterion comment="audit file user fail - ftruncate" test_ref="test_audit_rules_unsuccessful_file_modification_fail_ftruncate_el5" />
		  <criteria operator="AND">
		    <criterion comment="audit file user eacces - ftruncate" test_ref="test_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el5" />
		    <criterion comment="audit file user eperm - ftruncate" test_ref="test_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el5" />
		  </criteria>
	    </criteria>
      </criteria>
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" comment="audit file user fail - ftruncate" id="test_audit_rules_unsuccessful_file_modification_fail_ftruncate_el4" version="1">
    <ind:object object_ref="object_audit_rules_unsuccessful_file_modification_fail_ftruncate_el4" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rules_unsuccessful_file_modification_fail_ftruncate_el4" version="1">
    <ind:filepath>/etc/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+exit,always[\s]+(.*-S[\s]+ftruncate).*\-F\s+success=0</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit file user eacces - ftruncate" id="test_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el4" version="1">
    <ind:object object_ref="object_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el4" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el4" version="1">
    <ind:filepath>/etc/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+exit,always[\s]+(.*-S[\s]+ftruncate).*\-F\s+exit=\-EACCES</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit file user eperm - ftruncate" id="test_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el4" version="1">
    <ind:object object_ref="object_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el4" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el4" version="1">
    <ind:filepath>/etc/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+exit,always[\s]+(.*-S[\s]+ftruncate).*\-F\s+exit=\-EPERM</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit file user fail - ftruncate" id="test_audit_rules_unsuccessful_file_modification_fail_ftruncate_el5" version="1">
    <ind:object object_ref="object_audit_rules_unsuccessful_file_modification_fail_ftruncate_el5" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rules_unsuccessful_file_modification_fail_ftruncate_el5" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+exit,always[\s]+(.*-S[\s]+ftruncate).*\-F\s+success=0</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit file user eacces - ftruncate" id="test_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el5" version="1">
    <ind:object object_ref="object_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el5" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rules_unsuccessful_file_modification_eacces_ftruncate_el5" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+exit,always[\s]+(.*-S[\s]+ftruncate).*\-F\s+exit=\-EACCES</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit file user eperm - ftruncate" id="test_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el5" version="1">
    <ind:object object_ref="object_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el5" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rules_unsuccessful_file_modification_eperm_ftruncate_el5" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+exit,always[\s]+(.*-S[\s]+ftruncate).*\-F\s+exit=\-EPERM</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

</def-group>
