Skip to contentSkip to conversation

exportfs: make "insecure" the default for all exports

PATCH In review Jeff Layton 12 participants 61 messages May 13, 2025 – Jun 5, 2025 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Jeff Layton

author maintainer
#0 lore raw

PATCH 1/1 exportfs: make "insecure" the default for all exports

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -2
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)

---
base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

Quoted 6 lines

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

Quoted 47 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Chuck Lever
#2 lore raw
In reply to Jeff Layton
Quoted 10 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Quoted 6 lines

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

This patch is one of the WORST ideas in recent times.

While your assessment might be half-true for the average home office, sites like universities, scientific labs and enterprise networks consider RPC traffic being restricted to a port below 1024 as a layer of security.

The original idea was that only trusted people have "root" access, and only uid=0/root can allocate TCP ports below 1024.
That is STILL TRUE for universities and other sides, and I think most admins there will absolutely NOT appreciate that you disable a layer of security just to please script kiddles and wanna-be hackers.

I am going to fight this patch, to the BITTER end, with blood and biting.

Lionel

author maintainer
#3 lore raw
Quoted 25 lines · Lionel Cons
Quoted 10 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Quoted 6 lines

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

This patch is one of the WORST ideas in recent times.

While your assessment might be half-true for the average home office, sites like universities, scientific labs and enterprise networks consider RPC traffic being restricted to a port below 1024 as a layer of security.

Quoted 8 lines

The original idea was that only trusted people have "root" access, and only uid=0/root can allocate TCP ports below 1024.
That is STILL TRUE for universities and other sides, and I think most admins there will absolutely NOT appreciate that you disable a layer of security just to please script kiddles and wanna-be hackers.

I am going to fight this patch, to the BITTER end, with blood and biting.

Get your teeth ready then.

Are your university networks segregated such that you have control over every client? If not, then the current regime of limiting connections to ports lower than 1024 is absolutely meaningless. As soon as you have one unmanaged client that can access the server via socket that measure is easily defeated. Windows machines (for instance) have no such restriction on opening low ports, and on *nix most users can easily be root on their own host these days.

Also, if you're that concerned about security, why are you not using krb5? Note that using gssapi also disables the restriction to low ports, so I assume you must be using AUTH_UNIX? That's easily spoofable as well by an unmanaged client.

Finally, I'm not disabling anything. We're simply setting the default to the value that _most_ users will want to use. If you feel that you have need to keep preventing inbound connections from ports lower than 1024, you can just set "secure" on your exports and go about your day.

Cheers,

Signature · 1 line
Jeff Layton <[email protected]>
#4 lore raw
In reply to Lionel Cons
Quoted 25 lines · Lionel Cons
Quoted 10 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Quoted 6 lines

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

This patch is one of the WORST ideas in recent times.

While your assessment might be half-true for the average home office, sites like universities, scientific labs and enterprise networks consider RPC traffic being restricted to a port below 1024 as a layer of security.

Quoted 7 lines

The original idea was that only trusted people have "root" access, and only uid=0/root can allocate TCP ports below 1024.
That is STILL TRUE for universities and other sides, and I think most admins there will absolutely NOT appreciate that you disable a layer of security just to please script kiddles and wanna-be hackers.

I am going to fight this patch, to the BITTER end, with blood and biting.

Lionel, your combative attitude is not helpful. You clearly did not read Jeff's patch, nor do you understand how network security is implemented. Checking the source port was long ago deemed completely useless, no more secure than ROT13. Solaris NFS servers have not checked the client's source port for many many years, for example.

Most of the contributors and maintainers here were first employed by universities. We're well aware of the security requirements in those environments and how university IT departments meet those requirements. Any environment that requires security uses a solution based on cryptography, such as Kerberos or TLS.

Jeff can, of course, ably defend his work. The reason I'm responding in this email thread is to make this general comment to the list:

This mailing list is not a help desk, nor is it a users group, nor is it a place where you can come and ask for new features without providing a single use case. This is a discussion list for contributors to the Linux in-kernel NFS implementation. The active word in that last sentence is "contributor".

If you can't follow along or do not understand a posting, please do not respond to it. Or if you must respond, first ask for clarification -- if something seems outrageous to you, it is highly likely that you do not understand what you read.

Think carefully before you post on a public mailing list, and please respect your readers' time and attention.

Signature · 1 line
Chuck Lever
#5 lore raw
Quoted 41 lines · Chuck Lever
Quoted 25 lines · Lionel Cons
Quoted 10 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Quoted 6 lines

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

This patch is one of the WORST ideas in recent times.

While your assessment might be half-true for the average home office, sites like universities, scientific labs and enterprise networks consider RPC traffic being restricted to a port below 1024 as a layer of security.

Quoted 7 lines

The original idea was that only trusted people have "root" access, and only uid=0/root can allocate TCP ports below 1024.
That is STILL TRUE for universities and other sides, and I think most admins there will absolutely NOT appreciate that you disable a layer of security just to please script kiddles and wanna-be hackers.

I am going to fight this patch, to the BITTER end, with blood and biting.

Lionel, your combative attitude is not helpful. You clearly did not read Jeff's patch, nor do you understand how network security is implemented. Checking the source port was long ago deemed completely useless, no more secure than ROT13. Solaris NFS servers have not checked the client's source port for many many years, for example.

Quoted 5 lines

Most of the contributors and maintainers here were first employed by universities. We're well aware of the security requirements in those environments and how university IT departments meet those requirements. Any environment that requires security uses a solution based on cryptography, such as Kerberos or TLS.

I wouldn't even dare to mention TLS here. TLS is mostly experimental at best, and its performance is so bad that enforcing it might finally ruin the Linux NFS client+server reputation.

In that context, TLS is not an option, unless performance, latency sensitivity and CPU usage can be improved by at least a factor of 5. Yes, factor FIVE, because TLS is that BAD.

I only agree to this change because Solaris did change it long ago, but even then it was a highly disputed change, and today's universities still prefer the "resvport"

Ced

Signature · 3 lines
Cedric Blancher <[email protected]>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur
#6 lore raw
Quoted 48 lines · Cedric Blancher
Quoted 41 lines · Chuck Lever
Quoted 25 lines · Lionel Cons
Quoted 10 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Quoted 6 lines

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

This patch is one of the WORST ideas in recent times.

While your assessment might be half-true for the average home office, sites like universities, scientific labs and enterprise networks consider RPC traffic being restricted to a port below 1024 as a layer of security.

Quoted 7 lines

The original idea was that only trusted people have "root" access, and only uid=0/root can allocate TCP ports below 1024.
That is STILL TRUE for universities and other sides, and I think most admins there will absolutely NOT appreciate that you disable a layer of security just to please script kiddles and wanna-be hackers.

I am going to fight this patch, to the BITTER end, with blood and biting.

Lionel, your combative attitude is not helpful. You clearly did not read Jeff's patch, nor do you understand how network security is implemented. Checking the source port was long ago deemed completely useless, no more secure than ROT13. Solaris NFS servers have not checked the client's source port for many many years, for example.

Quoted 5 lines

Most of the contributors and maintainers here were first employed by universities. We're well aware of the security requirements in those environments and how university IT departments meet those requirements. Any environment that requires security uses a solution based on cryptography, such as Kerberos or TLS.

Quoted 7 lines

I wouldn't even dare to mention TLS here. TLS is mostly experimental at best, and its performance is so bad that enforcing it might finally ruin the Linux NFS client+server reputation.

In that context, TLS is not an option, unless performance, latency sensitivity and CPU usage can be improved by at least a factor of 5. Yes, factor FIVE, because TLS is that BAD.

I've heard this claim several times now with no reference to actual data. I do accept the claim that NFS on an ssh tunnel is going to be pretty awful. I don't accept the subtext that NFS over TLS will /always/ be terrible for the rest of time. (and note that QUIC is coming, and for QUIC, transport-layer encryption is always on -- this problem has to be solved).

We can't begin to address problems that we don't know about. Can you cite a study or give us a reproducer? Was testing done with a NIC capable of offloading the TLS record protocol (on both ends)? Flame graphs to show us where the CPU bottlenecks are? How does the performance of NFS on TLS compare with krb5p ? I would greatly appreciate seeing careful studies of the problems.

Lastly, there are plenty of light workloads where TLS is a more operational choice than Kerberos. It's fair to exclude intensive workloads for now, but those are not the only workloads being run on NFS.

Quoted 5 lines

I only agree to this change because Solaris did change it long ago, but even then it was a highly disputed change, and today's universities still prefer the "resvport"

Ced

Signature · 1 line
Chuck Lever
reviewer
#7 lore raw
In reply to Jeff Layton
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

But who is going to export any filesystem to their laptop?

Quoted 2 lines

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

I don't see any really motivation for this change. Could you provide it please?

Thanks,
NeilBrown

Quoted 54 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
reviewer
#8 lore raw
Quoted 10 lines · NeilBrown
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Quoted 7 lines

But who is going to export any filesystem to their laptop?

Quoted 2 lines

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

Sorry - I was wrong. You aren't breaking working configurations, but you are removing a protection that people might be expecting. It might not be much protection, but it is not zero.

Quoted 3 lines

I don't see any really motivation for this change. Could you provide it please?

Or to put it another way: who benefits?

Thanks,
NeilBrown

Quoted 61 lines

Thanks,
NeilBrown

Quoted 54 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
author maintainer
#9 lore raw
Quoted 8 lines · NeilBrown
Quoted 7 lines · NeilBrown
Quoted 6 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

But who is going to export any filesystem to their laptop?

Quoted 1 line

The point is that most NFS servers are run on networks where the admin may not have 100% control over every host on the network. Once you're that situation, relying on low port values for security is basically worthless.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

Sorry - I was wrong. You aren't breaking working configurations, but you are removing a protection that people might be expecting. It might not be much protection, but it is not zero.

True. Anyone relying on this "protection" is fooling themselves though.

Quoted 6 lines
Quoted 3 lines

I don't see any really motivation for this change. Could you provide it please?

Or to put it another way: who benefits?

Anyone running NFS clients behind NAT?

The main discussion came about when we were testing against a hammerspace deployment. They were using knfsd as their DS's, and had forgotten to add "insecure" to the export options. When the (NAT'ed) client tried to talk to the DS's, it got back NFSERR3_PERM because of this. It took a little while to ascertain the cause.

Note that Solaris' NFS server stopped checking source ports many years ago. We're only doing this now because we followed suit from how they behaved in the 90s and never changed it.

Quoted 61 lines
Quoted 61 lines

Thanks,
NeilBrown

Quoted 54 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Signature · 1 line
Jeff Layton <[email protected]>
reviewer
#10 lore raw
Quoted 12 lines · Jeff Layton
Quoted 11 lines · NeilBrown
Quoted 10 lines · NeilBrown
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines

But who is going to export any filesystem to their laptop?

Quoted 1 line

The point is that most NFS servers are run on networks where the admin may not have 100% control over every host on the network. Once you're that situation, relying on low port values for security is basically worthless.

"most" ?? Where did you get that statistic?

"Some" are run on in-machine-room networks which are completely controlled, but which allow local users to log in to unprivileged accounts. In this case it makes perfect sense to rely on "privileged" ports to control access. If you silently change nfs-utils so that unprivileged users can have root-level access over NFS, then you are exposing the file server completely to anyone who can log in to an server in that local network. Are you sure you want to do that?

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

Quoted 6 lines
Quoted 4 lines

Sorry - I was wrong. You aren't breaking working configurations, but you are removing a protection that people might be expecting. It might not be much protection, but it is not zero.

True. Anyone relying on this "protection" is fooling themselves though.

As above: in some circumstances with physically secure networks (entirely in a locked room, or entire in a virtualisation host, or a VPN) it makes perfect sense.

Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

I don't see any really motivation for this change. Could you provide it please?

Or to put it another way: who benefits?

Anyone running NFS clients behind NAT?

Maybe that should have been in the commit message?

Quoted 6 lines

The main discussion came about when we were testing against a hammerspace deployment. They were using knfsd as their DS's, and had forgotten to add "insecure" to the export options. When the (NAT'ed) client tried to talk to the DS's, it got back NFSERR3_PERM because of this. It took a little while to ascertain the cause.

"Change default to fix configuration problem"....??? The default must always be the more secure. "fail safe".

If we want to make this configuration problem more easy to detect, maybe we should log unprivileged port access (beyond the few requests for which it can make sense).

Quoted 4 lines

