pradeepagrawal8184 commented on code in PR #1188:
URL: https://github.com/apache/ranger/pull/1188#discussion_r3925733228


##########
kms/scripts/setup.sh:
##########
@@ -1112,6 +1114,37 @@ update_properties() {
                                updatePropertyToFilePy $propertyName 
$newPropertyValue $to_file_kms_site
                        fi
                fi
+               if [ "${ranger_kms_https_truststore_file}" != "" ] && [ 
"${ranger_kms_https_truststore_password}" != "" ]
+               then
+                       propertyName=ranger.service.https.attrib.truststore.file
+                       newPropertyValue="${ranger_kms_https_truststore_file}"
+                       updatePropertyToFilePy $propertyName $newPropertyValue 
$to_file_kms_site
+
+                       
policymgr_https_truststore_credential_alias=truststoreCredentialAlias
+                       
propertyName=ranger.service.https.attrib.truststore.credential.alias
+                       
newPropertyValue="${policymgr_https_truststore_credential_alias}"
+                       updatePropertyToFilePy $propertyName $newPropertyValue 
$to_file_kms_site
+
+                       if [ "${keystore}" != "" ]
+                       then
+                               
propertyName=ranger.service.https.attrib.truststore.pass
+                               newPropertyValue="_"
+                               updatePropertyToFilePy $propertyName 
$newPropertyValue $to_file_kms_site
+                               $PYTHON_COMMAND_INVOKER 
ranger_credential_helper.py -l "cred/lib/*" -f "$keystore" -k 
"$policymgr_https_truststore_credential_alias" -v 
"$ranger_kms_https_truststore_password" -c 1
+                       else
+                               
propertyName=ranger.service.https.attrib.truststore.pass

Review Comment:
   When keystore is set, password is written as _, credential helper runs, then 
a second block may overwrite with plaintext if the keystore file is missing. 
security-admin’s version is cleaner (fallback only inside the keystore != "" 
branch).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to