<def-group>
  <definition class="compliance" id="chromium_extension_whitelist"  version="1">
    <metadata>
      <title>Extension Whitelist</title>
      <affected family="unix">
        <platform>Google Chromium Browser</platform>
      </affected>
      <description>Extensions that are approved for use must be whitelisted.</description>
    </metadata>
    <criteria>
      <criterion comment="Chromium whitelist extension" test_ref="test_chromium_extension_whitelist" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" comment="Chromium whitelist extension" id="test_chromium_extension_whitelist" version="1">
    <ind:object object_ref="object_chromium_extension_whitelist" />
    <ind:state state_ref="state_chromium_extension_whitelist" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_chromium_extension_whitelist" version="1">
    <ind:filepath operation="pattern match">^/etc/chromium/policies/managed/.*\.json$</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]+\"ExtensionInstallWhitelist\"\:[\s]+\[\"(\S+)\"],</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_chromium_extension_whitelist" version="1">
    <ind:subexpression operation="equals" var_check="all" var_ref="var_extension_whitelist" />
  </ind:textfilecontent54_state>

  <external_variable id="var_extension_whitelist" datatype="string" version="1" comment="Expected approved extensions" />

</def-group>
