Save Audits to HDFS
How to save audits to HDFS, when enabling Ranger KMS Audit.
There are no configuration changes needed for Ranger properties.
To save Ranger KMS audits to HDFS, set the following properties in the Advanced ranger-kms-audit list.
Note | |
---|---|
The following configuration settings must be changed in each Plugin. |
- Check the box next to
Enable Audit to HDFS
in the Ranger KMS component. - Set the HDFS path to the path of the location in HDFS where you want to store audits:
xasecure.audit.destination.hdfs.dir = hdfs://NAMENODE_FQDN:8020/ranger/audit
. - Check the
Audit provider summary enabled
box, and make sure thatxasecure.audit.is.enabled
is set to true. - Make sure that the plugin's root user (
kms
) has permission to access HDFS Pathhdfs://NAMENODE_FQDN:8020/ranger/audit
. - Restart Ranger KMS.
- Generate audit logs for the Ranger KMS.
- (Optional) To verify audit to HDFS without waiting for the default sync delay (approximately 24 hours), restart Ranger KMS. Ranger KMS will start writing to HDFS after the changes are saved post-restart.
- To check for audit data:
hdfs dfs -ls /ranger/audit/
. - Test Ranger KMS audit to HDFS: