FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

RANGER-5698 : Disable Unix Authentication Service by default by fimugdha · Pull Request #1171 · apache/ranger · GitHub

/ ranger Public

RANGER-5698 : Disable Unix Authentication Service by default - #1171

Open
fimugdha wants to merge 1 commit into
apache:masterfrom
fimugdha:RANGER-5698
Open

RANGER-5698 : Disable Unix Authentication Service by default#1171
fimugdha wants to merge 1 commit into
apache:masterfrom
fimugdha:RANGER-5698

Conversation

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The Unix Authentication service is rarely utilized for Ranger authentication, as the vast majority of deployments have migrated to modern alternatives like PAM or LDAP.

To optimize default startup behavior, we are removing the Unix Authentication service from the Ranger Usersync default startup sequence.

Moving forward, this service will run only if explicitly enabled via the ranger.usersync.unix.auth.enabled property within the ranger-ugsync-site.xml configuration file.

How was this patch tested?

  1. Brought up ranger core services: ranger, usersync, tagsync, pdp and kms in containers.
  2. Created a user on ranger & usersync containers.
  3. Set the password for the user.
  4. User got synced successfully on Ranger Admin.
  5. Login was successfully with the user password on Ranger Admin with PAM authentication.

fimugdha self-assigned this Aug 21, 2026
fimugdha requested a review from vyommani August 24, 2026 05:48

kumaab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks @fimugdha for the patch, added a few comments.

&& rm -f /home/ranger/dist/ranger-${RANGER_VERSION}-admin.tar.gz \
&& rm -f /opt/ranger/admin/install.properties \
&& mkdir -p /var/run/ranger /var/log/ranger /usr/share/java/ \
&& chmod 755 ${RANGER_SCRIPTS}/setup-ranger-shadow-group.sh \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Adding users/groups have moved to the base image: https://github.com/apache/ranger-tools/blob/main/docker/Dockerfile , please see this script: https://github.com/apache/ranger-tools/blob/0e27092aedb0db01be54300f2936a6244e80ec6c/docker/create_users_and_groups.sh#L1 if a user like shadow is really required to be added.

# To enable file based sync source for usersync do:
export ENABLE_FILE_SYNC_SOURCE=true

# Unix authentication service is disabled by default in docker (ENABLE_UNIX_AUTH=false).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The comment may be removed, it's not relevant in docker deployments.

private static final String SSL_TRUSTSTORE_FILE_TYPE_PARAM = "ranger.truststore.file.type";
private static final String SSL_KEYSTORE_PATH_PARAM = "ranger.usersync.keystore.file";
private static final String SSL_KEYSTORE_PATH_PASSWORD_PARAM = "ranger.usersync.keystore.password";
private static final String SSL_KEYSTORE_PATH_PARAM = "ranger.usersync.service.https.attrib.keystore.file";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

it seems setup.py still using "ranger.usersync.keystore.file" and ranger-ugsync-template.xml does not have entry of ranger.usersync.service.https.attrib.keystore.file ; am i missing something here.

</property>
<property>
<name>ranger.usersync.unix.backend</name>
<value>nss</value>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

what was the previous default value for this property?

static class UnixAuthenticationServiceThread extends Thread {
@Override
public void run() {
String[] params = {"-enableUnixAuth"};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

address this in ranger_usersync.py file as well

# SSL Authentication
AUTH_SSL_ENABLED=false
# SSL Authentication configuration to be used when unix authentication is enabled.
AUTH_SSL_ENABLED=true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

i think we should this also as false when ENABLE_UNIX_AUTH is false by default.

# Also, Unix authentication is enabled in Ranger Admin.
# defaults to false
ENABLE_UNIX_AUTH = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

what will happen to upgrade case by default. probably they have to edit this line if they want to continue with unixauth.

LOG.info("Service: {} - STOPPED", serviceName);
if (this.userSyncHAInitializerImpl != null) {
LOG.info("Stopping curator leader latch service as main thread is closing");
this.userSyncHAInitializerImpl.stop();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you test this once when unix auth is disabled and usersync is running in HA once.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL