Kubernetes cluster multi-tenant access control method and device, computer equipment and storage medium

The Kubeconfig credentials are generated through the tenant controller and the access checksum audit is solved, which solves the shortcomings of security management requirements in Kubernetes cluster multi-tenant access control, and realizes efficient management of cluster resources and meets enterprise security requirements.

CN119089418APending Publication Date: 2024-12-06SHENZHEN HUAYUN ZHIXIANG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411192465.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing Kubernetes cluster multi-tenant access control method cannot effectively meet the security management needs of enterprises, especially in shared resource environments, and lacks fine-grained permission management and audit mechanisms.

Method used

The tenant controller is used to allocate resources and generate Kubeconfig permission credentials. Through access checksum credential verification, tenant operation data is obtained and audited, and audit audit results are persistently stored to realize security management and compliance analysis of tenant access.

Benefits of technology

Ensure the security and compliance of tenant resource access, support detailed security checks and compliance analysis, and achieve efficient management of cluster resources and meet enterprise security requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089418A_ABST
    Figure CN119089418A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a Kubernetes cluster multi-tenant access control method and device, computer equipment and a storage medium. The method comprises the following steps: allocating tenant resources by utilizing the tenant controller, and generating a Kubecfig authority certificate; obtaining an operation request of a tenant on the Kubernetes cluster; the operation request is subjected to access verification and verification of a Kubconfig permission certificate, so that a verification result is obtained; when the verification result is successful, acquiring data formed by the operation of the tenant in the Kubernetes cluster; performing operation auditing on the data to obtain an auditing result; and storing the audit result. By implementing the method provided by the embodiment of the invention, the safety requirement of an enterprise can be better met, and meanwhile, the efficient management of cluster resources is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a Kubernetes cluster management method, and more specifically to a Kubernetes cluster multi-tenant access control method, device, computer equipment and storage medium. Background Art

[0002] With the development of cloud-native technologies, Kubernetes has become the core operating system in the field of cloud computing. In order to improve resource utilization efficiency and simplify operation and maintenance management, the need for multiple tenants to share a single Kubernetes cluster has gradually emerged in real scenarios. For example, within an enterprise, different teams may share the same cluster. These teams have their own workspaces in the cluster and share computing, storage, and network resources.

[0003] However, this shared environment brings security issues to tenants' access to Kubernetes clusters. Currently, most solutions on the market manage permissions by controlling Namespace at the application system level, or adopt a one-size-fits-all approach to give super permissions to a few people. These methods usually cannot meet the security management needs of enterprises or industries.

[0004] Therefore, it is necessary to design a new method to better meet enterprise security requirements while achieving efficient management of cluster resources. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a Kubernetes cluster multi-tenant access control method, device, computer equipment and storage medium.

[0006] To achieve the above object, the present invention adopts the following technical solution: a Kubernetes cluster multi-tenant access control method, comprising:

[0007] Utilize the tenant controller to allocate tenant resources and generate Kubeconfig permission credentials;

[0008] Get the operation request made by the tenant to the Kubernetes cluster;

[0009] Perform admission verification on the operation request and verify the Kubeconfig permission credentials to obtain a verification result;

[0010] When the verification result is passed, the data generated by the tenant's operation in the Kubernetes cluster is obtained;

[0011] Conducting an operational audit on the data to obtain an audit result;

[0012] The audit results are stored.

[0013] Its further technical solution is: the tenant controller includes a custom controller component based on the cloud native Operator technology system.

[0014] The further technical solution is: the obtaining of the operation request of the tenant to the Kubernetes cluster includes:

[0015] Gets the operation requests initiated by tenants on the Kubernetes cluster through the API server.

[0016] The further technical solution is: the operation request is subjected to access verification and the Kubeconfig permission credential is verified to obtain a verification result, including:

[0017] Authentication of the operation request is performed by checking the IP address, user ID and hardware environment;

[0018] When the identity authentication is passed, determining the tenant's permission model according to the operation request;

[0019] Determine whether the Kubeconfig permission credential complies with the permission scope corresponding to the permission model;

[0020] If the Kubeconfig permission credential meets the permission scope corresponding to the permission model, the verification result is determined to be passed;

[0021] If the Kubeconfig permission credential does not conform to the permission scope corresponding to the permission model, the verification result is determined to be failed.

[0022] A further technical solution is: the operation audit of the data to obtain the audit result includes:

