Skip to content

Commit 5fadd4e

Browse files
committed
prevent nfs tunnelling through login node
1 parent ac3a31c commit 5fadd4e

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

docs/networks.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ as an SSH proxy to access the other nodes, this can create problems in recoverin
1414
the cluster if the login node is unavailable and can make Ansible problems harder
1515
to debug.
1616

17+
> [!WARNING]
18+
> If home directories are on a shared filesystem with no authentication (such
19+
> as the default NFS share) then the network(s) the fileserver is attached to
20+
> form a security boundary. If an untrusted user can access these networks they
21+
> could mount the home directories setting any desired uid/gid.
22+
>
23+
> Ensure there is no external access to these networks and that no untrusted
24+
> instances are attached to them.
25+
1726
This page describes supported configurations and how to implement them using
1827
the OpenTofu variables. These will normally be set in
1928
`environments/site/tofu/terraform.tfvars` for the site base environment. If they
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
nfs_configurations:
2+
- comment: Export /exports/home from Slurm control node as /home
3+
nfs_enable:
4+
server: "{{ inventory_hostname in groups['control'] }}"
5+
# Don't mount share on server where it is exported from...
6+
# Could do something like `nfs_clients: "{{ 'nfs_servers' not in group_names }}"` instead.
7+
clients: "{{ inventory_hostname in groups['cluster'] and inventory_hostname not in groups['control'] }}"
8+
nfs_server: "{{ nfs_server_default }}"
9+
nfs_export: "/exports/home" # assumes skeleton TF is being used
10+
nfs_client_mnt_point: "/home"
11+
12+
# EXPERIMENTAL - not generally secure
13+
- comment: Export /exports/cluster from Slurm control node
14+
nfs_enable:
15+
server: "{{ inventory_hostname in groups['control'] }}"
16+
clients: false
17+
nfs_export: "/exports/cluster"

environments/common/inventory/group_vars/all/nfs.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ nfs_configurations:
1616
nfs_export: "/exports/home" # assumes skeleton TF is being used
1717
nfs_client_mnt_point: "/home"
1818

19-
- comment: Export /exports/cluster from Slurm control node
20-
nfs_enable:
21-
server: "{{ inventory_hostname in groups['control'] }}"
22-
clients: false
23-
nfs_export: "/exports/cluster"
19+
# Set 'secure' to prevent tunneling nfs mounts
20+
# Cannot set 'root_squash' due to home directory creation
21+
nfs_export_options: 'rw,secure,no_root_squash'

0 commit comments

Comments
 (0)