Skip to content

RANGER-5333:Configurable Master key name for Ranger KMS DB with Luna HSM#680

Open
ChinmayHegde24 wants to merge 2 commits intoapache:masterfrom
ChinmayHegde24:RANGER-5333
Open

RANGER-5333:Configurable Master key name for Ranger KMS DB with Luna HSM#680
ChinmayHegde24 wants to merge 2 commits intoapache:masterfrom
ChinmayHegde24:RANGER-5333

Conversation

@ChinmayHegde24
Copy link
Contributor

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.

@ChinmayHegde24 ChinmayHegde24 force-pushed the RANGER-5333 branch 2 times, most recently from 0646d50 to 585d349 Compare September 30, 2025 15:51
@ChinmayHegde24 ChinmayHegde24 force-pushed the RANGER-5333 branch 2 times, most recently from 6465e0a to e5ee2a9 Compare September 30, 2025 16:41
Copy link
Contributor

@vikaskr22 vikaskr22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@dhavalshah9131 dhavalshah9131 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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);
Copy link
Contributor

@vikaskr22 vikaskr22 Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants