@@ -17,7 +17,7 @@ use stackable_operator::{
1717
1818use crate :: {
1919 controller:: ValidatedCluster ,
20- crd:: { TLS_STORE_DIR , TLS_STORE_PASSWORD , TLS_STORE_VOLUME_NAME } ,
20+ crd:: { TLS_STORE_DIR , TLS_STORE_PASSWORD , TLS_STORE_TYPE , TLS_STORE_VOLUME_NAME } ,
2121} ;
2222
2323/// Mount path of the Kerberos secret volume (keytab + `krb5.conf`).
@@ -27,6 +27,8 @@ pub const STACKABLE_KERBEROS_DIR: &str = "/stackable/kerberos";
2727pub const KRB5_CONFIG_PATH : & str = const_format:: concatcp!( STACKABLE_KERBEROS_DIR , "/krb5.conf" ) ;
2828/// Name of the Kerberos secret volume.
2929const KERBEROS_VOLUME_NAME : & str = "kerberos" ;
30+ /// The RPC/data-transfer quality-of-protection level used when Kerberos is enabled.
31+ const PROTECTION_PRIVACY : & str = "privacy" ;
3032
3133#[ derive( Snafu , Debug ) ]
3234pub enum Error {
@@ -66,26 +68,29 @@ pub fn kerberos_config_properties(
6668 "hbase.security.authorization" . to_string ( ) ,
6769 "true" . to_string ( ) ,
6870 ) ,
69- ( "hbase.rpc.protection" . to_string ( ) , "privacy" . to_string ( ) ) ,
71+ (
72+ "hbase.rpc.protection" . to_string ( ) ,
73+ PROTECTION_PRIVACY . to_string ( ) ,
74+ ) ,
7075 (
7176 "dfs.data.transfer.protection" . to_string ( ) ,
72- "privacy" . to_string ( ) ,
77+ PROTECTION_PRIVACY . to_string ( ) ,
7378 ) ,
7479 (
7580 "hbase.rpc.engine" . to_string ( ) ,
7681 "org.apache.hadoop.hbase.ipc.SecureRpcEngine" . to_string ( ) ,
7782 ) ,
7883 (
7984 "hbase.master.keytab.file" . to_string ( ) ,
80- "/stackable/kerberos/ keytab". to_string ( ) ,
85+ format ! ( "{STACKABLE_KERBEROS_DIR}/ keytab") ,
8186 ) ,
8287 (
8388 "hbase.regionserver.keytab.file" . to_string ( ) ,
84- "/stackable/kerberos/ keytab". to_string ( ) ,
89+ format ! ( "{STACKABLE_KERBEROS_DIR}/ keytab") ,
8590 ) ,
8691 (
8792 "hbase.rest.keytab.file" . to_string ( ) ,
88- "/stackable/kerberos/ keytab". to_string ( ) ,
93+ format ! ( "{STACKABLE_KERBEROS_DIR}/ keytab") ,
8994 ) ,
9095 (
9196 "hbase.coprocessor.master.classes" . to_string ( ) ,
@@ -101,7 +106,7 @@ pub fn kerberos_config_properties(
101106 ( "hbase.rest.authentication.kerberos.principal" . to_string ( ) , format ! (
102107 "HTTP/{principal_host_part}"
103108 ) ) ,
104- ( "hbase.rest.authentication.kerberos.keytab" . to_string ( ) , "/stackable/kerberos/ keytab". to_string ( ) ) ,
109+ ( "hbase.rest.authentication.kerberos.keytab" . to_string ( ) , format ! ( "{STACKABLE_KERBEROS_DIR}/ keytab") ) ,
105110
106111 // Enabled https as well
107112 ( "hbase.ssl.enabled" . to_string ( ) , "true" . to_string ( ) ) ,
@@ -114,7 +119,7 @@ pub fn kerberos_config_properties(
114119 ( "hbase.rest.ssl.enabled" . to_string ( ) , "true" . to_string ( ) ) ,
115120 ( "hbase.rest.ssl.keystore.store" . to_string ( ) , format ! ( "{TLS_STORE_DIR}/keystore.p12" ) ) ,
116121 ( "hbase.rest.ssl.keystore.password" . to_string ( ) , TLS_STORE_PASSWORD . to_string ( ) ) ,
117- ( "hbase.rest.ssl.keystore.type" . to_string ( ) , "pkcs12" . to_string ( ) ) ,
122+ ( "hbase.rest.ssl.keystore.type" . to_string ( ) , TLS_STORE_TYPE . to_string ( ) ) ,
118123 ] ) ;
119124 config. extend ( kerberos_principals ( & principal_host_part) ) ;
120125 config
@@ -132,7 +137,10 @@ pub fn kerberos_discovery_config_properties(
132137 "hbase.security.authentication" . to_string ( ) ,
133138 "kerberos" . to_string ( ) ,
134139 ) ,
135- ( "hbase.rpc.protection" . to_string ( ) , "privacy" . to_string ( ) ) ,
140+ (
141+ "hbase.rpc.protection" . to_string ( ) ,
142+ PROTECTION_PRIVACY . to_string ( ) ,
143+ ) ,
136144 ( "hbase.ssl.enabled" . to_string ( ) , "true" . to_string ( ) ) ,
137145 ] ) ;
138146 config. extend ( kerberos_principals ( & principal_host_part) ) ;
@@ -146,7 +154,10 @@ pub fn kerberos_ssl_server_settings() -> BTreeMap<String, String> {
146154 "ssl.server.keystore.location" . to_string ( ) ,
147155 format ! ( "{TLS_STORE_DIR}/keystore.p12" ) ,
148156 ) ,
149- ( "ssl.server.keystore.type" . to_string ( ) , "pkcs12" . to_string ( ) ) ,
157+ (
158+ "ssl.server.keystore.type" . to_string ( ) ,
159+ TLS_STORE_TYPE . to_string ( ) ,
160+ ) ,
150161 (
151162 "ssl.server.keystore.password" . to_string ( ) ,
152163 TLS_STORE_PASSWORD . to_string ( ) ,
@@ -250,7 +261,10 @@ fn truststore_settings(role: &str) -> BTreeMap<String, String> {
250261 format ! ( "ssl.{role}.truststore.location" ) ,
251262 format ! ( "{TLS_STORE_DIR}/truststore.p12" ) ,
252263 ) ,
253- ( format ! ( "ssl.{role}.truststore.type" ) , "pkcs12" . to_string ( ) ) ,
264+ (
265+ format ! ( "ssl.{role}.truststore.type" ) ,
266+ TLS_STORE_TYPE . to_string ( ) ,
267+ ) ,
254268 (
255269 format ! ( "ssl.{role}.truststore.password" ) ,
256270 TLS_STORE_PASSWORD . to_string ( ) ,
0 commit comments