<def-group>
  <definition class="compliance" id="audit_rules_session_events" version="1">
    {{{ oval_metadata("Audit rules should capture information about session initiation.") }}}

    <criteria operator="OR">

      <!-- Test the augenrules case -->
      <criteria operator="AND">
        <extend_definition comment="audit augenrules" definition_ref="audit_rules_augenrules" />
        <criterion comment="audit augenrules utmp" test_ref="test_arse_utmp_augenrules" />
        <criterion comment="audit augenrules btmp" test_ref="test_arse_btmp_augenrules" />
        <criterion comment="audit augenrules wtmp" test_ref="test_arse_wtmp_augenrules" />
      </criteria>

      <!-- Test the auditctl case -->
      <criteria operator="AND">
        <extend_definition comment="audit auditctl" definition_ref="audit_rules_auditctl" />
        <criterion comment="audit auditctl utmp" test_ref="test_arse_utmp_auditctl" />
        <criterion comment="audit auditctl btmp" test_ref="test_arse_btmp_auditctl" />
        <criterion comment="audit auditctl wtmp" test_ref="test_arse_wtmp_auditctl" />
      </criteria>

    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" comment="audit augenrules utmp" id="test_arse_utmp_augenrules" version="1">
    <ind:object object_ref="object_arse_utmp_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_arse_utmp_augenrules" version="1">
    <ind:filepath operation="pattern match">^/etc/audit/rules\.d/.*\.rules$</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/var/run/utmp\s+\-p\s+wa\b.*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit augenrules btmp" id="test_arse_btmp_augenrules" version="1">
    <ind:object object_ref="object_arse_btmp_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_arse_btmp_augenrules" version="1">
    <ind:filepath operation="pattern match">^/etc/audit/rules\.d/.*\.rules$</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/var/log/btmp\s+\-p\s+wa\b.*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit augenrules wtmp" id="test_arse_wtmp_augenrules" version="1">
    <ind:object object_ref="object_arse_wtmp_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_arse_wtmp_augenrules" version="1">
    <ind:filepath operation="pattern match">^/etc/audit/rules\.d/.*\.rules$</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/var/log/wtmp\s+\-p\s+wa\b.*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit auditctl utmp" id="test_arse_utmp_auditctl" version="1">
    <ind:object object_ref="object_arse_utmp_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_arse_utmp_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/var/run/utmp\s+\-p\s+wa\b.*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit auditctl btmp" id="test_arse_btmp_auditctl" version="1">
    <ind:object object_ref="object_arse_btmp_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_arse_btmp_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/var/log/btmp\s+\-p\s+wa\b.*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" comment="audit auditctl wtmp" id="test_arse_wtmp_auditctl" version="1">
    <ind:object object_ref="object_arse_wtmp_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_arse_wtmp_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/var/log/wtmp\s+\-p\s+wa\b.*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

</def-group>
