You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2014/05/23 22:30:35 UTC
[1/3] git commit: ACCUMULO-2840 disable audit logging in mini
Repository: accumulo
Updated Branches:
refs/heads/1.6.1-SNAPSHOT 2bf3ebb3d -> ff3ad7363
ACCUMULO-2840 disable audit logging in mini
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ff3ad736
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ff3ad736
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ff3ad736
Branch: refs/heads/1.6.1-SNAPSHOT
Commit: ff3ad736329584a9eda52948029fb00a8d7346d4
Parents: b2dd64d
Author: Keith Turner <kt...@apache.org>
Authored: Fri May 23 11:47:23 2014 -0400
Committer: Keith Turner <kt...@apache.org>
Committed: Fri May 23 16:27:25 2014 -0400
----------------------------------------------------------------------
.../impl/MiniAccumuloClusterImpl.java | 8 ++++
minicluster/src/main/resources/auditLog.xml | 41 ++++++++++++++++++++
2 files changed, 49 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/ff3ad736/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
index ef5056c..c82fab3 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java
@@ -74,6 +74,7 @@ import org.apache.accumulo.start.Main;
import org.apache.accumulo.start.classloader.vfs.MiniDFSUtil;
import org.apache.accumulo.tserver.TabletServer;
import org.apache.commons.configuration.MapConfiguration;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.impl.VFSClassLoader;
import org.apache.hadoop.conf.Configuration;
@@ -400,6 +401,13 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster {
zooCfg.store(fileWriter, null);
fileWriter.close();
+
+ // disable audit logging for mini....
+ InputStream auditStream = this.getClass().getResourceAsStream("/auditLog.xml");
+
+ if (auditStream != null) {
+ FileUtils.copyInputStreamToFile(auditStream, new File(config.getConfDir(), "auditLog.xml"));
+ }
}
private void writeConfig(File file, Iterable<Map.Entry<String,String>> settings) throws IOException {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/ff3ad736/minicluster/src/main/resources/auditLog.xml
----------------------------------------------------------------------
diff --git a/minicluster/src/main/resources/auditLog.xml b/minicluster/src/main/resources/auditLog.xml
new file mode 100644
index 0000000..9b7987e
--- /dev/null
+++ b/minicluster/src/main/resources/auditLog.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+
+
+ <!-- Write out Audit info to an Audit file -->
+ <appender name="Audit" class="org.apache.log4j.DailyRollingFileAppender">
+ <param name="File" value="${org.apache.accumulo.core.dir.log}/${org.apache.accumulo.core.ip.localhost.hostname}.audit"/>
+ <param name="MaxBackupIndex" value="10"/>
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS/Z} [%c{2}] %-5p: %m%n"/>
+ </layout>
+ </appender>
+ <logger name="Audit" additivity="false">
+ <appender-ref ref="Audit" />
+ <level value="OFF"/>
+ </logger>
+
+
+
+
+
+</log4j:configuration>
[2/3] git commit: ACCUMULO-2839 only audit if logging is enabled
Posted by kt...@apache.org.
ACCUMULO-2839 only audit if logging is enabled
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b2dd64d3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b2dd64d3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b2dd64d3
Branch: refs/heads/1.6.1-SNAPSHOT
Commit: b2dd64d3785b4199f2c7a47eb2bcc3977529968f
Parents: 850f4bc
Author: Keith Turner <kt...@apache.org>
Authored: Fri May 23 11:46:51 2014 -0400
Committer: Keith Turner <kt...@apache.org>
Committed: Fri May 23 16:27:25 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/b2dd64d3/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 d1fbdef..d55382d 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
@@ -48,6 +48,7 @@ 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.hadoop.io.Text;
+import org.apache.log4j.Level;
import org.apache.log4j.Logger;
/**
@@ -92,7 +93,7 @@ public class AuditedSecurityOperation extends SecurityOperation {
}
private static boolean shouldAudit(TCredentials credentials, String tableId) {
- return !tableId.equals(MetadataTable.ID) && shouldAudit(credentials);
+ return (audit.isInfoEnabled() || audit.isEnabledFor(Level.WARN)) && !tableId.equals(MetadataTable.ID) && shouldAudit(credentials);
}
// Is INFO the right level to check? Do we even need that check?
[3/3] git commit: ACCUMULO-2838 use resolved props
Posted by kt...@apache.org.
ACCUMULO-2838 use resolved props
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/850f4bc0
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/850f4bc0
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/850f4bc0
Branch: refs/heads/1.6.1-SNAPSHOT
Commit: 850f4bc04ac910526c7c9cae3d8424ccb55a5d8e
Parents: 2bf3ebb
Author: Keith Turner <kt...@apache.org>
Authored: Fri May 23 11:45:58 2014 -0400
Committer: Keith Turner <kt...@apache.org>
Committed: Fri May 23 16:27:25 2014 -0400
----------------------------------------------------------------------
.../java/org/apache/accumulo/core/conf/DefaultConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/850f4bc0/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
index 847fd02..44e198a 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
@@ -39,7 +39,7 @@ public class DefaultConfiguration extends AccumuloConfiguration {
@Override
public String get(Property property) {
- return property.getDefaultValue();
+ return getResolvedProps().get(property.getKey());
}
private synchronized Map<String,String> getResolvedProps() {