<def-group>
  <definition class="compliance" id="sshd_do_not_permit_user_env" version="1">
    <metadata>
      <title>Do Not Allow Users to Set Environment Options</title>
      <affected family="unix">
        <platform>multi_platform_rhel</platform>
      </affected>
      <description>PermitUserEnvironment should be disabled</description>
      <reference source="JL" ref_id="20140414" ref_url="test_attestation" />
    </metadata>
    <criteria comment="SSH is not being used or conditions are met"
    operator="OR">
      <extend_definition comment="sshd service is disabled"
      definition_ref="service_sshd_disabled" />
      <criterion comment="Check PermitUserEnvironment in /etc/ssh/sshd_config"
      negate="true" test_ref="test_sshd_no_user_envset" />
    </criteria>
  </definition>
  <ind:textfilecontent54_test check="all" check_existence="none_exist"
  comment="Check value of PermitUserEnvironment in /etc/ssh/sshd_config"
  id="test_sshd_no_user_envset" version="1">
    <ind:object object_ref="obj_sshd_no_user_envset" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_sshd_no_user_envset" version="2">
    <ind:filepath>/etc/ssh/sshd_config</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*(?i)PermitUserEnvironment(?-i)[\s]+no[\s]*(?:|(?:#.*))?$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
