<def-group>
  <definition class="compliance" id="mount_option_nodev_remote_filesystems" version="1">
    <metadata>
      <title>Mount Remote Filesystems with nodev</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 6</platform>
      </affected>
      <description>The nodev option should be enabled for all NFS mounts in /etc/fstab.</description>
	  <reference source="DS" ref_id="20130918" ref_url="test_attestation" />
    </metadata>
    <criteria operator="XOR">
      <!-- these tests are designed to be mutually exclusive; either no nfs mounts exist in /etc/fstab -->
      <!-- or all of the nfs mounts defined in /etc/fstab have the nodev mount option specified -->
      <criterion comment="remote nfs filesystems" test_ref="test_no_nfs_defined_etc_fstab_nodev" />
      <criterion comment="remote nfs filesystems" test_ref="test_nfs_nodev_etc_fstab" />
    </criteria>
  </definition>
  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="all nfs has nodev" id="test_nfs_nodev_etc_fstab" version="1">
    <ind:object object_ref="object_nfs_nodev_etc_fstab" />
    <ind:state state_ref="state_remote_filesystem_nodev" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_nfs_nodev_etc_fstab" version="1">
    <ind:filepath>/etc/fstab</ind:filepath>
    <ind:pattern operation="pattern match">^\s*[\.\w]+:[/\w]+\s+[/\w]+\s+nfs[4]?\s+(.*)$</ind:pattern>
    <!-- the "not equal" operation essentially means all instances of the regexp -->
    <ind:instance datatype="int" operation="not equal">0</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_state id="state_remote_filesystem_nodev" version="1">
    <ind:subexpression operation="pattern match">^.*nodev.*$</ind:subexpression>
  </ind:textfilecontent54_state>
  <ind:textfilecontent54_test check="all" check_existence="none_exist" comment="no nfs" id="test_no_nfs_defined_etc_fstab_nodev" version="1">
    <!-- this test returns 'true' if /etc/fstab does not contain nfs/nfs4 mounts -->
    <ind:object object_ref="object_no_nfs_defined_etc_fstab_nodev" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_no_nfs_defined_etc_fstab_nodev" version="1">
    <ind:filepath>/etc/fstab</ind:filepath>
    <ind:pattern operation="pattern match">^\s*[\.\w]+:[/\w]+\s+[/\w]+\s+nfs[4]?\s+.*$</ind:pattern>
    <!-- the "not equal" operation below essentially means all instances of the regexp -->
    <ind:instance datatype="int" operation="not equal">0</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
