Hey everyone,
I could use some help here. After a recent penetration test, it appears that two of our NFS shares on a Debian 11 server are accessible without any authentication. Here's what my `/etc/exports` file currently looks like:
1. `/images 172.16.0.0/12 (ro,sync,no_wdelay,no_subtree_check,insecure_locks,no_root_squash,insecure,fsid=0)`
2. `/images/dev 172.16.0.0/12 (rw,async,no_wdelay,no_subtree_check,no_root_squash,insecure,fsid=1)`
I thought I had addressed this issue after the last pen test a couple of years back. What am I missing to restrict access properly?
5 Answers
To tackle the anonymous access risk, think about making the filesystem read-only. Since you're probably just serving OS images, any necessary file access afterward should be authenticated. Make sure to document how you mitigated this risk, like having a read-only setting and highlighting that no sensitive data is there. Just remember, it might not pass every security check, but if it's designed that way without public info, it should be okay.
The biggest security issue I see is the `no_root_squash` option. This setting lets clients retain root permissions on your NFS server, which is a major security flaw. Also, using `insecure` allows unsecured connections that break NFS security expectations. Consider tightening your IP range too, as `/12` allows possibly thousands of clients. How many do you actually need?
Have you checked your network setup? It's crucial to manage your network and firewalls properly. If someone malicious already has access to your subnets, you might have bigger concerns than just NFS shares.
It looks like there might be an error in your `/etc/exports`. There's a space between the IP range and the options, which isn't allowed. The right format should not include any whitespace there.
Thanks for the feedback! I plan to change `no_root_squash` to `root_squash` and remove `insecure`. I'll also narrow down the IP range since we have about 350 clients split over five ranges. Appreciate the advice!
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures