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 20 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
63 changes: 63 additions & 0 deletions conf/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 conf/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>
tigrulya-exe marked this conversation as resolved.
Show resolved Hide resolved
<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>
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>
</modules>

<properties>
Expand Down Expand Up @@ -102,6 +103,8 @@
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
<aspectj.version>1.9.22</aspectj.version>
<lombok.version>1.18.32</lombok.version>
<ranger.version>2.4.0</ranger.version>
<ranger.jna.version>5.8.0</ranger.jna.version>
</properties>

<profiles>
Expand Down
6 changes: 6 additions & 0 deletions smart-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@
<version>1.6.0-SNAPSHOT</version>
<scope>test</scope>
<type>test-jar</type>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.smartdata</groupId>
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>
Loading
Loading