From owner-freebsd-fs@FreeBSD.ORG Sat May 12 01:45:17 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A55B5106566B for ; Sat, 12 May 2012 01:45:17 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 5D9B08FC14 for ; Sat, 12 May 2012 01:45:17 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAI2/rU+DaFvO/2dsb2JhbABEhXmufoIVAQEEASNWBRYOCgICDRkCWQaIHAWoRJJLgS+JaIRwgRgElX2QQIMF X-IronPort-AV: E=Sophos;i="4.75,574,1330923600"; d="scan'208";a="168933545" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 11 May 2012 21:45:11 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 32772B3EFE; Fri, 11 May 2012 21:45:11 -0400 (EDT) Date: Fri, 11 May 2012 21:45:11 -0400 (EDT) From: Rick Macklem To: Andrey Simonenko Message-ID: <1493074817.296570.1336787111152.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20120511122020.GA13906@pm513-1.comsys.ntu-kpi.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: freebsd-fs@freebsd.org Subject: Re: NFSv4 Questions X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2012 01:45:17 -0000 Andrey Simonenko wrote: > On Thu, May 10, 2012 at 04:34:15PM -0400, Rick Macklem wrote: > > Andrey Simonenko wrote: > > > > > in RFC 3530. (It may be implied by the fact that NFSv4 uses a > > > > "user" > > > > based > > > > security model and not a "host" based one.) > > > > > > > > As such, the client should never need to "waste" a reserved > > > > port# on > > > > a NFSv4 > > > > connection. > > > > > > Since AUTH_SYS can be used in NFSv4 as well and according to RFC > > > 3530 > > > AUTH_SYS in NFSv4 has the same logic as in NFSv2/3, then > > > > > > 1. Does "user" based security model mean RPCSEC_GSS? > > > > > > 2. Does "host" based security model mean AUTH_SYS? > > > > > My guess is that AUTH_SYS is not considered a security model at all, > > but the "authenticators" refer to users. > > Probably I wrongly asked the question. I did not mean that some > security > flavor (eg. AUTH_SYS) is a security model. I wanted to say that NFSv4 > allows to use AUTH_SYS security flavor and user credentials are given > as is by client's machine, so some form of control by client's IP > address > is required by the NFSv4 server if a client uses and is allowed to use > AUTH_SYS security flavor. Actually this is specified in "16. Security > Considerations" from RFC 3530 and AUTH_SYS in NFSv4 is called << > "classic" > model of machine authentication via IP address checking >>. > > What do you think about the following idea about configuration? > > 1. The NFS server for NFSv2/3 clients allows to specify whether their > MOUNT MNT, UMNT and UMNTALL RPC requests have to or do not have to > come > from reserved ports. > > 2. The NFS server for NFSv2/3/4 clients allows to specify whether > their > NFS RPC calls: > a) do not have to come from reserved ports > b) always have to come from reserved ports > c) have to come from reserved ports if clients use AUTH_SYS. > > 3. By default reserved ports are not required for MOUNT RPC and > NFS RPC calls. Corresponding options can be used for entire file > system and/or for single address specification. > > First item obviously is checked in a user space and second item is > checked > in the NFS server somewhere after VFS_CHECKEXP() when the server > decides > which security flavor to use. > One problem with this is that some NFSv4 operations do not have any file handle and, as such, cannot be associated with any exported file system. (I suppose you could add the export option for resvport to the V4: line like I did with "-sec" for these operations, but it will get messy.) > NetBSD already has -noresvmnt and -noresvport options in their > exports(5). > I'll let others comment w.r.t. whether they have a need for this. To me, unless others are saying "we need this", I don't see any reason to change what is already there, except maybe optionally require a reserved port# for NFSv4 mounts via a sysctl. I comment on this further down. > > Personally, I agree with the working group and have always thought > > requiring > > a client to use a "reserved port#" was meaningless. However, I > > already noted > > that I don't mind enabling it, with a comment that it should not be > > required > > for NFSv4. > > If a client machine is trusted, then reserved ports can guaranty that > requests come from privileged processes and not from user space where > client can fill any credentials in AUTH_SYS. If client machine is not > trusted, then this will not work of course. BTW mountd requires > reserved > port and NFS server does not required reserved port by default. Well, I agree that, if you have a client machine where "root" is secure (no root kit vunerabilities, etc) but non-root users on this machine would potentially run their own bogus userland NFS client, then requiring a reserved port# does subvert the use of such a bogus NFS client. (My concern is that some people will think that requiring a reserved port# makes NFS secure for other cases, like users with their own laptops/desktops.) Personally, I think the above case is rare and that having another sysctl vfs.nfsd.nfsv4_privport (similar to vfs.nfsd.nfs_privport) is sufficient, but I'll let others comment on this, since it is not my decision. rick