Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ public class EmbeddedServiceDefsUtil {


// following servicedef list should be reviewed/updated whenever a new embedded service-def is added
public static final String DEFAULT_BOOTSTRAP_SERVICEDEF_LIST = "tag,hdfs,hbase,hive,kms,knox,storm,yarn,kafka,solr,atlas,nifi,nifi-registry,sqoop,kylin,elasticsearch,presto,trino,ozone,kudu,schema-registry,nestedstructure,polaris";
public static final String DEFAULT_BOOTSTRAP_SERVICEDEF_LIST = "tag,hdfs,hbase,hive,drill,kms,knox,storm,yarn,kafka,solr,atlas,nifi,nifi-registry,sqoop,kylin,elasticsearch,presto,trino,ozone,kudu,schema-registry,nestedstructure,polaris";
private static final String PROPERTY_SUPPORTED_SERVICE_DEFS = "ranger.supportedcomponents";
private Set<String> supportedServiceDefs;
public static final String EMBEDDED_SERVICEDEF_TAG_NAME = "tag";
public static final String EMBEDDED_SERVICEDEF_HDFS_NAME = "hdfs";
public static final String EMBEDDED_SERVICEDEF_HBASE_NAME = "hbase";
public static final String EMBEDDED_SERVICEDEF_HIVE_NAME = "hive";
public static final String EMBEDDED_SERVICEDEF_DRILL_NAME = "drill";
public static final String EMBEDDED_SERVICEDEF_KMS_NAME = "kms";
public static final String EMBEDDED_SERVICEDEF_KNOX_NAME = "knox";
public static final String EMBEDDED_SERVICEDEF_STORM_NAME = "storm";
Expand Down Expand Up @@ -119,6 +120,7 @@ public class EmbeddedServiceDefsUtil {
private RangerServiceDef elasticsearchServiceDef;
private RangerServiceDef prestoServiceDef;
private RangerServiceDef trinoServiceDef;
private RangerServiceDef drillServiceDef;
private RangerServiceDef ozoneServiceDef;
private RangerServiceDef kuduServiceDef;
private RangerServiceDef nestedStructureServiveDef;
Expand Down Expand Up @@ -168,6 +170,7 @@ public void init(ServiceStore store) {
abfsServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_ABFS_NAME);
elasticsearchServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_ELASTICSEARCH_NAME);
trinoServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_TRINO_NAME);
drillServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_DRILL_NAME);
prestoServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_PRESTO_NAME);
ozoneServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_OZONE_NAME);
kuduServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_KUDU_NAME);
Expand Down Expand Up @@ -251,6 +254,8 @@ public long getElasticsearchServiceDefId() {

public long getTrinoServiceDefId() { return getId(trinoServiceDef); }

public long getDrillServiceDefId() { return getId(drillServiceDef); }

public long getPrestoServiceDefId() { return getId(prestoServiceDef); }

public long getOzoneServiceDefId() { return getId(ozoneServiceDef); }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"name": "drill",
"label": "Apache Drill",
"description": "Apache Drill distributed SQL query engine",
"guid": "d8b1c0a2-7e3f-4b2a-9c1d-0a1b2c3d4e5f",
"implClass": "org.apache.ranger.services.RangerServiceDrill",
"version": 1,
"resources": [
{
"itemId": 1,
"name": "datasource",
"label": "Data Source",
"description": "Drill storage plugin name (e.g. dfs, hive, mongo)",
"level": 10,
"parent": "",
"mandatory": true,
"lookupSupported": true,
"recursiveSupported": false,
"excludesSupported": false,
"matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher",
"matcherOptions": {
"wildCard": "false",
"ignoreCase": "false"
},
"validationRegEx": "",
"uiPageSize": "",
"accessTypeRestrictions": []
},
{
"itemId": 2,
"name": "schema",
"label": "Schema",
"description": "Schema path within the data source (e.g. tmp, default)",
"level": 20,
"parent": "datasource",
"mandatory": true,
"lookupSupported": true,
"recursiveSupported": true,
"excludesSupported": true,
"matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher",
"matcherOptions": {
"wildCard": "true",
"ignoreCase": "false"
},
"validationRegEx": "",
"uiPageSize": "",
"accessTypeRestrictions": []
},
{
"itemId": 3,
"name": "table",
"label": "Table",
"description": "Table name within the schema",
"level": 30,
"parent": "schema",
"mandatory": true,
"lookupSupported": true,
"recursiveSupported": true,
"excludesSupported": true,
"matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher",
"matcherOptions": {
"wildCard": "true",
"ignoreCase": "false"
},
"validationRegEx": "",
"uiPageSize": "",
"accessTypeRestrictions": []
},
{
"itemId": 4,
"name": "column",
"label": "Column",
"description": "Column name within the table",
"level": 40,
"parent": "table",
"mandatory": false,
"lookupSupported": true,
"recursiveSupported": true,
"excludesSupported": true,
"matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher",
"matcherOptions": {
"wildCard": "true",
"ignoreCase": "false"
},
"validationRegEx": "",
"uiPageSize": "",
"accessTypeRestrictions": []
}
],
"accessTypes": [
{
"itemId": 1,
"name": "SELECT",
"label": "Select"
},
{
"itemId": 2,
"name": "CREATE",
"label": "Create"
},
{
"itemId": 3,
"name": "DROP",
"label": "Drop"
}
],
"serviceConfigOptions": [
{
"itemId": 1,
"name": "username",
"label": "Username",
"description": "Drill user name for policy lookup connection",
"type": "string",
"mandatory": true,
"defaultValue": "",
"validationRegEx": ""
},
{
"itemId": 2,
"name": "password",
"label": "Password",
"description": "Drill user password",
"type": "password",
"mandatory": false,
"defaultValue": ""
},
{
"itemId": 3,
"name": "drill.connection.url",
"label": "Drill REST URL",
"description": "Drill REST API endpoint for resource lookup (e.g. http://drillbit-host:8047)",
"type": "string",
"mandatory": true,
"defaultValue": "http://localhost:8047"
}
],
"policyConditions": [],
"contextEnrichers": [],
"enums": []
}
6 changes: 6 additions & 0 deletions distro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger-drill-plugin</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger-elasticsearch-plugin</artifactId>
Expand Down
17 changes: 17 additions & 0 deletions distro/src/main/assembly/admin-web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,23 @@
</binaries>
</moduleSet>

<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.apache.ranger:ranger-drill-plugin</include>
</includes>
<binaries>
<outputDirectory>ews/webapp/WEB-INF/classes/ranger-plugins/drill</outputDirectory>
<includeDependencies>true</includeDependencies>
<unpack>false</unpack>
<directoryMode>755</directoryMode>
<fileMode>644</fileMode>
<includes>
<include>org.apache.ranger:ranger-drill-plugin</include>
</includes>
</binaries>
</moduleSet>

<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
Expand Down
89 changes: 89 additions & 0 deletions plugin-drill/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger</artifactId>
<version>2.9.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>ranger-drill-plugin</artifactId>
<packaging>jar</packaging>
<name>Ranger Security Plugin for Apache Drill</name>
<description>Ranger Security Plugin for Apache Drill (service-side resource lookup via Drill REST API)</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${fasterxml.jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger-common-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger-plugins-common</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading