Skip to content

Commit

Permalink
fix: use v3 configuration for ranger audit log export to hdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
PACordonnier authored and rpignolet committed Jul 5, 2024
1 parent 9462b4a commit 99b0d0d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
8 changes: 5 additions & 3 deletions roles/hdfs/common/templates/install_hdfs.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ XAAUDIT.SOLR.FILE_SPOOL_DIR={{ hadoop_log_dir }}/audit/solr/spool
#XAAUDIT.HDFS.HDFS_DIR=wasb[s]://<containername>@<accountname>.blob.core.windows.net/<path>
#XAAUDIT.HDFS.HDFS_DIR=wasb://[email protected]/ranger/audit

XAAUDIT.HDFS.ENABLE=false
XAAUDIT.HDFS.HDFS_DIR=hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit
XAAUDIT.HDFS.ENABLE=true
XAAUDIT.HDFS.HDFS_DIR={{ core_site['fs.defaultFS'] }}/ranger/audit
XAAUDIT.HDFS.FILE_SPOOL_DIR={{ hadoop_log_dir }}/audit/hdfs/spool

# Following additional propertis are needed When auditing to Azure Blob Storage via HDFS
Expand All @@ -73,6 +73,8 @@ XAAUDIT.HDFS.AZURE_ACCOUNTKEY_PROVIDER=__REPLACE_AZURE_ACCOUNT_KEY_PROVIDER

# End of V3 properties

# AUDIT configuration with V2 properties
# They wont be read if any V3 configuration are declared.
#
# Audit to HDFS Configuration
#
Expand All @@ -89,7 +91,7 @@ XAAUDIT.HDFS.AZURE_ACCOUNTKEY_PROVIDER=__REPLACE_AZURE_ACCOUNT_KEY_PROVIDER
# XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY=/var/log/hadoop/%app-type%/audit
# XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY=/var/log/hadoop/%app-type%/audit/archive
#
XAAUDIT.HDFS.IS_ENABLED=true
XAAUDIT.HDFS.IS_ENABLED=false
XAAUDIT.HDFS.DESTINATION_DIRECTORY={{ core_site['fs.defaultFS'] }}/ranger/audit/%app-type%/%time:yyyyMMdd%
XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY={{ hadoop_log_dir }}/%app-type%/audit
XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY={{ hadoop_log_dir }}/%app-type%/audit/archive
Expand Down
9 changes: 5 additions & 4 deletions roles/hive/common/templates/install.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ XAAUDIT.SOLR.FILE_SPOOL_DIR={{ hive_log_dir }}/audit/solr/spool
#XAAUDIT.HDFS.HDFS_DIR=wasb://[email protected]/ranger/audit
#XAAUDIT.HDFS.FILE_SPOOL_DIR=/var/log/hive/audit/hdfs/spool

XAAUDIT.HDFS.ENABLE=false
XAAUDIT.HDFS.HDFS_DIR=hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit
XAAUDIT.HDFS.ENABLE=true
XAAUDIT.HDFS.HDFS_DIR={{ ranger_hive_install_properties['audit_hdfs'] }}/ranger/audit
XAAUDIT.HDFS.FILE_SPOOL_DIR={{ hive_log_dir }}/audit/hdfs/spool

# Following additional propertis are needed When auditing to Azure Blob Storage via HDFS
Expand All @@ -76,7 +76,8 @@ XAAUDIT.HDFS.AZURE_ACCOUNTKEY_PROVIDER=__REPLACE_AZURE_ACCOUNT_KEY_PROVIDER

# End of V3 properties


# AUDIT configuration with V2 properties
# They wont be read if any V3 configuration are declared.
#
# Audit to HDFS Configuration
#
Expand All @@ -93,7 +94,7 @@ XAAUDIT.HDFS.AZURE_ACCOUNTKEY_PROVIDER=__REPLACE_AZURE_ACCOUNT_KEY_PROVIDER
# XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY=/var/log/hive/audit/%app-type%
# XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY=/var/log/hive/audit/archive/%app-type%
#
XAAUDIT.HDFS.IS_ENABLED=true
XAAUDIT.HDFS.IS_ENABLED=false
XAAUDIT.HDFS.DESTINATION_DIRECTORY={{ ranger_hive_install_properties['audit_hdfs'] }}/ranger/audit/%app-type%/%time:yyyyMMdd%
XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY={{ hive_log_dir }}/%app-type%/audit
XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY={{ hive_log_dir }}/%app-type%/audit/archive
Expand Down
9 changes: 5 additions & 4 deletions roles/yarn/common/templates/install_yarn.properties.j2
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ XAAUDIT.SOLR.FILE_SPOOL_DIR={{ hadoop_log_dir }}/audit/solr/spool
#XAAUDIT.HDFS.HDFS_DIR=wasb[s]://<containername>@<accountname>.blob.core.windows.net/<path>
#XAAUDIT.HDFS.HDFS_DIR=wasb://[email protected]/ranger/audit

XAAUDIT.HDFS.ENABLE=false
XAAUDIT.HDFS.HDFS_DIR=hdfs://__REPLACE__NAME_NODE_HOST:8020/ranger/audit
XAAUDIT.HDFS.ENABLE=true
XAAUDIT.HDFS.HDFS_DIR={{ core_site['fs.defaultFS'] }}/ranger/audit
XAAUDIT.HDFS.FILE_SPOOL_DIR={{ hadoop_log_dir }}/audit/hdfs/spool

# Following additional propertis are needed When auditing to Azure Blob Storage via HDFS
Expand All @@ -73,6 +73,8 @@ XAAUDIT.HDFS.AZURE_ACCOUNTKEY_PROVIDER=__REPLACE_AZURE_ACCOUNT_KEY_PROVIDER

# End of V3 properties

# AUDIT configuration with V2 properties
# They wont be read if any V3 configuration are declared.
#
# Audit to HDFS Configuration
#
Expand All @@ -89,7 +91,7 @@ XAAUDIT.HDFS.AZURE_ACCOUNTKEY_PROVIDER=__REPLACE_AZURE_ACCOUNT_KEY_PROVIDER
# XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY=/var/log/hadoop/%app-type%/audit
# XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY=/var/log/hadoop/%app-type%/audit/archive
#
XAAUDIT.HDFS.IS_ENABLED=true
XAAUDIT.HDFS.IS_ENABLED=false
XAAUDIT.HDFS.DESTINATION_DIRECTORY={{ core_site['fs.defaultFS'] }}/ranger/audit/%app-type%/%time:yyyyMMdd%
XAAUDIT.HDFS.LOCAL_BUFFER_DIRECTORY={{ hadoop_log_dir }}/%app-type%/audit
XAAUDIT.HDFS.LOCAL_ARCHIVE_DIRECTORY={{ hadoop_log_dir }}/%app-type%/audit/archive
Expand Down Expand Up @@ -144,4 +146,3 @@ CUSTOM_USER=yarn
# CUSTOM_COMPONENT_GROUP=<custom-group>
# keep blank if component group is default
CUSTOM_GROUP=hadoop

0 comments on commit 99b0d0d

Please sign in to comment.