[ 
https://issues.apache.org/jira/browse/HADOOP-10756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14072499#comment-14072499
 ] 

Alejandro Abdelnur commented on HADOOP-10756:
---------------------------------------------

*KMSAudit.java*:
* use a try/finally block in op() to ensure the MDC is cleaned up
* Make UNAUTHORIZED & OK an enum, this will make comparisons in the appender 
faster

*KMSAuditAppender*:
* {{equals()}}, (this seems autogenerated) use {}s in all IF statements
* {{hashcode()}}, (this seems autogenerated) simply return 
{{keyName.hashcode()}}, add a precondition check in the constructor so keyName 
is not NULL.
* no need to have {{AccessInfo}} class, {{DelayedEvent}} has everything 
already, just expose the accessCount Integer.
* having 2 threads for the executor seems more than enough, no need for making 
it configurable.
* {{append()}}, how about using a Guava Cache instead concurrent map not create 
an {{AccessInfo}} instance every time when already one may exists. without 
expiration policy the cache, or if simplifies things, use the expiration policy 
to trigger 'flushing'
* {{append()}} it can be a race condition with {{handleFirstAccess()}} calls 
with accessCount == 0.

*kms-log4j.properties*: the log4j settings for the appender should be here for 
the KMS to picked up in prod.

> KMS audit log should consolidate successful similar requests
> ------------------------------------------------------------
>
>                 Key: HADOOP-10756
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10756
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 3.0.0
>            Reporter: Alejandro Abdelnur
>            Assignee: Arun Suresh
>         Attachments: HADOOP-10756.1.patch, HADOOP-10756.2.patch, 
> HADOOP-10756.3.patch, HADOOP-10756.4.patch
>
>
> Every rejected access should be audited, but successful accesses should be 
> consolidated within a given amount of time if the request is from the same 
> user for he same key. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to