[0023] Performing classification operations on the data to obtain classification results;

[0024] Corresponding processing and recording are performed according to the classification results to obtain the audit results.

[0025] A further technical solution is: performing corresponding processing and recording according to the classification results to obtain audit results, including:

[0026] For operations whose classification results are high-risk and / or serious, corresponding notifications are generated and recorded to obtain audit results.

[0027] A further technical solution is: storing the audit results includes:

[0028] The audit results are persistently stored in the ETCD database.

[0029] The present invention also provides a Kubernetes cluster multi-tenant access control device, comprising:

[0030] A credential generation unit, used to allocate tenant resources using the tenant controller and generate Kubeconfig permission credentials;

[0031] An operation request acquisition unit, used to acquire operation requests from tenants to the Kubernetes cluster;

[0032] A verification unit, used to perform admission verification on the operation request and verify the Kubeconfig permission credentials to obtain a verification result;

[0033] An operation data acquisition unit, configured to acquire data generated by the tenant performing operations in the Kubernetes cluster when the verification result is passed;

[0034] An audit unit, used to perform an operation audit on the data to obtain an audit result;

[0035] A storage unit is used to store the audit result.

[0036] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.

[0037] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0038] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention allocates resources and generates Kubeconfig permission credentials through the tenant controller to ensure secure resource access management, performs access verification and credential verification on the tenant's operation request, and obtains and audits the operation data after the verification is passed to ensure operation compliance, store the audit results, and provide detailed records to support security inspections and compliance analysis, so as to achieve efficient resource management and meet the enterprise security requirements, thereby better meeting the enterprise security requirements and achieving efficient management of cluster resources.

[0039] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0041] Figure 1 A schematic diagram of an application scenario of the Kubernetes cluster multi-tenant access control method provided by an embodiment of the present invention;

[0042] Figure 2 A schematic diagram of a flow chart of a Kubernetes cluster multi-tenant access control method provided by an embodiment of the present invention;

[0043] Figure 3 A schematic diagram of a sub-process of a Kubernetes cluster multi-tenant access control method provided by an embodiment of the present invention;

[0044] Figure 4 A schematic diagram of a sub-process of a Kubernetes cluster multi-tenant access control method provided by an embodiment of the present invention;

[0045] Figure 5 A schematic diagram of the architecture of a tenant controller provided in an embodiment of the present invention;

[0046] Figure 6 A schematic diagram of a verification process provided by an embodiment of the present invention;

[0047] Figure 7 A schematic block diagram of a Kubernetes cluster multi-tenant access control device provided by an embodiment of the present invention;

[0048] Figure 8 A schematic block diagram of a verification unit of a Kubernetes cluster multi-tenant access control device provided by an embodiment of the present invention;

[0049] Fig. 9 A schematic block diagram of an audit unit of a Kubernetes cluster multi-tenant access control device provided in an embodiment of the present invention;

[0050] Fig.10 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0053] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0054] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0055] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of a Kubernetes cluster multi-tenant access control method provided in an embodiment of the present invention. Figure 2A schematic flow chart of a Kubernetes cluster multi-tenant access control method provided in an embodiment of the present invention. The Kubernetes cluster multi-tenant access control method is applied to a server. The server includes an API server and an access control component, wherein the tenant is integrated in a container cloud management platform, and the server interacts with the container cloud management platform and several Kubernetes clusters for data, connects the container cloud management platform and the Kubernetes cluster through an access control component, implements a new architecture design, and improves the management capability of permission access; supports multi-tenant solutions for container clouds, and can effectively manage and isolate resources of multiple tenants; supports mainstream access control models, such as RBAC (Role-Based Access Control), ABAC (Attribute-Based Access Control), and DAC (Discretionary Access Control), making the container cloud platform more flexible in selecting the underlying architecture; compared with the mainstream access control technology on the market, an autonomous audit agent is introduced to effectively enhance the security protection of Kubernetes cluster content.

[0056] Figure 2 Schematic diagram of the process of the Kubernetes cluster multi-tenant access control method provided by the embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S160.

[0057] S110. Allocate tenant resources using the tenant controller and generate Kubeconfig permission credentials.

[0058] In this embodiment, the Kubeconfig permission credential is the credential information required for the tenant to access the Kubernetes cluster.

