<def-group>
  <definition class="compliance" id="audit_rules_time_stime" version="1">
    {{{ oval_metadata("Record attempts to alter time through stime. Note that on
      64-bit architectures the stime system call is not defined in the audit
      system calls lookup table.") }}}

    <criteria operator="AND">
      <!-- System is 32-bit or 64-bit -->
      <criteria comment="32-bit or 64-bit system" operator="OR">
        <extend_definition comment="32-bit system" definition_ref="system_info_architecture_x86" />
        <extend_definition comment="64-bit system" definition_ref="system_info_architecture_64bit" />
      </criteria>
      <!-- augenrules or auditctl tools are used to load audit rules -->
      <criteria comment="audit augenrules or audit auditctl" operator="OR">
        <!-- Test the augenrules case -->
        <criteria comment="audit augenrules stime" operator="AND">
          <!-- augenrules is used to load audit rules and stime rule is defined in /etc/audit/rules.d/*.rules -->
          <extend_definition comment="audit augenrules" definition_ref="audit_rules_augenrules" />
          <criterion comment="audit augenrules 32-bit stime" test_ref="test_32bit_art_stime_augenrules" />
        </criteria>
        <!-- OR test the auditctl case -->
        <criteria comment="audit auditctl stime" operator="AND">
          <!-- OR auditctl is used to load audit rules and stime rule is defined in /etc/audit/audit.rules -->
          <extend_definition comment="audit auditctl" definition_ref="audit_rules_auditctl" />
          <criterion comment="audit auditctl 32-bit stime" test_ref="test_32bit_art_stime_auditctl" />
        </criteria>
      </criteria>
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" comment="audit augenrules 32-bit stime" id="test_32bit_art_stime_augenrules" version="1">
    <ind:object object_ref="object_32bit_art_stime_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_32bit_art_stime_augenrules" version="1">
    <ind:filepath operation="pattern match">^/etc/audit/rules\.d/.*\.rules$</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+stime[\s]+|([\s]+|[,])stime([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit auditctl 32-bit stime" id="test_32bit_art_stime_auditctl" version="1">
    <ind:object object_ref="object_32bit_art_stime_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_32bit_art_stime_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+-F[\s]+arch=b32.*(-S[\s]+stime[\s]+|([\s]+|[,])stime([\s]+|[,])).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

</def-group>
