-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple keytab kerberos issue #674
base: master
Are you sure you want to change the base?
Multiple keytab kerberos issue #674
Conversation
박지은 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
@kkonstantine @snehashisp @zeun0725 |
@@ -274,7 +274,7 @@ private void configureKerberosAuthentication(Configuration hadoopConfiguration) | |||
hostname | |||
); | |||
UserGroupInformation.loginUserFromKeytab(principal, connectorConfig.connectHdfsKeytab()); | |||
final UserGroupInformation ugi = UserGroupInformation.getLoginUser(); | |||
final UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, connectorConfig.connectHdfsKeytab()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the line exceeds 100 characters, mvn checkstyle error occurs, so it would be a good idea to change it like this.
final UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI(principal, connectorConfig.connectHdfsKeytab()); | |
final UserGroupInformation ugi = UserGroupInformation.loginUserFromKeytabAndReturnUGI( | |
principal, | |
connectorConfig.connectHdfsKeytab() | |
); |
@zeun0725 |
@lala7573 |
Problem
If multiple key tabs are distributed on the connect server, authentication errors may occur.
example) A connector uses the test user keytab (write path: /hdfs/user/test), and B connector uses the test2 user keytab (write path: /hdfs/user/test2).
If both connectors are restarted due to certain circumstances, different key tab information can be imported with thread-based behavior.
If the B connector calls loginUserFromKeytab('test2@EXAMPLE.COM' , '/../test2.keytab') when the A connector calls getLoginUser(), A login as test2 user. So you can face the error as below.
Caused by: org.apache.ranger.authorization.hadoop.exceptions.RangerAccessControlException: Permission denied: user=test2, access=EXECUTE, inode="/hdfs/user/test"
Solution
When receiving an ugi instance, it was changed to authenticate with a keytab and receive it.
Change to use loginUserFromKeytabAndReturnUGI() func.
Does this solution apply anywhere else?
If yes, where?
Test Strategy
Testing done:
Release Plan