[0059] The tenant controller includes a custom controller component based on the cloud native Operator technology system. Figure 5 , Operator consists of two main parts: CustomResource (custom resource) and TenantController (tenant controller).

[0060] CustomResource allows declaring and customizing tenant resources by extending the Kubernetes API.

[0061] TenantController consists of three components:

[0062] Kubeconfig (configuration management): information used to configure tenant resources.

[0063] Statefulset (resource creation): responsible for creating and managing Pods associated with tenants.

[0064] Service (traffic forwarding): used for Pod traffic forwarding and service discovery, processing and forwarding network traffic to tenant Pods.

[0065] In this embodiment, the Kubeconfig file contains the tenant's name, ID, resources, and proxy server (mainly including permission information). These credentials are the key authentication information required for the tenant to access the Kubernetes cluster.

[0066] The main steps to generate Kubeconfig permission credentials are as follows:

[0067] Tenant resource creation: In a cluster, each tenant will have a corresponding Custom Resource (CR) resource. This CR contains detailed information about the tenant.

[0068] Listen and generate credentials: TenantController will continuously listen to CR resource creation events in the cluster. Once it detects that a new CR resource is created, TenantController will automatically generate a Kubeconfig file containing tenant account information.

[0069] Credential content: The generated Kubeconfig file contains the basic information of the tenant (such as name and ID), the resources accessible to the tenant, and the address of the cluster's proxy server (proxy_server). This file is used to provide the tenant with the necessary permissions and configuration information to access the Kubernetes cluster.

[0070] By automatically generating and managing Kubeconfig files, the risks of manual operations and configuration errors are reduced, and management efficiency is improved. Each tenant has an independent Kubeconfig file to ensure that permissions and resource access between tenants are isolated, enhancing security and access control. TenantController can monitor and respond to changes in Custom Resource (CR) in real time, automatically update and adjust Kubeconfig files, thereby ensuring the latest and accuracy of tenant permission information. Tenants do not need to manually configure and manage access credentials. By automatically generating and distributing Kubeconfig files, users' operating procedures and management tasks are simplified. All tenants are ensured to use a unified credential generation process, which improves the consistency and standardization of operations and reduces potential problems caused by manual configuration. Centralized management and generation of credentials makes auditing and monitoring tenant access more efficient, helping operation and maintenance personnel track and manage permission usage.

[0071] S120. Obtain an operation request from a tenant for a Kubernetes cluster.

[0072] In this embodiment, an operation request for a Kubernetes cluster initiated by a tenant through an application programming interface server is obtained.

[0073] The operation requests include adding, deleting, modifying and checking the corresponding cluster.

[0074] S130: Perform access verification on the operation request and verify the Kubeconfig permission credentials to obtain a verification result.

[0075] In this embodiment, the verification result includes a pass verification result corresponding to a pass in the access verification and a pass in the credential verification, and a fail verification result corresponding to a pass in at most one of the access verification and the credential verification.

[0076] In one embodiment, see Figure 3 , the above-mentioned step S130 may include steps S131 to S135.

[0077] S131, performing identity authentication on the operation request by checking the IP address, user ID and hardware environment;

[0078] S132: When the identity authentication is passed, determining the tenant's permission model according to the operation request;

[0079] S133, judging whether the Kubeconfig permission credential complies with the permission scope corresponding to the permission model;

[0080] S134. If the Kubeconfig permission credential meets the permission scope corresponding to the permission model, determine that the verification result is passed;

[0081] S135. If the Kubeconfig permission credential does not conform to the permission scope corresponding to the permission model, determine that the verification result is failed.

[0082] In this example, see Figure 7 The admission controller and authentication controller in the access control component are important components to ensure the security and access control of the Kubernetes cluster. The admission controller is mainly responsible for preliminary verification and interception of requests through the API Server. Its workflow includes:

[0083] The admission controller intercepts all requests coming into the API Server. It analyzes and checks the requests according to the preset rules.

[0084] Check whether the IP address of the request source complies with the specified security policy.

[0085] Verify that the user ID making the request is within the allowed range.

[0086] Ensures that requests are initiated from an allowed hardware environment, which can help prevent requests from untrusted devices.

[0087] The authenticated request is forwarded to the next controller, the authentication controller.

[0088] The authentication controller is responsible for the final authorization verification of the request based on the policy and tenant permissions. Its workflow includes:

[0089] Based on the requested Token, the authentication controller determines the access control policy (such as RBAC, ABAC, DAC) corresponding to the Token.

