accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/5] git commit: ACCUMULO-3050 Include client IP from thrift processor in audit msg
Date Wed, 06 Aug 2014 22:26:53 GMT
ACCUMULO-3050 Include client IP from thrift processor in audit msg


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/cc30021c
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/cc30021c
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/cc30021c

Branch: refs/heads/master
Commit: cc30021c28417f20892302943100a4c4696d31bb
Parents: 66594db
Author: Josh Elser <elserj@apache.org>
Authored: Wed Aug 6 16:02:53 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Aug 6 18:17:50 2014 -0400

----------------------------------------------------------------------
 .../apache/accumulo/server/security/AuditedSecurityOperation.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/cc30021c/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
b/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
index e37d4a2..8049003 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
@@ -47,6 +47,7 @@ import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.accumulo.server.security.handler.Authenticator;
 import org.apache.accumulo.server.security.handler.Authorizor;
 import org.apache.accumulo.server.security.handler.PermissionHandler;
+import org.apache.accumulo.server.util.TServerUtils;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
@@ -120,7 +121,7 @@ public class AuditedSecurityOperation extends SecurityOperation {
   private void audit(TCredentials credentials, boolean permitted, String template, Object...
args) {
     if (shouldAudit(credentials)) {
       String prefix = permitted ? "permitted" : "denied";
-      audit.info("operation: " + prefix + "; user: " + credentials.getPrincipal() + "; "
+ String.format(template, args));
+      audit.info("operation: " + prefix + "; user: " + credentials.getPrincipal() + "; client:
"  + TServerUtils.clientAddress.get() + "; " + String.format(template, args));
     }
   }
 


Mime
View raw message