<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Ranger and HDFS over SSL in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185905#M83302</link>
    <description>&lt;P&gt;Thank you for your answer, &lt;A rel="user" href="https://community.cloudera.com/users/79158/vmurakami.html" nodeid="79158"&gt;@Vinicius Higa Murakami&lt;/A&gt;, this was very helpful!&lt;/P&gt;&lt;P&gt;It looks like I was missing the last part, I had to add root and intermediate certificates to the default java keystore "cacerts". I wonder why we need to add the certs to the default java keystore, and not the rangeradmin &amp;amp; client keystores?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Sep 2018 08:16:27 GMT</pubDate>
    <dc:creator>neagamaxim</dc:creator>
    <dc:date>2018-09-10T08:16:27Z</dc:date>
    <item>
      <title>Ranger and HDFS over SSL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185903#M83300</link>
      <description>&lt;P&gt;
	I am trying to set up SSL between Ranger Admin and Ranger HDFS plugin (HDP 2.6.5)&lt;/P&gt;&lt;P&gt;
	I am able to successfully have Ranger Admin UI served via HTTPS (browser says certificate is valid), but my HDFS plugin is not able to sync the policies with Ranger.&lt;/P&gt;&lt;P&gt;
	&lt;STRONG&gt;
	My setup:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;
	4-node cluster&lt;/P&gt;&lt;UL&gt;
	
&lt;LI&gt;Ranger Admin on Node 1&lt;/LI&gt;	
&lt;LI&gt;HDFS NameNode on Node 1&lt;/LI&gt;	
&lt;LI&gt;HDFS SNameNode on Node 2&lt;/LI&gt;	
&lt;LI&gt;HDFS DataNode on Node 4&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;	As far as I understand, I need to set up keystores and truststores on Node 1 and configure Ranger &amp;amp; HDFS to use those keystores and truststores.
	
&lt;/P&gt;&lt;P&gt;
		&lt;STRONG&gt;
		Steps performed:&lt;/STRONG&gt;
	&lt;/P&gt;&lt;OL&gt;
		
&lt;LI&gt;Obtained the PKCS7b (.pem) certificate file from my CA (my CA only offers DER, PKCS7b and CRT files)&lt;/LI&gt;		
&lt;P&gt;&lt;/P&gt;&lt;LI&gt;Created a keystore for Ranger Admin Service from the certificate&lt;/LI&gt;
		&lt;PRE&gt;cp cert.pem cert.p7b&lt;/PRE&gt;		&lt;PRE&gt;openssl pkcs7 -print_certs -in cert.p7b -out cert.cer&lt;/PRE&gt;		&lt;PRE&gt;openssl pkcs12 -export -in cert.cer -inkey certkey.key -out rangeradmin.p12 -name rangeradmin&lt;/PRE&gt;		&lt;PRE&gt;keytool -importkeystore -deststorepass pass2word -destkeypass pass2word -srckeystore rangeradmin.p12 -srcstoretype PKCS12 -destkeystore ranger-admin-keystore.jks -deststoretype JKS -alias rangeradmin&lt;/PRE&gt;&lt;LI&gt;Similarly, created a keystore for HDFS&lt;/LI&gt;
		&lt;PRE&gt;keytool -importkeystore -deststorepass pass2word -destkeypass pass2word -srckeystore rangeradmin.p12 -srcstoretype PKCS12 -destkeystore hdfs-plugin-keystore.jks -deststoretype JKS -alias hdfsplugin	&lt;/PRE&gt;&lt;LI&gt;Created Ranger Admin truststore&lt;/LI&gt;
		&lt;PRE&gt;keytool -export -keystore hdfs-plugin-keystore.jks -alias hdfsplugin -file hdfsplugin.cer -storepass pass2word&lt;BR /&gt;&lt;/PRE&gt;		&lt;PRE&gt;keytool -import -file hdfsplugin.cer -alias hdfsplugin -keystore /etc/ranger/admin/conf/ranger-admin-truststore.jks -storepass pass2word&lt;BR /&gt;&lt;/PRE&gt;		
&lt;LI&gt;Similarly, created HDFS truststore
		&lt;PRE&gt;keytool -export -keystore ranger-admin-keystore.jks -alias rangeradmin -file rangeradmin.cer -storepass pass2word&lt;BR /&gt;&lt;/PRE&gt;		&lt;PRE&gt;keytool -import -file rangeradmin.cer -alias rangeradmin -keystore /etc/hadoop/conf/hdfs-plugin-truststore.jks -storepass pass2word&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;
				At this point I have my Ranger keystore and truststore files in /etc/ranger/admin/conf and HDFS has its in /etc/hadoop/conf/
		&lt;/P&gt;&lt;/LI&gt;		
&lt;LI&gt;Set up Ranger to use SSL using Ranger Admin keystore by following &lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.3/bk_security/content/configure_ambari_ranger_ssl_public_ca_certs_admin.html"&gt;https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.3/bk_security/content/configure_ambari_ranger_ssl_public_ca_certs_admin.html&lt;/A&gt; . &lt;STRONG&gt;At this point Ranger Admin UI is served via HTTPS (browser says certificate is valid).&lt;/STRONG&gt;&lt;/LI&gt;		
&lt;LI&gt;Set up HDFS to use SSL via Ambari
		&lt;/LI&gt;	&lt;/OL&gt;&lt;OL&gt;
		