Note that Solaris' NFS server stopped checking source ports many years ago. We're only doing this now because we followed suit from how they behaved in the 90s and never changed it.

I wonder why Sun went out of business.....

Ignoring source ports makes no sense at all unless you enforce some other authentication, like krb5 or TLS, or unless you *know* that there are no unprivileged processes running on any client machines.

Thanks,
NeilBrown

Quoted 66 lines
Quoted 62 lines
Quoted 62 lines

Thanks,
NeilBrown

Quoted 54 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Signature · 1 line
Jeff Layton <[email protected]>
author maintainer
#11 lore raw
Quoted 17 lines · NeilBrown
Quoted 16 lines · Jeff Layton
Quoted 14 lines · NeilBrown
Quoted 13 lines · NeilBrown
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

But who is going to export any filesystem to their laptop?

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

The point is that most NFS servers are run on networks where the admin may not have 100% control over every host on the network. Once you're that situation, relying on low port values for security is basically worthless.

"most" ?? Where did you get that statistic?

Anecdotal experience.

Quoted 8 lines

"Some" are run on in-machine-room networks which are completely controlled, but which allow local users to log in to unprivileged accounts. In this case it makes perfect sense to rely on "privileged" ports to control access. If you silently change nfs-utils so that unprivileged users can have root-level access over NFS, then you are exposing the file server completely to anyone who can log in to an server in that local network. Are you sure you want to do that?

These types of environments are vanishingly small these days. If you have a network of any size, it is _really_ hard to prevent someone from plugging a laptop or something else into a random network drop.

You can prevent that with 802.1x security, or something similar, but at that point what is checking the source port going to give you?

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

Sorry - I was wrong. You aren't breaking working configurations, but you are removing a protection that people might be expecting. It might not be much protection, but it is not zero.

Quoted 6 lines
Quoted 1 line

True. Anyone relying on this "protection" is fooling themselves though.

As above: in some circumstances with physically secure networks (entirely in a locked room, or entire in a virtualisation host, or a VPN) it makes perfect sense.

Not really. If any host is compromised on your network then this protection goes out the window.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

I don't see any really motivation for this change. Could you provide it please?

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Or to put it another way: who benefits?

Anyone running NFS clients behind NAT?

Maybe that should have been in the commit message?

Sure. I can add that and resend.

Quoted 10 lines
Quoted 6 lines

The main discussion came about when we were testing against a hammerspace deployment. They were using knfsd as their DS's, and had forgotten to add "insecure" to the export options. When the (NAT'ed) client tried to talk to the DS's, it got back NFSERR3_PERM because of this. It took a little while to ascertain the cause.

"Change default to fix configuration problem"....??? The default must always be the more secure. "fail safe".

The default should also always "just work". We have to balance that with being secure. There is a reason we don't default to krb5, for instance. In this case, the added security of checking low port values by default is pretty worthless. I think we ought to err on the side of usability.

Also, to be clear, this currently not even enforced in all situations where TCP is used. iwarp travels over TCP, but using RDMA disables this check.

Quoted 4 lines

If we want to make this configuration problem more easy to detect, maybe we should log unprivileged port access (beyond the few requests for which it can make sense).

I don't see any benefit in that at all. If someone wants to do that, they can get that via tracepoints.

Quoted 7 lines
Quoted 4 lines

Note that Solaris' NFS server stopped checking source ports many years ago. We're only doing this now because we followed suit from how they behaved in the 90s and never changed it.

I wonder why Sun went out of business.....

I'm fairly certain that NFS server security had little to do with Sun's death.

Quoted 4 lines

Ignoring source ports makes no sense at all unless you enforce some other authentication, like krb5 or TLS, or unless you *know* that there are no unprivileged processes running on any client machines.

Paying attention to source ports makes no sense at all. In the modern age, all sorts of middleware boxes can change the source port on a connection. It is essentially meaningless outside of a few tightly controlled environments. Those environments can always enable "secure" if they require it.

Quoted 66 lines
Quoted 66 lines
Quoted 62 lines
Quoted 62 lines

Thanks,
NeilBrown

Quoted 54 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Signature · 1 line
Jeff Layton <[email protected]>
Signature · 1 line
Jeff Layton <[email protected]>
reviewer
#12 lore raw
Quoted 37 lines · Jeff Layton
Quoted 17 lines · NeilBrown
Quoted 16 lines · Jeff Layton
Quoted 14 lines · NeilBrown
Quoted 13 lines · NeilBrown
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

But who is going to export any filesystem to their laptop?

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

The point is that most NFS servers are run on networks where the admin may not have 100% control over every host on the network. Once you're that situation, relying on low port values for security is basically worthless.

"most" ?? Where did you get that statistic?

Anecdotal experience.

Quoted 8 lines

"Some" are run on in-machine-room networks which are completely controlled, but which allow local users to log in to unprivileged accounts. In this case it makes perfect sense to rely on "privileged" ports to control access. If you silently change nfs-utils so that unprivileged users can have root-level access over NFS, then you are exposing the file server completely to anyone who can log in to an server in that local network. Are you sure you want to do that?

Quoted 3 lines

These types of environments are vanishingly small these days. If you have a network of any size, it is _really_ hard to prevent someone from plugging a laptop or something else into a random network drop.

In that case you should be disabling AUTH_UNIX, not disabling "secure".

Quoted 17 lines

You can prevent that with 802.1x security, or something similar, but at that point what is checking the source port going to give you?

Quoted 13 lines
Quoted 12 lines
Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

Sorry - I was wrong. You aren't breaking working configurations, but you are removing a protection that people might be expecting. It might not be much protection, but it is not zero.

True. Anyone relying on this "protection" is fooling themselves though.

Quoted 7 lines
Quoted 4 lines

As above: in some circumstances with physically secure networks (entirely in a locked room, or entire in a virtualisation host, or a VPN) it makes perfect sense.

Not really. If any host is compromised on your network then this protection goes out the window.

If any host is compromised then all protections go out the window. Let's make "allsquash,anonuid=0" the default.

Quoted 6 lines

The default should also always "just work". We have to balance that with being secure. There is a reason we don't default to krb5, for instance. In this case, the added security of checking low port values by default is pretty worthless. I think we ought to err on the side of usability.

No. nonononono. The default should always be secure. Many things should be installed inactive and require explicit admin action to enable. A tool should "just work". A service should do nothing unless explicitly asked.

Quoted 4 lines

Also, to be clear, this currently not even enforced in all situations where TCP is used. iwarp travels over TCP, but using RDMA disables this check.

And presumably this has always been the case so there is no case of changing a default that people might be depending on. So they aren't particularly relevant.

Quoted 8 lines
Quoted 5 lines

If we want to make this configuration problem more easy to detect, maybe we should log unprivileged port access (beyond the few requests for which it can make sense).

I don't see any benefit in that at all. If someone wants to do that, they can get that via tracepoints.

You reported that a configuration error was hard to debug. I suggested a way to make the configuration error more visible (and hence easier to debug). You cannot see the benefit....... clearly I didn't explain myself well - sorry.

Quoted 10 lines
Quoted 4 lines

Ignoring source ports makes no sense at all unless you enforce some other authentication, like krb5 or TLS, or unless you *know* that there are no unprivileged processes running on any client machines.

Paying attention to source ports makes no sense at all. In the modern age, all sorts of middleware boxes can change the source port on a connection. It is essentially meaningless outside of a few tightly controlled environments. Those environments can always enable "secure" if they require it.

But they are currently using the default in the knowledge that it is "secure" and you want to change the default for *everyone*.

Sure - change the default for yourself if that is what you want. Update your script which generates /etc/exports or add some new option to /etc/nfs.conf, but don't impose your choice on everyone without asking them (and of course you cannot ask everyone).

NeilBrown

#13 lore raw
In reply to NeilBrown
Quoted 8 lines · NeilBrown
Quoted 3 lines · Jeff Layton

On Wed, 2025-05-14 at 12:28 +1000, NeilBrown wrote:

True. Anyone relying on this "protection" is fooling themselves though.

As above: in some circumstances with physically secure networks (entirely in a locked room, or entire in a virtualisation host, or a VPN) it makes perfect sense.

On a physically secure network where all the hosts are also known to be secure, source port checking is wholly superfluous. It makes no sense there.

Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I don't see any really motivation for this change. Could you provide it please?

Or to put it another way: who benefits?

Anyone running NFS clients behind NAT?

Maybe that should have been in the commit message?

Agreed, the commit message should have more beef (sorry, vegetarians).

The commit message should also mention that NFS clients frequently exhaust their privileged source port range, causing new mount operations to fail sporadically. This is a well-documented problem and the main reason we started moving Kerberized mounts to ephemeral ports.

Generally that's a situation that is sticky for a couple of minutes while TCP sockets proceed through TIME_WAIT until the source port can be re-used by another connection.

Quoted 8 lines
Quoted 5 lines

The main discussion came about when we were testing against a hammerspace deployment. They were using knfsd as their DS's, and had forgotten to add "insecure" to the export options. When the (NAT'ed) client tried to talk to the DS's, it got back NFSERR3_PERM because of this. It took a little while to ascertain the cause.

"Change default to fix configuration problem"....??? The default must always be the more secure. "fail safe".

Sure, but this option, although it's name is "secure", offers very little real security. So we are actively promoting a mythological level of security here, and that is a Bad Thing (tm).

Quoted 3 lines

If we want to make this configuration problem more easy to detect, maybe we should log unprivileged port access (beyond the few requests for which it can make sense).

Logging this would be a potential DoS: A simple user space program could connect to 2049 repeatedly and fill the server's log.

But again, not worth the trouble: desktop file browsers connect from ephemeral ports. Why log those harmless accesses?

Quoted 5 lines
Quoted 3 lines

Note that Solaris' NFS server stopped checking source ports many years ago. We're only doing this now because we followed suit from how they behaved in the 90s and never changed it.

I wonder why Sun went out of business.....

It certainly wasn't due to the Solaris NFS server's port checking behavior. This is a red herring.

I see very few CVEs or other security advisories that describe the Solaris NFS server behavior as an active exploit. That suggests to me that source port checking is not valuable as a security mechanism.

Quoted 3 lines

Ignoring source ports makes no sense at all unless you enforce some other authentication, like krb5 or TLS, or unless you *know* that there are no unprivileged processes running on any client machines.

I'd be in favor of, first:

* exportfs emitting a message when neither "secure" nor "insecure" is specified for one or more exports

* Updating the description of "secure" in exports(8) to explain that this option provides little to no security, and strongly recommending the deployment of cryptographic security mechanisms (as described in the "RPCSEC_GSS security" section

Then later change the default to "insecure".

Signature · 1 line
Chuck Lever
reviewer
#14 lore raw
Quoted 6 lines · Chuck Lever
Quoted 5 lines · NeilBrown
Quoted 3 lines · Jeff Layton

On Wed, 2025-05-14 at 12:28 +1000, NeilBrown wrote:

True. Anyone relying on this "protection" is fooling themselves though.

Quoted 7 lines
Quoted 3 lines

As above: in some circumstances with physically secure networks (entirely in a locked room, or entire in a virtualisation host, or a VPN) it makes perfect sense.

On a physically secure network where all the hosts are also known to be secure, source port checking is wholly superfluous. It makes no sense there.

No, that is the only place that it makes sense.

If you have a secure network of secure machines running a secure configuration of secure software managed by secure administrators, then you can trust that a low port number comes from secure software and, in particular, that the UID in the AUTH_SYS credential is reliable.

If you don't have that security, then you cannot trust the port number or the uid and should not be accepting AUTH_SYS at all.

If you *Do* have that security, then we can discuss if the "secure" or "insecure" flag is appropriate. If you know that all processes running on all nodes in the network are secure, and will only do what the admins let them do, then there is no need for "secure" with its restrictions, and "insecure" is perfectly fine. However if you allow lower-privileged processes - maybe you have a login server, or you let people upload their own cgi scripts to the web server - then "secure" is important to ensure users only access file that their uid has access to.

Quoted 31 lines
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

I don't see any really motivation for this change. Could you provide it please?

Or to put it another way: who benefits?

Anyone running NFS clients behind NAT?

Maybe that should have been in the commit message?

Agreed, the commit message should have more beef (sorry, vegetarians).

The commit message should also mention that NFS clients frequently exhaust their privileged source port range, causing new mount operations to fail sporadically. This is a well-documented problem and the main reason we started moving Kerberized mounts to ephemeral ports.

Generally that's a situation that is sticky for a couple of minutes while TCP sockets proceed through TIME_WAIT until the source port can be re-used by another connection.

Quoted 6 lines
Quoted 5 lines

The main discussion came about when we were testing against a hammerspace deployment. They were using knfsd as their DS's, and had forgotten to add "insecure" to the export options. When the (NAT'ed) client tried to talk to the DS's, it got back NFSERR3_PERM because of this. It took a little while to ascertain the cause.

