Skip to content

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

Merged
vikaskr22 merged 3 commits intoapache:masterfrom
ChinmayHegde24:RANGER-5333
Apr 30, 2026
Merged

RANGER-5333:Configurable Master key name for Ranger KMS DB with Luna HSM#680
vikaskr22 merged 3 commits intoapache:masterfrom
ChinmayHegde24:RANGER-5333

Conversation

@ChinmayHegde24
Copy link
Copy Markdown
Contributor

@ChinmayHegde24 ChinmayHegde24 commented Sep 22, 2025

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.

Test:
Successful creation of new master key with configured name
Noticed duplicate creation of key error if created with existing Master key name (as expected)
Successful mvn build

Comment thread kms/config/kms-webapp/dbks-site.xml Outdated
@ChinmayHegde24 ChinmayHegde24 force-pushed the RANGER-5333 branch 4 times, most recently from 6465e0a to e5ee2a9 Compare September 30, 2025 16:41
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ?

@vikaskr22
Copy link
Copy Markdown
Contributor

@ChinmayHegde24 , can you pls update the cases you have tested for this patch ? It would be helpful to review this PR.

@ChinmayHegde24
Copy link
Copy Markdown
Contributor Author

@ChinmayHegde24 , can you pls update the cases you have tested for this patch ? It would be helpful to review this PR.

Yeah please check it once now @vikaskr22

Copy link
Copy Markdown
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. Once CI pipeline is passed, it can be merged.

@vikaskr22
Copy link
Copy Markdown
Contributor

@kumaab , Above build-11 & plugin-docker-build is failing. Is it a known issue ? Can it be merged ?

@vikaskr22 vikaskr22 merged commit deeb432 into apache:master Apr 30, 2026
2 of 4 checks passed
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