Disclosure of Invention
One or more embodiments of the present disclosure describe a cloud platform management system and an authentication method for multiple clusters and multiple users, which can meet the authority control requirements of different services and services, can perform role-based access control RBAC authentication on simple services or services, and can use role-based access control RBAC and attribute-based access control ABAC authentication on complex services or services.
In a first aspect, embodiments of the present disclosure provide a multi-cluster multi-user oriented cloud platform management system, including at least one cloud platform, where each cloud platform may deploy different types of clusters; each cloud platform is configured with an IAM service, and the IAM service is provided with an API interface facing user access; the IAM service includes a Keystone component for supporting role-based access control RBAC authentication and a Casbin component for supporting attribute-based access control ABAC authentication; the Casbin component is integrated into the Keystone component, so that each cloud platform firstly carries out role-based access control RBAC authentication on the received API access request, and if the role-based access control RBAC authentication is successful, the authentication is finished and an access result is returned to the user; and if the role-based access control RBAC authentication fails, performing attribute-based access control ABAC authentication.
In some embodiments, the IAM service of each cloud platform is further configured with a synchronization service; when there are two or more cloud platforms, the IAM service of a certain cloud platform serves as a master service that synchronizes information data to the IAM service of other cloud platforms serving as slave services.
In some embodiments, when the IAM service of a certain cloud platform is used as a master service, the master service synchronizes information data to the IAM service of other cloud platforms as slave services, including:
when an IAM service of a certain cloud platform receives an API access request, the IAM service of the cloud platform serves as a master service, changes, caused by the API access request, on information data are synchronously distributed to IAM services of other cloud platforms serving as slave services.
In some embodiments, when the IAM service of a certain cloud platform is used as a master service, the master service synchronizes information data to the IAM service of other cloud platforms as slave services, and the method further includes:
when the slave service does not receive the API access request during the process of distributing the API access request to the slave service by the master service, the slave service periodically acquires information data of the master service and performs information data synchronization.
In some embodiments, the cloud platform may deploy any one type of OpenStack cluster, kubernetes cluster, cluster integrated with OpenStack and Kubernetes, openStack cluster deployed with Kubernetes.
In some embodiments, the IAM service has a user access oriented API interface that is a RESTful API interface.
In a second aspect, embodiments of the present disclosure provide an authentication method, where the method is performed on any one of the cloud platforms in the system described in the first aspect; the method comprises the following steps:
receiving an API access request sent by a user;
Performing role-based access control RBAC authentication on the API access request by using a Keystone component of the fusion Casbin component; when the role-based access control RBAC authentication is successful, returning an access result to the user; and when the access control RBAC authentication based on the role fails, performing attribute-based access control ABAC authentication on the API access request by utilizing a Keystone component of the fusion Casbin component, and when the attribute-based access control ABAC authentication is successful, returning an access result to the user, otherwise, returning authentication failure to the user.
In some embodiments, the role-based access control RBAC authentication of API access requests using the Keystone component of the converged Casbin component includes:
analyzing the API access request to obtain token data and operation information of the user; wherein the operation information comprises an operation type and request information;
Based on the operation type of the operation information, obtaining RBAC authentication rules corresponding to the operation type from an RBAC authentication rule table; the RBAC authentication rule table stores a plurality of RBAC authentication rules, and each RBAC authentication rule comprises an operation role and an operation type;
analyzing the token data of the user to obtain user information, role information and project information;
matching the role information of the user with the operation roles in the RBAC authentication rules, if so, controlling RBAC authentication based on the access of the roles, otherwise, failing authentication.
In some embodiments, the performing attribute-based access control ABAC authentication on the API access request using the Keystone component of the fusion Casbin component includes:
Based on the operation type of the operation information, obtaining an ABAC authentication rule corresponding to the operation type from an ABAC authentication rule table; the ABAC authentication rule table stores a plurality of ABAC authentication rules, and each ABAC authentication rule comprises an operation type and an operation object; the request information and the operation object comprise service names, access area IDs and access resource information;
And matching the request information of the operation information with the operation object in the obtained ABAC authentication rule, if so, successfully authenticating the access control ABAC based on the attribute, returning an access result to the user, and otherwise, returning authentication failure to the user.
In some embodiments, the method further comprises: before receiving an API request for authentication, each cloud platform configures an RBAC authentication rule table and an ABAC authentication rule table; the RBAC authentication rule table is configured in a file form, and the ABAC authentication rule table is configured in a database form.
The technical scheme provided by some embodiments of the present specification has the following beneficial effects:
In one or more embodiments of the present disclosure, a system of an embodiment of the present disclosure includes at least one cloud platform capable of deploying different types of clusters, and by deploying an IAM service of a Keystone component fused with Casbin components in the cloud platform, role-based access control RBAC authentication and attribute-based access control ABAC authentication can be simultaneously implemented, so that not only role-based access control RBAC authentication in a simple service or service scenario, but also role-based access control RBAC authentication and attribute-based access control ABAC authentication in a complex service or service scenario can be satisfied; furthermore, the IAM service is also configured with synchronization capability, so that the IAM service provides unified authentication and authorization services of multiple clusters in the cloud platform.
Detailed Description
The technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification.
The terms first, second, third and the like in the description and in the claims and in the above drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
The existing OpenStack cloud platform (mainstream open source virtualized dispatch cloud platform) only supports multi-user role-based access control RBAC authentication for a single OpenStack cluster. The Kubernetes cloud platform (mainstream open source container cloud scheduling platform) supports multi-user based role-based access control RBAC or attribute-based access control ABAC authentication, but cannot support both at the same time, and cannot share the same authentication service for multiple heterogeneous cloud platforms. In an actual production environment, we often need to perform unified authentication management on multiple self-built IaaS (Infrastructure AS A SERVICE as a service) clouds, container clouds, and other public/private cloud platforms of a nanotube, and in the management and operation processes, role-based access control RBAC authentication and role-based access control ABAC authentication need to be simultaneously utilized.
Role-based access control RBAC authentication is a common method of rights control that primarily focuses on the roles of users in an organization or system, and the rights possessed by those roles. The method is suitable for a scene with definite organization structure and relatively fixed roles and responsibilities. For example, in an in-enterprise system, employees may be assigned different roles, each role having particular rights, to access or operate particular resources, depending on their job or department.
Access control ABAC authentication based on rights is a more flexible and fine-grained rights control method. It decides the access control policy based on attributes of the user, the resource, the environment, etc. The method is suitable for scenes in which a large number of users and resources need to be processed and the permission needs are complex and changeable. For example, in a cloud computing environment, users and resources may have a variety of attributes, such as geographic location, time, device type, etc., from which access control policies may be dynamically formulated and enforced by rights-based access control ABAC authentication.
Thus, different businesses and services need to select the proper authentication mode according to the characteristics and requirements. For example, some simple businesses or services may only require the use of role-based access control RBAC authentication, while some complex businesses or services may require the use of a combination of role-based access control RBAC authentication and attribute-based access control ABAC authentication to meet their more complex and sophisticated rights control requirements.
Therefore, the embodiment of the specification provides a cloud platform management system for multiple clusters and multiple users, and each cloud platform in the system has the capabilities of role-based access control RBAC authentication and attribute-based access control ABAC authentication so as to support the authentication requirements of complex cloud platforms.
The system of the embodiment of the specification comprises at least one cloud platform, and each cloud platform can be deployed with different types of clusters, such as an OpenStack cluster, a Kubernetes cluster, a cluster integrated with OpenStack and Kubernetes, an OpenStack cluster deployed with Kubernetes, and the like.
When there is one cloud platform, the cloud platform may deploy one or two or more identical clusters, or may deploy one or two or more different types of clusters.
When there are two or more cloud platforms, each cloud platform may deploy one or two or more identical clusters, or may deploy one or two or more different types of clusters.
Taking fig. 1 as an example, in fig. 1, there are four cloud platforms located in the areas-1, -2, -3, and-4, respectively. The cloud platform at the area-1 and the cloud platform at the area-2 are respectively provided with a cluster, namely an OpenStack-1 cluster and an OpenStack-2 cluster. The cloud platform at region-3 and the cloud platform at region-4 are each deployed with two clusters, kubeClipper and Kubernetes-3, kubeClipper and Kubernetes-4, respectively. The KubeClipper cluster is a cluster of an open source Kubernetes cloud platform facing the AI application.
Each cloud platform is configured with IAM (IDENTITY AND ACCESS MANAGEMENT ) services.
The IAM service includes a Keystone component and a Casbin component. The Keystone component is used for providing unified verification, and can provide perfect role-based access control RBAC authentication service. The Casbin component is an authorization library that supports access control models, such as attribute-based access control ABAC, and Casbin component can support attribute-based access control ABAC authentication services.
The Casbin component merges into the Keystone component. Specifically, casbin Python development suite is introduced, so that the two are fused, and the fused IAM service can simultaneously support role-based access control RBAC authentication and attribute-based access control ABAC authentication. That is, the IAM service of the Keystone component, the native support role-based access control RBAC authentication, adds Casbin attribute-based access control ABAC authentication of the component on the basis of honoring the role-based access control RBAC authentication.
Taking fig. 1 as an example, there is a respective Keystone (IAM) component in each region that provides authentication of role-based access control RBAC and attribute-based access control ABAC for services within its cluster.
The IAM service has an API interface for user access. The API interface is an application programming interface, which is a set of rules and protocols that define how the different software components communicate and interact with each other. The API interface may be a RESTful API interface that uses standard HTTP request methods (e.g., GET, POST, PUT, DELETE) to access and manipulate resources, typically using JSON or XML formats to transfer data.
The IAM service of each cloud platform is also configured with a synchronous service; when there are two or more cloud platforms, the IAM service of a certain cloud platform serves as a master service that synchronizes information data to the IAM service of other cloud platforms serving as slave services.
Taking fig. 1 as an example, in fig. 1, there are four cloud platforms, and the IAM service of the cloud platform at the area-1 is an IAM master service, and the IAM service of the cloud platform at the areas-2, -3 and-4 is an IAM slave service. The IAM master service at the area-1 synchronizes information data to the IAM slave service at the area-2, the area-3, and the area-4 using the IAM synchronization service.
Specifically, when the IAM service of a certain cloud platform is used as a master service, the master service synchronizes information data to the IAM service of other cloud platforms serving as slave services, and the method comprises the following steps:
when an IAM service of a certain cloud platform receives an API access request, the IAM service of the cloud platform serves as a master service, changes, caused by the API access request, on information data are synchronously distributed to IAM services of other cloud platforms serving as slave services.
When the master service receives an API access request to perform creation, update or deletion operation, the synchronous service distributes the request to the slave service at the same time and performs corresponding operation. This maintains data consistency between the master and slave services.
In addition, when the IAM service of a certain cloud platform is used as a master service, the master service synchronizes information data to the IAM service of other cloud platforms serving as slave services, and the method further comprises the following steps:
when the slave service does not receive the API access request during the process of distributing the API access request to the slave service by the master service, the slave service periodically acquires information data of the master service and performs information data synchronization.
Assuming that during this process, the slave service has unexpectedly not received an API access request (e.g., network disruption, service abnormality, and service unavailability), the slave service periodically acquires information data from the master service for synchronization. For example, synchronization is performed in a delta manner. The slave service periodically acquires information data from the master service, compares the information data with the information data of the current slave service, acquires the information data which the current slave service does not have, and then performs corresponding data update. In addition, even if the cloud platform corresponding to the slave service is disconnected from the master service network, the slave service can ensure that the authentication service is normal under the synchronous service.
The system of the embodiment of the specification further comprises a service gateway, wherein the service gateway is used for acquiring the operation requirement of the user, converting the operation requirement of the user into an API access request through an API interface and sending the API access request to a certain cloud platform.
The cloud platform firstly authenticates the received API access request based on the role access control RBAC, and if the role access control RBAC authentication is successful, the authentication is finished and an access result is returned to the user; and if the role-based access control RBAC authentication fails, performing attribute-based access control ABAC authentication.
As shown in fig. 2, the embodiment of the present disclosure further provides an authentication method, which is performed by any one of the cloud platforms in the above system. The method comprises the following steps:
Step 102, receiving an API access request sent by a user;
104, performing role-based access control RBAC authentication on the API access request by using a Keystone component of the converged Casbin component; when the role-based access control RBAC authentication is successful, returning an access result to the user; and when the access control RBAC authentication based on the role fails, performing attribute-based access control ABAC authentication on the API access request by utilizing a Keystone component of the fusion Casbin component, and when the attribute-based access control ABAC authentication is successful, returning an access result to the user, otherwise, returning authentication failure to the user.
The method of the embodiment of the specification can only perform role-based access control RBAC authentication on the API access request by using the Keystone component fused with Casbin components, or can re-use attribute-based access control ABAC authentication after the role-based access control RBAC authentication fails. This allows different authentication requirements to be met.
Next, each step will be described in detail.
In step 102, the API access request includes token data and operation information for the user.
Before the cloud platform is put into use, each cloud platform is default provided with a plurality of roles, for example, a total manager admin, a system manager system_admin, a system reader system_reader, a project manager project_admin, a project member project_member, a project reader project_reader, and the like, and a new role can be defined. The platform manager can bind roles for different users (including principal users and tenants) of the cloud platform, so that the cloud platform has different roles under different users.
After the user logs in, token data (namely token data) of the corresponding user is returned, wherein the token data comprises user information, role information, project information and the like.
The operation information includes an operation type and request information. The operation types may include operations of deleting, querying, creating, updating, etc. of different service contents. For example, the operation type may be identified as "identity: delete_user" for performing a delete operation of the authentication service. The request information includes a service name, an access area ID, and access resource information. The request information can determine what service access is performed on what resources on which cloud platform.
In step 104, role-based access control RBAC authentication and attribute-based access control ABAC authentication are performed sequentially. After successful authentication with role-based access control RBAC, attribute-based access control ABAC authentication is no longer required. When authentication fails with role-based access control RBAC, attribute-based access control ABAC authentication is required.
The role-based access control RBAC authentication for the API access request using the Keystone component of the converged Casbin component includes:
step A11, analyzing the API access request to obtain token data and operation information of a user;
step A13, based on the operation type of the operation information, obtaining RBAC authentication rules corresponding to the operation type from an RBAC authentication rule table;
The RBAC authentication rule table stores a plurality of RBAC authentication rules, and each RBAC authentication rule comprises an operation role and an operation type. For example, the rule "identity: delete_user" is "role: admin". "identity: delete_user" is the operation type, and "role: admin" is the operation role.
Step A15, analyzing the token data of the user to obtain user information, role information and project information;
And step A17, matching the role information of the user with the operation roles in the RBAC authentication rules, if so, controlling RBAC authentication based on the access of the roles, otherwise, failing authentication.
Taking the deletion operation of the authentication service as an example, the operation type of "identity: delete_user" is first used to match a certain RBAC authentication rule in the RBAC authentication rule table. Then, compare role is admin to decide whether to allow execution of the subsequent logic of this API.
In the matching process, when one rule in the RBAC authentication rule table can be matched, the other rules in the RBAC authentication rule table are not required to be matched. For example, the operation type "identity: delete_user" is first used to match a plurality of RBAC authentication rules in the RBAC authentication rule table, each RBAC authentication rule corresponding to a different role. After the operation type and the operation role of one RBAC authentication rule are successfully matched, other rules do not need to be matched one by one.
The performing attribute-based access control (ABAC) authentication on the API access request by using the Keystone component of the fusion Casbin component comprises the following steps:
step B11, based on the operation type of the operation information, obtaining an ABAC authentication rule corresponding to the operation type from an ABAC authentication rule table;
the ABAC authentication rule table stores a plurality of ABAC authentication rules, and each ABAC authentication rule comprises an operation type and an operation object.
Each ABAC authentication rule also contains a rule name, a rule description, a rule efficacy (either allowing execution or denying execution). The operation type is identified by "service_type", for example, "service_type" is "identity", i.e. the operation type is authentication service.
The request information and the operation object each include a service name, an access area ID, and access resource information.
And step B13, matching the request information of the operation information with the operation object in the obtained ABAC authentication rule, if so, successfully authenticating the access control ABAC based on the attribute, returning an access result to the user, and otherwise, returning authentication failure to the user.
Before the method is put into application, a platform administrator or a user administrator can bind corresponding ABAC authentication rules for different users of the cloud platform aiming at different resource classes or specific resources. After the user logs in, corresponding token data including information of the user, the project, the role and the like is returned.
And B13, when the request information is matched with the service name, the access area ID and the access resource information in the operation object, the authentication is considered to be successful, otherwise, the authentication is failed.
Specifically, the matching judgment is performed layer by layer. For example, the { service_type }: { service_name: { region_id }: { resource_type } is matched layer by layer in sequence, i.e., the operation type, the service name, the access region ID, and the access resource information are matched layer by layer. If the matching is successful, the resource type has access rights in the area; conversely, none of the resource types has access rights in this region.
If the access resource information is not the resource type { resource_type }, but the resource ID { resource_id }, the matching is successful only when the resource_id is identical, the resource ID has access rights in the area, and other resource IDs cannot be accessed even if the resource IDs belong to the same resource type. Conversely, this resource ID does not have access rights in this area.
In the matching process, when one rule in the ABAC authentication rule table can be matched, other rules in the ABAC authentication rule table are not required to be matched.
Each API access request is sequentially authenticated by role-based access control RBAC and attribute-based access control ABAC. When the role-based access control RBAC authentication is successful, attribute-based access control ABAC authentication is not required.
The authentication process uses a white list rule, and follows the short circuit principle. For example, when a role is matched as a manager, all resources of the region can be accessed without performing attribute-based access control (ABAC) authentication.
The method of the embodiment of the specification further comprises the following steps: before receiving an API request for authentication, each cloud platform configures an RBAC authentication rule table and an ABAC authentication rule table; the RBAC authentication rule table is configured in a file form, and the ABAC authentication rule table is configured in a database form.
The RBAC authentication rules table is configured by predefining a policy. Yaml static file. Typically this file is self-defining by the respective services that make up the cloud platform.
The ABAC authentication rule table is formed by inserting system rule information into ABAC _ policies tables of a key database in a deployment stage of a cloud platform. The platform administrator or user administrator may bind corresponding ABAC authentication rules for different users of the cloud platform for different resource classes or specific resources.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present description, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line (Digital Subscriber Line, DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital versatile disk (DIGITAL VERSATILE DISC, DVD)), or a semiconductor medium (e.g., solid state disk (SolidState Disk, SSD)), etc.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiment methods may be accomplished by way of a computer program, which may be stored in a computer-readable storage medium, instructing relevant hardware, and which, when executed, may comprise the embodiment methods as described above. And the aforementioned storage medium includes: various media capable of storing program code, such as ROM, RAM, magnetic or optical disks. The technical features in the present examples and embodiments may be arbitrarily combined without conflict.
The above-described embodiments are merely preferred embodiments of the present disclosure, and do not limit the scope of the disclosure, and various modifications and improvements made by those skilled in the art to the technical solutions of the disclosure should fall within the protection scope defined by the claims of the disclosure without departing from the design spirit of the disclosure.