Ambari plugin not working with encrypted password

Description

The ambari plugin does not work with encrypting passwords. It has to be plain text

Activity

Show:
RuslansU
July 1, 2017, 4:04 AM
Edited

Here is how to test it:

1. Create a user in Ambari which will be used by Kylo to query Ambari REST API
Ambari -> Manage Ambari -> Create local user -> name: kylo, pass: Pretend$Password
Ambari -> Manage Ambari -> Clusters -> <cluster name> -> Roles -> assign kylo user to "cluster users"

2. Install the Spring CLI client on Linux

$ wget http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/1.5.3.RELEASE/spring-boot-cli-1.5.3.RELEASE-bin.tar.gz

$ sudo su
$ mkdir /opt/spring-boot
$ tar -xvf spring-boot-cli-1.5.3.RELEASE-bin.tar.gz -C /opt/spring-boot/

$ vi /etc/profile
export SPRING_HOME=/opt/spring-boot/spring-1.5.3.RELEASE
export JAVA_HOME=<<path-to-java-8, e.g. /usr/lib/jvm/jre-1.8.0>>
export PATH=$SPRING_HOME/bin:$JAVA_HOME/bin:$PATH

$ source /etc/profile
$ spring install org.springframework.cloud:spring-cloud-cli:1.3.1.RELEASE

3. Encrypt password
Note: Make sure to use single quotes around the password. If not special characters like $ will cause issues

$ spring encrypt 'Pretend$Password' --key /opt/kylo/encrypt.key
dda0202d65ac03d250b1bc77afcf109795482e08fc118b0f804a6624286f61ae

You can test decryption by running the following
$ spring decrypt 9345adbaf9e1decb09b600fdf3217c09aced6804389e639cd7037fe2145bb2c7af5ac62b9c959455b66793c02589bf1f --key /opt/kylo/encrypt.key

4. Install Ambari Plugin
$ sudo vi /opt/kylo/kylo-services/conf/ambari.properties
ambariRestClientConfig.host=<<HDP Ambari node ip, e.g. localhost>>
ambariRestClientConfig.port=8080
ambariRestClientConfig.username=kylo
#ambariRestClientConfig.password=<<encrypted
password from step 3, e.g. see following line>>
ambariRestClientConfig.password={cipher}dda0202d65ac03d250b1bc77afcf109795482e08fc118b0f804a6624286f61ae
ambari.services.status=HDFS,HIVE,MAPREDUCE2,SQOOP

$ sudo chown kylo:users /opt/kylo/kylo-services/conf/ambari.properties
$ sudo cp /opt/kylo/setup/plugins/kylo-service-monitor-ambari-0.8.2-SNAPSHOT.jar /opt/kylo/kylo-services/plugin/
$ sudo chown kylo:users /opt/kylo/kylo-services/plugin/kylo-service-monitor-ambari-0.8.2-SNAPSHOT.jar

5. Test Kylo connection to Ambari

Start kylo-services and kylo-ui
Browse to Ops Manager Dashboard and ensure Kylo displays correct state of Hadoop services like HDFS, HIVE, MAPREDUCE and SQOOP

Done

Assignee

RuslansU

Reporter

Jeremy Merrifield

Labels

None

Reviewer

None

Components

Sprint

None

Fix versions

Priority

Medium