<def-group>
  <definition class="compliance" id="{{{ rule_id }}}" version="1">
    {{{ oval_metadata("Accessing a repository should be allowed only when the repository is authenticated.") }}}

    <criteria comment="Check if allow-unauthenticated is set to false or is undefined" operator="AND">
      <criterion comment="Check if allow-unauthenticated is set to false or is undefined"
          test_ref="test_{{{ rule_id }}}" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="any_exist"
      comment="Checks allow-unauthenticated in apt configs"
      id="test_{{{ rule_id }}}" version="1">
    <ind:object object_ref="obj_{{{ rule_id }}}" />
    <ind:state state_ref="state_{{{ rule_id }}}" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="obj_{{{ rule_id }}}" version="1">
    <ind:filepath operation="pattern match">/etc/apt/apt.conf(\.d/.*)?$</ind:filepath>
    <ind:pattern operation="pattern match">^[^#]*(?i)AllowUnauthenticated(?-i)(.*)$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_{{{ rule_id }}}" version="1">
    <ind:subexpression datatype="string" operation="pattern match">^[\s]+"false"[\s]*;[\s]*$</ind:subexpression>
  </ind:textfilecontent54_state>
</def-group>
