HDFS audit security considerations

This topic outlines security considerations and related framework settings for Apache Ranger HDFS audit storage.

File permissions

HDFS audit files inherit permissions from:

  • Parent directory permissions

  • HDFS umask settings

  • Service user's default permissions

Best Practice: Set appropriate ACLs on audit directory:

hdfs dfs -setfacl -R -m user:rangeradmin:r-x /ranger/audit
hdfs dfs -setfacl -R -m user:auditor:r-x /ranger/audit
Kerberos authentication

Always use Kerberos in production:

xasecure.audit.destination.hdfs.config.hadoop.security.authentication=kerberos

Ensure the service principal has write permission to audit directory.

Encryption

Enable HDFS transparent encryption:

hdfs crypto -createZone -keyName rangerAuditKey -path /ranger/audit
Credential management

For cloud storage, use credential providers instead of plain text:

# Instead of plain text secrets, use Hadoop credential provider
xasecure.audit.destination.hdfs.config.hadoop.security.credential.provider.path=jceks://hdfs/user/ranger/ranger-audit.jceks

Related configuration

HDFS audit destination works with other audit framework components:
Queue configuration (Batching)
# Batch queue settings
xasecure.audit.destination.hdfs.batch.size=1000
xasecure.audit.destination.hdfs.batch.interval.ms=3000
File spooling (Local disk backup)
# Enable local file spooling if HDFS is down
xasecure.audit.destination.hdfs.batch.filespool.enabled=true
xasecure.audit.destination.hdfs.batch.filespool.dir=/var/log/ranger/audit/hdfs/spool