[
https://issues.apache.org/jira/browse/RANGER-5710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ramachandran Krishnan updated RANGER-5710:
------------------------------------------
Description:
The {{ClassCastException}} on multi-value {{requestUser}} occurred because
installs fell through to the deprecated *DB audit path* when
{{ranger.audit.source.type}} was unset or misconfigured:
# {{RangerBizUtil}} defaulted to {{AUDIT_STORE_RDBMS}} when the property was
missing
# Docker Postgres {{install.properties}} had {{audit_store=opensearch}} active
while Solr URLs were commented out
was:
Access Audit UI search fails when the Users filter contains more than one value
(e.g. {{admin}} and {{{}hive{}}}).
Ranger Admin returns an error and {{catalina.out}} shows:
{code:java}
java.lang.ClassCastException: java.util.ArrayList cannot be cast to
java.lang.String at
org.apache.ranger.common.SearchUtil.buildWhereClause(SearchUtil.java:513) at
org.apache.ranger.service.XAccessAuditService ... {code}
h3. Root cause
{{AssetREST.getAccessLogs()}} has used {{extractStringList()}} for the Users
filter since RANGER-2394 (2019). Repeated query params
({{{}requestUser=admin&requestUser=hive{}}}) are stored in
{{SearchCriteria.paramList}} as an {{{}ArrayList{}}}.
On the Solr audit path, {{AccessAuditsService}} already declares
{{requestUser}} as {{{}STR_LIST{}}}, so multi-value filters work.
On the DB audit path, {{XAccessAuditService}} still declared {{requestUser}} as
{{{}DATA_TYPE.STRING{}}}. {{SearchUtil.buildWhereClause()}} casts the param to
{{{}String{}}}, which fails when the value is a list.
> Default access audit store to Solr
> ----------------------------------
>
> Key: RANGER-5710
> URL: https://issues.apache.org/jira/browse/RANGER-5710
> Project: Ranger
> Issue Type: Task
> Components: Ranger
> Affects Versions: 3.0.0, 2.8.0
> Reporter: Ramachandran Krishnan
> Assignee: Ramachandran Krishnan
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The {{ClassCastException}} on multi-value {{requestUser}} occurred because
> installs fell through to the deprecated *DB audit path* when
> {{ranger.audit.source.type}} was unset or misconfigured:
> # {{RangerBizUtil}} defaulted to {{AUDIT_STORE_RDBMS}} when the property was
> missing
> # Docker Postgres {{install.properties}} had {{audit_store=opensearch}}
> active while Solr URLs were commented out
--
This message was sent by Atlassian Jira
(v8.20.10#820010)