Apache Ranger HDFS audit destination configuration
This comprehensive topic covers all configuration properties for Apache Ranger's HDFS audit destination along with substitution variables, configuration examples, advanced features, best practices, and so on.
The HDFS audit destination writes Apache Ranger audit logs to HDFS (or HDFS-compatible file systems like Azure Blob Storage, S3, and so on). HDFS is the recommended long-term storage for Ranger audit messages, typically used alongside Solr for short-term storage and searching.
For production deployments, always:
-
Enable periodic rollover.
-
Use appropriate rollover frequency.
-
Configure Hadoop settings for your environment.
-
Enable file spooling for resilience.
-
Monitor audit file creation and rollover.
-
Secure audit files with appropriate permissions and encryption.
Key classes
-
HDFSAuditDestination: Main destination class that handles audit logging to HDFS.
-
AbstractRangerAuditWriter: Abstract base class for audit writers with common HDFS functionality.
-
RangerJSONAuditWriter: Implementation for writing audits as JSON format (default).
-
RangerORCAuditWriter: Implementation for writing audits in ORC format.
-
AuditWriterFactory: Factory class to create appropriate writer implementations.
Configuration prefix
All HDFS audit properties use the prefix:
xasecure.audit.destination.hdfs.
For example: xasecure.audit.destination.hdfs.dir
References
- Apache Ranger documentation
- Source code classes
-
-
org.apache.ranger.audit.destination.HDFSAuditDestination -
org.apache.ranger.audit.utils.AbstractRangerAuditWriter -
org.apache.ranger.audit.utils.RangerJSONAuditWriter -
org.apache.ranger.audit.utils.RangerORCAuditWriter -
org.apache.ranger.audit.provider.AuditWriterFactory -
org.apache.ranger.audit.utils.RollingTimeUtil
-
- Hadoop documentation