[0090] Identify the access control model that the request applies to, that is, the tenant's permission model, such as RBAC (role-based access control), ABAC (attribute-based access control), or DAC (discretionary access control).

[0091] The authentication controller uses the permission information in the Kubeconfig file associated with the request to verify whether the request meets the tenant's permission scope.

[0092] Verify the permission scope of the request based on the tenant's permission configuration to ensure that the operation requested by the user is within the permitted permission scope.

[0093] If the request is verified to be in compliance with the regulations, the requested operation is allowed to be executed.

[0094] If the request does not meet the permission requirements, the operation is denied and the corresponding error message is returned.

[0095] In this embodiment, the access control model defines how to manage and control user access rights to system resources based on different standards and policies. These models determine the management method and policy of permissions, usually including role-based control (RBAC), attribute-based control (ABAC) and discretionary access control (DAC). They provide different frameworks and methods for permission verification.

[0096] Permission requirements refer to the specific permission conditions that a user or tenant needs to meet when performing a specific operation. These requirements are determined based on the rules defined by the access control model. For example, in RBAC, permission requirements are verified based on the user's role; in ABAC, they are verified based on the user's attributes and the context of the request; and in DAC, they are verified by the permissions set by the resource owner.

[0097] The access control model defines the criteria and verification methods for permission requirements. Permission requirements are the conditions that need to be met for specific operations and access requests, which are evaluated based on the selected access control model.

[0098] In summary, the access control model provides a framework for how to manage and verify permissions, while permission requirements are the specific conditions that need to be followed in actual operations. Together, these models and requirements ensure the security and compliance of the system.

[0099] In the above steps, the admission controller and the authentication controller are combined to provide double verification to ensure that the request meets security standards in all aspects; implementing fine permission control according to different access control models (RBAC, ABAC, DAC) helps to meet different security needs and compliance requirements; the authentication controller is compatible with mainstream access control models and provides a flexible permission management method to meet the needs of different organizations; it can dynamically adjust verification requests according to policy changes and tenant permissions to maintain consistency and accuracy of permission control; automated identity authentication and permission checks reduce human configuration errors and maintenance costs, and improve system stability; the admission controller and authentication controller can process requests in real time, improving the response speed and efficiency of the system; the controller records detailed logs of all verification and permission checks, which helps to audit and monitor access and ensure compliance; through unified policy and model management, it ensures the consistency of access control and helps to simplify compliance checks and management.

[0100] S140. When the verification result is passed, obtain data generated by the tenant's operation in the Kubernetes cluster.

[0101] In this embodiment, the data may include the following:

[0102] Operation log: API request log: records all requests to the Kubernetes API, including timestamp, request method (GET, POST, PUT, DELETE, etc.), request path, initiator's identity, request parameters, etc. Operation record: tracks the specific operations performed by tenants, such as operation records for creating, updating, or deleting resources.

[0103] Resource status:

[0104] Pod status: includes Pod creation time, running status (Pending, Running, Succeeded, Failed), container health status, logs, etc.

[0105] Service status: records the creation time, type (ClusterIP, NodePort, LoadBalancer), load balancing status of the service, etc.

[0106] Deployment status: includes Deployment configuration (such as replicas, policies), rolling update status, Pod replica status, etc.

[0107] ConfigMap and Secret: Store tenant configuration data and sensitive information (encryption and confidentiality measures must be ensured).

[0108] Resource quota and usage:

[0109] Resource quota: records the resource quotas allocated to tenants, including CPU, memory, storage and other limits.

[0110] Resource usage: Track the actual amount of resources used and compare it with the quota to help understand the actual situation of resource usage.

[0111] Access Control and Permissions:

[0112] Role and RoleBinding: record the tenant's role and permission configuration, including role definition, role binding, and permission granting.

[0113] ServiceAccount: records the ServiceAccount used by the tenant and its associated permissions.

[0114] Scheduling and health checks:

[0115] Scheduling decisions: Record the scheduling decisions of the Kubernetes scheduler, including the scheduling location of the Pod, node selection, etc.

[0116] Health check results: Record the health check results (Liveness Probe and Readiness Probe) of the Pod to help understand the health status of the Pod.

[0117] Events and Alerts:

[0118] Kubernetes events: record resource-related events, such as Pod startup, failure, and restart.