Quoted 6 lines
Quoted 2 lines

"Change default to fix configuration problem"....??? The default must always be the more secure. "fail safe".

Sure, but this option, although it's name is "secure", offers very little real security. So we are actively promoting a mythological level of security here, and that is a Bad Thing (tm).

"very little" is not zero. "mythological" is unfair. There is real security is certain specific situations.

NeilBrown

#15 lore raw
Quoted 68 lines · NeilBrown
Quoted 6 lines · Chuck Lever
Quoted 5 lines · NeilBrown
Quoted 3 lines · Jeff Layton

On Wed, 2025-05-14 at 12:28 +1000, NeilBrown wrote:

True. Anyone relying on this "protection" is fooling themselves though.

Quoted 7 lines
Quoted 3 lines

As above: in some circumstances with physically secure networks (entirely in a locked room, or entire in a virtualisation host, or a VPN) it makes perfect sense.

On a physically secure network where all the hosts are also known to be secure, source port checking is wholly superfluous. It makes no sense there.

No, that is the only place that it makes sense.

If you have a secure network of secure machines running a secure configuration of secure software managed by secure administrators, then you can trust that a low port number comes from secure software and, in particular, that the UID in the AUTH_SYS credential is reliable.

If you don't have that security, then you cannot trust the port number or the uid and should not be accepting AUTH_SYS at all.

If you *Do* have that security, then we can discuss if the "secure" or "insecure" flag is appropriate. If you know that all processes running on all nodes in the network are secure, and will only do what the admins let them do, then there is no need for "secure" with its restrictions, and "insecure" is perfectly fine. However if you allow lower-privileged processes - maybe you have a login server, or you let people upload their own cgi scripts to the web server - then "secure" is important to ensure users only access file that their uid has access to.

Quoted 34 lines
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

I don't see any really motivation for this change. Could you provide it please?

Or to put it another way: who benefits?

Anyone running NFS clients behind NAT?

Maybe that should have been in the commit message?

Agreed, the commit message should have more beef (sorry, vegetarians).

The commit message should also mention that NFS clients frequently exhaust their privileged source port range, causing new mount operations to fail sporadically. This is a well-documented problem and the main reason we started moving Kerberized mounts to ephemeral ports.

Generally that's a situation that is sticky for a couple of minutes while TCP sockets proceed through TIME_WAIT until the source port can be re-used by another connection.

Quoted 8 lines
Quoted 5 lines

The main discussion came about when we were testing against a hammerspace deployment. They were using knfsd as their DS's, and had forgotten to add "insecure" to the export options. When the (NAT'ed) client tried to talk to the DS's, it got back NFSERR3_PERM because of this. It took a little while to ascertain the cause.

"Change default to fix configuration problem"....??? The default must always be the more secure. "fail safe".

Quoted 6 lines
Quoted 3 lines

Sure, but this option, although it's name is "secure", offers very little real security. So we are actively promoting a mythological level of security here, and that is a Bad Thing (tm).

"very little" is not zero. "mythological" is unfair. There is real security is certain specific situations.

We can argue about "mythological", but it is totally fair to say that calling this mechanism "secure", and its inverse "insecure" is an overreach and a gross misrepresentation. It is relevant only for AUTH_UNIX and only then when there are other active forms of security in place.

So I think our fundamental point is that the balance has changed. These days, in most situations, source port checking is not relevant and is actively inconvenient for many common usage scenarios.

Before changing the default behavior of NFSD, we can survey other common network storage protocol implementations (iSCSI, NVMe, SMB) to see if those protocols also use this form of authorizing access.

In the meantime, do you object to moving forward with the other two suggestions I made:

- Updating the description of the "secure" export option in exports(5)

- Adding a warning to exportfs when an export has neither "secure" or "insecure" set and allows access via sec=sys ?

Signature · 1 line
Chuck Lever
reviewer
#16 lore raw
Quoted 16 lines · Chuck Lever
Quoted 8 lines · NeilBrown
Quoted 4 lines · Chuck Lever

Sure, but this option, although it's name is "secure", offers very little real security. So we are actively promoting a mythological level of security here, and that is a Bad Thing (tm).

"very little" is not zero. "mythological" is unfair. There is real security is certain specific situations.

We can argue about "mythological", but it is totally fair to say that calling this mechanism "secure", and its inverse "insecure" is an overreach and a gross misrepresentation. It is relevant only for AUTH_UNIX and only then when there are other active forms of security in place.

Quoted 7 lines

So I think our fundamental point is that the balance has changed. These days, in most situations, source port checking is not relevant and is actively inconvenient for many common usage scenarios.

Before changing the default behavior of NFSD, we can survey other common network storage protocol implementations (iSCSI, NVMe, SMB) to see if those protocols also use this form of authorizing access.

I don't think it is relevant what other protocols do. If we were adding a new feature, then examining the state of the art would make sense, but that is not what is happening here.

It might make sense to remove AUTH_SYS support in the same way that rlogin and rsh have effectively been removed and replaced by ssh. It would never have made sense to change rlogind to stop checking the source port of the TCP connection (and would never have made sense for sshd to check it).

I cannot ever see any justification for changing defaults to make a service less secure.

Quoted 8 lines

In the meantime, do you object to moving forward with the other two suggestions I made:

- Updating the description of the "secure" export option in exports(5)

- Adding a warning to exportfs when an export has neither "secure" or "insecure" set and allows access via sec=sys ?

Those two sound like very sensible changes.

Thanks,
NeilBrown

#17 lore raw
Quoted 25 lines · NeilBrown
Quoted 16 lines · Chuck Lever
Quoted 8 lines · NeilBrown
Quoted 4 lines · Chuck Lever

Sure, but this option, although it's name is "secure", offers very little real security. So we are actively promoting a mythological level of security here, and that is a Bad Thing (tm).

"very little" is not zero. "mythological" is unfair. There is real security is certain specific situations.

We can argue about "mythological", but it is totally fair to say that calling this mechanism "secure", and its inverse "insecure" is an overreach and a gross misrepresentation. It is relevant only for AUTH_UNIX and only then when there are other active forms of security in place.

Quoted 7 lines

So I think our fundamental point is that the balance has changed. These days, in most situations, source port checking is not relevant and is actively inconvenient for many common usage scenarios.

Before changing the default behavior of NFSD, we can survey other common network storage protocol implementations (iSCSI, NVMe, SMB) to see if those protocols also use this form of authorizing access.

Quoted 6 lines

I don't think it is relevant what other protocols do. If we were adding a new feature, then examining the state of the art would make sense, but that is not what is happening here.

It might make sense to remove AUTH_SYS support in the same way that rlogin and rsh have effectively been removed and replaced by ssh.

The point of TLS is to protect the use of AUTH_SYS, because as Martin points out, Kerberos is challenging to deploy. I don't believe support for AUTH_SYS is something we can get rid of, and the nfsv4 WG has recognized this reality with the publication of RFC 9289.

With TLS, not only is the use of cleartext user identity encrypted, but when mtls is in use, we have client peer authentication, which serves the same purpose as source port checking, but does so with cryptography.

Quoted 7 lines

It
would never have made sense to change rlogind to stop checking the source port of the TCP connection (and would never have made sense for sshd to check it).

I cannot ever see any justification for changing defaults to make a service less secure.

I do not disagree at all with that general philosophy.

I think where you and I disagree is in how much actual security that source port checking actually confers.

Quoted 9 lines
Quoted 7 lines

In the meantime, do you object to moving forward with the other two suggestions I made:

- Updating the description of the "secure" export option in exports(5)

- Adding a warning to exportfs when an export has neither "secure" or "insecure" set and allows access via sec=sys ?

Those two sound like very sensible changes.

Fair enough. We'll focus on improving the man page text for now.

Signature · 1 line
Chuck Lever
reviewer
#18 lore raw
Quoted 3 lines · Chuck Lever

Fair enough. We'll focus on improving the man page text for now.

Has anyone volunteered to do that?

Here are some words that might be useful. I haven't tried to structure them to fit well into the man page.
---------------
sec=sys (also known as AUTH_SYS) is only safe to specify for clients that are connected to the server by a secure network - either physically secure such as in a locked room, or cryptographically secure such as with a VPN where the client hardware is also secure (locked cage or secure-boot etc).

When such physical and/or crypto security is in place sec=sys can safely be used and there is an extra configuration option available in a choice between the "secure" and "insecure" export options.

"insecure" means that all software running in the client node is fully trusted to only access files on the NFS exports that it is expected to access. In this case the server will accept connections from any TCP port on the client (and messages from any UDP port) - as they can equally be trusted.

"secure" means that the clients are Unix-like systems and that only "admin" software such as the kernel and administrative software running as "root" can be trusted to access files appropriately. All other software, which includes all user-space software running with a UID other than zero, should be treated with caution and not given direct access to the NFS server. In this case the server will reject connections from TCP ports on the client with numbers not less than 1024 (and UDP messages from ports not less than 1024) as such connections an messages may be from an untrusted process. Note that on Unix-like systems only privileged processes can send from ports below 1024.

The "secure" option is enabled by default as it is least likely to give away undesired access. Note that the names of the options do not clearly match the descriptions given.

-------------

I haven't added anything about mtls as I couldn't find out how nfsd interprets the identity presented in the client-side certificate. If the identity is a "machine identity" then sec=sys would make sense on that connection. If the identity is for a specific user and can map to a uid, the all_squash,anon=UID should be imposed on that connection.

Can you point me to any documentation about how the client certificate is interpreted by nfsd?

Thanks,
NeilBrown

author maintainer
#19 lore raw
Quoted 9 lines · NeilBrown
Quoted 3 lines · Chuck Lever

Fair enough. We'll focus on improving the man page text for now.

Has anyone volunteered to do that?

Here are some words that might be useful. I haven't tried to structure them to fit well into the man page.

Thanks Neil.

I was planning to write up a manpage patch for this once the dust had settled from this discussion. I'll plan to incorporate something like what you've written below.

Quoted 42 lines

---------------
sec=sys (also known as AUTH_SYS) is only safe to specify for clients that are connected to the server by a secure network - either physically secure such as in a locked room, or cryptographically secure such as with a VPN where the client hardware is also secure (locked cage or secure-boot etc).

When such physical and/or crypto security is in place sec=sys can safely be used and there is an extra configuration option available in a choice between the "secure" and "insecure" export options.

"insecure" means that all software running in the client node is fully trusted to only access files on the NFS exports that it is expected to access. In this case the server will accept connections from any TCP port on the client (and messages from any UDP port) - as they can equally be trusted.

"secure" means that the clients are Unix-like systems and that only "admin" software such as the kernel and administrative software running as "root" can be trusted to access files appropriately. All other software, which includes all user-space software running with a UID other than zero, should be treated with caution and not given direct access to the NFS server. In this case the server will reject connections from TCP ports on the client with numbers not less than 1024 (and UDP messages from ports not less than 1024) as such connections an messages may be from an untrusted process. Note that on Unix-like systems only privileged processes can send from ports below 1024.

The "secure" option is enabled by default as it is least likely to give away undesired access. Note that the names of the options do not clearly match the descriptions given.

-------------

I haven't added anything about mtls as I couldn't find out how nfsd interprets the identity presented in the client-side certificate. If the identity is a "machine identity" then sec=sys would make sense on that connection. If the identity is for a specific user and can map to a uid, the all_squash,anon=UID should be imposed on that connection.

Can you point me to any documentation about how the client certificate is interpreted by nfsd?

Signature · 1 line
Jeff Layton <[email protected]>
#20 lore raw
In reply to NeilBrown
Quoted 6 lines · NeilBrown
Quoted 3 lines · Chuck Lever

Fair enough. We'll focus on improving the man page text for now.

Has anyone volunteered to do that?

Jeff has, but thank you for the text!

Quoted 8 lines

I haven't added anything about mtls as I couldn't find out how nfsd interprets the identity presented in the client-side certificate. If the identity is a "machine identity" then sec=sys would make sense on that connection. If the identity is for a specific user and can map to a uid, the all_squash,anon=UID should be imposed on that connection.

