Authority management method and equipment for Kerberos and storage medium
By storing user permission information in the Ranger permission service and using proxy users and UserGroupInformation objects for Kerberos account management, the complexity of permission verification in the Kerberos authentication environment is solved, and resource saving and permission simplification are achieved.
Patent Information
- Application Number
- CN202411192336.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-28
AI Technical Summary
In the Kerberos authentication environment, Ranger permission management cannot take effect, causing users to be unable to switch keytab and krb5.conf in the virtual machine, resulting in excessive resource consumption and complex permission verification.
The user permission management information is stored in the Ranger permission service, and the Kerberos account permission management is carried out through the proxy user and the UserGroupInformation object, monitoring and determining whether the hive database accessed by the user complies with the permissions, and allowing or prohibiting the use of the Kerberos account.
It realizes permission management for Kerberos accounts without adding virtual machines, simplifies the permission authentication link, avoids the hidden dangers caused by Kerberos user switching, reduces resource consumption, and improves the efficiency of permission management.
Smart Images

Figure CN119089498A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of user rights allocation, and in particular to a rights management method, device and storage medium for Kerberos. Background Art
[0002] Kerberos is an identity authentication protocol based on symmetric key technology. As an independent and reliable third-party identity authentication service, it can provide identity authentication functions for other services and support Single Sign-On (SSO). That is, after client identity authentication, it can access multiple services such as HBase / HDFS (distributed storage system).
[0003] A Kerberos principal is used to uniquely identify an identity within the Kerberos cryptographic system. A keytab is a file containing principals and encrypted principal keys. krb5.conf is the primary Kerberos configuration file, where you configure the location of the KDC and the mapping of Kerberos domain hostnames.
[0004] Hadoop is an open source distributed computing platform under the Apache Software Foundation.
[0005] Hive is a data warehouse tool based on Hadoop, used for data extraction, transformation, and loading. It is a mechanism for storing, querying, and analyzing large-scale data stored in Hadoop.
[0006] Enabling Kerberos authentication in Hive ensures that both communicating parties can verify their identities and prevent data tampering or interception by unknown users or services. After Kerberos is enabled, all Hive client connections must provide a valid Kerberos ticket, which increases security.
[0007] Apache Ranger is a comprehensive data security management framework for the Hadoop platform, providing comprehensive security management for the entire Hadoop ecosystem. Users can use Ranger to securely access data within the cluster. It primarily monitors Hadoop platform components, launches services, and controls resource access.
[0008] Currently, when a business user relying on Ranger permission management needs to access a Hive database, the hive-jdbc driver is loaded into the JVM (Java Virtual Machine), a Kerberos account is selected, and the corresponding keytab file is loaded. Because the Kerberos account is used to log in to the VM, permissions maintained in Ranger are not effective. For example, Ranger specifies that user A can only access Hive database X. However, after user A passes Kerberos authentication, they can access all Hive databases.
[0009] To solve the above problem, you can configure corresponding permissions for different Kerberos accounts. However, since keytab and krb5.conf cannot be switched in a virtual machine, each Kerberos account requires a corresponding virtual machine when logging in, which consumes a lot of resources. Summary of the Invention
[0010] In view of the defects in the prior art, the present invention solves the technical problem of how to manage the permissions of Kerberos accounts without adding virtual machines, thereby significantly saving resources.
[0011] To achieve the above objectives, in the first aspect, an embodiment of the present application provides a permission management method for Kerberos, comprising the following steps: storing the user's permission management information in the user's Ranger permission service; when monitoring the user accessing the hive database, determining whether the accessed hive database meets the permissions of the current user; if so, allowing the current user to use the Kerberos account; otherwise, prohibiting the current user from using the Kerberos account.
[0012] In combination with the first aspect, in one embodiment, the process of storing the user's permission management information in the user's Ranger permission service includes: the business end creates a proxy user and synchronizes it to the Ranger permission service; configures the proxy user's permission management information, and calls the Ranger permission service to store the proxy user's permission management information.
[0013] In combination with the first aspect, in one embodiment, when a user is monitored accessing a hive database, the process of determining whether the accessed hive database complies with the current user's permissions includes: configuring Kerberos account information for the proxy user, and creating a hive database connection object through the proxy user; when a proxy user is monitored accessing the hive database, determining the permission management information of the proxy user in the Ranger permission service; and determining whether the hive database to be accessed complies with the permissions based on the permission management information.
[0014] In conjunction with the first aspect, in one embodiment, when a business end uses a proxy user to access a hive database, the proxy user is spliced in the connection path;
[0015] Set the environment variable "java.security.krb5.conf" in the Java program, build the Configuration object for Kerberos authentication, and create a UserGroupInformation object;
[0016] Use the information in the authentication file to set the identity credentials, Kerberos user and permission files of the UserGroupInformation object;
[0017] Perform user authentication by calling the UserGroupInformation object;
[0018] Returns the UserGroupInformation object that was successfully verified;
[0019] Inject the UserGroupInformation object into the proxy user and use the proxy user to create a Hive-Connection connection object.
[0020] In a second aspect, an embodiment of the present application provides a permission management system for Kerberos, which is used to: store the user's permission management information in the user's Ranger permission service; when monitoring the user accessing the hive database, determine whether the accessed hive database meets the permissions of the current user. If so, allow the current user to use the Kerberos account; otherwise, prohibit the current user from using the Kerberos account.
[0021] In combination with the second aspect, in one embodiment, the system's process of storing the user's permission management information in the user's Ranger permission service includes: the business end creates a proxy user and synchronizes it to the Ranger permission service; configures the proxy user's permission management information, and calls the Ranger permission service to store the proxy user's permission management information.
[0022] In combination with the second aspect, in one embodiment, when the system detects that a user accesses a hive database, the process of determining whether the accessed hive database complies with the current user's permissions includes: configuring Kerberos account information for the proxy user, and creating a hive database connection object through the proxy user; when detecting that the proxy user accesses the hive database, determining the permission management information of the proxy user in the Ranger permission service; and determining whether the hive database to be accessed complies with the permissions based on the permission management information.
[0023] In conjunction with the second aspect, in one embodiment, the system specifically includes:
[0024] The proxy user configuration module is used to: create a proxy user and synchronize it to the Ranger permission service; configure the permission management information of the proxy user and call the Ranger permission service to store the permission management information of the proxy user; when monitoring the proxy user accessing the Hive database, the proxy user is spliced in the connection path;
[0025] The Kerberos login environment configuration module is used to set the environment variable "java.security.krb5.conf" in the Java program and build the Configuration object for Kerberos authentication;
[0026] Create a UserGroupInformation object;
[0027] Use the information in the authentication file to set the identity credentials, Kerberos user and permission files of the UserGroupInformation object;
[0028] Perform user authentication by calling the UserGroupInformation object;
[0029] Returns the UserGroupInformation object that was successfully verified;
[0030] The database connection module is used to inject the UserGroupInformation object into the proxy user and use the proxy user to create the Hive-Connection connection object.
[0031] In a third aspect, an embodiment of the present application provides a permission management device for Kerberos, wherein the permission management device for Kerberos includes a processor, a memory, and a permission management program for Kerberos stored on the memory and executable by the processor, wherein when the permission management program for Kerberos is executed by the processor, the method provided in the first aspect is implemented.
[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a rights management program for Kerberos is stored, and when the computer program is executed, the method provided in the first aspect is implemented.
[0033] Compared with the prior art, the advantages of the present invention are:
[0034] The present invention stores the user's permission management information in the user's Ranger permission service and then authenticates through the Ranger permission service to achieve the purpose of allowing users who meet the permission to use Kerberos accounts and prohibiting users who do not meet the permission from using Kerberos accounts. Therefore, the present invention avoids the problem of being unable to use Ranger to perform permission verification when a Kerberos account logs into a Hive database, breaks down the barrier that prevents Hive users and Kerberos users from communicating with each other, uses the Hive user as a proxy user, and divides the process of connecting to the Hive database into two, each performing its own function. Only one Kerberos user and account are required to complete permission control, decoupling permission control from the complex Kerberos user.
[0035] On this basis, compared with the prior art in which a keytab file must be loaded and a Kerberos account and password must be used to connect to a Hive database with Kerberos authentication, the present invention avoids the need for a Hive user to create a Kerberos user, avoids the problem of switching keytab and krb5.conf in the same JVM process, eliminates the hidden dangers caused by Kerberos user switching, and only requires a Kerberos user with administrator privileges to perform login authentication, while the Hive user's privilege management is handed over to Ranger, which greatly simplifies the Hive privilege authentication link. The Kerberos configuration can be loaded when the service is started.
[0036] Therefore, the present invention can perform authority management on Kerberos accounts without adding virtual machines, thereby significantly saving resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 A schematic diagram of the process of configuring users and permissions in an embodiment of the present invention;
[0039] Figure 2 Schematic diagram of the process of the Kerberos rights management method in an embodiment of the present invention.
[0040] Figure 3 This is a schematic diagram of the hardware structure of the rights management device for Kerberos involved in the embodiment of the present application. DETAILED DESCRIPTION
[0041] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0042] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0043] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0044] First, the research and development process of this application is briefly described.
[0045] To manage Kerberos account permissions without adding additional virtual machines, business users can manually maintain Hive access permissions data without relying on the Ranger permission service. Hive users can access Hive using a specified Kerberos user and keytab file. This intercepts the call before the Hive-JDBC connection is made, parses the database and table names in the Hive-SQL statement, and checks the permission data for permissions, thus achieving multi-user permissions on the business side. However, this approach exponentially increases the development difficulty on the business side and increases the risk of parsing HiveSQL statements. It is cumbersome, difficult to maintain, and difficult to troubleshoot.
[0046] On this basis, in the first aspect, an embodiment of the present application provides a permission management method for Kerberos, comprising the following steps: storing the user's permission management information in the user's Ranger permission service; when monitoring the user accessing the hive database, determining whether the accessed hive database complies with the current user's permissions, and if so, allowing the current user to use the Kerberos account, otherwise prohibiting the current user from using the Kerberos account.
[0047] As can be seen from this, the present invention allows users who meet the permission to use Kerberos accounts and prohibits users who do not meet the permission to use Kerberos accounts by storing the user's permission management information in the user's Ranger permission service and then authenticating through the Ranger permission service. Therefore, the present invention avoids the problem of not being able to use Ranger for permission verification when a Kerberos account logs into the hive database, breaks down the barrier that prevents hive users and Kerberos users from communicating with each other, uses the hive user as a proxy user, and divides the process of connecting to the hive database into two, each performing its own function. Only one Kerberos user and account are needed to complete permission control, decoupling permission control from the complex Kerberos user.
[0048] On this basis, compared with the prior art in which a keytab file must be loaded and a Kerberos account and password must be used to connect to a Kerberos-authenticated Hive database, the present invention only requires one Kerberos account to implement different permission management, avoiding the need for a hive user to create a Kerberos user and a virtual machine, avoiding the problem of switching keytab and krb5.conf in the same JVM process, eliminating the hidden dangers caused by Kerberos user switching, and only requiring a Kerberos user with administrator privileges to perform login authentication, while the permission management of the hive user is handed over to Ranger, which greatly simplifies the hive permission authentication link. The Kerberos configuration can be loaded when the service is started.
[0049] In one embodiment, the process of storing the user's rights management information in the user's Ranger rights service in the above method includes: Figure 1 As shown, the business side creates (adds, deletes, modifies users, etc.) proxy users and synchronizes them to the Ranger permission service; configures the proxy user's permission management information (specific permissions and policies, such as authorizing the user to query, modify, delete, and add permissions for a specified Hive database), and calls the Ranger permission service to store the proxy user's permission management information.
[0050] On this basis, when the above method detects a user accessing a Hive database, the process of determining whether the accessed Hive database complies with the current user's permissions includes: configuring Kerberos account information for the proxy user and creating a Hive database connection object through the proxy user; when detecting a proxy user accessing a Hive database, determining the proxy user's permission management information in the Ranger permission service; and determining whether the Hive database to be accessed complies with the permissions based on the permission management information.
[0051] For details, see Figure 2 As shown, the specific process of the above method includes:
[0052] Step 1: When the business end uses a proxy user to access the Hive database, add the proxy user to the hive-jdbc-url connection path. The key is "hive.server2.proxy.user=" and the value is the name of the proxy user (such as abc). The completed example is:
[0053] jdbc:hive2: / / xxx.com:2181 / ; serviceDiscoveryMode=zooKeeper; zooKeeperNamespace=hiveserver2; auth=KERBEROS; principal=hive / _HOS T@xxx.COM; user.principal=xxx; user.keytab= / etc / user.keytab; hive.server2.proxy.user=abc;
[0054] Step 2: Construct a UserGroupInformation object. UserGroupInformation is a key class in Hadoop that manages user identity information, permissions, and credentials. UserGroupInformation transfers user identity information between components in the cluster for secure authentication and authorization.
[0055] Specifically: Set the environment variable "java.security.krb5.conf" in the Java program and build the Configuration object for Kerberos authentication.
[0056] Create a UserGroupInformation object.
[0057] Set authentication file and password: Use the information in the authentication file to set the identity credentials of the UserGroupInformation object, Kerberos user and permission file.
[0058] Verify user identity: User authentication is performed by calling the loginUserFromKeytabAndReturnUGI() method of the UserGroupInformation object.
[0059] Returns the UserGroupInformation object that was successfully verified.
[0060] The sample code is:
[0061] system.setProperty("java.security.krb5.conf",krb5Conf);
[0062] UserGroupInformation.setConfiguration(conf);
[0063] UserGroupInformation.loginUserFromKeytabAndReturnUGI(princi pal,keytabFile);
[0064] Step 3: Inject the UserGroupInformation object into the proxy user and use the proxy user to create a Hive-Connection object. The sample code is as follows:
[0065] Connection connection=
[0066] UserGroupInformation.createProxyUser("abc",userGroupInformatio n).doAs((PrivilegedAction <connection>)()->{
[0067] return DriverManager.getConnection(jdbcUrl);
[0068] });
[0069] After completing the above operations, you can log in and authenticate using a Kerberos account, construct a database connection object using a proxy user, and execute Hive-SQL statements. Hive-SQL and proxy user requests will be intercepted by the Ranger permission service for permission verification. This implements a multi-user permission management system in the Kerberos-Hive database.
[0070] In a second aspect, an embodiment of the present application also provides a permission management system for Kerberos, which is used to: store the user's permission management information in the user's Ranger permission service; when monitoring the user accessing the hive database, determine whether the accessed hive database meets the permissions of the current user. If so, allow the current user to use the Kerberos account; otherwise, prohibit the current user from using the Kerberos account.
[0071] In one embodiment, the process of storing the user's rights management information in the user's Ranger rights service of the above system includes: Figure 1 As shown, the business side creates (adds, deletes, modifies users, etc.) proxy users and synchronizes them to the Ranger permission service; configures the proxy user's permission management information (specific permissions and policies, such as authorizing the user to query, modify, delete, and add permissions for a specified Hive database), and calls the Ranger permission service to store the proxy user's permission management information.
[0072] On this basis, when the above system detects that a user accesses the hive database, the process of determining whether the accessed hive database complies with the current user's permissions includes: configuring Kerberos account information for the proxy user, and creating a hive database connection object through the proxy user; when detecting that the proxy user accesses the hive database, determining the proxy user's permission management information in the Ranger permission service; and determining whether the hive database to be accessed complies with the permissions based on the permission management information.
[0073] Specifically, the above system includes:
[0074] The proxy user configuration module is used to: create a proxy user and synchronize it to the Ranger permission service; configure the proxy user's permission management information and call the Ranger permission service to store the proxy user's permission management information; when a proxy user is detected accessing the Hive database, the proxy user is spliced into the hive-jdbc-url connection path, with the key being "hive.server2.proxy.user=" and the value being the proxy user's name (such as abc); the completed splicing example is as follows:
[0075] jdbc:hive2: / / xxx.com:2181 / ; serviceDiscoveryMode=zooKeeper; zooKeeperNamespace=hiveserver2; auth=KERBEROS; principal=hive / _HOS T@xxx.COM; user.principal=xxx; user.keytab= / etc / user.keytab; hive.server2.proxy.user=abc;
[0076] The Kerberos login environment configuration module is used to build a UserGroupInformation object. Specifically, it sets the environment variable "java.security.krb5.conf" in the Java program to build a Configuration object for Kerberos authentication.
[0077] Create a UserGroupInformation object.
[0078] Set authentication file and password: Use the information in the authentication file to set the identity credentials of the UserGroupInformation object, Kerberos user and permission file.
[0079] Verify user identity: User authentication is performed by calling the loginUserFromKeytabAndReturnUGI() method of the UserGroupInformation object.
[0080] Returns the UserGroupInformation object that was successfully verified.
[0081] The sample code is:
[0082] system.setProperty("java.security.krb5.conf",krb5Conf);
[0083] UserGroupInformation.setConfiguration(conf);
[0084] UserGroupInformation.loginUserFromKeytabAndReturnUGI(princi pal,keytabFile);
[0085] The database connection module is used to inject the UserGroupInformation object into the proxy user and use the proxy user to create the Hive-Connection connection object. The sample code is as follows:
[0086] Connection connection=
[0087] UserGroupInformation.createProxyUser("abc",userGroupInformatio n).doAs((PrivilegedAction <connection>)()->{
[0088] return DriverManager.getConnection(jdbcUrl);
[0089] });
[0090] After completing the above operations, you can log in and authenticate using a Kerberos account, construct a database connection object using a proxy user, and execute Hive-SQL statements. Hive-SQL and proxy user requests will be intercepted by the Ranger permission service for permission verification. This implements a multi-user permission management system in the Kerberos-Hive database.
[0091] In a third aspect, an embodiment of the present application provides a rights management device for Kerberos. The rights management device for Kerberos can be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0092] Reference Figure 3 , Figure 3 FIG2 is a schematic diagram of the hardware structure of a rights management device for Kerberos involved in an embodiment of the present application. In an embodiment of the present application, the rights management device for Kerberos may include a processor, a memory, a communication interface, and a communication bus.
[0093] The communication bus may be of any type and is used to interconnect the processor, memory, and communication interface.
[0094] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces, which interconnect components within the Kerberos rights management device and connect the Kerberos rights management device to other devices (e.g., other computing devices or user devices). Physical interfaces can include Ethernet, fiber, or ATM interfaces; user devices can include displays and keyboards.
[0095] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0096] The processor may be a general-purpose processor, which may call a rights management program for Kerberos stored in a memory and execute the rights management method for Kerberos provided in an embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the rights management program for Kerberos is called may refer to the various embodiments of the rights management method for Kerberos in this application, which will not be repeated here.
[0097] Those skilled in the art will understand that Figure 3 The hardware structure shown in the figure does not constitute a limitation to the present application and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0098] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0099] The computer-readable storage medium of the present application stores a rights management program for Kerberos, wherein when the rights management program for Kerberos is executed by a processor, the steps of the rights management method for Kerberos described above are implemented.
[0100] Among them, the method implemented when the Kerberos rights management program is executed can refer to the various embodiments of the Kerberos rights management method of this application, and will not be repeated here.
[0101] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device to execute the methods described in each embodiment of the present application.
[0103] The terms "including" and "having," and any variations thereof, in the specification and claims of this application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus. The terms "first," "second," and "third" are used to distinguish between different objects, etc., and do not indicate a sequential order, nor do they limit the "first," "second," and "third" to different types.
[0104] In the description of the embodiments of this application, words such as "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0105] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two.
[0106] In some processes described in the embodiments of the present application, multiple operations or steps are included that appear in a specific order. However, it should be understood that these operations or steps may not be performed in the order in which they appear in the embodiments of the present application or may be performed in parallel. The sequence numbers of the operations are only used to distinguish between different operations, and the sequence numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be performed in sequence or in parallel, and these operations or steps may be combined.
[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device to execute the methods described in each embodiment of the present application.
[0108] The above are only specific implementations of the embodiments of the present invention, but the scope of protection of the embodiments of the present invention is not limited to them. Any person skilled in the art can easily conceive of various equivalent modifications or replacements within the technical scope disclosed in the embodiments of the present invention, and such modifications or replacements should be included in the scope of protection of the embodiments of the present invention. Therefore, the scope of protection of the embodiments of the present invention should be based on the scope of protection of the claims.< / connection> < / connection>
Claims
1. A method for Kerberos rights management, characterized in that: The method comprises the following steps: storing the permission management information of the user in the user's Ranger permission service; when monitoring the user accessing the hive database, judging whether the accessed hive database complies with the permission of the current user, if so, allowing the current user to use the Kerberos account, otherwise prohibiting the current user from using the Kerberos account.
2. The Kerberos rights management method according to claim 1, wherein: The process of storing the user's rights management information in the user's Ranger rights service includes: the business end creates a proxy user and synchronizes it to the Ranger rights service; configures the rights management information of the proxy user, and calls the Ranger rights service to store the rights management information of the proxy user.
3. The Kerberos rights management method according to claim 2, wherein: When the user is monitored to access the hive database, the process of judging whether the accessed hive database meets the permissions of the current user includes: configuring Kerberos account information for the proxy user, and creating a hive database connection object through the proxy user; when the proxy user is monitored to access the hive database, determining the permission management information of the proxy user in the Ranger permission service; judging whether the hive database to be accessed meets the permissions according to the permission management information.
4. The Kerberos rights management method according to claim 3, wherein: When the business end uses a proxy user to access the hive database, the proxy user is added to the connection path; Set the environment variable "java.security.krb5.conf" in the Java program, build the Configuration object for Kerberos authentication; create a UserGroupInformation object; Use the information in the authentication file to set the identity credentials, Kerberos user and permission file of the UserGroupInformation object; Perform user authentication by calling the UserGroupInformation object; Returns the UserGroupInformation object that was successfully verified; Inject the UserGroupInformation object into the proxy user and use the proxy user to create a Hive-Connection connection object.
5. A rights management system for Kerberos, characterized in that: The system is used to: store the user's permission management information in the user's Ranger permission service; when monitoring the user's access to the hive database, determine whether the accessed hive database meets the current user's permissions. If so, allow the current user to use the Kerberos account, otherwise prohibit the current user from using the Kerberos account.
6. The rights management system for Kerberos as claimed in claim 5, characterized in that: The process of storing the rights management information of the user in the Ranger rights service of the user includes: the business end creates a proxy user and synchronizes it to the Ranger rights service; configures the rights management information of the proxy user, and calls the Ranger rights service to store the rights management information of the proxy user.
7. The rights management system for Kerberos as claimed in claim 6, characterized in that: When the system detects that a user accesses a hive database, the process of determining whether the accessed hive database complies with the permissions of the current user includes: configuring Kerberos account information for a proxy user, and creating a hive database connection object through the proxy user; when detecting that a proxy user accesses a hive database, determining the permission management information of the proxy user in the Ranger permission service; and determining whether the hive database to be accessed complies with the permissions based on the permission management information.
8. The rights management system for Kerberos as claimed in claim 7, characterized in that: The system specifically comprises: The proxy user configuration module is used to: create a proxy user and synchronize it to the Ranger permission service; configure the permission management information of the proxy user, call the Ranger permission service to store the permission management information of the proxy user; when monitoring the proxy user accessing the hive database, splice the proxy user in the connection path; Kerberos login environment configuration module, which is used to: set the environment variable "java.security.krb5.conf" in the Java program and build the Configuration object for Kerberos authentication; Create a UserGroupInformation object; Use the information in the authentication file to set the identity credentials, Kerberos user and permission file of the UserGroupInformation object; Perform user authentication by calling the UserGroupInformation object; Returns the UserGroupInformation object that was successfully verified; The database connection module is used to inject the UserGroupInformation object into the proxy user and use the proxy user to create the Hive-Connection connection object.
9. A rights management device for Kerberos, characterized in that: The rights management device for Kerberos includes a processor, a memory, and a rights management program for Kerberos stored in the memory and executable by the processor, wherein when the rights management program for Kerberos is executed by the processor, the steps of the rights management method for Kerberos as described in any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a rights management program for Kerberos, wherein when the rights management program for Kerberos is executed, the steps of the rights management method for Kerberos as claimed in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Permission control method for SparkSQL thriftserver query and Hive operation
CN110175164A
Big data platform user information synchronization and management method and system
CN117221319A
Data access method and device, electronic equipment and storage medium
CN118536128A
Partition authorization method, apparatus and device, and computer-readable storage medium
WO2020238359A1
