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

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.10 or 203.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

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.

Prerequisites

To use hostnames in host access rules, you must:

  • Enable and configure reverse DNS lookups on your DNS server.

  • Optimize your system for reverse DNS lookups.

  • Use fully qualified domain names (FQDNs).

  • Use wildcards carefully because they match only one hostname level. For example, *.accounting.example.com matches user1.accounting.example.com but not machine.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

  1. Log in to the Qumulo Core Web UI.

  2. Click Sharing > NFS Exports.

  3. For an NFS export, in the Actions column, click Edit .

  4. On the NFS Export page, in the Host Access Rules section:

    1. For Allowed Hosts, enter a comma-separated host access rule.

    2. (Optional) To give the allowed hosts read-only access to the NFS export, click Read-only.

    3. (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.

    4. (Optional) Select the Required Authentication Mode.

    5. (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.

    6. To add a new rule, click + Add a Host Access Rule.

    7. 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

  1. 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"
      }]
    }
    
  2. Run the qq nfs_modify_export command and specify the export path and the file with the host access rules. For example:

    qq nfs_modify_export \
      --export-path / \
      --restrictions root_restrictions.json
    

    The 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

  1. To add a TLS requirement for an existing host access rule, run the qq nfs_modify_export_host_access command with the modify_entry subcommand, specify the export path and the rule’s position, and then use the --require-tls flag. For example:

    qq nfs_modify_export_host_access \
      --export-path /data \
      modify_entry \
      --position 1 \
      --require-tls
    
  2. To check the export’s host access rules, run the qq nfs_get_export command and specify the export path. For example:

    qq nfs_get_export --export-path /data
    

    The following is example output. In the following example, xprtsec=tls in the Access Options column 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

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:

  1. Place a rule without the TLS requirement for the hosts that continue to mount in plaintext.

  2. 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.

  1. To view the NFS export’s host access rules, run the qq nfs_get_export command 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_squash
    

    In this example, only the user1.accounting.example.com host can access the NFS export at /.

  2. 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)
    
  3. To find the client’s hostname, run the qq dns_resolve_ips command and specify the client’s IP address. For example:

    qq dns_resolve_ips --ips 203.0.113.2
    

    The following is example output.

    [{
      "hostname": "user2.accounting.example.com",
      "ip_address": "203.0.113.2",
      "result": "OK"
    }]
    

    In this example, the 203.0.113.2 IP address maps to user2.accounting.example.com.

  4. 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.2 should resolve to user1.accounting.example.com). To clear your Qumulo cluster’s DNS cache, run the qq dns_clear_cache command.

    • 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 the qq dns_resolve_hostnames command 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"
  }]
}