Skip to content

RANGER-5567: allow validateConfig API available only for users with Ranger admin role#931

Open
vyommani wants to merge 3 commits intoapache:masterfrom
vyommani:RANGER-5567-clean-v2
Open

RANGER-5567: allow validateConfig API available only for users with Ranger admin role#931
vyommani wants to merge 3 commits intoapache:masterfrom
vyommani:RANGER-5567-clean-v2

Conversation

@vyommani
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

allow validateConfig API available only for users with Ranger admin role

How was this patch tested?

mvn clean install is success and added the new tests as well.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to restrict access to the ServiceREST.validateConfig API, and it also introduces Hive JDBC URL validation to block potentially dangerous JDBC parameters before connecting.

Changes:

  • Re-maps RangerAPIList.VALIDATE_CONFIG to a different UI/module association in RangerAPIMapping.
  • Adds a new JdbcUrlValidator and a comprehensive JUnit test suite for it.
  • Wires JDBC URL validation into HiveClient connection initialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
security-admin/src/main/java/org/apache/ranger/security/context/RangerAPIMapping.java Adjusts which UI tab/module is associated with VALIDATE_CONFIG for authorization decisions.
hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java Invokes JDBC URL validation prior to attempting a JDBC connection.
hive-agent/src/main/java/org/apache/ranger/services/hive/client/JdbcUrlValidator.java New validator that rejects JDBC URLs with prohibited/dangerous parameter names/patterns.
hive-agent/src/test/java/org/apache/ranger/services/hive/client/JdbcUrlValidatorTest.java New test coverage for URL validation, bypass attempts, and sanitization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vyommani vyommani closed this May 3, 2026
@vyommani vyommani force-pushed the RANGER-5567-clean-v2 branch from dfd593c to e8f8063 Compare May 3, 2026 03:32
@vyommani vyommani reopened this May 3, 2026
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.

2 participants