&lt;LI&gt;HDFS &amp;gt; Configs &amp;gt; Advanced &amp;gt; ranger-hdfs-policymgr-ssl and set the following properties:&lt;/LI&gt;
		&lt;PRE&gt;xasecure.policymgr.clientssl.keystore = /etc/hadoop/conf/hdfs-plugin-keystore.jks
xasecure.policymgr.clientssl.keystore.password = pass2word
xasecure.policymgr.clientssl.truststore = hdfs-plugin-truststore.jks
xasecure.policymgr.clientssl.truststore.password = pass2word&lt;BR /&gt;&lt;LI&gt;HDFS &amp;gt; Configs &amp;gt; Advanced &amp;gt; Advanced ranger-hdfs-plugin-properties&lt;/LI&gt;
		&lt;PRE&gt; common.name.for.certificate = hdfsplugin&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;
	The problem is that the HDFS Ranger policies do not get synced. Ranger admin'sxa_portal.log says "Unauthorized access. Unable to get client certificate."
		&lt;/P&gt;&lt;P&gt;
			&lt;STRONG&gt;What am I missing here?&lt;/STRONG&gt;
		&lt;/P&gt;&lt;/PRE&gt;&lt;/OL&gt;</description>
      <pubDate>Sat, 08 Sep 2018 02:52:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185903#M83300</guid>
      <dc:creator>neagamaxim</dc:creator>
      <dc:date>2018-09-08T02:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger and HDFS over SSL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185904#M83301</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/92158/neagamaxim.html" nodeid="92158"&gt;@Maxim Neaga&lt;/A&gt;. &lt;BR /&gt;Just to make sure, if you run the following command for every keystore/trustore, are you able to see the certificate? &lt;/P&gt;&lt;PRE&gt;keytool -v -list -keystore &amp;lt;pathtokeystore&amp;gt;/&amp;lt;keystore/trustore.jks&amp;gt;&lt;/PRE&gt;&lt;P&gt;It should show up something like this:&lt;/P&gt;&lt;PRE&gt;[root@vmurakami-1 ~]# keytool -v -list -keystore windows.jks 
