You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by sn...@apache.org on 2016/06/21 01:23:32 UTC
incubator-ranger git commit: RANGER-1045: Ranger should provide
support to force use inmemory jaas config when auditing to secure solr
Repository: incubator-ranger
Updated Branches:
refs/heads/master 2b7122d3c -> 4b4790abe
RANGER-1045: Ranger should provide support to force use inmemory jaas config when auditing to secure solr
Signed-off-by: sneethiraj <sn...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/4b4790ab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/4b4790ab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/4b4790ab
Branch: refs/heads/master
Commit: 4b4790abe921d7cd18532183afaec200208f8e8a
Parents: 2b7122d
Author: rmani <rm...@hortonworks.com>
Authored: Mon Jun 20 18:07:58 2016 -0700
Committer: sneethiraj <sn...@apache.org>
Committed: Mon Jun 20 21:19:00 2016 -0400
----------------------------------------------------------------------
.../ranger/audit/destination/SolrAuditDestination.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/4b4790ab/agents-audit/src/main/java/org/apache/ranger/audit/destination/SolrAuditDestination.java
----------------------------------------------------------------------
diff --git a/agents-audit/src/main/java/org/apache/ranger/audit/destination/SolrAuditDestination.java b/agents-audit/src/main/java/org/apache/ranger/audit/destination/SolrAuditDestination.java
index 5be2b42..46f33a5 100644
--- a/agents-audit/src/main/java/org/apache/ranger/audit/destination/SolrAuditDestination.java
+++ b/agents-audit/src/main/java/org/apache/ranger/audit/destination/SolrAuditDestination.java
@@ -49,6 +49,8 @@ public class SolrAuditDestination extends AuditDestination {
public static final String PROP_SOLR_URLS = "urls";
public static final String PROP_SOLR_ZK = "zookeepers";
public static final String PROP_SOLR_COLLECTION = "collection";
+ public static final String PROP_SOLR_FORCE_USE_INMEMORY_JAAS_CONFIG = "force.use.inmemory.jaas.config";
+
public static final String DEFAULT_COLLECTION_NAME = "ranger_audits";
public static final String PROP_JAVA_SECURITY_AUTH_LOGIN_CONFIG = "java.security.auth.login.config";
@@ -268,7 +270,11 @@ public class SolrAuditDestination extends AuditDestination {
String confFileName = System.getProperty(PROP_JAVA_SECURITY_AUTH_LOGIN_CONFIG) ;
LOG.info("In solrAuditDestination.init() : JAAS Configuration set as [" + confFileName + "]") ;
if ( System.getProperty(PROP_JAVA_SECURITY_AUTH_LOGIN_CONFIG) == null ) {
- System.setProperty(PROP_JAVA_SECURITY_AUTH_LOGIN_CONFIG, "/dev/null") ;
+ if ( MiscUtil.getBooleanProperty(props, propPrefix + "." + PROP_SOLR_FORCE_USE_INMEMORY_JAAS_CONFIG,false) ) {
+ System.setProperty(PROP_JAVA_SECURITY_AUTH_LOGIN_CONFIG, "/dev/null") ;
+ } else {
+ LOG.warn("No Client JAAS config present in solr audit config. Ranger Audit to Kerberized Solr will fail...");
+ }
}
LOG.info("Loading SolrClient JAAS config from Ranger audit config if present...");
InMemoryJAASConfiguration.init(props);