<def-group>
  <definition class="compliance" id="auditd_data_retention_max_log_file" version="2">
    <metadata>
      <title>Auditd Maximum Log File Size</title>
      <affected family="unix">
        <platform>multi_platform_all</platform>
      </affected>
      <description>max_log_file setting in /etc/audit/auditd.conf is set to at least a certain value</description>
      <reference source="JL" ref_id="RHEL6_20150813" ref_url="test_attestation" />
      <reference source="JL" ref_id="RHEL7_20150813" ref_url="test_attestation" />
      <reference source="JL" ref_id="FEDORA22_20150813" ref_url="test_attestation" />
    </metadata>

    <criteria>
        <criterion comment="max_log_file setting in auditd.conf" test_ref="test_auditd_data_retention_max_log_file" />
    </criteria>

  </definition>

  <ind:textfilecontent54_test check="all" comment="max log file size" id="test_auditd_data_retention_max_log_file" version="1">
    <ind:object object_ref="object_auditd_data_retention_max_log_file" />
    <ind:state state_ref="state_auditd_data_retention_max_log_file" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_auditd_data_retention_max_log_file" version="2">
    <ind:filepath>/etc/audit/auditd.conf</ind:filepath>
    <!-- Allow only space (exactly) as delimiter: https://fedorahosted.org/audit/browser/trunk/src/auditd-config.c#L426 -->
    <!-- Require at least one space before and after the equal sign -->
    <ind:pattern operation="pattern match">^[ ]*max_log_file[ ]+=[ ]+(\d+)[ ]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_auditd_data_retention_max_log_file" version="1">
    <ind:subexpression operation="greater than or equal" var_ref="var_auditd_max_log_file" datatype="int" />
  </ind:textfilecontent54_state>

  <external_variable comment="audit max_log_file settting" datatype="int" id="var_auditd_max_log_file" version="1" />

</def-group>