Enter keystore password:  
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 2 entries
Alias name: nifi-cert
Creation date: Sep 1, 2018
Entry type: trustedCertEntry
Owner: CN=vmurakami-3, OU=NIFI
Issuer: CN=vmurakami-3, OU=NIFI
Serial number: 1649584f09b00000000
Valid from: Fri Jul 13 21:21:14 UTC 2018 until: Mon Jul 12 21:21:14 UTC 2021
Certificate fingerprints:
	 MD5:  02:BE:7D:37:22:5B:A8:37:F2:F0:02:E0:26:96:E7:54
	 SHA1: 1F:D0:EC:B5:1A:6E:E7:E5:B4:65:71:1B:8A:B3:99:C2:2A:50:28:0D
	 SHA256: 14:1C:40:B9:2E:6C:C4:5F:56:C8:9D:76:31:21:B5:CB:E2:FA:B1:A2:BE:9B:CA:7F:0D:B4:72:1B:32:2A:95:69
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
Extensions: 
#1: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 78 2D ED D1 1D 7F F6 22   A3 60 39 EF CE AC 09 6E  x-.....".`9....n
0010: CD 51 B9 D3                                        .Q..
]
]
#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
  CA:true
  PathLen:2147483647
]
#3: ObjectId: 2.5.29.37 Criticality=false
ExtendedKeyUsages [
  clientAuth
  serverAuth
]
#4: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
  DigitalSignature
  Non_repudiation
  Key_Encipherment
  Data_Encipherment
  Key_Agreement
  Key_CertSign
  Crl_Sign
]
#5: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 78 2D ED D1 1D 7F F6 22   A3 60 39 EF CE AC 09 6E  x-.....".`9....n
0010: CD 51 B9 D3                                        .Q..
]
]
*******************************************
*******************************************
Alias name: windows
Creation date: Sep 1, 2018
Entry type: PrivateKeyEntry
Certificate chain length: 2
Certificate[1]:
Owner: CN=MSEDGEWIN10, OU=NIFI
Issuer: CN=MSEDGEWIN10, OU=NIFI
Serial number: 27ba96c9
Valid from: Sat Sep 01 07:21:44 UTC 2018 until: Tue Aug 27 07:21:44 UTC 2019
Certificate fingerprints:
	 MD5:  B7:FE:EB:0C:3E:7D:EE:E9:58:54:EC:2B:F4:02:9C:0D
	 SHA1: 3A:9A:DD:05:FF:E8:41:99:C8:8B:D4:84:4C:4A:5E:56:6C:46:15:B0
	 SHA256: 22:CD:A6:CE:9E:F0:B8:A3:A8:6E:25:2E:4D:A2:AB:70:4F:98:36:AC:8C:C0:A0:B6:15:22:E8:27:80:CC:F3:A6
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
Extensions: 
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 3B FE 73 64 EC 9C 91 B6   AC 3D EC 44 9D AF DD 66  ;.sd.....=.D...f
0010: B8 DE 4A F8                                        ..J.
]
]
Certificate[2]:
Owner: CN=vmurakami-3, OU=NIFI
Issuer: CN=vmurakami-3, OU=NIFI
Serial number: 1649584f09b00000000
Valid from: Fri Jul 13 21:21:14 UTC 2018 until: Mon Jul 12 21:21:14 UTC 2021
Certificate fingerprints:
	 MD5:  02:BE:7D:37:22:5B:A8:37:F2:F0:02:E0:26:96:E7:54
	 SHA1: 1F:D0:EC:B5:1A:6E:E7:E5:B4:65:71:1B:8A:B3:99:C2:2A:50:28:0D
	 SHA256: 14:1C:40:B9:2E:6C:C4:5F:56:C8:9D:76:31:21:B5:CB:E2:FA:B1:A2:BE:9B:CA:7F:0D:B4:72:1B:32:2A:95:69
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
Extensions: 
#1: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 78 2D ED D1 1D 7F F6 22   A3 60 39 EF CE AC 09 6E  x-.....".`9....n
0010: CD 51 B9 D3                                        .Q..
]
]
#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
  CA:true
  PathLen:2147483647
]
#3: ObjectId: 2.5.29.37 Criticality=false
ExtendedKeyUsages [
  clientAuth
  serverAuth
]
#4: ObjectId: 2.5.29.15 Criticality=true
KeyUsage [
  DigitalSignature
  Non_repudiation
  Key_Encipherment
  Data_Encipherment
  Key_Agreement
  Key_CertSign
  Crl_Sign
]
#5: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 78 2D ED D1 1D 7F F6 22   A3 60 39 EF CE AC 09 6E  x-.....".`9....n
0010: CD 51 B9 D3                                        .Q..
]
]
*******************************************
*******************************************
Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore windows.jks -destkeystore windows.jks -deststoretype pkcs12".
&lt;/PRE&gt;&lt;P&gt;Also, make sure of 2 things:&lt;BR /&gt;- Give the read permission to the ranger hdfs plugin keystore/trustore&lt;/P&gt;&lt;PRE&gt;chmod o+r keystore.jks truststore.jks&lt;/PRE&gt;&lt;P&gt;- Put the same owner (CN=&amp;lt;some_name&amp;gt;) in the&lt;BR /&gt;Ranger HDFS plugin &amp;gt; Owner of the certificate in Ambari UI&lt;BR /&gt;commonNameForCertificate in the Ranger Plugin for HDFS in Ranger UI&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;And lastly, to make sure, go to the ranger-admin node into the default java keystore "cacerts" and add the client certificate. &lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;find / -name "cacerts" -type f &lt;BR /&gt;keytool -import -file &amp;lt;your cert file&amp;gt; -alias &amp;lt;your alias&amp;gt; -keystore &amp;lt;the_path_for_the_jdk_listed_above&amp;gt;/cacerts -storepass changeit #default passwor&lt;/PRE&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Sat, 08 Sep 2018 07:05:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185904#M83301</guid>
      <dc:creator>vmurakami</dc:creator>
      <dc:date>2018-09-08T07:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger and HDFS over SSL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185905#M83302</link>
      <description>&lt;P&gt;Thank you for your answer, &lt;A rel="user" href="https://community.cloudera.com/users/79158/vmurakami.html" nodeid="79158"&gt;@Vinicius Higa Murakami&lt;/A&gt;, this was very helpful!&lt;/P&gt;&lt;P&gt;It looks like I was missing the last part, I had to add root and intermediate certificates to the default java keystore "cacerts". I wonder why we need to add the certs to the default java keystore, and not the rangeradmin &amp;amp; client keystores?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 08:16:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185905#M83302</guid>
      <dc:creator>neagamaxim</dc:creator>
      <dc:date>2018-09-10T08:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger and HDFS over SSL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185906#M83303</link>
      <description>&lt;P&gt;Hello &lt;A rel="user" href="https://community.cloudera.com/users/92158/neagamaxim.html" nodeid="92158"&gt;@Maxim Neaga&lt;/A&gt;!&lt;BR /&gt;I'm glad that I could help you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;BR /&gt;Yeah, make totally sense your question. I'd say because you've 3 truststore's:&lt;BR /&gt;- 1 x truststore's for the nifi nodes&lt;BR /&gt;- 1 x For the Ranger x Nifi plugin&lt;BR /&gt;- 1 x For Ranger Admin (which is the java default cacerts).&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 11:17:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-and-HDFS-over-SSL/m-p/185906#M83303</guid>
      <dc:creator>vmurakami</dc:creator>
      <dc:date>2018-09-11T11:17:09Z</dc:date>
    </item>
  </channel>
</rss>

