Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/ranger-2.2' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
nityanandagohain committed Nov 29, 2021
2 parents 6d5a0a8 + dd297ce commit 1dad72c
Show file tree
Hide file tree
Showing 88 changed files with 216 additions and 358 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache Ranger
Copyright 2014-2019 The Apache Software Foundation
Copyright 2014-2021 The Apache Software Foundation

This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
This product includes software developed by Spring Security Project (http://www.springframework.org/security)
Expand Down
6 changes: 6 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ Build Process
ranger-<version>-yarn-plugin.tar.gz
ranger-<version>-kylin-plugin.tar.gz
ranger-<version>-elasticsearch-plugin.tar.gz
ranger-<version>-ozone-plugin.tar.gz
ranger-<version>-presto-plugin.tar.gz
ranger-<version>-schema-registry-plugin.tar.gz

Importing Apache Ranger Project into Eclipse
============================================
Expand Down Expand Up @@ -85,6 +88,9 @@ Installation Host Information
(h) Sqoop plugin needs to be installed on Sqoop2 hosts
(i) Kylin plugin needs to be installed on Kylin hosts
(j) Elasticsearch plugin needs to be installed on Elasticsearch hosts
(k) Ozone plugin needs to be installed on Ozone hosts
(l) Presto plugin needs to be installed on Presto hosts
(m) Schema Registry plugin needs to be installed on Schema Registry hosts

Installation Process
~~~~~~~~~~~~~~~~~~~~
Expand Down
7 changes: 1 addition & 6 deletions agents-audit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down Expand Up @@ -303,11 +303,6 @@
<artifactId>log4j-api</artifactId>
<version>${log4j.core.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>${httpcomponents.httpcore.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-storage-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion agents-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,22 +849,16 @@ private void getDeltasSortedByZones(PolicyEngine current, ServicePolicies servic
Map<String, List<RangerPolicyDelta>> zoneDeltasMap = new HashMap<>();

for (Map.Entry<String, ServicePolicies.SecurityZoneInfo> zone : servicePolicies.getSecurityZones().entrySet()) {
List<RangerPolicyDelta> deltas = zone.getValue().getPolicyDeltas();
String zoneName = zone.getKey();
List<RangerPolicyDelta> deltas = zone.getValue().getPolicyDeltas();
List<RangerPolicyDelta> zoneDeltas = new ArrayList<>();

for (RangerPolicyDelta delta : deltas) {
String zoneName = delta.getZoneName();

if (StringUtils.isNotEmpty(zoneName)) {
List<RangerPolicyDelta> zoneDeltas = zoneDeltasMap.get(zoneName);

if (zoneDeltas == null) {
zoneDeltas = new ArrayList<>();
zoneDeltasMap.put(zoneName, zoneDeltas);
}
if (StringUtils.isNotEmpty(zoneName)) {
zoneDeltasMap.put(zoneName, zoneDeltas);

for (RangerPolicyDelta delta : deltas) {
zoneDeltas = zoneDeltasMap.get(zoneName);
zoneDeltas.add(delta);
} else {
LOG.warn("policyDelta : [" + delta + "] does not belong to any zone. Should not have come here.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,14 +988,12 @@ private void init(RangerPolicyEngineOptions options) {
LOG.debug("rowFilter policy evaluation order: #" + (++order) + " - policy id=" + policy.getId() + "; name=" + policy.getName() + "; evalOrder=" + policyEvaluator.getEvalOrder());
}

LOG.debug("audit policy evaluation order: " + ((this.auditPolicyEvaluators != null) ? this.auditPolicyEvaluators.size() : 0 + " policies"));
if (this.auditPolicyEvaluators != null) {
order = 0;
for(RangerPolicyEvaluator policyEvaluator : this.auditPolicyEvaluators) {
RangerPolicy policy = policyEvaluator.getPolicy();
LOG.debug("audit policy evaluation order: " + this.auditPolicyEvaluators.size() + " policies");
order = 0;
for(RangerPolicyEvaluator policyEvaluator : this.auditPolicyEvaluators) {
RangerPolicy policy = policyEvaluator.getPolicy();

LOG.debug("rowFilter policy evaluation order: #" + (++order) + " - policy id=" + policy.getId() + "; name=" + policy.getName() + "; evalOrder=" + policyEvaluator.getEvalOrder());
}
LOG.debug("rowFilter policy evaluation order: #" + (++order) + " - policy id=" + policy.getId() + "; name=" + policy.getName() + "; evalOrder=" + policyEvaluator.getEvalOrder());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ public void init(RangerPolicy policy, RangerServiceDef serviceDef, RangerPolicyE
if(policy != null) {
validityScheduleEvaluators = createValidityScheduleEvaluators(policy);

this.disableRoleResolution = options.disableRoleResolution;

if (!options.disableAccessEvaluationWithPolicyACLSummary) {
aclSummary = createPolicyACLSummary();
}
Expand All @@ -152,7 +154,7 @@ public void init(RangerPolicy policy, RangerServiceDef serviceDef, RangerPolicyE
} else {
allowEvaluators = createPolicyItemEvaluators(policy, serviceDef, options, RangerPolicyItemEvaluator.POLICY_ITEM_TYPE_ALLOW);

if (ServiceDefUtil.getOption_enableDenyAndExceptionsInPolicies(serviceDef, getPluginContext())) {
if (ServiceDefUtil.getOption_enableDenyAndExceptionsInPolicies(serviceDef, pluginContext)) {
denyEvaluators = createPolicyItemEvaluators(policy, serviceDef, options, RangerPolicyItemEvaluator.POLICY_ITEM_TYPE_DENY);
allowExceptionEvaluators = createPolicyItemEvaluators(policy, serviceDef, options, RangerPolicyItemEvaluator.POLICY_ITEM_TYPE_ALLOW_EXCEPTIONS);
denyExceptionEvaluators = createPolicyItemEvaluators(policy, serviceDef, options, RangerPolicyItemEvaluator.POLICY_ITEM_TYPE_DENY_EXCEPTIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static List<RangerPolicy> applyDeltas(List<RangerPolicy> policies, List<R
}
} else {
if (LOG.isDebugEnabled()) {
LOG.warn("Unexpected : applyDeltas called with deltas=null");
LOG.debug("applyDeltas called with empty deltas. Will return policies without change");
}
ret = policies;
}
Expand Down
2 changes: 1 addition & 1 deletion agents-cred/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>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion agents-installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion credentialbuilder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions dev-support/ranger-docker/.env
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
BUILD_HOST_SRC=true
SKIPTESTS=true
GIT_URL=https://github.com/apache/ranger.git
BRANCH=master
BRANCH=ranger-2.2

POSTGRES_PASSWORD=rangerR0cks!

RANGER_VERSION=3.0.0-SNAPSHOT
RANGER_VERSION=2.2.0
HADOOP_VERSION=3.3.0
HBASE_VERSION=2.2.6
HIVE_VERSION=3.1.2
HIVE_HADOOP_VERSION=3.1.0
HIVE_HADOOP_VERSION=3.1.1
KAFKA_VERSION=2.5.0
2 changes: 1 addition & 1 deletion dev-support/ranger-docker/scripts/ranger-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

if [ "${BRANCH}" == "" ]
then
BRANCH=master
BRANCH=ranger-2.1
fi

if [ "${GIT_URL}" == "" ]
Expand Down
2 changes: 1 addition & 1 deletion distro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>

Expand Down
1 change: 0 additions & 1 deletion distro/src/main/assembly/admin-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@
<include>joda-time:joda-time</include>
<include>org.apache.ranger:ranger-plugins-cred</include>
<include>org.apache.ranger:ugsyn-util</include>
<include>org.eclipse.jetty:jetty-client:jar:${jetty-client.version}</include>
<include>org.apache.commons:commons-compress:jar:${commons.compress.version}</include>
</includes>
</binaries>
Expand Down
1 change: 1 addition & 0 deletions distro/src/main/assembly/plugin-kafka.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<include>org.elasticsearch.plugin:lang-mustache-client</include>
<include>org.apache.httpcomponents:httpcore-nio:jar:${httpcomponents.httpcore.version}</include>
<include>org.apache.httpcomponents:httpasyncclient:jar:${httpcomponents.httpasyncclient.version}</include>
<include>org.apache.htrace:htrace-core4</include>
<include>org.apache.lucene:lucene-core</include>
<include>joda-time:joda-time</include>
<include>com.carrotsearch:hppc</include>
Expand Down
2 changes: 1 addition & 1 deletion docs/NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache Ranger
Copyright 2014-2016 The Apache Software Foundation
Copyright 2014-2021 The Apache Software Foundation

This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<url>http://ranger.apache.org/</url>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.ranger</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<artifactId>ranger</artifactId>
<packaging>pom</packaging>
<licenses>
Expand Down
2 changes: 1 addition & 1 deletion embeddedwebserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion hbase-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion hdfs-agent/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>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public AccessControlEnforcer getExternalAccessControlEnforcer(AccessControlEnfor
return rangerAce;
}


// for testing
public Configuration getConfig() {
return rangerPlugin.getConfig();
Expand Down
2 changes: 1 addition & 1 deletion hive-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>2.2.0</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
Expand Down
Loading

0 comments on commit 1dad72c

Please sign in to comment.