We have a NetApp file server running Data ONTAP Release 7.2.7. It serves NFSv3 with sec=sys authentication to a large number of centrally administered Linux clients, where root is trusted but the normal users are not. Unfortunately, we have not found a way to configure our NetApp file server to restrict NFS RPC calls (to port 2049) such that they are only allowed if they come from a privileged source port (<1024). While many other NFS servers (e.g., the Linux one) support in /etc/exports an option
secure This option requires that requests originate on an internet port less than
IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify
insecure.
we could not find any equivalent in Data ONTAP Release 7.2.7. This is a critical security problem for us, because the absence of a source-port restriction allows normal users easily to bypass all NFS security of the NetApp filer. Two types of attack are possible:
a) via NFSv3: We are restricting the mount protocol to privileged source ports (NetApp option nfs.mount_rootonly). However, this is insufficient and insecure. The mount protocol only serves to tell the NFS client a valid file handle. Such file handles can alternatively easily be either observed on the wire (e.g., using WireShark), or they can be brute-force searched. Once any valid directory file handle is known (and they last a long time!), a suitable user-level NFSv3 client (e.g. http://www.watson.org/~robert/freebsd/nfssuite-0.1.tgz) can then be used easily by non-root users to access the filespace with an arbitrarily chosen uid/gid. 😞
b) via NFSv4: This is even easier. Because NFSv4 has no separate mount protocol, there is not even any need to guess or eavesdrop a filehandle and to use a special NFS client that can bypass the mount protocol when given a known hexadecimal filehandle. A normal non-root user can simply use ssh port-2049 forwarding from an untrusted machine under their control to a trusted machine in order to get full access to the NetApp filespace, by mounting via ssh from their own machine (where they are root). :-((
Question: Did we miss anything in the documentation or is there really no way to restrict the whole NFS protocol (except for NULL requests, see RFC2623 section 2.3.1), and not just the mount protocol, to privileged source ports? This seems to pose a very serious security problem for any installation that still has to rely on sec=sys for the foreseeable future!
Feature request: Could you please consider adding to the /etc/exports syntax something equivalent to the "secure" option (see "man exports" on Linux).
Thanks,
Dr Markus Kuhn
Computer Laboratory, University of Cambridge
http://www.cl.cam.ac.uk/~mgk25/