[0119] Alarms and notifications: Records alarms and notifications related to tenant resources, including resource anomalies, performance issues, etc.

[0120] Resources List:

[0121] Resource definition: records all resource lists defined by tenants in Kubernetes, including YAML files or JSON data of Deployment, Service, Ingress, ConfigMap, etc.

[0122] S150: Perform an operation audit on the data to obtain an audit result.

[0123] In this embodiment, the audit result refers to the result formed after the data is audited.

[0124] In one embodiment, see Figure 4 , the above-mentioned step S150 may include steps S151 to S152.

[0125] S151, performing classification operations on the data to obtain classification results.

[0126] In this embodiment, the classification result refers to the level of the operation, such as high risk, severe, etc.

[0127] S152. Perform corresponding processing and recording according to the classification results to obtain audit results.

[0128] In this embodiment, for operations whose classification results are high-risk and / or serious, corresponding notifications are generated and recorded to obtain audit results.

[0129] First, define the audit policy for the operation, and classify the operation into three levels: high-risk, serious, and normal. According to the policy, notification personnel can be set for high-risk and serious operations so that relevant persons in charge can be notified in a timely manner when these operations occur. When a high-risk or serious operation is triggered, the system will automatically send a notification to the preset interface personnel and record these operations in the system. You can set a threshold for the number of times a high-risk or serious operation is triggered. If the threshold is reached within a certain period of time, the system will automatically lock the operation permission and wait for the administrator to review the operation record before unlocking it. Automated audit policies facilitate future operation backtracking and redline setting to help monitor and constrain user operation behavior and prevent illegal operations.

[0130] This audit process not only ensures transparency and traceability of operations, but also helps maintain the security and compliance of the cluster.

[0131] S160: Store the audit results.

[0132] Specifically, the audit results are persistently stored in the ETCD database.

[0133] The method of this embodiment can more finely control the access rights of the Kubernetes cluster by decoupling from the front-end management system and providing an access control management method that is highly compatible with the permission model. This method is designed to better meet enterprise security requirements while achieving efficient management of cluster resources.

[0134] The above-mentioned Kubernetes cluster multi-tenant access control method allocates resources and generates Kubeconfig permission credentials through the tenant controller to ensure secure resource access management, performs admission verification and credential verification on the tenant's operation request, and obtains and audits the operation data after the verification to ensure operation compliance, store the audit results, and provide detailed records to support security inspections and compliance analysis, so as to achieve efficient resource management and meet the enterprise security requirements, thereby better meeting the enterprise security requirements and achieving efficient management of cluster resources.

[0135] Figure 7 Schematic block diagram of a Kubernetes cluster multi-tenant access control device 300 provided in an embodiment of the present invention. Figure 7 As shown, corresponding to the above Kubernetes cluster multi-tenant access control method, the present invention also provides a Kubernetes cluster multi-tenant access control device 300. The Kubernetes cluster multi-tenant access control device 300 includes a unit for executing the above Kubernetes cluster multi-tenant access control method, and the device can be configured in a server. Specifically, please refer to Figure 7The Kubernetes cluster multi-tenant access control device 300 includes a credential generation unit 301, an operation request acquisition unit 302, a verification unit 303, an operation data acquisition unit 304, an audit unit 305 and a storage unit 306.

[0136] The credential generation unit 301 is used to allocate tenant resources using the tenant controller and generate Kubeconfig permission credentials; the operation request acquisition unit 302 is used to obtain the operation request of the tenant to the Kubernetes cluster; the verification unit 303 is used to perform access verification on the operation request and verify the Kubeconfig permission credentials to obtain a verification result; the operation data acquisition unit 304 is used to obtain the data generated by the tenant's operation in the Kubernetes cluster when the verification result is passed; the audit unit 305 is used to perform an operation audit on the data to obtain an audit result; the storage unit 306 is used to store the audit result.

[0137] In one embodiment, the operation request acquisition unit 302 is used to acquire an operation request for a Kubernetes cluster initiated by a tenant through an application programming interface server.

[0138] In one embodiment, if Figure 8 As shown, the verification unit 303 includes an identity authentication subunit 3031 , a model determination subunit 3032 , a judgment subunit 3033 , a first determination subunit 3034 and a second determination subunit 3035 .

