Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-3751

ElasticSearch Audit shows wrong date on Ranger-admin UI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0, 2.3.0
    • None
    • admin, audit
    • None

    Description

      Recently AmazonCloudWatch support was added to the audit module in this commit.

      However, this commit also changed the toDate method of ElasticSearchAccessAuditsService.java because of which the event time on the Audit screen is showing the wrong date from 1970. The error stack is as follows:

      2022-05-08 07:04:22,887 [http-nio-6080-exec-6] ERROR [MiscUtil.java:938] Error converting value to date. Value = 2022-05-08T06:42:01.621Z
      java.lang.IllegalArgumentException: null
          at java.base/java.util.Date.parse(Date.java:616)
          at java.base/java.util.Date.<init>(Date.java:274)
          at org.apache.ranger.audit.provider.MiscUtil.toDate(MiscUtil.java:936)
          at org.apache.ranger.elasticsearch.ElasticSearchAccessAuditsService.populateViewBean(ElasticSearchAccessAuditsService.java:260)
          at org.apache.ranger.elasticsearch.ElasticSearchAccessAuditsService.searchXAccessAudits(ElasticSearchAccessAuditsService.java:95)
          at org.apache.ranger.biz.AssetMgr.getAccessLogs(AssetMgr.java:1139)
          at org.apache.ranger.rest.AssetREST.getAccessLogs(AssetREST.java:672)
          at org.apache.ranger.rest.AssetREST$$FastClassBySpringCGLIB$$8cffcb6d.invoke(<generated>)
          at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
          at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:61)
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
          at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
          at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)

       

       

      The screenshot shows the erroneous date on ranger-admin

       

      Please refer: https://github.com/apache/ranger/commit/71744d3ff8e0db7f0a49881a891e77edf0ea518d#r73132360 

      Attachments

        1. admin-ui-audit-screen.png
          596 kB
          Aakash Nand

        Activity

          People

            Unassigned Unassigned
            aakashnand Aakash Nand
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m