freebsd-dev/sys/fs/nfsclient
Rick Macklem 896516e54a nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts
Without this patch, a Kerberized NFSv4.1/4.2 mount must provide
a Kerberos credential for the client at mount time.  This credential
is typically referred to as a "machine credential".  It can be
created one of two ways:
- The user (usually root) has a valid TGT at the time the mount
  is done and this becomes the machine credential.
  There are two problems with this.
  1 - The user doing the mount must have a valid TGT for a user
      principal at mount time.  As such, the mount cannot be put
      in fstab(5) or similar.
  2 - When the TGT expires, the mount breaks.
- The client machine has a service principal in its default keytab
  file and this service principal (typically called a host-based
  initiator credential) is used as the machine credential.
  There are problems with this approach as well:
  1 - There is a certain amount of administrative overhead creating
      the service principal for the NFS client, creating a keytab
      entry for this principal and then copying the keytab entry
      into the client's default keytab file via some secure means.
  2 - The NFS client must have a fixed, well known, DNS name, since
      that FQDN is in the service principal name as the instance.

This patch uses a feature of NFSv4.1/4.2 called SP4_NONE, which
allows the state maintenance operations to be performed by any
authentication mechanism, to do these operations via AUTH_SYS
instead of RPCSEC_GSS (Kerberos).  As such, neither of the above
mechanisms is needed.

It is hoped that this option will encourage adoption of Kerberized
NFS mounts using TLS, to provide a more secure NFS mount.

This new NFSv4.1/4.2 mount option, called "syskrb5" must be used
with "sec=krb5[ip]" to avoid the need for either of the above
Kerberos setups to be done by the client.

Note that all file access/modification operations still require
users on the NFS client to have a valid TGT recognized by the
NFSv4.1/4.2 server.  As such, this option allows, at most, a
malicious client to do some sort of DOS attack.

Although not required, use of "tls" with this new option is
encouraged, since it provides on-the-wire encryption plus,
optionally, client identity verification via a X.509
certificate provided to the server during TLS handshake.
Alternately, "sec=krb5p" does provide on-the-wire
encryption of file data.

A mount_nfs(8) man page update will be done in a separate commit.

Discussed on:	freebsd-current@
MFC after:	3 months
2023-03-16 15:55:36 -07:00
..
nfs_clbio.c filesystems: return error from vn_rlimit_fsize() instead of EFBIG 2022-09-24 19:41:14 +03:00
nfs_clcomsubs.c nfsclient: Fix a typos in source code comments 2022-03-27 19:27:05 +02:00
nfs_clkdtrace.c Adjust dtnfsclient_unload() definition to avoid clang 15 warning 2022-07-19 20:41:24 +02:00
nfs_clkrpc.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clnfsiod.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs_clnode.c nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts 2023-03-16 15:55:36 -07:00
nfs_clport.c nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts 2023-03-16 15:55:36 -07:00
nfs_clrpcops.c nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts 2023-03-16 15:55:36 -07:00
nfs_clstate.c nfscl: Move nfsrpc_destroysession into nfscommon 2022-07-09 08:02:14 -07:00
nfs_clsubs.c sysent: Get rid of bogus sys/sysent.h include. 2022-05-28 20:52:17 +03:00
nfs_clvfsops.c nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts 2023-03-16 15:55:36 -07:00
nfs_clvnops.c nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts 2023-03-16 15:55:36 -07:00
nfs_kdtrace.h fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs.h nfscl: Add support for a NFSv4 AppendWrite RPC 2022-04-30 13:49:23 -07:00
nfsmount.h nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts 2023-03-16 15:55:36 -07:00
nfsnode.h PR#259071 provides a test program that fails for the NFS client. 2021-10-30 16:35:02 -07:00
nlminfo.h