[0139] The identity authentication subunit 3031 is used to authenticate the operation request by checking the IP address, user ID and hardware environment; the model determination subunit 3032 is used to determine the tenant's permission model according to the operation request when the identity authentication is passed; the judgment subunit 3033 is used to judge whether the Kubeconfig permission credential conforms to the permission scope corresponding to the permission model; the first determination subunit 3034 is used to determine that the verification result is passed if the Kubeconfig permission credential conforms to the permission scope corresponding to the permission model; the second determination subunit 3035 is used to determine that the verification result is failed if the Kubeconfig permission credential does not conform to the permission scope corresponding to the permission model.

[0140] In one embodiment, if Fig. 9 As shown, the audit unit 305 includes a grading subunit 3051 and a processing subunit 3052 .

[0141] The grading subunit 3051 is used to perform grading operations on the data to obtain a grading result; the processing subunit 3052 is used to perform corresponding processing and recording according to the grading result to obtain an audit result.

[0142] In one embodiment, the storage unit 306 is used to persistently store the audit result in the ETCD database.

[0143] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned Kubernetes cluster multi-tenant access control device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and conciseness of the description, it will not be repeated here.

[0144] The Kubernetes cluster multi-tenant access control device 300 can be implemented in the form of a computer program. Fig.10 Runs on the computer device shown.

[0145] See also Fig.10 , Fig.10 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.

[0146] See also Fig.10 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0147] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a Kubernetes cluster multi-tenant access control method.

[0148] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0149] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a Kubernetes cluster multi-tenant access control method.

[0150] The network interface 505 is used to communicate with other devices over the network. Fig.10The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0151] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0152] The tenant controller is used to allocate tenant resources and generate Kubeconfig permission credentials; an operation request from the tenant to the Kubernetes cluster is obtained; the operation request is access-checked and the Kubeconfig permission credentials are verified to obtain a verification result; when the verification result is passed, data generated by the tenant's operation in the Kubernetes cluster is obtained; an operation audit is performed on the data to obtain an audit result; and the audit result is stored.

[0153] Among them, the tenant controller includes a custom controller component based on the cloud native Operator technology system.

[0154] In one embodiment, when the processor 502 implements the step of obtaining the operation request of the tenant to the Kubernetes cluster, it specifically implements the following steps:

[0155] Gets the operation requests initiated by tenants on the Kubernetes cluster through the API server.

[0156] In one embodiment, the processor 502 implements the following steps when implementing the step of performing access verification on the operation request and verifying the Kubeconfig permission credentials to obtain a verification result:

[0157] The operation request is authenticated by checking the IP address, user ID and hardware environment; when the identity authentication is passed, the tenant's permission model is determined according to the operation request; it is judged whether the Kubeconfig permission credential conforms to the permission scope corresponding to the permission model; if the Kubeconfig permission credential conforms to the permission scope corresponding to the permission model, the verification result is determined to be passed; if the Kubeconfig permission credential does not conform to the permission scope corresponding to the permission model, the verification result is determined to be failed.

[0158] In one embodiment, when the processor 502 implements the step of performing an operation audit on the data to obtain an audit result, the processor 502 specifically implements the following steps:

[0159] The data is subjected to operation classification to obtain classification results; and corresponding processing and recording are performed according to the classification results to obtain audit results.

[0160] In one embodiment, when the processor 502 implements the step of performing corresponding processing and recording according to the classification result to obtain the audit result, the processor 502 specifically implements the following steps:

[0161] For operations whose classification results are high-risk and / or serious, corresponding notifications are generated and recorded to obtain audit results.

[0162] In one embodiment, when implementing the step of storing the audit result, the processor 502 specifically implements the following steps:

[0163] The audit results are persistently stored in the ETCD database.

[0164] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0165] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0166] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:

[0167] The tenant controller is used to allocate tenant resources and generate Kubeconfig permission credentials; an operation request from the tenant to the Kubernetes cluster is obtained; the operation request is access-checked and the Kubeconfig permission credentials are verified to obtain a verification result; when the verification result is passed, data generated by the tenant's operation in the Kubernetes cluster is obtained; an operation audit is performed on the data to obtain an audit result; and the audit result is stored.

[0168] Among them, the tenant controller includes a custom controller component based on the cloud native Operator technology system.

[0169] In one embodiment, when the processor executes the computer program to implement the step of obtaining an operation request from a tenant to a Kubernetes cluster, the processor specifically implements the following steps:

