You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by rm...@apache.org on 2015/03/31 18:38:33 UTC

[1/2] incubator-ranger git commit: Ranger-333:Update plugins to load config from earlier version, when new version configs are not available

Repository: incubator-ranger
Updated Branches:
  refs/heads/master a697bca04 -> 3487811ec


Ranger-333:Update plugins to load config from earlier version, when new version configs are not available


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

Branch: refs/heads/master
Commit: d4ca4ef6299a23be6088eb71b35625dbc2e31674
Parents: 7058bbb
Author: rmani <rm...@hortonworks.com>
Authored: Tue Mar 31 09:38:02 2015 -0700
Committer: rmani <rm...@hortonworks.com>
Committed: Tue Mar 31 09:38:02 2015 -0700

----------------------------------------------------------------------
 .../hadoop/config/RangerConfigConstants.java    |  48 ++++
 .../hadoop/config/RangerConfiguration.java      |  69 ++++-
 .../config/RangerLegacyConfigBuilder.java       | 264 +++++++++++++++++++
 3 files changed, 376 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d4ca4ef6/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfigConstants.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfigConstants.java b/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfigConstants.java
new file mode 100644
index 0000000..69b030c
--- /dev/null
+++ b/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfigConstants.java
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.ranger.authorization.hadoop.config;
+
+public class RangerConfigConstants {
+	//SECURITY CONFIG DEFAULTS
+	public static final String  RANGER_SERVICE_NAME 							= "ranger.plugin.<ServiceType>.service.name";
+	public static final String  RANGER_PLUGIN_POLICY_SOURCE_IMPL 				= "ranger.plugin.<ServiceType>.policy.source.impl";
+	public static final String  RANGER_PLUGIN_POLICY_SOURCE_IMPL_DEFAULT 		= "org.apache.ranger.admin.client.RangerAdminRESTClient";
+	public static final String  RANGER_PLUGIN_POLICY_REST_URL					= "ranger.plugin.<ServiceType>.policy.rest.url";
+	public static final String 	RANGER_PLUGIN_REST_SSL_CONFIG_FILE				= "ranger.plugin.<ServiceType>.policy.rest.ssl.config.file";
+	public static final String 	RANGER_PLUGIN_POLICY_POLLINVETERVALMS			= "ranger.plugin.<ServiceType>.policy.pollIntervalMs";
+    public static final String	RANGER_PLUGIN_POLICY_CACHE_DIR					= "ranger.plugin.<ServiceType>.policy.cache.dir";
+    public static final	String 	RANGER_PLUGIN_ADD_HADDOOP_AUTHORIZATION			= "xasecure.add-hadoop-authorization";
+
+    //CHANGE MAP CONSTANTS
+    public static final String	XASECURE_POLICYMGR_URL							= "xasecure.<ServiceType>.policymgr.url";
+    public static final String  XASECURE_POLICYMGR_URL_LASTSTOREDFILE			= "xasecure.<ServiceType>.policymgr.url.laststoredfile";		
+    public static final String  XASECURE_POLICYMGR_GRL_RELOADINTERVALINMILLIS   = "xasecure.<ServiceType>.policymgr.url.reloadIntervalInMillis";
+    public static final String 	XASECURE_ADD_HADDOP_AUTHORZATION				= "xasecure.add-hadoop-authorization";
+    public static final	String  XASECURE_UPDATE_XAPOLICIES_ON_GRANT				= "xasecure.<ServiceType>.update.xapolicies.on.grant.revoke";	
+
+    //Legacy Files
+    public static final String  XASECURE_AUDIT_FILE								= "xasecure-audit.xml";
+    public static final String  XASECURE_SECURITY_FILE							= "xasecure-<ServiceType>-security.xml";
+    public static final String  XASECURE_POLICYMGR_SSL_FILE						= "/etc/<ServiceType>/conf/xasecure-policymgr-ssl.xml";
+    
+    //KNOX
+    public static final String  RANGER_KNOX_PLUGIN_POLICY_SOURCE_IMPL_DEFAULT   = "org.apache.ranger.admin.client.RangerAdminJersey2RESTClient";
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d4ca4ef6/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfiguration.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfiguration.java b/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfiguration.java
index 3610e9f..0a8907c 100644
--- a/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfiguration.java
+++ b/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerConfiguration.java
@@ -43,12 +43,19 @@ public class RangerConfiguration extends Configuration {
 		String auditCfg    = "ranger-" + serviceType + "-audit.xml";
 		String securityCfg = "ranger-" + serviceType + "-security.xml";
 		
-		addResourceIfReadable(auditCfg);
-		addResourceIfReadable(securityCfg);
+		if ( !addResourceIfReadable(auditCfg)) {
+			addAuditResource(serviceType);
+		}
+
+		if ( !addResourceIfReadable(securityCfg)) {
+			addSecurityResource(serviceType);
+		}
 	}
 
-	@SuppressWarnings("deprecation")
-	private void addResourceIfReadable(String aResourceName) {
+
+	private boolean addResourceIfReadable(String aResourceName) {
+		
+		boolean ret = false;
 		if(LOG.isDebugEnabled()) {
 			LOG.debug("==> addResourceIfReadable(" + aResourceName + ")");
 		}
@@ -63,8 +70,9 @@ public class RangerConfiguration extends Configuration {
 			if (f.exists() && f.canRead()) {
 				URL fUrl = null ;
 				try {
-					fUrl = f.toURL() ;
+					fUrl = f.toURI().toURL() ;
 					addResource(fUrl) ;
+					ret = true;
 				} catch (MalformedURLException e) {
 					if(LOG.isDebugEnabled()) {
 						LOG.debug("Unable to find URL for the resource name [" + aResourceName +"]. Ignoring the resource:" + aResourceName);
@@ -84,6 +92,7 @@ public class RangerConfiguration extends Configuration {
 		if(LOG.isDebugEnabled()) {
 			LOG.debug("<== addResourceIfReadable(" + aResourceName + ")");
 		}
+		return ret;
 	}
 	
 
@@ -141,5 +150,55 @@ public class RangerConfiguration extends Configuration {
 		
 		return ret ;
 	}
+	
+	private void  addSecurityResource(String serviceType) {
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> addSecurityResource(Service Type: " + serviceType );
+		}
+
+		Configuration rangerConf = RangerLegacyConfigBuilder.getSecurityConfig(serviceType);
+
+		if ( rangerConf != null ) {
+			addResource(rangerConf);
+		} else {
+			if(LOG.isDebugEnabled()) {
+				LOG.debug("Unable to add the Security Config for" + serviceType + "Pluing won't be enabled!");
+			}
+		}
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<= addSecurityResource(Service Type: " + serviceType );
+		}
+	}
+
+	private void  addAuditResource(String serviceType) {
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> addAuditResource(Service Type: " + serviceType );
+		}
+
+		URL url = null;
+		try {
+			url = RangerLegacyConfigBuilder.getAuditConfig(serviceType);
+
+			if( url != null) {
+				addResource(url);
+				
+				if(LOG.isDebugEnabled()) {
+					LOG.debug("==> addAuditResource() URL" + url.getPath());
+				}
+			}
+				
+		} catch (Throwable t) {
+			LOG.warn(" Unable to find Audit Config for "  + serviceType + " Auditing not enabled !" );
+			if(LOG.isDebugEnabled()) {
+				LOG.debug(" Unable to find Audit Config for "  + serviceType + " Auditing not enabled !" + t);
+			}
+		}
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== addAuditResource(Service Type: " + serviceType + ")");
+		}
+	}
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d4ca4ef6/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerLegacyConfigBuilder.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerLegacyConfigBuilder.java b/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerLegacyConfigBuilder.java
new file mode 100644
index 0000000..d970534
--- /dev/null
+++ b/agents-common/src/main/java/org/apache/ranger/authorization/hadoop/config/RangerLegacyConfigBuilder.java
@@ -0,0 +1,264 @@
+/*
+ * 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.
+ */
+
+package org.apache.ranger.authorization.hadoop.config;
+
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.log4j.Logger;
+import org.apache.ranger.plugin.store.EmbeddedServiceDefsUtil;
+
+public class RangerLegacyConfigBuilder {
+
+	public static final Logger LOG = Logger.getLogger(RangerLegacyConfigBuilder.class);
+
+	static String serviceType 	   = null;
+	static String legacyResource  = null;
+
+
+	public static Configuration getSecurityConfig(String serviceType) {
+
+		RangerLegacyConfigBuilder.legacyResource = getPropertyName(RangerConfigConstants.XASECURE_SECURITY_FILE,serviceType);
+		RangerLegacyConfigBuilder.serviceType	 = serviceType;
+
+		Configuration	ret				= null;
+		Configuration   legacyConfig	= new Configuration();
+		URL 			legacyFileUrl	= getFileURL(legacyResource);
+
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("==> getSecurityConfig() " + legacyResource + " FileName: " + legacyFileUrl);
+		}
+
+		if ( legacyFileUrl  != null) {
+			legacyConfig.addResource(legacyFileUrl);
+			Configuration rangerDefaultProp =  buildRangerSecurityConf(serviceType);
+					   ret	 			    =  mapLegacyConfigToRanger(rangerDefaultProp,legacyConfig);
+		}
+		if(LOG.isDebugEnabled()) {
+			LOG.debug("<== getSecurityConfig() " + legacyResource + " FileName: " + legacyFileUrl);
+		}
+
+		return ret;
+	}
+
+	public static URL getAuditConfig(String serviceType) throws Throwable {
+		
+		RangerLegacyConfigBuilder.legacyResource = getPropertyName(RangerConfigConstants.XASECURE_AUDIT_FILE,serviceType);
+		RangerLegacyConfigBuilder.serviceType	 = serviceType;
+		
+		URL ret = null;
+		try {
+			ret = getAuditResource(legacyResource);
+		} catch (Throwable t) {
+		   throw t;
+		}
+		return ret;
+	}
+
+   private static  Configuration mapLegacyConfigToRanger(Configuration rangerInConf, Configuration legacyConf) {
+	   
+	    Configuration ret 				   = rangerInConf;
+	   
+	    HashMap<String,String>  chgMap     = getConfigChangeMap(serviceType);
+	    if(LOG.isDebugEnabled()) {
+			LOG.debug("<== mapLegacyConfigToRanger() MAP Size:  " + chgMap.size());
+		} 
+		for(Map.Entry<String, String> entry : chgMap.entrySet()) {
+			String legacyKey 	 = entry.getKey();
+			String rangerKey 	 = entry.getValue();
+			
+			String legacyConfVal = null;
+			
+			if ( rangerKey.equals(getPropertyName(RangerConfigConstants.RANGER_SERVICE_NAME,serviceType)) )  {
+				//For getting the service
+				String serviceURL = legacyConf.get(getPropertyName(RangerConfigConstants.XASECURE_POLICYMGR_URL,serviceType));
+				legacyConfVal = fetchLegacyValue(serviceURL,rangerKey);
+			} else if  ( rangerKey.equals(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_REST_URL,serviceType)) || 
+					     rangerKey.equals(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_CACHE_DIR,serviceType)) ) {
+				// For Getting Admin URL and CacheDir
+				legacyConfVal = fetchLegacyValue(legacyConf.get(legacyKey),rangerKey); 
+			} else {
+				legacyConfVal = legacyConf.get(legacyKey);
+			}
+			
+			if(LOG.isDebugEnabled()) {
+				LOG.debug("<== mapLegacyConfigToRanger() Ranger Key: " + rangerKey + "Legacy Key:" + legacyKey +  "Legacy Value:" + legacyConfVal);
+			}
+			
+			ret.set(rangerKey, legacyConfVal);	
+		}
+		return ret;
+	} 
+   
+   
+	public  static URL getAuditResource(String fName) throws Throwable {
+		URL ret = null ;
+
+		try {
+			for(String  cfgFile : 	new String[] {  "hive-site.xml",  "hbase-site.xml",  "hdfs-site.xml" } ) {
+				String loc = getFileLocation(cfgFile) ;
+				if (loc != null) {
+					File f = new File(loc);
+					if ( f.exists() && f.canRead()) {
+						File parentFile = new File(loc).getParentFile() ;
+								   ret  = new File(parentFile, RangerConfigConstants.XASECURE_AUDIT_FILE).toURI().toURL();
+						break ;
+					}
+				}
+			}
+		}
+		catch(Throwable t) {
+			LOG.error("Unable to locate audit file location." + fName + " " + t) ;
+			throw t;
+		}
+		return ret ;
+	}
+
+	public static Configuration  buildRangerSecurityConf(String serviceType) {
+
+		Configuration rangerConf = new Configuration();
+
+		rangerConf.set(getPropertyName(RangerConfigConstants.RANGER_SERVICE_NAME,serviceType),"");
+		if (serviceType.equals(EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_KNOX_NAME) )  {
+			rangerConf.set(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_SOURCE_IMPL,serviceType),RangerConfigConstants.RANGER_KNOX_PLUGIN_POLICY_SOURCE_IMPL_DEFAULT);
+		} else {
+			rangerConf.set(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_SOURCE_IMPL,serviceType),"");
+		}
+		rangerConf.set(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_REST_URL,serviceType),"");
+		rangerConf.set(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_REST_SSL_CONFIG_FILE,serviceType), getPropertyName(RangerConfigConstants.XASECURE_POLICYMGR_SSL_FILE,serviceType));
+		rangerConf.set(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_POLLINVETERVALMS,serviceType), "");
+		rangerConf.set(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_CACHE_DIR,serviceType), "");
+		rangerConf.set(RangerConfigConstants.RANGER_PLUGIN_ADD_HADDOOP_AUTHORIZATION,"");
+
+		return rangerConf;
+	}
+
+
+	public static HashMap<String, String> getConfigChangeMap(String serviceType) {
+		// ConfigMap for moving legacy Configuration to Ranger Configuration
+		HashMap<String, String> changeMap = new HashMap<String,String>();
+		
+		changeMap.put(serviceType,
+					  getPropertyName(RangerConfigConstants.RANGER_SERVICE_NAME,serviceType));
+		changeMap.put(getPropertyName(RangerConfigConstants.XASECURE_POLICYMGR_URL,serviceType),
+					  getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_REST_URL,serviceType));
+		changeMap.put(getPropertyName(RangerConfigConstants.XASECURE_POLICYMGR_GRL_RELOADINTERVALINMILLIS,serviceType),
+					  getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_POLLINVETERVALMS,serviceType));
+		changeMap.put(getPropertyName(RangerConfigConstants.XASECURE_POLICYMGR_URL_LASTSTOREDFILE,serviceType),
+					  getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_CACHE_DIR,serviceType));
+		
+		
+		if (serviceType.equals(EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_HDFS_NAME)) {
+			changeMap.put(RangerConfigConstants.XASECURE_ADD_HADDOP_AUTHORZATION,
+				      RangerConfigConstants.RANGER_PLUGIN_ADD_HADDOOP_AUTHORIZATION);
+		}
+		
+		if (serviceType.equals(EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_HBASE_NAME) ||
+			serviceType.equals(EmbeddedServiceDefsUtil.EMBEDDED_SERVICEDEF_HIVE_NAME)) {
+			changeMap.put(getPropertyName(RangerConfigConstants.XASECURE_UPDATE_XAPOLICIES_ON_GRANT,serviceType),
+					getPropertyName(RangerConfigConstants.XASECURE_UPDATE_XAPOLICIES_ON_GRANT,serviceType));
+		}
+		
+		if ( LOG.isDebugEnabled()) {
+			for(Map.Entry<String, String> entry : changeMap.entrySet()) {
+				String legacyKey 	 = entry.getKey();
+				String rangerKey 	 = entry.getValue();
+				LOG.debug("<== getConfigChangeMap() RangerConfig Key: " + rangerKey + " Legacy Key: " + legacyKey);
+			}
+		}
+		
+		return changeMap;
+	}
+
+	public static String getFileLocation(String fileName) {
+		String ret = null ;
+		
+		URL lurl = RangerLegacyConfigBuilder.class.getClassLoader().getResource(fileName) ;
+		if (lurl == null ) {
+			lurl = RangerLegacyConfigBuilder.class.getClassLoader().getResource("/" + fileName) ;
+		}
+		if (lurl != null) {
+			ret = lurl.getFile() ;
+		}
+		return ret ;
+	}
+
+	public static URL getFileURL(String fileName) {
+		URL lurl = RangerLegacyConfigBuilder.class.getClassLoader().getResource(fileName) ;
+		return lurl ;
+	}
+
+	public static String getPropertyName(String rangerProp, String serviceType) {
+		
+		String ret = rangerProp.replace("<ServiceType>", serviceType);
+		
+		return ret;
+	}	
+
+	public static String getPolicyMgrURL(String url) {
+		String ret = null;
+		
+		int index = url.indexOf("/",url.lastIndexOf(":"));
+		
+		ret = url.substring(0,index);
+		
+		return ret;
+	}
+
+	public static String getServiceNameFromURL(String url) {
+		String ret = null;
+		
+		int index = url.lastIndexOf("/");
+		
+		ret = url.substring(index+1);
+		
+		return ret;
+	}
+
+	
+	public static String getCacheFileURL(String cacheFile) {
+		String ret = null;
+		
+		int index = cacheFile.lastIndexOf("/");
+		
+		ret = cacheFile.substring(0,index);
+		
+		return ret;
+	}
+
+	public static String fetchLegacyValue(String legacyVal, String rangerKey) {
+		String ret = null;
+	
+		if ( rangerKey.equals(getPropertyName(RangerConfigConstants.RANGER_SERVICE_NAME,serviceType)) ) {
+			// To Fetch ServiceName
+			ret = getServiceNameFromURL(legacyVal);
+		} else if ( rangerKey.equals(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_REST_URL,serviceType)) ) {
+		   // To Fetch PolicyMgr URL
+		   ret = getPolicyMgrURL(legacyVal);		  
+		} else if  ( rangerKey.equals(getPropertyName(RangerConfigConstants.RANGER_PLUGIN_POLICY_CACHE_DIR,serviceType)) ) {
+			  ret = getCacheFileURL(legacyVal);  
+	   }
+	   
+	   return ret;
+	}
+}


