This section explains how host access rules work in Qumulo Core and how to configure and troubleshoot them.
How Host Access Rules for NFS Exports Work in Qumulo Core
This section explains the three types of host access rules for NFS exports.
Restricting Access by IP Address or Hostname
If you don’t specify a host access rule, Qumulo Core allows access to all IP addresses.
In Qumulo Core 6.2.0.1 (and higher), you can add a host access rule to an NFS export to restrict the export by IP address or hostname.
The following examples show the elements that a host access rule can include:
-
Hostnames
-
With a wildcard (
*.example.com) -
Without a wildcard (
name.example.com)
-
-
IP Addresses
-
IP address ranges (
203.0.113.0-203.0.113.10or203.0.113.0-10) -
Single IP addresses (
203.0.113.0)
-
-
Network Segments
-
With a subnet mask (
203.0.113.0/255.255.255.0) -
Without a subnet mask (
203.0.113.0/24)
-
Restricting Access by the NFS Client’s Kerberos Security Flavor
In Qumulo Core 7.7.1.1 (and higher), you can also restrict access to NFSv4.1 clients by Kerberos security flavor:
-
KRB5: Allows access to clients that use any Kerberos security flavor for authentication
-
KRB5I: Allows access only to clients that use a Kerberos security flavor with message integrity or encryption for authentication
-
KRB5P: Allows access only to clients that use a Kerberos security flavor with encryption for authentication
-
None: No authentication restrictions
Restricting Access by the NFS Client’s TLS Connectivity
- To avoid potential data loss, move your clients to NFS over TLS first.
- If a host access rule that requires TLS matches clients that still mount the export in plaintext, their mounts fail at the next NFS call and the clients lose any writes that they have cached but haven't yet sent to the cluster.
- On NFSv4.1, a client with files open at that moment can't close or unlock them on the cluster. The client's opens and byte-range locks remain on the cluster until the client unmounts the export or restarts the client. Until that time, other clients can't lock those byte ranges.
In Qumulo Core 7.11.0 (and higher), you can require the hosts that a host access rule matches to use NFS over TLS for an NFS export. When a host access rule requires TLS, Qumulo Core refuses NFS calls that arrive in plaintext from the hosts that the rule matches and it serves the same calls when they arrive over TLS. For information about configuring your cluster and your clients for NFS over TLS, see Enabling and Using NFS over TLS in Qumulo Core.
- Because Qumulo Core applies only the first host access rule that matches a client, and a rule that requires TLS takes effect for a client only when it is the first rule that matches the client, you must place more specific rules above broader ones.
- When a rule that requires TLS refuses a plaintext client, Qumulo Core doesn't use the rules below it.
- The TLS requirement is separate from the other settings of a host access rule (such as read-only access and the required authentication mode).
- A host access rule can require both TLS and a Kerberos security flavor.
Prerequisites
To use hostnames in host access rules, you must:
-
Enable and configure reverse DNS lookups on your DNS server.
-
Use fully qualified domain names (FQDNs).
-
Use wildcards carefully because they match only one hostname level. For example,
*.accounting.example.commatchesuser1.accounting.example.combut notmachine.user1.accounting.example.com.
Adding a Host Access Rule to an Existing NFS Export
This section explains how to add a host access rule to an existing NFS export by using the Qumulo Core Web UI or the qq CLI.
To Add a Host Access Rule by Using the Qumulo Core Web UI
-
Log in to the Qumulo Core Web UI.
-
Click Sharing > NFS Exports.
-
For an NFS export, in the Actions column, click
. -
On the NFS Export page, in the Host Access Rules section:
-
For Allowed Hosts, enter a comma-separated host access rule.
-
(Optional) To give the allowed hosts read-only access to the NFS export, click Read-only.
-
(Optional) To require the allowed hosts to use NFS over TLS, click Require TLS.
For more information, see Restricting Access by the NFS Client’s TLS Connectivity.
-
(Optional) Select the Required Authentication Mode.
-
(Optional) For User mapping, select one of the following:
-
Map all to…: Qumulo Core associates all users that access the NFS export with a specific user in your Qumulo cluster.
-
Map root to…: Qumulo Core associates the root user that accesses the NFS export with a specific user in your Qumulo cluster.
-
No mapping: Qumulo Core doesn’t apply a user mapping when it accesses the NFS export and relies on default NFS protocol behavior.
-
-
To add a new rule, click + Add a Host Access Rule.
-
Click Save.
-
Qumulo Core applies the host access rule to the NFS export. On the NFS Exports page, the Require TLS column shows the exports that require TLS.
To Add a Host Access Rule by Using the qq CLI
-
Prepare a list of host access rules in JSON format. The following is an example of the contents of
root_restrictions.json.{ "restrictions": [{ "host_restrictions": [ "user1.accounting.example.com", "*.eng.example.com", "203.0.113.0" ], "required_authentication_mode": "AUTHENTICATION_MODE_KRB5" }] } -
Run the
qq nfs_modify_exportcommand and specify the export path and the file with the host access rules. For example:qq nfs_modify_export \ --export-path / \ --restrictions root_restrictions.jsonThe following is example output.
{ "description": "", "export_path": "/", "fields_to_present_as_32_bit": [], "fs_path": "/", "id": "1", "restrictions": [{ "host_restrictions": [ "user1.accounting.example.com", "*.eng.example.com", "203.0.113.0" ], "read_only": false, "required_authentication_mode": "AUTHENTICATION_MODE_KRB5", "require_privileged_port": false, "require_tls": false, "user_mapping": "NFS_MAP_NONE" }], "tenant_id": 1 }
To Add an NFS over TLS Host Access Rule by Using the qq CLI
- When you replace all of an export's host access rules by using the
--restrictionsflag of theqq nfs_modify_exportcommand or the/v3/nfs/exports/{export_id}Qumulo REST API endpoint, you must includerequire_tlsfor each rule that must require TLS. qqCLI from a Qumulo Core version lower than 7.11.0 disables the TLS requirement of every host access rule when it creates an export or replaces an export's host access rules, even if the rules file specifiesrequire_tls. To manage exports that require TLS, useqqCLI from Qumulo Core 7.11.0 (or higher).
-
To add a TLS requirement for an existing host access rule, run the
qq nfs_modify_export_host_accesscommand with themodify_entrysubcommand, specify the export path and the rule’s position, and then use the--require-tlsflag. For example:qq nfs_modify_export_host_access \ --export-path /data \ modify_entry \ --position 1 \ --require-tlsTip
- To add a new host access rule that requires TLS, use the
add_entrysubcommand with the--require-tlsflag. - To remove the TLS requirement from a host access rule, use the
--no-require-tlsflag.
- To add a new host access rule that requires TLS, use the
-
To check the export’s host access rules, run the
qq nfs_get_exportcommand and specify the export path. For example:qq nfs_get_export --export-path /dataThe following is example output. In the following example,
xprtsec=tlsin theAccess Optionscolumn indicates that the rule requires TLS.ID: 2 Export Path: /data Tenant ID: 1 FS Path: /data Description: 32bit-mapped fields: None Host Access: ID Hosts Authentication Mode Access Options == ============== ======================== ========================================= 1 203.0.113.0/24 AUTHENTICATION_MODE_NONE rw, insecure, xprtsec=tls, no_root_squash
To Require NFS over TLS while Permitting Some Clients to Mount in Plaintext
An NFSv4.1 TLS mount—that a client makes while it has a plaintext NFSv4.1 mount of the same node open—sends its traffic in plaintext, and a host access rule that requires TLS refuses that traffic. For this reason, you should count a host as moved only when it has no plaintext NFSv4.1 cluster export mounts left and the
findmnt command shows xprtsec=tls for each of its mounts of the cluster. For more information, see Allowing Plaintext and TLS Mounts on the Same Client.
When you move clients to NFS over TLS, you can require TLS only from specific hosts that have already moved. Because Qumulo Core applies the first rule that matches a client, you must add a rule that requires TLS for the moved hosts and put it above the rule that matches the other hosts. For example:
| Position | Hosts | Require TLS |
|---|---|---|
| 1 | 203.0.113.0/24 (moved to TLS) |
Yes |
| 2 | * |
No |
To add a rule to the top of the list, run the qq nfs_modify_export_host_access
command with the add_entry subcommand and then specify 0 for the --insert-after flag. For example:
qq nfs_modify_export_host_access \
--export-path /data \
add_entry \
--hosts 203.0.113.0/24 \
--insert-after 0 \
--require-tls
As more hosts move, you can expand the first rule. When most hosts have moved, you can reverse the configuration as follows:
-
Place a rule without the TLS requirement for the hosts that continue to mount in plaintext.
-
Below the first rule, place a rule that requires TLS for all hosts (
*).
To Troubleshoot Host Access Rules for an NFS Export
This section explains how to troubleshoot an NFS client that can’t mount or access an NFS export.
If you use multiple DNS servers, the
qq dns_resolve_hostnames
and qq dns_resolve_ips
commands aren't tenant-aware and might not return the same results as the DNS resolution mechanism in NFS.
-
To view the NFS export’s host access rules, run the
qq nfs_get_exportcommand and specify the export path. For example:qq nfs_get_export --export-path /The following is example output.
ID: 1 Export Path: / Tenant ID: 1 FS Path: / Description: 32bit-mapped fields: None Host Access: ID Hosts Access Options == ============================= ============================ 1 user1.accounting.example.com rw, insecure, no_root_squashIn this example, only the
user1.accounting.example.comhost can access the NFS export at/. -
To find the client’s IP address, check your Qumulo cluster’s logs for a message such as the following:
Client 203.0.113.2 is not authorized to use export ExportId(1) -
To find the client’s hostname, run the
qq dns_resolve_ipscommand and specify the client’s IP address. For example:qq dns_resolve_ips --ips 203.0.113.2The following is example output.
[{ "hostname": "user2.accounting.example.com", "ip_address": "203.0.113.2", "result": "OK" }]In this example, the
203.0.113.2IP address maps touser2.accounting.example.com. -
To troubleshoot the NFS client, you can take one or more of the following steps:
-
Ensure that the NFS client configuration entry is correct.
-
Ensure that your Qumulo cluster’s DNS cache isn’t out of date (for example, if
203.0.113.2should resolve touser1.accounting.example.com). To clear your Qumulo cluster’s DNS cache, run theqq dns_clear_cachecommand. -
If the NFS client can access the NFS export but shouldn’t be able to, remove the client’s IP address from the export’s host access rules.
-
If the NFS client can’t access the NFS export but should be able to, add the client’s IP address to the export’s host access rules.
-
To look up
user1.accounting.example.com, run theqq dns_resolve_hostnamescommand and specify the hostname.The following is example output.
[{ "hostname": "user1.accounting.example.com", "ip_addresses": ["203.0.113.1"], "result": "OK" }] -
Update the host access rules for
user2.accounting.example.com.
-
Optimizing Your System for Reverse DNS Lookups
Qumulo Core checks hostnames by performing a reverse DNS lookup on the cluster. Because continuous reverse DNS lookups can affect system performance, Qumulo Core caches the results on the cluster. Because the cache follows the DNS time to live (TTL), a low TTL can cause cache entries to expire frequently and require new queries.
By increasing the TTL, you can reduce the number of DNS requests that your cluster makes. However, a higher TTL can also cause your cluster to keep outdated results for longer. For the best performance, list your organization’s DNS servers first in your DNS configuration.
To bypass DNS, you can set explicit IP address-to-hostname mappings for your cluster by using the qq dns_set_lookup_overrides
command. If Qumulo Core finds an override for an IP address or host, it uses the override instead of the DNS cache.
In the following JSON example, the IP address 203.0.113.2 binds to the host user3.accounting.example.com explicitly.
{
"lookup_overrides": [{
"aliases": ["user3.accounting.example.com"],
"ip_address": "203.0.113.2"
}]
}