[ 
https://issues.apache.org/jira/browse/RANGER-4808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

woosuk.ro updated RANGER-4808:
------------------------------
    Description: 
When using MultiDestAuditProvider (audit provider v3) with KafkaAuditProvider,
the Kafka producer is not initialized.

Root Cause:
AuditProviderFactory calls init(props, basePropertyName), but KafkaAuditProvider
only overrides init(props). The Kafka-specific initialization is never executed.

Additionally, simply overriding init(props, basePropertyName) to call 
init(props)
causes infinite recursion because BaseAuditHandler.init(props) internally calls
init(props, null), which triggers the override.

Solution:
- Call super.init(props, null) directly to break recursion
- Override init(props, basePropertyName) to delegate to init(props)

  was:
In the current implementation of Impala plugin’s Audit V3, the 
{{KafkaAuditProvider}} cannot be properly initialized because it lacks the 
{{init(Properties props, String basePropertyName)}} method. Additionally, it 
depends on Kafka client version 0.8.0, which complicates integration with newer 
Kafka versions.

This proposal introduces two key improvements:

*1. Implement the init(Properties props, String basePropertyName) method*
- Add the {{init(Properties props, String basePropertyName)}} method to 
properly initialize the {{KafkaAuditProvider}} in an Audit V3 environment.

*2. Dynamic Configuration*
- Enable dynamic setting of Kafka Producer configuration values within the 
{{{}*KafkaAuditProvider*{}}}, allowing more flexible and customizable 
configurations.
 

By implementing these changes, the {{KafkaAuditProvider}} will work seamlessly 
with updated Kafka clients and support dynamic configuration, ultimately 
enhancing audit logging in Impala.


> KafkaAuditProvider fails to initialize when used with MultiDestAuditProvider
> ----------------------------------------------------------------------------
>
>                 Key: RANGER-4808
>                 URL: https://issues.apache.org/jira/browse/RANGER-4808
>             Project: Ranger
>          Issue Type: Improvement
>          Components: audit
>            Reporter: woosuk.ro
>            Priority: Major
>             Fix For: 2.3.0, 2.4.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When using MultiDestAuditProvider (audit provider v3) with KafkaAuditProvider,
> the Kafka producer is not initialized.
> Root Cause:
> AuditProviderFactory calls init(props, basePropertyName), but 
> KafkaAuditProvider
> only overrides init(props). The Kafka-specific initialization is never 
> executed.
> Additionally, simply overriding init(props, basePropertyName) to call 
> init(props)
> causes infinite recursion because BaseAuditHandler.init(props) internally 
> calls
> init(props, null), which triggers the override.
> Solution:
> - Call super.init(props, null) directly to break recursion
> - Override init(props, basePropertyName) to delegate to init(props)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to