Can you point me to any documentation about how the client certificate is interpreted by nfsd?

A TLS handshake is rejected if the server does not recognize the client certificate's trust chain, as is standard practice for TLS with other upper layer protocols. Therefore, when an export requires mtls, the client must present a certificate and the server must recognize the granting CA for that cert. In recent nfs-utils, there is a "Transport layer security" section in exports(5) that might be updated to include that information.

According to RFC 9289, client certificates are machine identities. To identify a squash user, we plan to adopt the FreeBSD mechanism where user squashing instructions can be included in the client certificate as part of the Subject Alternate Name. This is not documented because it is not yet implemented in Linux (but FreeBSD client and server do currently implement this mechanism).

Signature · 1 line
Chuck Lever

A message that is not in the archive (sent off-list or not yet received): [email protected]

#22 lore raw
Quoted 11 lines · Rik Theys

Hi,

Quoted 7 lines · Chuck Lever
Quoted 2 lines

Can you point me to any documentation about how the client certificate is interpreted by nfsd?

A TLS handshake is rejected if the server does not recognize the client certificate's trust chain, as is standard practice for TLS with other upper layer protocols. Therefore, when an export requires mtls, the client must present a certificate and the server must recognize the granting CA for that cert.

Quoted 4 lines

In the man page for tlshd.conf, I only see options to configure the CA and certificate. I don't see any options to configure a CRL? What's the procedure to prevent a specific client certificate from accessing the server if the certificate is believed to be stolen?

It isn't clear to me that CRLs are the preferred mechanism to reject a certificate. But in any event, that support can be added to tlshd if gnuTLS itself doesn't already handle that under the library API.

Signature · 1 line
Chuck Lever
#23 lore raw
In reply to Chuck Lever
Quoted 24 lines · Chuck Lever

CAUTION: This email originated from outside of the University of Guelph. Do not click links or open attachments unless you recognize the sender and know the content is safe. If in doubt, forward suspicious emails to [email protected].

Quoted 6 lines · NeilBrown
Quoted 3 lines · Chuck Lever

Fair enough. We'll focus on improving the man page text for now.

Has anyone volunteered to do that?

Jeff has, but thank you for the text!

Quoted 8 lines

I haven't added anything about mtls as I couldn't find out how nfsd interprets the identity presented in the client-side certificate. If the identity is a "machine identity" then sec=sys would make sense on that connection. If the identity is for a specific user and can map to a uid, the all_squash,anon=UID should be imposed on that connection.

Can you point me to any documentation about how the client certificate is interpreted by nfsd?

Quoted 7 lines

A TLS handshake is rejected if the server does not recognize the client certificate's trust chain, as is standard practice for TLS with other upper layer protocols. Therefore, when an export requires mtls, the client must present a certificate and the server must recognize the granting CA for that cert. In recent nfs-utils, there is a "Transport layer security" section in exports(5) that might be updated to include that information.

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

rick

Quoted 12 lines

According to RFC 9289, client certificates are machine identities. To identify a squash user, we plan to adopt the FreeBSD mechanism where user squashing instructions can be included in the client certificate as part of the Subject Alternate Name. This is not documented because it is not yet implemented in Linux (but FreeBSD client and server do currently implement this mechanism).

--
Chuck Lever

#24 lore raw

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

I'll need to find out what flexibility gnuTLS offers. tlshd on Linux cannot use OpenSSL because its license is incompatible with GPLv2, which is the license the Linux kernel uses.

Signature · 1 line
Chuck Lever
#25 lore raw
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

Signature · 1 line
Chuck Lever
reviewer
#26 lore raw
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

Thanks,
NeilBrown

#27 lore raw
Quoted 51 lines · NeilBrown
Quoted 49 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

Quoted 6 lines
Quoted 1 line

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Well, what happens when someone naughty copies the cert. to a different system?
--> It is true that verification will show that the cert. is valid, but is it
valid for that client system?
(Not checking the reverse DNS name makes the check somewhat weaker,
imho. Now, is having the IP address in the cert. and checking
that stronger.
Well, maybe. The hassle is that the certs. all have to be replaced when some network type decides to reconfigure the LANs or move the system onto a different subnet for some reason.)

Another way a cert. can be protected from being moved to a different client by someone naughty is adding a passphrase to it (the -aes256 option on the openssl command line when creating the CSR). The hassle is that someone has to type the passphrase in when the system is started/rebooted.

There is no perfect solution (or security is not a binary value, if you prefer), so
I chose to provide as many options as I could, so that sysadmins could choose what works for them. (Of course, they need to understand what is going on and documenting that can be a challenge.)

rick

Quoted 18 lines

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

Thanks,
NeilBrown

#28 lore raw
Quoted 59 lines · Rick Macklem
Quoted 51 lines · NeilBrown
Quoted 49 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

Quoted 6 lines
Quoted 1 line

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Quoted 6 lines

Well, what happens when someone naughty copies the cert. to a different system?
--> It is true that verification will show that the cert. is valid, but is it
valid for that client system?
(Not checking the reverse DNS name makes the check somewhat weaker,
imho.

I should have said "reverse name lookup" and not reverse DNS. Important fqdn names can be put in /etc/hosts and the system configured to look there before DNS. If that is done on the NFS server end, a problem with DNS spoofing should be avoided, I think?

rick

Quoted 37 lines

Now, is having the IP address in the cert. and checking that stronger.
Well, maybe. The hassle is that the certs. all have to be replaced when some network type decides to reconfigure the LANs or move the system onto a different subnet for some reason.)

Another way a cert. can be protected from being moved to a different client by someone naughty is adding a passphrase to it (the -aes256 option on the openssl command line when creating the CSR). The hassle is that someone has to type the passphrase in when the system is started/rebooted.

There is no perfect solution (or security is not a binary value, if you prefer), so
I chose to provide as many options as I could, so that sysadmins could choose what works for them. (Of course, they need to understand what is going on and documenting that can be a challenge.)

rick

Quoted 18 lines

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

Thanks,
NeilBrown

reviewer
#29 lore raw
In reply to Rick Macklem
Quoted 52 lines · Rick Macklem
Quoted 51 lines · NeilBrown
Quoted 49 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Well, what happens when someone naughty copies the cert. to a different system?

Then you have already lost. Certificates are like passwords.

I guess 2FA is a thing and maybe it makes sense to check both IP and certificate. But I certainly wouldn't want to trust only that the IP matches the certificate. I would want to be able to check the certificate without even considering the IP.
Maybe:
1/ Is the IP from a permitted subnet - if not, reject.
2/ is the certificate for an approved CN - if not, reject. 3/ Does the IP match the CN

1 and 3 could be optional. 2 shouldn't be.

Thanks,
NeilBrown

#30 lore raw
Quoted 56 lines · NeilBrown
Quoted 54 lines · Rick Macklem
Quoted 53 lines · NeilBrown
Quoted 50 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Well, what happens when someone naughty copies the cert. to a different system?

Then you have already lost. Certificates are like passwords.

True. But if the IP address must match that of the client's IP host address, it limits where the cert. (or password, if you like) can be used. (The subnet where the IP address is supported, for example.)

Without this, a compromised cert. can be used from anywhere.

Quoted 11 lines

I guess 2FA is a thing and maybe it makes sense to check both IP and certificate. But I certainly wouldn't want to trust only that the IP matches the certificate. I would want to be able to check the certificate without even considering the IP.
Maybe:
1/ Is the IP from a permitted subnet - if not, reject.
2/ is the certificate for an approved CN - if not, reject. 3/ Does the IP match the CN

1 and 3 could be optional. 2 shouldn't be.

I'm not sure #2 makes it stronger than just "it verified", since verified means that the "password" is correct.

