HDFS Permissions, ACLs, Encryption Zones and Hadoop KMS

Big Data and Hadoop Administrator 17 min min read Updated: Nov 16, 2026 Advanced
HDFS Permissions, ACLs, Encryption Zones and Hadoop KMS
Advanced Topic 3 of 5

Basic Permissions

HDFS permissions look like Linux: owner, group, other with rwx. For directories, x means 'may enter'.

bash hdfs dfs -ls /data hdfs dfs -chmod 750 /data/finance hdfs dfs -chown etl:finance /data/finance hdfs dfs -chmod -R 770 /data/finance/curated hdfs dfs -chmod 1777 /tmp # sticky bit: users delete only their own files
xml <property><name>dfs.permissions.enabled</name><value>true</value></property> <property><name>dfs.permissions.superusergroup</name><value>hdfs_admins</value></property> <property><name>fs.permissions.umask-mode</name><value>027</value></property> <!-- new files 640, dirs 750 -->
Superuser: The OS user that starts the NameNode (usually hdfs) and members of dfs.permissions.superusergroup bypass checks. Keep this group small.

Group Mapping

The NameNode computes groups itself (not from the client). Configure hadoop.security.group.mapping so group lookups match your directory.

xml <property><name>hadoop.security.group.mapping</name><value>org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback</value></property> <!-- or LdapGroupsMapping / SSSD-backed OS groups --> <property><name>hadoop.security.groups.cache.secs</name><value>300</value></property>
bash hdfs groups alice # groups as the NameNode sees them hdfs dfsadmin -refreshUserToGroupsMappings

POSIX ACLs

Permission bits allow only one owner group. ACLs add extra users and groups to a path.

xml <property><name>dfs.namenode.acls.enabled</name><value>true</value></property>
bash hdfs dfs -setfacl -m user:bob:r-x,group:auditors:r-x /data/finance hdfs dfs -setfacl -R -m default:group:auditors:r-x /data/finance # default ACL for new children hdfs dfs -getfacl /data/finance hdfs dfs -setfacl -x user:bob /data/finance # remove one entry hdfs dfs -setfacl -b /data/finance # remove all extended ACLs
A + in ls: A trailing + in drwxr-x---+ means the path has ACL entries. Too many ACLs increase NameNode memory, so prefer groups and Ranger policies at scale.

Transparent Encryption at Rest

An encryption zone is a directory whose files are encrypted. Data is encrypted and decrypted on the client, so DataNodes and HDFS admins only see ciphertext.

text Zone key (EZ key) in KMS | encrypts Data Encryption Key (DEK) per file <- stored in the file's metadata as an EDEK (encrypted DEK) | encrypts File data blocks (AES-CTR)
ComponentRole
Hadoop KMSKey server. Stores zone keys and encrypts or decrypts the per-file keys
Encryption zone key (EZ key)Master key for a zone, versioned for rotation
EDEKPer-file key, encrypted by the EZ key
ClientAsks KMS to decrypt the EDEK, then decrypts data locally

Set Up KMS

xml <!-- kms-site.xml (key provider storage and ACLs) --> <property><name>hadoop.kms.key.provider.uri</name><value>jceks://file@/etc/hadoop/kms/kms.keystore</value></property> <property><name>hadoop.security.keystore.JavaKeyStoreProvider.password-file</name><value>kms.password</value></property> <property><name>hadoop.kms.authentication.type</name><value>kerberos</value></property>
xml <!-- core-site.xml / hdfs-site.xml on cluster and clients --> <property><name>hadoop.security.key.provider.path</name><value>kms://https@kms1.example.com;kms2.example.com:9600/kms</value></property>
bash hdfs --daemon start kms # or: hadoop --daemon start kms (Hadoop 3 KMS service) curl -k https://kms1.example.com:9600/kms/v1/keys/names --negotiate -u :
Production KMS: Run at least two KMS instances behind the provider path. For serious protection store keys in an HSM-backed or enterprise key store (Ranger KMS is a common choice) instead of a local keystore file. Back up the keystore; losing keys means permanent data loss.

Create Keys and Zones

bash hadoop key create finance_key -size 256 hadoop key list -metadata hdfs dfs -mkdir /data/finance_secure hdfs crypto -createZone -keyName finance_key -path /data/finance_secure hdfs crypto -listZones hdfs dfs -put payroll.csv /data/finance_secure/ # encrypted automatically hdfs dfs -cat /data/finance_secure/payroll.csv # works for authorised users # rotate the key: new files use the new version, old files keep their old key version hadoop key roll finance_key hdfs crypto -reencryptZone -start -path /data/finance_secure # optional: re-encrypt EDEKs hdfs crypto -listReencryptionStatus
Rules and limits: A zone must start as an empty directory. You cannot rename files across zone boundaries (copy instead). Trash inside zones needs care. Set KMS ACLs so HDFS superusers can not decrypt data and only data owners can.

KMS Access Control

xml <!-- kms-acls.xml --> <property><name>key.acl.finance_key.DECRYPT_EEK</name><value>etl,finance_analysts</value></property> <property><name>key.acl.finance_key.GENERATE_EEK</name><value>hdfs</value></property> <property><name>hadoop.kms.acl.ROLLOVER</name><value>keyadmin</value></property> <property><name>hadoop.kms.blacklist.DECRYPT_EEK</name><value>hdfs</value></property> <!-- HDFS admin cannot decrypt -->

distcp and Encrypted Data

bash # copy raw encrypted bytes between clusters (keep the same keys on target) hadoop distcp -px -update /.reserved/raw/data/finance_secure hdfs://dr-cluster/.reserved/raw/data/finance_secure

Copying through the normal path decrypts and re-encrypts, which is slower and needs KMS access on both sides. The /.reserved/raw path copies ciphertext and extended attributes (needs superuser).

Conclusion

Use HDFS permissions, umask and ACLs for access control, and encryption zones with Hadoop KMS for transparent encryption. Back up keys, separate key admins from HDFS admins, and know the rename and distcp rules.

Quick Summary: chmod/ACL + EZ key in KMS; hdfs crypto -createZone; backup KMS keys.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators