Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADH-4642]: Implement Ranger plugin for SSM #71

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
134fc99
ADH-4642
VitekArkhipov Jul 8, 2024
500028c
ADH-4642
VitekArkhipov Jul 8, 2024
fad78e6
ADH-4642
VitekArkhipov Jul 19, 2024
9aff78c
Merge remote-tracking branch 'origin/develop' into feature/ADH-4642
VitekArkhipov Jul 24, 2024
73a9d63
ADH-4643
VitekArkhipov Jul 26, 2024
6e1020a
ADH-4643
VitekArkhipov Jul 26, 2024
c518b44
Merge remote-tracking branch 'origin/feature/ADH-4643' into feature/A…
VitekArkhipov Jul 26, 2024
60390dd
ADH-4643
VitekArkhipov Aug 5, 2024
a066858
ADH-4642
VitekArkhipov Aug 6, 2024
0c5b19c
Merge remote-tracking branch 'origin/develop' into feature/ADH-4642
VitekArkhipov Aug 6, 2024
05aca32
ADH-4642
VitekArkhipov Aug 6, 2024
323eb62
Merge remote-tracking branch 'origin/feature/ADH-4642' into feature/A…
VitekArkhipov Aug 6, 2024
aab32cc
ADH-4643
VitekArkhipov Aug 8, 2024
862b516
Merge remote-tracking branch 'origin/develop' into feature/ADH-4642
VitekArkhipov Aug 14, 2024
dd6d9f9
Merge remote-tracking branch 'origin/feature/ADH-4642' into feature/A…
VitekArkhipov Aug 14, 2024
4129a16
Merge remote-tracking branch 'origin/develop' into feature/ADH-4642
VitekArkhipov Aug 14, 2024
d7ea070
Merge branch 'feature/ADH-4642' into feature/ADH-4643
VitekArkhipov Aug 14, 2024
c14ee78
Merge pull request #76 from arenadata/feature/ADH-4643
iamlapa Aug 16, 2024
f90ca99
[ADH-4958] Fix ranger definition json
tigrulya-exe Sep 16, 2024
7eae273
Merge remote-tracking branch 'origin/develop' into feature/ADH-4642
tigrulya-exe Sep 16, 2024
9ab70a9
build(ranger): ADH-5151. Added additional dependencies for the ranger…
Asmoday Dec 26, 2024
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
51 changes: 51 additions & 0 deletions conf/ranger-ssm-audit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- DB audit provider configuration -->
<property>
<name>xasecure.audit.destination.db</name>
<value>false</value>
</property>

<property>
<name>xasecure.audit.destination.db.jdbc.driver</name>
<value>com.mysql.jdbc.Driver</value>
</property>

<property>
<name>xasecure.audit.destination.db.password</name>
<value>rangerlogger</value>
</property>

<property>
<name>xasecure.audit.destination.db.user</name>
<value>rangerlogger</value>
</property>

<property>
<name>xasecure.audit.destination.db.batch.filespool.dir</name>
<value>/tmp/audit/db/spool</value>
</property>

<!-- HDFS audit provider configuration -->
<property>
<name>xasecure.audit.destination.hdfs</name>
<value>false</value>
</property>

<property>
<name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
<value>/tmp/audit/hdfs/spool</value>
</property>

<!-- Log4j audit provider configuration -->
<property>
<name>xasecure.audit.destination.log4j</name>
<value>true</value>
</property>

<property>
<name>xasecure.audit.destination.log4j.logger</name>
<value>ranger_audit_logger</value>
</property>
</configuration>
76 changes: 76 additions & 0 deletions conf/ranger-ssm-security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>

<property>
<name>ranger.plugin.ssm.service.name</name>
<value>dev_tag</value>
<description>
Name of the Ranger service containing policies for this ssm instance
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.source.impl</name>
<value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
<description>
Class to retrieve policies from the source
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.rest.ssl.config.file</name>
<value>ranger-policymgr-ssl.xml</value>
<description>
Path to the file containing SSL details to contact Ranger Admin
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.pollIntervalMs</name>
<value>30000</value>
<description>
How often to poll for changes in policies?
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.cache.dir</name>
<value>/tmp</value>
<description>
Directory where Ranger policies are cached after successful retrieval from the source
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.rest.client.connection.timeoutMs</name>
<value>120000</value>
<description>
RangerRestClient Connection Timeout in Milli Seconds
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.rest.client.read.timeoutMs</name>
<value>30000</value>
<description>
RangerRestClient read Timeout in Milli Seconds
</description>
</property>
</configuration>
8 changes: 8 additions & 0 deletions conf/smart-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -591,4 +591,12 @@
for later submission and drop old failing events.
</description>
</property>