Now, I agree that the CN (or cert. serial# or anything else in the cert) can be used to distinguish which certs. are allowed for which file system exports. (Saves having different issuers to differentiate the certs.) --> Put another way, the CN can be used to decide which file systems
can be accessed and how, but it is not really useful to just say that the cert. is valid, since verification has already done that.

I also agree #1 and #3 are optional and their use really depends on what the network topology for client->server is and ranges from useless up to useful, I think?

rick

Quoted 4 lines

Thanks,
NeilBrown

#31 lore raw
In reply to Rick Macklem
Quoted 52 lines · Rick Macklem
Quoted 51 lines · NeilBrown
Quoted 49 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Well, what happens when someone naughty copies the cert. to a different system?

When that copy is discovered, the server can use a CRL to fence the use of the copied certificate (and as Rik T. pointed out, NFSD does not yet support that kind of mechanism).

Quoted 8 lines

--> It is true that verification will show that the cert. is valid, but is it
valid for that client system?
(Not checking the reverse DNS name makes the check somewhat weaker,
imho. Now, is having the IP address in the cert. and checking
that stronger.
Well, maybe. The hassle is that the certs. all have to be replaced when some network type decides to reconfigure the LANs or move the system onto a different subnet for some reason.)

None of that works for NFS clients whose name and address are dynamically assigned.

Quoted 10 lines

Another way a cert. can be protected from being moved to a different client by someone naughty is adding a passphrase to it (the -aes256 option on the openssl command line when creating the CSR). The hassle is that someone has to type the passphrase in when the system is started/rebooted.

There is no perfect solution (or security is not a binary value, if you prefer), so
I chose to provide as many options as I could, so that sysadmins could choose what works for them. (Of course, they need to understand what is going on and documenting that can be a challenge.)

Fair. Our implementations might differ in this regard.

Quoted 20 lines

rick

Quoted 18 lines

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

Thanks,
NeilBrown

Signature · 1 line
Chuck Lever
#32 lore raw
In reply to NeilBrown
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

What about pre-shared keys? No certificate fields there.

Signature · 1 line
Chuck Lever
#33 lore raw
Quoted 100 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

Quoted 8 lines

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

One thing you might want to consider as well is the case of compounds not associated with files (such as the initial EXCHANGEID, CREATESESSION).
- A naughty client can do a pretty good job of a DOS with those.

Right now there is SP4_NONE and SP4_MACH_CRED for Kerberos.
I have tried to suggest to the NFSv4 working group that SP4_MACH_CRED should be allowed for the mtls case as well, although I'm not sure it has gained traction. (Something might be buried in David Noveck's security draft. I haven't gotten around to looking at it lately.)

rick

Quoted 7 lines

What about pre-shared keys? No certificate fields there.

--
Chuck Lever

#34 lore raw
In reply to Chuck Lever
Quoted 91 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

Quoted 8 lines

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

Just fyi, here's an example where filtering on the DNS or IP field in the SAN (SubjectAltName) could improve security..
(Dusting off my CS sysadmin hat.)

Suppose I had a file system where student grades and exam questions were stored.
The mount was restricted to faculty offices, where their machines had fixed well known IP addresses and FQDNs assigned.
However, as it was for my case, the building their offices were in also had student labs and the building was assigned a subnet by the campus networking folk.
--> As such, a student could easily come in off hours (when the faculty were not
around and, as such, had their office computers shut down) and
plug into the
subnet (they just had to find an RJ45 jack somewhere that they
could access).

     --> They could then set their laptop up with the same IP address

as a faculty
member's office computer and defeat ordinary /etc/exports
filtering based
on client IP address.

However, these students would not have the X.509 cert. with a DNS or IP field set to the correct address in it. (They might have a valid cert. so their laptop can
mount the file systems students have coursework assignments on, but it would not have the DNS or IP of a faculty member's office computer.) --> This additional filtering would stop them from accessing the marks/exam question
file system (or at least make it a lot harder for them to do so).

As already discussed, there is a tradeoff between using DNS or IP. (I'll admit FreeBSD doesn't currently support the IP case, but it probably should.)

rick

Quoted 16 lines

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

What about pre-shared keys? No certificate fields there.

--
Chuck Lever

#35 lore raw
Quoted 131 lines · Rick Macklem
Quoted 91 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

Quoted 8 lines

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

Just fyi, here's an example where filtering on the DNS or IP field in the SAN (SubjectAltName) could improve security..
(Dusting off my CS sysadmin hat.)

Suppose I had a file system where student grades and exam questions were stored.
The mount was restricted to faculty offices, where their machines had fixed well known IP addresses and FQDNs assigned.
However, as it was for my case, the building their offices were in also had student labs and the building was assigned a subnet by the campus networking folk.
--> As such, a student could easily come in off hours (when the faculty were not
around and, as such, had their office computers shut down) and
plug into the
subnet (they just had to find an RJ45 jack somewhere that they
could access).

     --> They could then set their laptop up with the same IP address

as a faculty
member's office computer and defeat ordinary /etc/exports
filtering based
on client IP address.

However, these students would not have the X.509 cert. with a DNS or IP field set to the correct address in it. (They might have a valid cert. so their laptop can
mount the file systems students have coursework assignments on, but it would not have the DNS or IP of a faculty member's office computer.) --> This additional filtering would stop them from accessing the marks/exam question
file system (or at least make it a lot harder for them to do so).

Quoted 2 lines

As already discussed, there is a tradeoff between using DNS or IP. (I'll admit FreeBSD doesn't currently support the IP case, but it probably should.)

To be clear, there is a marked difference between relying on reverse DNS queries versus relying on a DNS hostname or IP address contained in a client certificate's SAN field. DNS queries are untrustworthy, but fields in a certificate (once its trust chain has been validated) are OK to use, IMO.

But I would like NFSD's administrative interface to be unambiguous about which DNS/IP information is being matched against.

Quoted 18 lines

rick

Quoted 16 lines

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

What about pre-shared keys? No certificate fields there.

--
Chuck Lever

Signature · 1 line
Chuck Lever
#36 lore raw
Quoted 133 lines · Chuck Lever
Quoted 131 lines · Rick Macklem
Quoted 91 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

Quoted 8 lines

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

Just fyi, here's an example where filtering on the DNS or IP field in the SAN (SubjectAltName) could improve security..
(Dusting off my CS sysadmin hat.)

Suppose I had a file system where student grades and exam questions were stored.
The mount was restricted to faculty offices, where their machines had fixed well known IP addresses and FQDNs assigned.
However, as it was for my case, the building their offices were in also had student labs and the building was assigned a subnet by the campus networking folk.
--> As such, a student could easily come in off hours (when the faculty were not
around and, as such, had their office computers shut down) and
plug into the
subnet (they just had to find an RJ45 jack somewhere that they
could access).

     --> They could then set their laptop up with the same IP address

as a faculty
member's office computer and defeat ordinary /etc/exports
filtering based
on client IP address.

However, these students would not have the X.509 cert. with a DNS or IP field set to the correct address in it. (They might have a valid cert. so their laptop can
mount the file systems students have coursework assignments on, but it would not have the DNS or IP of a faculty member's office computer.) --> This additional filtering would stop them from accessing the marks/exam question
file system (or at least make it a lot harder for them to do so).

Quoted 8 lines
Quoted 2 lines

As already discussed, there is a tradeoff between using DNS or IP. (I'll admit FreeBSD doesn't currently support the IP case, but it probably should.)

To be clear, there is a marked difference between relying on reverse DNS queries versus relying on a DNS hostname or IP address contained in a client certificate's SAN field. DNS queries are untrustworthy, but fields in a certificate (once its trust chain has been validated) are OK to use, IMO.

Yes, after sending this (an early morning brain fart;-) I realized I actually just demonstrated a case where the IP or DNS field matching the client's host IP address was not useful.
--> For the above example, it only shows that certs. can be differentiated
between student and faculty.

However, having the IP/DNS match work limits the use of a compromised cert. to the subnet it was meant to be used on.
Or, put another way, if the faculty offices are on a separate subnet from the student labs, the students would have difficulties using a compromised cert. before it ends up in a CRL. (Admittedly, for separate subnets, just filtering on client host IP address as /etc/exports now does can work, as well.)

Another advantage of using client certs is the "identity squashing" case, where the cert. identifies the user, avoiding any need for Kerberos. (Then, if the compromised cert. cannot be used outside of the subnet it was issued for, you are in a better place than if the compromised cert. can be used from anywhere.)

I do think CRLs should be supported, but it takes a while for someone to realize a cert. has been compromised and then do what it takes to get it into a CRL (notifying the sysadmin or ??).

rick

Quoted 27 lines

But I would like NFSD's administrative interface to be unambiguous about which DNS/IP information is being matched against.

Quoted 18 lines

rick

Quoted 16 lines

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

What about pre-shared keys? No certificate fields there.

--
Chuck Lever

--
Chuck Lever

#37 lore raw
In reply to Chuck Lever
Quoted 99 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

Quoted 8 lines

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

It might be useful to make the kernel's authorization based on mapping to a keyword that tlshd passes back after the handshake, and keep the more complicated logic of parsing certificate fields and using config files up in ktls-utils userspace. I'm imagining something like this in /etc/exports:

/exports *(rw,sec=sys,xprtsec=mtls,tlsauth=any) /exports/home *(rw,sec=sys,xprtsec=mtls,tlsauth=users)

.. and then tlshd would do the work to create a map of authorized certificate identities mapped to a keyword, something like:

CN=* any
CN=*.nfsv4bat.org users
SHA1=4EB6D578499B1CCF5F581EAD56BE3D9B6744A5E5 bob

I imagine more flexible or complex rule logic might be desired in the future, and having that work land in ktls-utils would be nicer than having to do kernel work or handling various bits of certificate logic or reverse lookups in-kernel.

Quoted 1 line

What about pre-shared keys? No certificate fields there.

Same idea would work for those - list/map them to a keyword set on the export.

Ben

#38 lore raw
Quoted 106 lines · Benjamin Coddington
Quoted 104 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

Quoted 8 lines
Quoted 3 lines

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

It might be useful to make the kernel's authorization based on mapping to a keyword that tlshd passes back after the handshake, and keep the more complicated logic of parsing certificate fields and using config files up in ktls-utils userspace.

I agree that the kernel can't do the filtering.

But it's not possible that tlshd knows what export the client wants to access during the TLS handshake; no NFS traffic has been exchanged yet. Thus parsing per-export security settings during the handshake is not possible; it can happen only once tlshd passes the connected socket back to the kernel.

And remember that ktls-utils is shared with NVMe and now QUIC as well. tlshd doesn't know anything about the upper layer protocols. Therefore adding NFS-specific authorization policy settings to ktls-utils is a layering violation.

What makes the most sense is that the handshake succeeds, then NFSD permits the client to access any export resources that the server's per-export security policy allows, based on the client's cert.

Quoted 11 lines

I'm imagining something like this in /etc/exports:

/exports *(rw,sec=sys,xprtsec=mtls,tlsauth=any) /exports/home *(rw,sec=sys,xprtsec=mtls,tlsauth=users)

.. and then tlshd would do the work to create a map of authorized certificate identities mapped to a keyword, something like:

CN=* any
CN=*.nfsv4bat.org users
SHA1=4EB6D578499B1CCF5F581EAD56BE3D9B6744A5E5 bob

I think mountd is going to have to do that, somehow. It already knows about netgroups, for example, and this is very similar.

Quoted 4 lines

I imagine more flexible or complex rule logic might be desired in the future, and having that work land in ktls-utils would be nicer than having to do kernel work or handling various bits of certificate logic or reverse lookups in-kernel.

I agree that the kernel will have to be hands off (or, it will act as a pipe between the user space pieces that actually handle the security policy, if you will).

Signature · 1 line
Chuck Lever
#39 lore raw
Quoted 124 lines · Chuck Lever
Quoted 106 lines · Benjamin Coddington
Quoted 104 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

Quoted 8 lines
Quoted 3 lines

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

It might be useful to make the kernel's authorization based on mapping to a keyword that tlshd passes back after the handshake, and keep the more complicated logic of parsing certificate fields and using config files up in ktls-utils userspace.

I agree that the kernel can't do the filtering.

But it's not possible that tlshd knows what export the client wants to access during the TLS handshake; no NFS traffic has been exchanged yet. Thus parsing per-export security settings during the handshake is not possible; it can happen only once tlshd passes the connected socket back to the kernel.

Quoted 4 lines

And remember that ktls-utils is shared with NVMe and now QUIC as well. tlshd doesn't know anything about the upper layer protocols. Therefore adding NFS-specific authorization policy settings to ktls-utils is a layering violation.

Here tlshd doesn't need to know anything about the upper layer protocols, it merely uses its mapping rules to match the certificate to a keyword it passes back to the kernel in the successful handshake downcall. The kernel then can decide what that keyword means. If not implemented in-kernel it can merely be ignored.

Quoted 13 lines

What makes the most sense is that the handshake succeeds, then NFSD permits the client to access any export resources that the server's per-export security policy allows, based on the client's cert.

Quoted 8 lines

I'm imagining something like this in /etc/exports:

/exports *(rw,sec=sys,xprtsec=mtls,tlsauth=any) /exports/home *(rw,sec=sys,xprtsec=mtls,tlsauth=users)

.. and then tlshd would do the work to create a map of authorized certificate identities mapped to a keyword, something like:

Quoted 6 lines
Quoted 3 lines

CN=* any
CN=*.nfsv4bat.org users
SHA1=4EB6D578499B1CCF5F581EAD56BE3D9B6744A5E5 bob

I think mountd is going to have to do that, somehow. It already knows about netgroups, for example, and this is very similar.

That sounds.. complicated.

Ben

#40 lore raw
Quoted 131 lines · Benjamin Coddington
Quoted 124 lines · Chuck Lever
Quoted 106 lines · Benjamin Coddington
Quoted 104 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

Quoted 8 lines
Quoted 3 lines

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

It might be useful to make the kernel's authorization based on mapping to a keyword that tlshd passes back after the handshake, and keep the more complicated logic of parsing certificate fields and using config files up in ktls-utils userspace.

I agree that the kernel can't do the filtering.

But it's not possible that tlshd knows what export the client wants to access during the TLS handshake; no NFS traffic has been exchanged yet. Thus parsing per-export security settings during the handshake is not possible; it can happen only once tlshd passes the connected socket back to the kernel.

Quoted 4 lines

And remember that ktls-utils is shared with NVMe and now QUIC as well. tlshd doesn't know anything about the upper layer protocols. Therefore adding NFS-specific authorization policy settings to ktls-utils is a layering violation.

Quoted 5 lines

Here tlshd doesn't need to know anything about the upper layer protocols, it merely uses its mapping rules to match the certificate to a keyword it passes back to the kernel in the successful handshake downcall. The kernel then can decide what that keyword means. If not implemented in-kernel it can merely be ignored.

Actually this sounds close to what I was imagining.

Following the NIS netgroups metaphor, some other user space system would define groups, and then /etc/exports could use those to define security policy. tlshd would know nothing of NFS, and mountd would know nothing of certificates.

Here, tlshd would match a list of groups that the client certificate belongs to, and return that list to the kernel as part of a successful handshake. That list could be either passed to mountd, or mountd could provide the group list on the export and let the kernel match on that.

I guess the TLS groups would be defined in /etc/tlshd.conf. Any upper layer protocol can use or ignore them.

TLS groups would be wildcards that might include CN, SAN, certificate serial no., etc. So NFSD could still filter by the IP or hostname in the certificate presented by the client.

Then, would TLS groups be specified in the export entry's machine name, like netgroups today, or would we add a new export option? I'm still mulling Rick's suggestion about continuing to restrict mtls access by actual IP.

Quoted 24 lines
Quoted 13 lines

What makes the most sense is that the handshake succeeds, then NFSD permits the client to access any export resources that the server's per-export security policy allows, based on the client's cert.

Quoted 8 lines

I'm imagining something like this in /etc/exports:

/exports *(rw,sec=sys,xprtsec=mtls,tlsauth=any) /exports/home *(rw,sec=sys,xprtsec=mtls,tlsauth=users)

.. and then tlshd would do the work to create a map of authorized certificate identities mapped to a keyword, something like:

Quoted 6 lines
Quoted 3 lines

CN=* any
CN=*.nfsv4bat.org users
SHA1=4EB6D578499B1CCF5F581EAD56BE3D9B6744A5E5 bob

I think mountd is going to have to do that, somehow. It already knows about netgroups, for example, and this is very similar.

That sounds.. complicated.

Ben

Signature · 1 line
Chuck Lever
reviewer
#41 lore raw
In reply to Chuck Lever
Quoted 124 lines · Chuck Lever
Quoted 106 lines · Benjamin Coddington
Quoted 104 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

Quoted 8 lines
Quoted 3 lines

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

It might be useful to make the kernel's authorization based on mapping to a keyword that tlshd passes back after the handshake, and keep the more complicated logic of parsing certificate fields and using config files up in ktls-utils userspace.

I agree that the kernel can't do the filtering.

But it's not possible that tlshd knows what export the client wants to access during the TLS handshake; no NFS traffic has been exchanged yet. Thus parsing per-export security settings during the handshake is not possible; it can happen only once tlshd passes the connected socket back to the kernel.

Quoted 8 lines

And remember that ktls-utils is shared with NVMe and now QUIC as well. tlshd doesn't know anything about the upper layer protocols. Therefore adding NFS-specific authorization policy settings to ktls-utils is a layering violation.

What makes the most sense is that the handshake succeeds, then NFSD permits the client to access any export resources that the server's per-export security policy allows, based on the client's cert.

We certainly need a mapping between content of the certificate and an "auth_domain" as understood by net/sunrpc, then a mapping from auth_domain and filesystem to export options - we already have the latter.

There seem to be two option for the first mapping.
1/ tlshd can pass the "important" parts of the certificate (and the PSK
info) to the sunrpc module much as the IP layer currently passes the IP address and port number to the sunrpc module. sunrpc then passes this up to mountd which does whatever mapping magic we want and passes down an auth_domain which is then used for further lookup.

2/ tlshd can do some initial interpretation of the certificate (and PSK)
and determine one or more tags which serve to sufficiently classify the certificate for local needs. It passes them to sunrpc and thence to mountd which gives relevant details to nfsd.

So the core question is: what sort of info do we want to pass from tlshd to mountd (via sunrpc) and where is the processing easiest. Or maybe:
which part of the processing can usefully be shared with other clients of tlshd and which are truly nfsd-specific?

I'd be inclined to keep as much understanding of the various details of certificates in tlshd as possible. It has to deal with some of that complexity, and mountd really doesn't.

Quoted 10 lines
Quoted 10 lines

I'm imagining something like this in /etc/exports:

/exports *(rw,sec=sys,xprtsec=mtls,tlsauth=any) /exports/home *(rw,sec=sys,xprtsec=mtls,tlsauth=users)

.. and then tlshd would do the work to create a map of authorized certificate identities mapped to a keyword, something like:

Quoted 6 lines
Quoted 3 lines

CN=* any
CN=*.nfsv4bat.org users
SHA1=4EB6D578499B1CCF5F581EAD56BE3D9B6744A5E5 bob

I think mountd is going to have to do that, somehow. It already knows about netgroups, for example, and this is very similar.

netgroups is a good example. mountd knows what a netgroup is but doesn't really know about the internal details. There is a function "innetgr()" which it calls to do the required magic. We similarly want a simple way for mountd to know that a given certificate matches a given tlsgroup. A library function would be OK. strcmp would be good too.

We export to a netgroups as:
/path @netgroup(options)
could we export to a certificate as
/path &tlsgroup(options)
??

It's always seems weird to me have the "sec=" in the options list. The authentication bit comes before the options. An IP address or hostname meand AUTH_SYS. A krb5 indicator means krb5 etc.... But that isn't the way we went .... unfortunately??

Thanks,
NeilBrown

Quoted 15 lines
Quoted 6 lines

I imagine more flexible or complex rule logic might be desired in the future, and having that work land in ktls-utils would be nicer than having to do kernel work or handling various bits of certificate logic or reverse lookups in-kernel.

I agree that the kernel will have to be hands off (or, it will act as a pipe between the user space pieces that actually handle the security policy, if you will).

Signature · 1 line
Chuck Lever
#42 lore raw
Quoted 152 lines · NeilBrown
Quoted 124 lines · Chuck Lever
Quoted 106 lines · Benjamin Coddington
Quoted 104 lines · Chuck Lever
Quoted 66 lines · NeilBrown
Quoted 46 lines · Chuck Lever
Quoted 25 lines · Chuck Lever

Hiya Rick -

Quoted 8 lines · Rick Macklem

Do you also have some configurable settings for if/how the DNS field in the client's X.509 cert is checked?
The range is, imho:
- Don't check it at all, so the client can have any IP/DNS name (a mobile device). The least secure, but still pretty good, since the ert. verified.
- DNS matches a wildcard like *.umich.edu for the reverse DNS name for the client's IP host address.
- DNS matches exactly what reverse DNS gets for the client's IP host address.

I've been told repeatedly that certificate verification must not depend on DNS because DNS can be easily spoofed. To date, the Linux implementation of RPC-with-TLS depends on having the peer's IP address in the certificate's SAN.

I recognize that tlshd will need to bend a little for clients that use a dynamically allocated IP address, but I haven't looked into it yet. Perhaps client certificates do not need to contain their peer IP address, but server certificates do, in order to enable mounting by IP instead of by hostname.

Quoted 5 lines
Quoted 1 line

Wildcards are discouraged by some RFC, but are still supported by OpenSSL.

I would prefer that we follow the guidance of RFCs where possible, rather than a particular implementation that might have historical reasons to permit a lack of security.

Let me follow up on this.

We have an open issue against tlshd that has suggested that, rather than looking at DNS query results, the NFS server should authorize access by looking at the client certificate's CN. The server's administrator should be able to specify a list of one or more CN wildcards that can be used to authorize access, much in the same way that NFSD currently uses netgroups and hostnames per export.

So, after validating the client's CA trust chain, an NFS server can match the client certificate's CN against its list of authorized CNs, and if the client's CN fails to match, fail the handshake (or whatever we need to do).

Quoted 4 lines

I favor this approach over using DNS labels, which are often untrustworthy, and IP addresses, which can be dynamically reassigned.

What do you think?

I completely agree with this. IP address and DNS identity of the client is irrelevant when mTLS is used. What matters is whether the client has authority to act as one of the the names given when the filesystem was exported (e.g. in /etc/exports). His is exacly what you said.

Ideally it would be more than just the CN. We want to know both the domain in which the peer has authority (e.g. example.com) and the type of authority (e.g. serve-web-pages or proxy-file-access or act-as-neilb).
I don't know internal details of certificates so I don't know if there is some other field that can say "This peer is authorised to proxy file access requests for all users in the given domain" or if we need a hack like exporting to nfs-client.example.com.

Quoted 5 lines

But if the admin has full control of what names to export to, it is possible that the distinction doesn't matter. I wouldn't want the certificate used to authenticate my web server to have authority to access all files on my NFS server just because the same domain name applies to both.

My thought is that, for each handshake, there would be two stages:

1. Does the NFS server trust the certificate? This is purely a chain-of- trust issue, so validating the certificate presented by the client is the order of the day.

2. Does the NFS server authorize this client to access the export? This is a check very similar to the hostname/netgroup/IP address check that is done today, but it could be done just once at handshake time. Match the certificate's fields against a per-export filter.

I would take tlshd out of the picture for stage 2, and let NFSD make its own authorization decisions. Because an NFS client might be authorized to access some exports but not others.

So:

How does the server indicate to clients that yes, your cert is trusted, but no, you are not authorized to access this file system? I guess that is an NFS error like NFSERR_STALE or NFS4ERR_WRONGSEC.

What certificate fields should we implement matches for? CN is obvious. But what about SAN? Any others? I say start with only CN, but I'd like to think about ways to make it possible to match against other fields in the future.

What would the administrative interface look like? Could be the machine name in /etc/exports, for instance:

*,OU="NFS Bake-a-thon",* rw,sec=sys,xprtsec=mtls,fsid=42

Quoted 8 lines
Quoted 3 lines

But I worry that will not be flexible enough. A more general filter mechanism might need something like the ini file format used to create CSRs.

It might be useful to make the kernel's authorization based on mapping to a keyword that tlshd passes back after the handshake, and keep the more complicated logic of parsing certificate fields and using config files up in ktls-utils userspace.

I agree that the kernel can't do the filtering.

But it's not possible that tlshd knows what export the client wants to access during the TLS handshake; no NFS traffic has been exchanged yet. Thus parsing per-export security settings during the handshake is not possible; it can happen only once tlshd passes the connected socket back to the kernel.

Quoted 8 lines

And remember that ktls-utils is shared with NVMe and now QUIC as well. tlshd doesn't know anything about the upper layer protocols. Therefore adding NFS-specific authorization policy settings to ktls-utils is a layering violation.

What makes the most sense is that the handshake succeeds, then NFSD permits the client to access any export resources that the server's per-export security policy allows, based on the client's cert.

We certainly need a mapping between content of the certificate and an "auth_domain" as understood by net/sunrpc, then a mapping from auth_domain and filesystem to export options - we already have the latter.

There seem to be two option for the first mapping.
1/ tlshd can pass the "important" parts of the certificate (and the PSK
info) to the sunrpc module much as the IP layer currently passes the IP address and port number to the sunrpc module. sunrpc then passes this up to mountd which does whatever mapping magic we want and passes down an auth_domain which is then used for further lookup.

2/ tlshd can do some initial interpretation of the certificate (and PSK)
and determine one or more tags which serve to sufficiently classify the certificate for local needs. It passes them to sunrpc and thence to mountd which gives relevant details to nfsd.

Quoted 4 lines

So the core question is: what sort of info do we want to pass from tlshd to mountd (via sunrpc) and where is the processing easiest. Or maybe:
which part of the processing can usefully be shared with other clients of tlshd and which are truly nfsd-specific?

I'm a simple minded guy, so here's a simple minded suggestion... Define CNs using a DNS like syntax. For example:
alice.faculty.cis.uoguelph.ca bob.student.cis.uoguelph.ca

When a handshake gets the cert., extract the above CN and push it into the kernel, associated with the TCP connection.

Then in /etc/exports, specify a CN or a wildcarded suffix. For example:
/exports/faculty/alice (rw,sec=sys,xprtsec=mtls,cn=alice.faculty.cis.uoguelph.ca) /exports/faculty/data (rw,sec=sys,xprtsec=mtls,cn=*.faculty.cis.uoguelph.ca) /exports/students (rw,sec=sys,xprtsec=mtls,cn=*.student.cis.uoguelph.ca)

Then whatever processes /etc/exports pushes the cn strings into the kernel, associating them with the file systems.

Then, when an RPC request arrives on the TCP connection, tag it with the CN string (alice.faculty.cis.uoguelph.ca or bob.student.cis.uoguelph.ca) and when exports need to be checked for a file system, it is just a string compare (either the whole string or a suffix when wildcarded).

You can use the same string comparison rules as DNS names. Ascii case independent and Puny encoding for non-ascii chars.

rick

Quoted 60 lines

I'd be inclined to keep as much understanding of the various details of certificates in tlshd as possible. It has to deal with some of that complexity, and mountd really doesn't.

Quoted 10 lines
Quoted 10 lines

I'm imagining something like this in /etc/exports:

/exports *(rw,sec=sys,xprtsec=mtls,tlsauth=any) /exports/home *(rw,sec=sys,xprtsec=mtls,tlsauth=users)

.. and then tlshd would do the work to create a map of authorized certificate identities mapped to a keyword, something like:

Quoted 6 lines
Quoted 3 lines

CN=* any
CN=*.nfsv4bat.org users
SHA1=4EB6D578499B1CCF5F581EAD56BE3D9B6744A5E5 bob

I think mountd is going to have to do that, somehow. It already knows about netgroups, for example, and this is very similar.

netgroups is a good example. mountd knows what a netgroup is but doesn't really know about the internal details. There is a function "innetgr()" which it calls to do the required magic. We similarly want a simple way for mountd to know that a given certificate matches a given tlsgroup. A library function would be OK. strcmp would be good too.

We export to a netgroups as:
/path @netgroup(options)
could we export to a certificate as
/path &tlsgroup(options)
??

It's always seems weird to me have the "sec=" in the options list. The authentication bit comes before the options. An IP address or hostname meand AUTH_SYS. A krb5 indicator means krb5 etc.... But that isn't the way we went .... unfortunately??

Thanks,
NeilBrown

Quoted 15 lines
Quoted 6 lines

I imagine more flexible or complex rule logic might be desired in the future, and having that work land in ktls-utils would be nicer than having to do kernel work or handling various bits of certificate logic or reverse lookups in-kernel.

I agree that the kernel will have to be hands off (or, it will act as a pipe between the user space pieces that actually handle the security policy, if you will).

--
Chuck Lever

#43 lore raw
In reply to NeilBrown
Quoted 14 lines · NeilBrown
Quoted 13 lines · NeilBrown
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

But who is going to export any filesystem to their laptop?

Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

Sorry - I was wrong. You aren't breaking working configurations, but you are removing a protection that people might be expecting. It might not be much protection, but it is not zero.

I beg to differ. It really is no protection at all in the modern era, and it is actively inconvenient for deployments with desktop file browsers or NAT routers.

As a community we should be encouraging secure deployments out of the shrink wrap. Making cryptographic security easy should be (and is for me) job number one. This export option is nothing more than theater.

I agree that a warning would be useful if neither "secure" nor "insecure" is specified for an export.

Quoted 72 lines
Quoted 2 lines

I don't see any really motivation for this change. Could you provide it please?

Or to put it another way: who benefits?

Thanks,
NeilBrown

Quoted 61 lines

Thanks,
NeilBrown

Quoted 54 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Signature · 1 line
Chuck Lever
#44 lore raw
In reply to NeilBrown
Quoted 17 lines · NeilBrown
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

But who is going to export any filesystem to their laptop?

Quoted 1 line
Quoted 7 lines
Quoted 1 line

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

I don't see any really motivation for this change. Could you provide it please?

Consider a pNFS Flex File deployment with 1000s of data servers. The metadata server needs access to each data server. If it needs to be on a secure port, then the metadata server can easily run out of room.

Quoted 59 lines

Thanks,
NeilBrown

Quoted 54 lines

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.
---
support/nfs/exports.c | 7 +++++--
utils/exportfs/exports.man | 4 ++--

2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS \
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS (NFSEXP_READONLY | \
+ NFSEXP_ROOTSQUASH | \
+ NFSEXP_GATHERED_WRITES |\
+ NFSEXP_NOSUBTREECHECK | \
+ NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 { "krb5", RPC_AUTH_GSS_KRB5, 1},
utils/exportfs/exports.man +0 -0
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:

.TP
.IR secure
This option requires that requests not using gss originate on an

utils/exportfs/exports.man +2 -2
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying

.IR insecure .
(NOTE: older kernels (before upstream kernel version 4.17) enforced this requirement on gss requests as well.)

---
base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
reviewer
#45 lore raw
Quoted 21 lines · Thomas Haynes
Quoted 21 lines · NeilBrown
Quoted 8 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

But who is going to export any filesystem to their laptop?

Quoted 2 lines

Make the default be "insecure" when creating exports.

So you want to break lots of configurations that are working perfectly well?

Quoted 8 lines
Quoted 2 lines

I don't see any really motivation for this change. Could you provide it please?

Consider a pNFS Flex File deployment with 1000s of data servers. The metadata server needs access to each data server. If it needs to be on a secure port, then the metadata server can easily run out of room.

What is the cost of specifying "insecure" on each export line?

If this really is a burden, I suggest adding a "default-export-options" or similar to /etc/nfs.conf. Then you can put
default-export-options = secure
in your /etc/nfs.conf and be happy.

Thanks,
NeilBrown

reviewer
#46 lore raw
In reply to Jeff Layton
Quoted 43 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +0 -0
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644

utils/exportfs/exports.man understands the following export options: · line 185

Quoted 8 lines
utils/exportfs/exports.man +2 -2
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .

I think you mean "can be explicit enabled if desired" or similar.

If you really want to do this, you should require either "insecure" or "secure" and generate a warning like we did when changing other defaults in the past. After a period of time you can remove that requirement.

NeilBrown

Quoted 13 lines
utils/exportfs/exports.man +0 -1
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
author maintainer
#47 lore raw
Quoted 46 lines · NeilBrown
Quoted 45 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
 support/nfs/exports.c      | 7 +++++--
 utils/exportfs/exports.man | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
 #include "reexport.h"
 #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
 struct flav_info flav_map[] = {
 	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +0 -0
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
 .TP
 .IR secure
Quoted 9 lines

utils/exportfs/exports.man understands the following export options: · line 185

Quoted 6 lines
utils/exportfs/exports.man +2 -2
 This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
 .IR insecure .

I think you mean "can be explicit enabled if desired" or similar.

Yeah, it is a little awkward. I want to keep "insecure" in the manpage so that people know what the option is (and don't try to use something like "nosecure"). I'll see if I can rephrase that.

Quoted 6 lines

If you really want to do this, you should require either "insecure" or "secure" and generate a warning like we did when changing other defaults in the past. After a period of time you can remove that requirement.

NeilBrown

Requiring the option _would_ break existing setups, so I'd be against that plan.

One thing we could do is have exportfs log a warning to syslog when neither option is specified. Admins could specify it either way to silence the message. Would that overcome your objection?

Quoted 15 lines
Quoted 14 lines
utils/exportfs/exports.man +0 -1
 (NOTE: older kernels (before upstream kernel version 4.17) enforced this
 requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Signature · 1 line
Jeff Layton <[email protected]>
#48 lore raw

Just want to weigh in on this briefly,

Firstly:

Yes, people have arbitrary access to low ports on their systems, but such privileges are voided behind a NAT. Meaning a, possibly accidental, publicly facing server may indeed benefit from such a check.

Secondly:

Even if NAT's didn't exist and you needed no system capabilities to bind to any port. It is entirely legitimate for server/client applications, let alone ones living in the kernel, to restrict client access based on any criterion that may (de)legitimize them. Look at smtp. Yes there are workarounds to everything, but goal isn't to stop bad actors in whole, or even in large part. If such a thing can deter a small portion of malicious traffic, it worked.

Thirdly:

Kinda goes with the above. Evaluating the efficiency of individual components of a larger system can often lead to false conclusions.

Unless this has actively caused any issues for people where they would rather it be opt-in, I think this should remain unchanged. If anything, I'd say the argument to take it out completely is much more compelling.

It's a simple toggle option, those likely to need the change can easily do so. If we assume zero user knowledge, they are likely incapable of stepping outside the default ports used by client/server. Meaning, best case scenario, the connection from port 60000 may be the vacuum cleaner.

Regards,
Christopher Bii

Quoted 91 lines · Jeff Layton
Quoted 46 lines · NeilBrown
Quoted 45 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
  support/nfs/exports.c      | 7 +++++--
  utils/exportfs/exports.man | 4 ++--
  2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
  #include "reexport.h"
  #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
  struct flav_info flav_map[] = {
  	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +0 -0
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
  .TP
  .IR secure
Quoted 9 lines

utils/exportfs/exports.man understands the following export options: · line 185

Quoted 6 lines
utils/exportfs/exports.man +2 -2
  This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
  .IR insecure .

I think you mean "can be explicit enabled if desired" or similar.

Yeah, it is a little awkward. I want to keep "insecure" in the manpage so that people know what the option is (and don't try to use something like "nosecure"). I'll see if I can rephrase that.

Quoted 6 lines

If you really want to do this, you should require either "insecure" or "secure" and generate a warning like we did when changing other defaults in the past. After a period of time you can remove that requirement.

NeilBrown

Requiring the option _would_ break existing setups, so I'd be against that plan.

One thing we could do is have exportfs log a warning to syslog when neither option is specified. Admins could specify it either way to silence the message. Would that overcome your objection?

Quoted 15 lines
Quoted 14 lines
utils/exportfs/exports.man +0 -1
  (NOTE: older kernels (before upstream kernel version 4.17) enforced this
  requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
#49 lore raw
In reply to Jeff Layton
Quoted 11 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

I made a poll webpage for our sysadmins about what they think about this change.

Out of 26 people allowed to vote 24 voted "BAD idea, keep the secure option the default", and two didn't vote.

So this is a change which is virtually 100% hated by the people primarily affected by such a change.

Sebi

Signature · 1 line
Sebastian Feld - IT security consultant
author maintainer
#50 lore raw
Quoted 13 lines · Sebastian Feld
Quoted 11 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

Quoted 9 lines

I made a poll webpage for our sysadmins about what they think about this change.

Out of 26 people allowed to vote 24 voted "BAD idea, keep the secure option the default", and two didn't vote.

So this is a change which is virtually 100% hated by the people primarily affected by such a change.

Polling is all about the question being asked. What was the question? Did it explain that despite the name, the "secure" option offers virtually nothing in the way of security?

I'd like at ask these same admins why they care about the source port, because I find it really hard to believe that there are environments out there in 2025 where one simply doesn't have to worry about a random user contacting the server from an unmanaged laptop, or worry about someone rebooting an existing host on the network with a USB stick.

Once someone does that, any protection that "secure" gives you is defeated. To wit, if the server is _at_all_ reachable over wifi then this option is likely already worthless.

Are there really that many administrators that are running NFS in hermetically-sealed environments? Or are are they just fooling themselves?

I think it more likely that most of the people who object to this didn't read beyond the subject line. If this export option were named _anything_ else (e.g. "privilegedport" or something), we wouldn't be having this discussion.

Signature · 1 line
Jeff Layton <[email protected]>
#51 lore raw
In reply to Sebastian Feld
Quoted 8 lines · Sebastian Feld
Quoted 7 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

Quoted 6 lines
Quoted 4 lines

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

I made a poll webpage for our sysadmins about what they think about this change.

Who are "our sysadmins" and what did you do to compensate for various cognitive biases?

Quoted 5 lines

Out of 26 people allowed to vote 24 voted "BAD idea, keep the secure option the default", and two didn't vote.

So this is a change which is virtually 100% hated by the people primarily affected by such a change.

I'm interested in understanding why changing the default behavior is a problem. Is explicitly adding the "secure" export option on the exports where it matters a heavy lift? If so, why?

Signature · 1 line
Chuck Lever
#52 lore raw
Quoted 23 lines · Chuck Lever
Quoted 8 lines · Sebastian Feld
Quoted 7 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

Quoted 6 lines
Quoted 4 lines

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

I made a poll webpage for our sysadmins about what they think about this change.

Who are "our sysadmins" and what did you do to compensate for various cognitive biases?

Quoted 3 lines

Out of 26 people allowed to vote 24 voted "BAD idea, keep the secure option the default", and two didn't vote.

Quoted 6 lines
Quoted 2 lines

So this is a change which is virtually 100% hated by the people primarily affected by such a change.

I'm interested in understanding why changing the default behavior is a problem. Is explicitly adding the "secure" export option on the exports where it matters a heavy lift? If so, why?

To be clear: asking around is a sensible thing to do. However I'd like to see more nuanced feedback than "BAD idea".

Signature · 1 line
Chuck Lever
#53 lore raw
In reply to Jeff Layton
Quoted 11 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

I'd request that you also rename the darn thing to "resvport" and "noresvport", and keep "insecure"+"secure" as a depreciated alias around.

if you do that you'll get a Reviewed-by: Cedric Blancher <[email protected]>

Ced

Signature · 3 lines
Cedric Blancher <[email protected]>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur
#54 lore raw
In reply to Jeff Layton

Hello all,

Quoted 58 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
  support/nfs/exports.c      | 7 +++++--
  utils/exportfs/exports.man | 4 ++--
  2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
  #include "reexport.h"
  #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
  struct flav_info flav_map[] = {
  	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
  .TP
  .IR secure
  This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
  .IR insecure .
  (NOTE: older kernels (before upstream kernel version 4.17) enforced this
  requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Quoted 1 line

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down. Will there be a V2?

I'm wondering what type documentation impact this would have on all docs out there that say one has to be root to do the mount.

I guess I'm not against the patch but as Neil pointed out making things insecure is a different direction that the rest of the world is going.

my two cents,

steved.

#55 lore raw
Quoted 58 lines · Steve Dickson

Hello all,

Quoted 54 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
  support/nfs/exports.c      | 7 +++++--
  utils/exportfs/exports.man | 4 ++--
  2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
  #include "reexport.h"
  #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS \
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS (NFSEXP_READONLY |      \
+                              NFSEXP_ROOTSQUASH |    \
+                              NFSEXP_GATHERED_WRITES |\
+                              NFSEXP_NOSUBTREECHECK | \
+                              NFSEXP_INSECURE_PORT)
 
  struct flav_info flav_map[] = {
      { "krb5",       RPC_AUTH_GSS_KRB5,      1},
utils/exportfs/exports.man +2 -2
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
  .TP
  .IR secure
  This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
  .IR insecure .
  (NOTE: older kernels (before upstream kernel version 4.17) enforced this
  requirement on gss requests as well.)
Quoted 7 lines
Quoted 5 lines

---
base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down.

Thumbs up for a V2, which renames the darn option "resvport" and "noresvport" (like Solaris, Windows, ...), and keeping "insecure"+"secure" as a depreciated alias around.

Ced

Signature · 3 lines
Cedric Blancher <[email protected]>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur
author maintainer
#56 lore raw
In reply to Steve Dickson
Quoted 70 lines · Steve Dickson

Hello all,

Quoted 58 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
  support/nfs/exports.c      | 7 +++++--
  utils/exportfs/exports.man | 4 ++--
  2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
  #include "reexport.h"
  #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
  struct flav_info flav_map[] = {
  	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
  .TP
  .IR secure
  This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
  .IR insecure .
  (NOTE: older kernels (before upstream kernel version 4.17) enforced this
  requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Quoted 1 line

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down. Will there be a V2?

I'm wondering what type documentation impact this would have on all docs out there that say one has to be root to do the mount.

Quoted 7 lines

I guess I'm not against the patch but as Neil pointed out making things insecure is a different direction that the rest of the world is going.

my two cents,

Thumbs down for now. Neil argued for a more measured approach to changing this.

I started work on a manpage patch for exports(5) but it's not quite ready yet. I also want to look at converting some manpages to asciidoc as we go, to make future updates easier.

Signature · 1 line
Jeff Layton <[email protected]>
#57 lore raw
Quoted 79 lines · Jeff Layton
Quoted 70 lines · Steve Dickson

Hello all,

Quoted 58 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
   support/nfs/exports.c      | 7 +++++--
   utils/exportfs/exports.man | 4 ++--
   2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
   #include "reexport.h"
   #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS	\
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)
 
   struct flav_info flav_map[] = {
   	{ "krb5",	RPC_AUTH_GSS_KRB5,	1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
   .TP
   .IR secure
   This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
   .IR insecure .
   (NOTE: older kernels (before upstream kernel version 4.17) enforced this
   requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Quoted 1 line

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down. Will there be a V2?

I'm wondering what type documentation impact this would have on all docs out there that say one has to be root to do the mount.

Quoted 7 lines

I guess I'm not against the patch but as Neil pointed out making things insecure is a different direction that the rest of the world is going.

my two cents,

Quoted 6 lines

Thumbs down for now. Neil argued for a more measured approach to changing this.

I started work on a manpage patch for exports(5) but it's not quite ready yet. I also want to look at converting some manpages to asciidoc as we go, to make future updates easier.

Sounds like a plan... Thanks!

steved.

#58 lore raw
Quoted 102 lines · Steve Dickson
Quoted 99 lines · Jeff Layton
Quoted 87 lines · Steve Dickson

Hello all,

Quoted 71 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set
of ports that only privileged users could use. When NFS was originally
conceived, Sun made its server require that clients use low ports.
Since Linux was following suit with Sun in those days, exportfs has
always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections
to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making
"insecure" the default for all exports.
---
   support/nfs/exports.c      | 7 +++++-- utils/exportfs/exports.man | 4 ++--

   2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +0 -0

index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef 287ca0685af3e70ed0b 100644

support/nfs/exports.c +0 -0
@@ -34,8 +34,11 @@
    #include "reexport.h"
    #include "nfsd_path.h"


-#define EXPORT_DEFAULT_FLAGS \
- (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEX P_NOSUBTREECHECK)

support/nfs/exports.c +5 -0
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)


   struct flav_info flav_map[] = {
    { "krb5", RPC_AUTH_GSS_KRB5, 1},

utils/exportfs/exports.man +0 -0

index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7e b84301c4ec97b14d003 100644

utils/exportfs/exports.man +0 -0
@@ -180,8 +180,8 @@ understands the following export options:

   .TP
   .IR secure
   This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.

utils/exportfs/exports.man +1 -1
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is

off by default
+but can be explicitly disabled by specifying
   .IR insecure .
   (NOTE: older kernels (before upstream kernel version 4.17) enforced this
   requirement on gss requests as well.)

Quoted 5 lines

---
base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down. Will there be a V2?

I'm wondering what type documentation impact this would have on all docs out there that say one has to be root to do the mount.

Quoted 7 lines

I guess I'm not against the patch but as Neil pointed out making things insecure is a different direction that the rest of the world is going.

my two cents,

Thumbs down for now. Neil argued for a more measured approach to changing this.

Quoted 9 lines
Quoted 4 lines

I started work on a manpage patch for exports(5) but it's not quite ready yet. I also want to look at converting some manpages to asciidoc
as we go, to make future updates easier.

Sounds like a plan... Thanks!

steved.

Can we please add an explanation to the manpage to let people know why this default is set?

It is basically in order to prevent any untrusted Tom, Dick or Harry from spinning up a userspace NFS client that spoofs a different user.

IOW: The assumption is that you should at least be able to trust the kernel NFS client to at provide the correct credential for an untrusted user.
If you can't make that assumption, then your server should probably be configured to squash any AUTH_SYS credential supplied by this client.

Signature · 3 lines
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]
#59 lore raw
Quoted 107 lines · Trond Myklebust
Quoted 106 lines · Steve Dickson
Quoted 103 lines · Jeff Layton
Quoted 87 lines · Steve Dickson

Hello all,

Quoted 71 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set
of ports that only privileged users could use. When NFS was originally
conceived, Sun made its server require that clients use low ports.
Since Linux was following suit with Sun in those days, exportfs has
always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections
to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making
"insecure" the default for all exports.
---
   support/nfs/exports.c      | 7 +++++-- utils/exportfs/exports.man | 4 ++--

   2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +0 -0

index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef 287ca0685af3e70ed0b 100644

support/nfs/exports.c +0 -0
@@ -34,8 +34,11 @@
    #include "reexport.h"
    #include "nfsd_path.h"


-#define EXPORT_DEFAULT_FLAGS \
- (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEX P_NOSUBTREECHECK)

support/nfs/exports.c +5 -0
+#define EXPORT_DEFAULT_FLAGS	(NFSEXP_READONLY |	\
+				 NFSEXP_ROOTSQUASH |	\
+				 NFSEXP_GATHERED_WRITES |\
+				 NFSEXP_NOSUBTREECHECK | \
+				 NFSEXP_INSECURE_PORT)


   struct flav_info flav_map[] = {
    { "krb5", RPC_AUTH_GSS_KRB5, 1},

utils/exportfs/exports.man +0 -0

index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7e b84301c4ec97b14d003 100644

utils/exportfs/exports.man +0 -0
@@ -180,8 +180,8 @@ understands the following export options:

   .TP
   .IR secure
   This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.

utils/exportfs/exports.man +1 -1
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is

off by default
+but can be explicitly disabled by specifying
   .IR insecure .
   (NOTE: older kernels (before upstream kernel version 4.17) enforced this
   requirement on gss requests as well.)

Quoted 5 lines

---
base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down. Will there be a V2?

I'm wondering what type documentation impact this would have on all docs out there that say one has to be root to do the mount.

Quoted 7 lines

I guess I'm not against the patch but as Neil pointed out making things insecure is a different direction that the rest of the world is going.

my two cents,

Thumbs down for now. Neil argued for a more measured approach to changing this.

I started work on a manpage patch for exports(5) but it's not quite ready yet. I also want to look at converting some manpages to asciidoc
as we go, to make future updates easier.

Quoted 8 lines
Quoted 5 lines

Sounds like a plan... Thanks!

steved.

Can we please add an explanation to the manpage to let people know why this default is set?

That's exactly what Jeff is working on right now.

Quoted 8 lines

It is basically in order to prevent any untrusted Tom, Dick or Harry from spinning up a userspace NFS client that spoofs a different user.

IOW: The assumption is that you should at least be able to trust the kernel NFS client to at provide the correct credential for an untrusted user.
If you can't make that assumption, then your server should probably be configured to squash any AUTH_SYS credential supplied by this client.

Signature · 1 line
Chuck Lever
#60 lore raw
In reply to Jeff Layton
Quoted 76 lines · Jeff Layton
Quoted 74 lines · Steve Dickson

Hello all,

Quoted 58 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
  support/nfs/exports.c      | 7 +++++--
  utils/exportfs/exports.man | 4 ++--
  2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
  #include "reexport.h"
  #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS       \
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS       (NFSEXP_READONLY |      \
+                            NFSEXP_ROOTSQUASH |    \
+                            NFSEXP_GATHERED_WRITES |\
+                            NFSEXP_NOSUBTREECHECK | \
+                            NFSEXP_INSECURE_PORT)
 
  struct flav_info flav_map[] = {
    { "krb5",       RPC_AUTH_GSS_KRB5,      1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
  .TP
  .IR secure
  This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
  .IR insecure .
  (NOTE: older kernels (before upstream kernel version 4.17) enforced this
  requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Quoted 1 line

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down. Will there be a V2?

I'm wondering what type documentation impact this would have on all docs out there that say one has to be root to do the mount.

I guess I'm not against the patch but as Neil pointed out making things insecure is a different direction that the rest of the world is going.

Quoted 6 lines
Quoted 3 lines

my two cents,

Thumbs down for now. Neil argued for a more measured approach to changing this.

What about renaming the option to "resvport" / "noresvport"?

Quoted 4 lines

I started work on a manpage patch for exports(5) but it's not quite ready yet. I also want to look at converting some manpages to asciidoc as we go, to make future updates easier.

Why asciidoc? I think every localisation staff in companies will NOT be happy with that.
I'd suggest Docbook/XML, as it is more flexible and allows HTML generation without going to the groff/asciidoc eye of the needle.

Ced

Signature · 3 lines
Cedric Blancher <[email protected]>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur
#61 lore raw
Quoted 77 lines · Cedric Blancher
Quoted 76 lines · Jeff Layton
Quoted 74 lines · Steve Dickson

Hello all,

Quoted 58 lines · Jeff Layton

Back in the 80's someone thought it was a good idea to carve out a set of ports that only privileged users could use. When NFS was originally conceived, Sun made its server require that clients use low ports. Since Linux was following suit with Sun in those days, exportfs has always defaulted to requiring connections from low ports.

These days, anyone can be root on their laptop, so limiting connections to low source ports is of little value.

Make the default be "insecure" when creating exports.

---
In discussion at the Bake-a-thon, we decided to just go for making "insecure" the default for all exports.

---
  support/nfs/exports.c      | 7 +++++--
  utils/exportfs/exports.man | 4 ++--
  2 files changed, 7 insertions(+), 4 deletions(-)
support/nfs/exports.c +5 -2
index 21ec6486ba3d3945df0800972ba1dfd03bd65375..69f8ca8b5e2ed50b837ef287ca0685af3e70ed0b 100644
@@ -34,8 +34,11 @@
  #include "reexport.h"
  #include "nfsd_path.h"
 
-#define EXPORT_DEFAULT_FLAGS       \
-  (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+#define EXPORT_DEFAULT_FLAGS       (NFSEXP_READONLY |      \
+                            NFSEXP_ROOTSQUASH |    \
+                            NFSEXP_GATHERED_WRITES |\
+                            NFSEXP_NOSUBTREECHECK | \
+                            NFSEXP_INSECURE_PORT)
 
  struct flav_info flav_map[] = {
    { "krb5",       RPC_AUTH_GSS_KRB5,      1},
utils/exportfs/exports.man +2 -3
index 39dc30fb8290213990ca7a14b1b3971140b0d120..0b62bb3a82b0e74bc2a7eb84301c4ec97b14d003 100644
@@ -180,8 +180,8 @@ understands the following export options:
  .TP
  .IR secure
  This option requires that requests not using gss originate on an
-Internet port less than IPPORT_RESERVED (1024). This option is on by default.
-To turn it off, specify
+Internet port less than IPPORT_RESERVED (1024). This option is off by default
+but can be explicitly disabled by specifying
  .IR insecure .
  (NOTE: older kernels (before upstream kernel version 4.17) enforced this
  requirement on gss requests as well.)
 
---

base-commit: 2cf015ea4312f37598efe9733fef3232ab67f784
change-id: 20250513-master-89974087bb04

Quoted 1 line

Best regards,

My apologies but I got a bit lost in the fairly large thread What as is consensus on this patch? Thumbs up or down. Will there be a V2?

I'm wondering what type documentation impact this would have on all docs out there that say one has to be root to do the mount.

I guess I'm not against the patch but as Neil pointed out making things insecure is a different direction that the rest of the world is going.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

my two cents,

Thumbs down for now. Neil argued for a more measured approach to changing this.

What about renaming the option to "resvport" / "noresvport"?

I've also wondered about renaming the export option. "secure" is terribly misleading and quite unspecific.

And agreed, after adding the new name, "secure" would need to remain as a (perhaps hidden) synonym for a while.

Signature · 1 line
Chuck Lever