Skip to content

Use Kerberos Security on All Exports

An XCCDF Rule

Description

Using Kerberos on all exported mounts prevents a malicious client or user from impersonating a system user. To cryptography authenticate users to the NFS server, add sec=krb5:krb5i:krb5p to each export in /etc/exports.

Rationale

When an NFS server is configured to use AUTH_SYS a selected userid and groupid are used to handle requests from the remote user. The userid and groupid could mistakenly or maliciously be set incorrectly. The AUTH_GSS method of authentication uses certificates on the server and client systems to more securely authenticate the remote mount request.

ID
xccdf_org.ssgproject.content_rule_use_kerberos_security_all_exports
Severity
Medium
References
Updated



Remediation - Ansible

- name: Drop any security clause for every export
  replace:
    path: /etc/exports
    regexp: ^(/.*\w+.*\(.*),sec=[^,]*(.*\)\w*$)
    replace: \1\2
  tags:

Remediation - Shell Script


nfs_exports=()
readarray -t nfs_exports < <(grep -E "^/.*[[:space:]]+ .*\(.*\)[[:space:]]*$" /etc/exports | awk '{print $2}')

for nfs_export in "${nfs_exports[@]}"
do