1) Set up Apache Atlas
First let's look at setting up Apache Atlas. Download the latest released version (0.7.1-incubating) and extract it. Build the distribution that contains an embedded HBase and Solr instance via:
- mvn clean package -Pdist,embedded-hbase-solr -DskipTests
- export MANAGE_LOCAL_HBASE=true
- export MANAGE_LOCAL_SOLR=true
- alice=DATA_SCIENTIST::5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
- curl -u alice:password http://localhost:21000/api/atlas/types?type=TRAIT
To use Apache Ranger to secure Apache Atlas, the next step we need to do is to configure and install the Apache Ranger Atlas plugin. Follow the steps in an earlier tutorial to build Apache Ranger and to setup and start the Apache Ranger Admin service. I recommend to use the latest SNAPSHOT of Ranger (0.7.0-SNAPSHOT at this time) as there are some bugs fixed in relation to Atlas support since the 0.6.x release. Once this is done, go back to the Apache Ranger distribution that you have built and extract the atlas plugin:
- tar zxvf target/ranger-0.7.0-SNAPSHOT-atlas-plugin.tar.gz
- POLICY_MGR_URL=http://localhost:6080
- Specify location for SQL_CONNECTOR_JAR
- Specify REPOSITORY_NAME (AtlasTest)
- COMPONENT_INSTALL_DIR_NAME pointing to your Atlas install
3) Creating authorization policies for Atlas in the Ranger Admin Service
Now that we have set up Apache Atlas to use Apache Ranger for authorization, what remains is to start the Apache Ranger Admin Service and to create some authorization policies. Start Apache Ranger ('sudo ranger-admin start'). Log in to 'http://localhost:6080/' (credentials admin/admin). Click on the "+" button for Atlas, and specify the following fields:
- Service Name: AtlasTest
- Username: admin
- Password: admin
- atlas.rest.address: http://localhost:21000
Now let's update the authorization policies to allow "alice" access to reading the tags. Back in Apache Ranger, click on "Settings" and then "Users/Groups" and "Groups". Click on "Add new group" and enter "DATA_SCIENTIST" for the name. Now go back into "AtlasTest", and edit the policy called "all - type". Create a new "Allow Condition" for the group "DATA_SCIENTIST" with permission "read" and click "Save". After waiting some time for the policies to sync, try again with the "Curl" command and it should work.
No comments:
Post a Comment