1) Build the source code
The first step is to download the source code, as well as the signature file and associated message digests (all available on the download page). Verify that the signature is valid and that the message digests match. Now extract and build the source, and copy the resulting KMS archive to a location where you wish to install it:
- tar zxvf apache-ranger-incubating-0.6.0.tar.gz
- cd apache-ranger-incubating-0.6.0
- mvn clean package assembly:assembly
- tar zxvf target/ranger-0.6.0-kms.tar.gz
- mv ranger-0.6.0-kms ${rangerkms.home}
As the Apache Ranger KMS Service stores the cryptographic keys in a database, we will need to setup and configure a database. We will also configure the KMS Service to store audit logs in the database. Follow the steps given in section 2 of the tutorial on the Apache Ranger Admin Service to set up MySQL. We will also need to create a new user 'rangerkms':
- CREATE USER 'rangerkms'@'localhost' IDENTIFIED BY 'password';
- FLUSH PRIVILEGES;
- export JAVA_HOME=/opt/jdk1.8.0_91
- Change SQL_CONNECTOR_JAR to point to the MySQL JDBC driver jar (see previous tutorial).
- Set (db_root_user/db_root_password) to (admin/password)
- Set (db_user/db_password) to (rangerkms/password)
- Change KMS_MASTER_KEY_PASSWD to a secure password value.
- Set POLICY_MGR_URL=http://localhost:6080
- Set XAAUDIT.DB.IS_ENABLED=true
- Set XAAUDIT.DB.FLAVOUR=MYSQL
- Set XAAUDIT.DB.HOSTNAME=localhost
- Set XAAUDIT.DB.DATABASE_NAME=ranger_audit
- Set XAAUDIT.DB.USER_NAME=rangerlogger
- Set XAAUDIT.DB.PASSWORD=password
3) Starting the Apache Ranger KMS service
After a successful installation, first start the Apache Ranger admin service with "sudo ranger-admin start". Then start the Apache Ranger KMS Service via "sudo ranger-kms start". Now open a browser and go to "http://localhost:6080/". Log on with "keyadmin/keyadmin". Note that these are different credentials to those used to log onto the Apache Ranger Admin UI in the previous tutorial. Click on the "+" button on the "KMS" tab to create a new KMS Service. Specify the following values:
- Service Name: kmsdev
- KMS URL: kms://http@localhost:9292/kms
- Username: keyadmin
- Password: keyadmin
After logging back in to the UI as "keyadmin" you can start to create keys. Click on the "Encryption/Key Manager" tab. Select the "kmsdev" service in the dropdown list and click on "Add New Key". You can create, delete and rollover keys in the UI:
Thank You for an excellent article set. Does Ranger Key Server also work with KMIP?
ReplyDeleteI don't think it does...the only reference I could find to KMIP is on the following JIRA: https://issues.apache.org/jira/browse/RANGER-723
Delete