RANGER-5333:Configurable Master key name for Ranger KMS DB with Luna HSM#680
Open
ChinmayHegde24 wants to merge 2 commits intoapache:masterfrom
Open
RANGER-5333:Configurable Master key name for Ranger KMS DB with Luna HSM#680ChinmayHegde24 wants to merge 2 commits intoapache:masterfrom
ChinmayHegde24 wants to merge 2 commits intoapache:masterfrom
Conversation
vikaskr22
reviewed
Sep 29, 2025
0646d50 to
585d349
Compare
6465e0a to
e5ee2a9
Compare
Contributor
dhavalshah9131
left a comment
There was a problem hiding this comment.
Hi @ChinmayHegde24 ,
Ref link : Thales doc
We should have some kind validation as per Thales guidelines for alias name string value.
Also we need to considering how KMS will behave in case of invalid name or consider documenting it.
vikaskr22
reviewed
Jan 27, 2026
| Key aesKey = new SecretKeySpec(key, MK_CIPHER); | ||
|
|
||
| myStore.setKeyEntry(ALIAS, aesKey, password.toCharArray(), (java.security.cert.Certificate[]) null); | ||
| myStore.setKeyEntry(alias, aesKey, password.toCharArray(), (java.security.cert.Certificate[]) null); |
Contributor
There was a problem hiding this comment.
@ChinmayHegde24 , it's not related to your change. But it would be better to add one check to verify if the key alias already exists or not , the way we check in generateMasterKey() method.
@dhavalshah9131 , is there any reason there is no check for key existence ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Master Key name is hard coded for Ranger KMS DB integration with Luna HSM.
Refer : https://github.com/apache/ranger/blob/master/kms/src/main/java/org/apache/hadoop/crypto/key/RangerHSM.java#L50
It is made configurable so CU can provide customised name.