Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6da9fe4
RANGER-1093: updated version to 0.6.1-SNAPSHOT and updated links for …
vperiasamy Jul 20, 2016
cc02a5d
RANGER-1095 - Invert authorization logic in RangerSolrAuthorizer
coheigea Jul 21, 2016
7af2a1e
Fixing some potential NPEs
coheigea Jul 12, 2016
c7b90aa
Also log the error message
coheigea Jul 13, 2016
08cb7d9
Adding missing equals sign
coheigea Jul 19, 2016
ce12064
Adding a new profile to sign artifacts if required (as it is for deploy)
coheigea Jul 19, 2016
1b2b32b
Typo
coheigea Jul 25, 2016
c202a20
RANGER-1124 Good coding practices in Ranger recommended by static cod…
gautamborad Aug 8, 2016
11e8d07
RANGER-1103: added maven version enforcer and moved the plugin to be …
sneethiraj Aug 8, 2016
d691288
RANGER-1124: Good coding practices
Jul 26, 2016
e8bc76f
RANGER-1124:Good coding practices in Ranger recommended by static cod…
Jul 29, 2016
b795649
RANGER-1124:Good coding practices
pradeepagrawal8184 Jul 29, 2016
ce7edb2
RANGER-1124: Fixes for CID#s 131473, 150594, 150789
spolavarapu1 Jul 28, 2016
ee47136
RANGER-1124 : Good coding practices in Ranger recommended by static c…
Jul 30, 2016
dcb93b5
RANGER-1151: Updated version to 0.6.1 from 0.6.1-SNAPSHOT for release
sneethiraj Aug 12, 2016
428f120
RANGER-1109: changes to LICENSE,NOTICE,pom.xml file contents based on…
sneethiraj Aug 12, 2016
cad64ce
RANGER-1158: updated version to 0.6.2-SNAPSHOT
sneethiraj Aug 20, 2016
d4cbf4f
RANGER-1156:Audit migration script from DB to Solr cloud failing
pradeepagrawal8184 Aug 19, 2016
00e07f2
RANGER-1160:Ranger installation is failing on MSSQL Server
pradeepagrawal8184 Aug 25, 2016
2dea1f9
RANGER-1100: Hive authorizer does not block update operations if one …
mneethiraj Sep 6, 2016
064c4f8
RANGER-1166 : Auto complete wait time needs to be increased on Ranger UI
mehulbparikh Sep 1, 2016
351f870
RANGER-1167 : Ranger admin UI loading issues in Internet Explorer
mehulbparikh Sep 1, 2016
bf71880
RANGER-1171 - Invert authorization logic in RangerKafkaAuthorizer
coheigea Sep 8, 2016
6d30412
RANGER-1173: Improve Ranger database schema import logic and make it …
pradeepagrawal8184 Sep 13, 2016
b323f90
RANGER-1129: Ability to specify 'audit all accesses' via Ranger admin…
Jul 28, 2016
caba857
RANGER-1107: Performance trace to measure policy download performance…
Jul 15, 2016
efe49a8
RANGER-1146: Policy engine optimization: dynamic reordering of policy…
Aug 6, 2016
543bfe0
RANGER-1155: potential performance/correctness issues uncovered by st…
Aug 18, 2016
d79f127
RANGER-1145: Policy engine optimization: convert wildcard matches int…
Aug 5, 2016
b265605
RANGER-1161: Policy evaluation optimization by using trie lookup to r…
mneethiraj Aug 24, 2016
5fa2e88
RANGER-1162: optimize retrieval of tags for resource, using trie lookup
mneethiraj Aug 26, 2016
46f95f7
RANGER-1162: updated to create resource-trie only when needed
mneethiraj Aug 30, 2016
13e36cf
RANGER-1161: trie prefilter updated to handle empty resource value
mneethiraj Sep 2, 2016
4a332a9
RANGER-1175: Create policy fails for updated servicedef (Fixed :polic…
ni3galave Sep 16, 2016
1b728eb
RANGER-1170: Added Unit tests for PuclicAPIsv2 and PublicAPIs (0.6 br…
spolavarapu1 Oct 13, 2016
26bfd13
RANGER-1170 : Improvement of Unit Test coverage in Ranger
ankitap0302 Oct 13, 2016
4a64c4f
RANGER-1170 : Improvement of Unit Test coverage in Ranger
pradeepagrawal8184 Oct 12, 2016
ecfa86c
RANGER-1126 : Authorization checks for non existent file/directory sh…
Jul 27, 2016
fb95d3e
RANGER-1169: global audit settings specified by Ranger configuration …
Sep 6, 2016
3b7cf3a
RANGER-1159: removed Apache Licensed software listing from NOTICE file
sneethiraj Oct 28, 2016
167a382
RANGER-1193: updated pom.xml version to 0.6.2
vperiasamy Oct 28, 2016
37512c1
RANGER-1193: Completed 0.6.2 release and updated version to 0.6.3-SNA…
vperiasamy Nov 9, 2016
ffbb138
RANGER-1229:RangerResourceMatcher for Hdfs and Yarn resources does no…
Nov 24, 2016
2fcd7f7
RANGER-1229: fix resource-matcher to correctly handle policy containi…
Nov 29, 2016
200dd5a
RANGER-1254 : HiveAuthorizer should deny access to URI operations if …
Dec 13, 2016
043daf3
RANGER-1254 : HiveAuthorizer should deny access to URI operations if …
Dec 13, 2016
f2990fe
RANGER-1189:Enhance and provide APIs to getAllpolicies with different…
Oct 21, 2016
d6308e6
RANGER-1237 : Ranger permissions do not load when there are bulk users
pradeepagrawal8184 Dec 20, 2016
115f9d4
RANGER-1094 : One way SSL (when Kerberos is enabled) for Ranger and i…
ankitap0302 Jul 11, 2016
c3a2b50
RANGER-1099 : keyadmin user is not able to create service/repo using …
ankitap0302 Jul 13, 2016
8992c35
RANGER-1090 : Revoke command with grant option does not disable deleg…
pradeepagrawal8184 Jul 14, 2016
a38480f
RANGER-1112 - Remove "Empty" PMD restrictions
coheigea Aug 24, 2016
dc873cb
RANGER-698: updated Ranger policies to support variables like {USER} …
Sep 1, 2016
9039504
RANGER-1170: Added Unit tests for PuclicAPIsv2 and PublicAPIs
spolavarapu1 Sep 27, 2016
c599bbb
RANGER-698: create pre-defined user, {USER}, during ranger-admin startup
Sep 1, 2016
dd8a581
RANGER-698: fix DB error while creating user {USER} - descr field is …
mneethiraj Sep 20, 2016
76867e5
RANGER-1170: Added Unit tests for PuclicAPIsv2 and PublicAPIs (fixed …
mneethiraj Jan 3, 2017
9dfde6d
RANGER-1261: fix path matching inconsistencies and wildcard treatment
Dec 6, 2016
86b6065
RANGER-1301: updating version to 0.6.3
vperiasamy Jan 9, 2017
6f89b16
Updating year in NOTICE
coheigea Jan 23, 2017
bedbc4b
RANGER-1332: updated docs and scripts for removal of incubation
sneethiraj Jan 26, 2017
f3cee6d
RANGER-1301: Updating version to 0.6.4-SNAPSHOT
vperiasamy Jan 31, 2017
9561f0d
RANGER-1423 : Ranger Upgrade is failing for Oracle DB flavor
pradeepagrawal8184 Mar 6, 2017
76020e4
RANGER-1434: Enable Group Search First causes issues when Enable Grou…
spolavarapu1 Mar 10, 2017
3a33a2d
RANGER-1435: Allow different files to be specified for unix based use…
spolavarapu1 Mar 10, 2017
f66e14f
RANGER-1603: Code improvement as recommended by good coding practices
May 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions DISCLAIMER.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
Apache Ranger is an effort undergoing incubation at the Apache Software
Foundation (ASF), sponsored by the Apache Incubator PMC.
Apache Ranger is a Top Level Project (TLP) at the Apache Software Foundation (ASF).

Incubation is required of all newly accepted projects until a further review
indicates that the infrastructure, communications, and decision making process
have stabilized in a manner consistent with other successful ASF projects.
This product includes software developed at The Apache Software
Foundation (http://www.apache.org/).

While incubation status is not necessarily a reflection of the completeness
or stability of the code, it does indicate that the project has yet to be
fully endorsed by the ASF.

For more information about the incubation status of the Apache Ranger project you
can go to the following page:

http://ranger.incubator.apache.org
http://ranger.apache.org
194 changes: 31 additions & 163 deletions LICENSE.txt

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Apache Ranger
Copyright 2014-2016 The Apache Software Foundation

This product includes software developed at The Apache Software
Foundation (http://www.apache.org/).

Copyright 2014-2017 The Apache Software Foundation

This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
his product includes json2.js (https://github.com/douglascrockford/JSON-js - Public Domain license) by Douglas Crockford
This product includes Font Awesome 3.2.1 (http://fontawesome.io/ - SIL Open Font License (OFL) licensee) by Dave Gandy
This product includes software developed by Spring Security Project (http://www.springframework.org/security)
2 changes: 1 addition & 1 deletion agents-audit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>0.6.0</version>
<version>0.6.4-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class SolrAuditDestination extends AuditDestination {
public static final String DEFAULT_COLLECTION_NAME = "ranger_audits";
public static final String PROP_JAVA_SECURITY_AUTH_LOGIN_CONFIG = "java.security.auth.login.config";

SolrClient solrClient = null;
private volatile SolrClient solrClient = null;

public SolrAuditDestination() {
}
Expand All @@ -74,77 +74,80 @@ public void stop() {
}

synchronized void connect() {
if (solrClient == null) {
if (solrClient == null) {
String urls = MiscUtil.getStringProperty(props, propPrefix
+ "." + PROP_SOLR_URLS);
if (urls != null) {
urls = urls.trim();
}
if (urls != null && urls.equalsIgnoreCase("NONE")) {
urls = null;
}

List<String> solrURLs = new ArrayList<String>();
String zkHosts = null;
solrURLs = MiscUtil.toArray(urls, ",");
zkHosts = MiscUtil.getStringProperty(props, propPrefix + "."
+ PROP_SOLR_ZK);
if (zkHosts != null && zkHosts.equalsIgnoreCase("NONE")) {
zkHosts = null;
}

String collectionName = MiscUtil.getStringProperty(props,
propPrefix + "." + PROP_SOLR_COLLECTION);
if (collectionName == null
|| collectionName.equalsIgnoreCase("none")) {
collectionName = DEFAULT_COLLECTION_NAME;
}

LOG.info("Solr zkHosts=" + zkHosts + ", solrURLs=" + urls
+ ", collectionName=" + collectionName);

if (zkHosts != null && !zkHosts.isEmpty()) {
LOG.info("Connecting to solr cloud using zkHosts="
+ zkHosts);
try {
// Instantiate
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
CloudSolrClient solrCloudClient = new CloudSolrClient(
zkHosts);
solrCloudClient.setDefaultCollection(collectionName);
solrClient = solrCloudClient;
} catch (Throwable t) {
LOG.fatal("Can't connect to Solr server. ZooKeepers="
+ zkHosts, t);
SolrClient me = solrClient;
if (me == null) {
synchronized(SolrAuditDestination.class) {
me = solrClient;
if (solrClient == null) {
String urls = MiscUtil.getStringProperty(props, propPrefix
+ "." + PROP_SOLR_URLS);
if (urls != null) {
urls = urls.trim();
}
finally {
resetInitializerInSOLR() ;
if (urls != null && urls.equalsIgnoreCase("NONE")) {
urls = null;
}
} else if (solrURLs != null && !solrURLs.isEmpty()) {
try {
LOG.info("Connecting to Solr using URLs=" + solrURLs);
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
LBHttpSolrClient lbSolrClient = new LBHttpSolrClient(
solrURLs.get(0));
lbSolrClient.setConnectionTimeout(1000);
List<String> solrURLs = new ArrayList<String>();
String zkHosts = null;
solrURLs = MiscUtil.toArray(urls, ",");
zkHosts = MiscUtil.getStringProperty(props, propPrefix + "."
+ PROP_SOLR_ZK);
if (zkHosts != null && zkHosts.equalsIgnoreCase("NONE")) {
zkHosts = null;
}
String collectionName = MiscUtil.getStringProperty(props,
propPrefix + "." + PROP_SOLR_COLLECTION);
if (collectionName == null
|| collectionName.equalsIgnoreCase("none")) {
collectionName = DEFAULT_COLLECTION_NAME;
}

LOG.info("Solr zkHosts=" + zkHosts + ", solrURLs=" + urls
+ ", collectionName=" + collectionName);

for (int i = 1; i < solrURLs.size(); i++) {
lbSolrClient.addSolrServer(solrURLs.get(i));
if (zkHosts != null && !zkHosts.isEmpty()) {
LOG.info("Connecting to solr cloud using zkHosts="
+ zkHosts);
try {
// Instantiate
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
CloudSolrClient solrCloudClient = new CloudSolrClient(
zkHosts);
solrCloudClient.setDefaultCollection(collectionName);
me = solrClient = solrCloudClient;
} catch (Throwable t) {
LOG.fatal("Can't connect to Solr server. ZooKeepers="
+ zkHosts, t);
}
finally {
resetInitializerInSOLR() ;
}
} else if (solrURLs != null && !solrURLs.isEmpty()) {
try {
LOG.info("Connecting to Solr using URLs=" + solrURLs);
HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer());
LBHttpSolrClient lbSolrClient = new LBHttpSolrClient(
solrURLs.get(0));
lbSolrClient.setConnectionTimeout(1000);

for (int i = 1; i < solrURLs.size(); i++) {
lbSolrClient.addSolrServer(solrURLs.get(i));
}
me = solrClient = lbSolrClient;
} catch (Throwable t) {
LOG.fatal("Can't connect to Solr server. URL="
+ solrURLs, t);
}
finally {
resetInitializerInSOLR() ;
}
solrClient = lbSolrClient;
} catch (Throwable t) {
LOG.fatal("Can't connect to Solr server. URL="
+ solrURLs, t);
}
finally {
resetInitializerInSOLR() ;
}
}
}
}
}


private void resetInitializerInSOLR() {
javax.security.auth.login.Configuration solrConfig = javax.security.auth.login.Configuration.getConfiguration();
String solrConfigClassName = solrConfig.getClass().getName() ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class AuditProviderFactory {

private static final int RANGER_AUDIT_SHUTDOWN_HOOK_PRIORITY = 30;

private static AuditProviderFactory sFactory;
private volatile static AuditProviderFactory sFactory = null;

private AuditHandler mProvider = null;
private String componentAppType = "";
Expand All @@ -80,15 +80,17 @@ private AuditProviderFactory() {
}

public static AuditProviderFactory getInstance() {
if (sFactory == null) {
synchronized (AuditProviderFactory.class) {
if (sFactory == null) {
sFactory = new AuditProviderFactory();
AuditProviderFactory ret = sFactory;
if(ret == null) {
synchronized(AuditProviderFactory.class) {
ret = sFactory;
if(ret == null) {
ret = sFactory = new AuditProviderFactory();
}
}
}

return sFactory;
return ret;
}

public static AuditHandler getAuditProvider() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ public static String getApplicationType() {
}

public static String getJvmInstanceId() {
String ret = Integer.toString(Math.abs(sJvmID.toString().hashCode()));
Integer val = Integer.valueOf(sJvmID.toString().hashCode());
long longVal = val.longValue();
String ret = Long.toString(Math.abs(longVal));

return ret;
}
Expand Down Expand Up @@ -565,6 +567,10 @@ static public boolean logErrorMessageByInterval(Log useLogger,
*/
static public boolean logErrorMessageByInterval(Log useLogger,
String message, Throwable e) {
if (message == null) {
return false;
}

LogHistory log = logHistoryList.get(message);
if (log == null) {
log = new LogHistory();
Expand Down Expand Up @@ -636,7 +642,7 @@ public static void authWithConfig(String appName, Configuration config) {
}
} catch (Throwable t) {
logger.fatal("Error logging as appName=" + appName + ", config="
+ config.toString());
+ config.toString() + ", error=" + t.getMessage());
}
}

Expand Down Expand Up @@ -715,7 +721,7 @@ public static void authWithKerberos(String keytab, String principal,
}

} catch (Throwable t) {
logger.error("Failed to login as [" + spnegoPrincipals + "]", t);
logger.error("Failed to login with given keytab and principal", t);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private void logException(String msg, IOException excp) {
return;
}

String excpMsgToExclude = EXCP_MSG_FILESYSTEM_CLOSED;;
String excpMsgToExclude = EXCP_MSG_FILESYSTEM_CLOSED;
String excpMsg = excp != null ? excp.getMessage() : null;
boolean excpExcludeLogging = (excpMsg != null && excpMsg.contains(excpMsgToExclude));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class SolrAuditProvider extends AuditDestination {
public static final String AUDIT_RETRY_WAIT_PROP = "xasecure.audit.solr.retry.ms";

static final Object lock = new Object();
SolrClient solrClient = null;
volatile SolrClient solrClient = null;
Date lastConnectTime = null;
long lastFailTime = 0;

Expand All @@ -61,9 +61,11 @@ public void init(Properties props) {
}

void connect() {
if (solrClient == null) {
SolrClient me = solrClient;
if (me == null) {
synchronized (lock) {
if (solrClient == null) {
me = solrClient;
if (me == null) {
String solrURL = MiscUtil.getStringProperty(props,
"xasecure.audit.solr.solr_url");

Expand All @@ -89,7 +91,7 @@ void connect() {

try {
// TODO: Need to support SolrCloud also
solrClient = new HttpSolrClient(solrURL);
me = solrClient = new HttpSolrClient(solrURL);
if (solrClient instanceof HttpSolrClient) {
HttpSolrClient httpSolrClient = (HttpSolrClient) solrClient;
httpSolrClient.setAllowCompression(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ public boolean accept(File pathname) {
}
});

if (logFiles.length > maxArchiveFiles) {
if (logFiles != null && logFiles.length > maxArchiveFiles) {
int filesToDelete = logFiles.length - maxArchiveFiles;
BufferedReader br = new BufferedReader(new FileReader(
indexDoneFile));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,15 @@ public static void init(String propFile) throws Exception {
properties.load(in);
init(properties);
} catch (IOException e) {
if (in != null) {
try {
in.close();
} catch (Exception exception) {
// Ignore
}
}
throw new Exception("Failed to load JAAS application properties", e);
} finally {
if ( in != null) {
try {
in.close();
} catch ( Exception e) {
//Ignore
}
}
}
LOG.debug("<== InMemoryJAASConfiguration.init( {} ) ", propFile);
}
Expand Down
2 changes: 1 addition & 1 deletion agents-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>0.6.0</version>
<version>0.6.4-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ public ClientResponse run() {

if(response != null && response.getStatus() == 200) {
ret = response.getEntity(ServicePolicies.class);
} else if(response != null && response.getStatus() == 304) {
// no change
} else {
} else if(!(response != null && response.getStatus() == 304)) {
RESTResponse resp = RESTResponse.fromClientResponse(response);
LOG.error("Error getting policies. secureMode=" + isSecureMode + ", user=" + user + ", response=" + resp.toString() + ", serviceName=" + serviceName);

Expand Down Expand Up @@ -278,9 +276,7 @@ public ClientResponse run() {

if(response != null && response.getStatus() == 200) {
ret = response.getEntity(ServiceTags.class);
} else if(response != null && response.getStatus() == 304) {
// no change
} else {
} else if(!(response != null && response.getStatus() == 304)) {
RESTResponse resp = RESTResponse.fromClientResponse(response);
LOG.error("Error getting taggedResources. secureMode=" + isSecureMode + ", user=" + user
+ ", response=" + resp.toString() + ", serviceName=" + serviceName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public void processResults(Collection<RangerAccessResult> results) {

Collection<AuthzAuditEvent> events = getAuthzEvents(results);

logAuthzAudits(events);
if (events != null) {
logAuthzAudits(events);
}

if(LOG.isDebugEnabled()) {
LOG.debug("<== RangerDefaultAuditHandler.processResults(" + results + ")");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean isMatched(final RangerAccessRequest request) {
if (isInitialized && CollectionUtils.isNotEmpty(matchers)) {
RangerRequestedResources resources = RangerAccessRequestUtil.getRequestedResourcesFromContext(request.getContext());

ret = resources == null ? false : !resources.isMutuallyExcluded(matchers);
ret = resources == null ? false : !resources.isMutuallyExcluded(matchers, request.getContext());
} else {
LOG.error("RangerHiveResourcesAccessedTogetherCondition.isMatched() - condition is not initialized correctly and will NOT be enforced");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean isMatched(final RangerAccessRequest request) {
if (isInitialized && CollectionUtils.isNotEmpty(matchers)) {
RangerRequestedResources resources = RangerAccessRequestUtil.getRequestedResourcesFromContext(request.getContext());

ret = resources == null ? true : resources.isMutuallyExcluded(matchers);
ret = resources == null ? true : resources.isMutuallyExcluded(matchers, request.getContext());
} else {
LOG.error("RangerHiveResourcesNotAccessedTogetherCondition.isMatched() - Enforcer is not initialized correctly, Mutual Exclusion will NOT be enforced");
}
Expand Down
Loading