[2/2] incubator-ranger git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ranger

Posted by rm...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ranger


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/3487811e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/3487811e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/3487811e

Branch: refs/heads/master
Commit: 3487811ecb3717d306f3c6834b5dae3d6c6c2892
Parents: d4ca4ef a697bca
Author: rmani <rm...@hortonworks.com>
Authored: Tue Mar 31 09:38:21 2015 -0700
Committer: rmani <rm...@hortonworks.com>
Committed: Tue Mar 31 09:38:21 2015 -0700

----------------------------------------------------------------------
 .../ranger/plugin/model/RangerPolicy.java       |  25 +-
 .../ranger/plugin/model/RangerServiceDef.java   | 200 +++++++++++--
 .../policyengine/RangerPolicyRepository.java    |   4 +-
 .../RangerDefaultPolicyEvaluator.java           |   6 +-
 .../RangerAbstractResourceMatcher.java          |  10 +-
 .../RangerDefaultResourceMatcher.java           |  10 -
 .../RangerPathResourceMatcher.java              |   9 -
 .../ranger/plugin/service/RangerBasePlugin.java |   4 +-
 .../service-defs/ranger-servicedef-hbase.json   |  19 ++
 .../service-defs/ranger-servicedef-hdfs.json    |  22 ++
 .../service-defs/ranger-servicedef-hive.json    |  17 ++
 .../service-defs/ranger-servicedef-knox.json    |   8 +
 .../service-defs/ranger-servicedef-solr.json    | 132 +++++++++
 .../service-defs/ranger-servicedef-storm.json   |  19 ++
 .../service-defs/ranger-servicedef-yarn.json    |   8 +
 .../ranger/plugin/store/TestServiceStore.java   |   2 +-
 embeddedwebserver/scripts/ranger-admin-initd    |  42 ++-
 .../hbase/AuthorizationSession.java             |   8 +-
 .../authorization/hbase/HbaseAuthUtilsImpl.java |   8 -
 .../hbase/RangerAuthorizationCoprocessor.java   |   2 +-
 .../RangerAuthorizationCoprocessorBase.java     |  33 +++
 .../services/hbase/client/HBaseResourceMgr.java |   6 +-
 .../namenode/RangerFSPermissionChecker.java     |   2 +-
 .../agent/HadoopAuthClassTransformer.java       |  51 ++--
 .../hive/authorizer/RangerHiveAuthorizer.java   |  11 +-
 .../services/hive/client/HiveResourceMgr.java   |  10 +-
 .../main/java/org/apache/util/sql/Jisql.java    |   5 +-
 .../hadoop/crypto/key/RangerKeyStore.java       |   5 +-
 .../crypto/key/RangerKeyStoreProvider.java      |   6 +-
 .../authorization/knox/RangerPDPKnoxFilter.java |   4 +-
 .../ranger/services/knox/client/KnoxClient.java |  47 +--
 .../apache/ranger/knox/client/KnoxClient.java   |  28 +-
 migration-util/bin/import_ranger_to_ambari.py   |  34 ++-
 plugin-solr/.gitignore                          |   1 +
 .../conf/ranger-policymgr-ssl-changes.cfg       |  23 ++
 plugin-solr/conf/ranger-policymgr-ssl.xml       |  63 ++++
 plugin-solr/conf/ranger-solr-audit-changes.cfg  |  36 +++
 plugin-solr/conf/ranger-solr-audit.xml          | 235 +++++++++++++++
 .../conf/ranger-solr-security-changes.cfg       |  26 ++
 plugin-solr/conf/ranger-solr-security.xml       |  67 +++++
 plugin-solr/pom.xml                             |  56 ++++
 plugin-solr/scripts/install.properties          | 112 +++++++
 .../scripts/solr-plugin-install.properties      |  23 ++
 .../solr/authorizer/RangerSolrAuthorizer.java   |  37 +++
 .../ranger/services/solr/RangerServiceSolr.java |  78 +++++
 .../services/solr/client/ServiceSolrClient.java | 292 +++++++++++++++++++
 .../solr/client/ServiceSolrConnectionMgr.java   |  60 ++++
 .../ranger/services/yarn/client/YarnClient.java |   3 +-
 .../services/yarn/client/YarnResourceMgr.java   |   5 +-
 pom.xml                                         |   6 +-
 security-admin/scripts/setup.sh                 |   8 +-
 .../java/org/apache/ranger/biz/AssetMgr.java    |  44 ++-
 .../java/org/apache/ranger/biz/ServiceMgr.java  |   4 +-
 .../java/org/apache/ranger/biz/SessionMgr.java  |   5 +-
 .../java/org/apache/ranger/biz/UserMgr.java     |  27 +-
 .../java/org/apache/ranger/biz/XUserMgr.java    |  16 +-
 .../org/apache/ranger/common/SearchGroup.java   |   4 +-
 .../org/apache/ranger/common/SearchUtil.java    |   2 +-
 .../org/apache/ranger/common/ServiceUtil.java   |   4 +-
 .../java/org/apache/ranger/rest/AssetREST.java  |   2 +-
 .../java/org/apache/ranger/rest/PublicAPIs.java |  15 +-
 .../org/apache/ranger/rest/ServiceREST.java     |  28 +-
 .../RangerSecurityContextFormationFilter.java   |  94 +++---
 .../ranger/service/RangerPolicyService.java     |  16 +-
 .../service/RangerServiceDefServiceBase.java    |   2 +-
 .../ranger/service/RangerServiceService.java    |   4 +-
 .../apache/ranger/service/XAssetService.java    |   6 +-
 .../apache/ranger/service/XAuditMapService.java |   6 +-
 .../apache/ranger/service/XPermMapService.java  |   8 +-
 .../ranger/service/XPortalUserService.java      |   3 +-
 .../ranger/service/XRepositoryService.java      |   4 +-
 .../apache/ranger/service/XResourceService.java |  15 +-
 .../apache/ranger/service/XTrxLogService.java   |   2 +-
 .../org/apache/ranger/service/XUserService.java |   2 +-
 .../java/org/apache/ranger/solr/SolrMgr.java    |  41 +--
 .../main/resources/sample.xa_system.properties  |   7 +
 src/main/assembly/plugin-solr.xml               | 157 ++++++++++
 .../storm/authorizer/RangerStormAuthorizer.java |   4 +-
 .../services/storm/client/StormResourceMgr.java |   5 +
 .../process/LdapUserGroupBuilder.java           |   3 +
 .../config/UserGroupSyncConfig.java             |   5 +-
 .../unix/jaas/RemoteUnixLoginModule.java        |   9 +-
 82 files changed, 2154 insertions(+), 318 deletions(-)
----------------------------------------------------------------------