<property>
<name>smart.rest.server.auth.ranger.enabled</name>
<value>false</value>
<description>
Whether to enable Apache Ranger authorization for SSM REST server.
</description>
</property>
</configuration>
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<module>smart-dist</module>
<module>smart-integration</module>
<module>smart-web-server</module>
<module>smart-ranger-plugin</module>
<module>smart-hadoop-support</module>
</modules>

Expand Down Expand Up @@ -109,6 +110,8 @@
<hamcrest.version>1.3</hamcrest.version>
<smart.hadoop.artifact>smart-hadoop-3.2</smart.hadoop.artifact>
<smart.hadoop.client.artifact>smart-hadoop-client-3</smart.hadoop.client.artifact>
<ranger.version>2.4.0</ranger.version>
<ranger.jna.version>5.8.0</ranger.jna.version>
</properties>

<profiles>
Expand Down
63 changes: 63 additions & 0 deletions smart-integration/src/test/resources/ranger-ssm-audit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- DB audit provider configuration -->
<property>
<name>xasecure.audit.destination.db</name>
<value>false</value>
</property>

<property>
<name>xasecure.audit.destination.db.jdbc.driver</name>
<value>com.mysql.jdbc.Driver</value>
</property>

<property>
<name>xasecure.audit.destination.db.jdbc.url</name>
<value>jdbc:mysql://10.92.3.109/ranger_audit</value>
</property>

<property>
<name>xasecure.audit.destination.db.password</name>
<value>rangerlogger</value>
</property>

<property>
<name>xasecure.audit.destination.db.user</name>
<value>rangerlogger</value>
</property>

<property>
<name>xasecure.audit.destination.db.batch.filespool.dir</name>
<value>/tmp/audit/db/spool</value>
</property>


<!-- HDFS audit provider configuration -->
<property>
<name>xasecure.audit.destination.hdfs</name>
<value>false</value>
</property>

<property>
<name>xasecure.audit.destination.hdfs.dir</name>
<value>hdfs://10.92.3.109:8020/ranger/audit</value>
</property>

<property>
<name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
<value>/tmp/audit/hdfs/spool</value>
</property>


<!-- Log4j audit provider configuration -->
<property>
<name>xasecure.audit.destination.log4j</name>
<value>true</value>
</property>

<property>
<name>xasecure.audit.destination.log4j.logger</name>
<value>ranger_audit_logger</value>
</property>
</configuration>
83 changes: 83 additions & 0 deletions smart-integration/src/test/resources/ranger-ssm-security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>ranger.plugin.ssm.policy.rest.url</name>
<value>http://10.92.6.199:6080</value>
<description>
URL to Ranger Admin
</description>
</property>

<property>
<name>ranger.plugin.ssm.service.name</name>
<value>dev_tag</value>
<description>
Name of the Ranger service containing policies for this ssm instance
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.source.impl</name>
<value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
<description>
Class to retrieve policies from the source
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.rest.ssl.config.file</name>
<value>ranger-policymgr-ssl.xml</value>
<description>
Path to the file containing SSL details to contact Ranger Admin
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.pollIntervalMs</name>
<value>30000</value>
<description>
How often to poll for changes in policies?
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.cache.dir</name>
<value>/tmp</value>
<description>
Directory where Ranger policies are cached after successful retrieval from the source
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.rest.client.connection.timeoutMs</name>
<value>120000</value>
<description>
RangerRestClient Connection Timeout in Milli Seconds
</description>
</property>

<property>
<name>ranger.plugin.ssm.policy.rest.client.read.timeoutMs</name>
<value>30000</value>
<description>
RangerRestClient read Timeout in Milli Seconds
</description>
</property>
</configuration>
25 changes: 25 additions & 0 deletions smart-integration/src/test/resources/smart-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,29 @@
<value>5</value>
<description>Max number of rules that can be executed in parallel</description>
</property>

<property>
<name>smart.rest.server.security.enabled</name>
<value>false</value>
<description>
Whether to enable SSM REST server security.
</description>
</property>

<property>
<name>smart.rest.server.auth.predefined.enabled</name>
<value>false</value>
<description>
Whether to enable SSM REST server basic authentication with users,
predefined in the 'smart.rest.server.auth.predefined.users' option.
</description>
</property>

<property>
<name>smart.rest.server.auth.ranger.enabled</name>
<value>false</value>
<description>
Whether to enable Apache Ranger authorization for SSM REST server.
</description>
</property>
</configuration>
59 changes: 59 additions & 0 deletions smart-ranger-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!--

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.smartdata</groupId>
<artifactId>smartdata-project</artifactId>
<version>1.6.0-SNAPSHOT</version>
tigrulya-exe marked this conversation as resolved.
Show resolved Hide resolved
</parent>

<artifactId>smart-ranger-plugin</artifactId>
<name>smart-ranger-plugin</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.apache.ranger</groupId>
<artifactId>ranger-plugins-common</artifactId>
<version>${ranger.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<artifactId>hadoop-common</artifactId>
<groupId>org.apache.hadoop</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Loading
Loading