[0170] Gets the operation requests initiated by tenants on the Kubernetes cluster through the API server.

[0171] In one embodiment, when the processor executes the computer program to implement the step of performing access verification on the operation request and verifying the Kubeconfig permission credentials to obtain a verification result, the processor specifically implements the following steps:

[0172] The operation request is authenticated by checking the IP address, user ID and hardware environment; when the identity authentication is passed, the tenant's permission model is determined according to the operation request; it is judged whether the Kubeconfig permission credential conforms to the permission scope corresponding to the permission model; if the Kubeconfig permission credential conforms to the permission scope corresponding to the permission model, the verification result is determined to be passed; if the Kubeconfig permission credential does not conform to the permission scope corresponding to the permission model, the verification result is determined to be failed.

[0173] In one embodiment, when the processor executes the computer program to implement the step of performing an operation audit on the data to obtain an audit result, the processor specifically implements the following steps:

[0174] The data is subjected to operation classification to obtain classification results; and corresponding processing and recording are performed according to the classification results to obtain audit results.

[0175] In one embodiment, when the processor executes the computer program to implement the step of performing corresponding processing and recording according to the classification result to obtain the audit result, the processor specifically implements the following steps:

[0176] For operations whose classification results are high-risk and / or serious, corresponding notifications are generated and recorded to obtain audit results.

[0177] In one embodiment, when the processor executes the computer program to implement the step of storing the audit result, the processor specifically implements the following steps:

[0178] The audit results are persistently stored in the ETCD database.

[0179] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0180] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0181] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0182] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0183] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0184] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A multi-tenant access control method for a Kubernetes cluster, characterized in that: include: Utilize the tenant controller to allocate tenant resources and generate Kubeconfig permission credentials; Get the operation request made by the tenant to the Kubernetes cluster; Perform admission verification on the operation request and verify the Kubeconfig permission credentials to obtain a verification result; When the verification result is passed, the data generated by the tenant's operation in the Kubernetes cluster is obtained; Conducting an operational audit on the data to obtain an audit result; The audit results are stored.

2. The Kubernetes cluster multi-tenant access control method according to claim 1, characterized in that: The tenant controller includes a custom controller component based on the cloud native Operator technology system.

3. The Kubernetes cluster multi-tenant access control method according to claim 1, characterized in that: The obtaining of the operation request of the tenant on the Kubernetes cluster includes: Gets the operation requests initiated by tenants on the Kubernetes cluster through the API server.

4. The Kubernetes cluster multi-tenant access control method according to claim 1, characterized in that: The operation request is subjected to admission verification and Kubeconfig permission credential verification to obtain a verification result, including: Authentication of the operation request is performed by checking the IP address, user ID and hardware environment; When the identity authentication is passed, determining the tenant's permission model according to the operation request; Determine whether the Kubeconfig permission credential complies with the permission scope corresponding to the permission model; If the Kubeconfig permission credential meets the permission scope corresponding to the permission model, the verification result is determined to be passed; If the Kubeconfig permission credential does not conform to the permission scope corresponding to the permission model, the verification result is determined to be failed.

5. The Kubernetes cluster multi-tenant access control method according to claim 4 is characterized in that: The performing of an operation audit on the data to obtain an audit result includes: Performing classification operations on the data to obtain classification results; Corresponding processing and recording are performed according to the classification results to obtain the audit results.

6. The Kubernetes cluster multi-tenant access control method according to claim 5, characterized in that: The corresponding processing and recording are performed according to the classification results to obtain the audit results, including: For operations whose classification results are high-risk and / or serious, corresponding notifications are generated and recorded to obtain audit results.

7. The Kubernetes cluster multi-tenant access control method according to claim 1, characterized in that: The storing of the audit result comprises: The audit results are persistently stored in the ETCD database.

8. A Kubernetes cluster multi-tenant access control device, characterized in that: include: A credential generation unit, used to allocate tenant resources using the tenant controller and generate Kubeconfig permission credentials; An operation request acquisition unit, used to acquire operation requests from tenants to the Kubernetes cluster; A verification unit, used to perform admission verification on the operation request and verify the Kubeconfig permission credentials to obtain a verification result; An operation data acquisition unit, configured to acquire data generated by the tenant performing operations in the Kubernetes cluster when the verification result is passed; An audit unit, used to perform an operation audit on the data to obtain an audit result; A storage unit is used to store the audit result.

9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.