Container access method and device
By verifying and updating the authorization mechanism of container addresses, the bastion host system authorization problem caused by address drift in container deployment scenarios is solved, ensuring secure access and improving resource utilization.
Patent Information
- Application Number
- CN202011126234.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-20
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-10-20
AI Technical Summary
In a container deployment scenario, after the container updates the image or configuration, the container address drifts or remains unchanged, causing authorization and use problems for the bastion host system, and posing security risks and the risk of superuser key leakage.
By receiving the user's container access request, return the authorized container address list, verify the user's operation permissions, and delete the failed addresses until the passed addresses are selected, generate a key pair and use the private key to log in to the container, ensuring Secure access.
It solves the problem of secure access after container address drift, avoids the risk of password leakage and pre-prepared super users, and improves security and resource utilization.
Smart Images

Figure CN113742711B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for accessing a container. Background Art
[0002] Bastion host systems play a significant role in system testing, development, and operations, primarily providing users with commands and instructions for the machines where services are deployed. Using containers to deploy services is more lightweight and resource-efficient than using physical or virtual machines. Currently, a common method for registering users on a bastion host is to pre-define a super account on the physical machine, virtual machine, or container. When authorization is required for a user, this designated account uses the super account to inject credentials.
[0003] In the process of implementing the present invention, the inventors discovered that the prior art has at least the following problems:
[0004] In scenarios where services are deployed using containers, after a container image is replaced or a configuration is updated, it is restarted, causing the container address to change and the original address to drift. At this time, the administrator can still log in and execute commands at the original address of the container, posing a huge security risk. Pre-creating super users and permissions in physical machines, virtual machines, or containers may cause security issues due to the leakage of super user passwords or keys. Summary of the Invention
[0005] In view of this, an embodiment of the present invention provides a method and device for accessing containers, which can solve the authorization and usage problems of the bastion host system in the container deployment scenario when the container address drifts or remains unchanged after the container image or configuration is updated, and the container's operating status returns to the initial state.
[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for accessing a container is provided.
[0007] A container access method includes receiving a container access request from a user and returning a list of authorized container addresses; verifying the user's operation authority for a first container address selected by the user; if the verification fails, deleting the first container address from the authorized container address list, and returning the deleted authorized container address list to the user, allowing the user to select again until the user passes the operation authority verification for a second container address selected; and accessing a second container based on the second container address.
[0008] Optionally, the method authorizes the user to operate the container in the following manner: receiving a container operation authorization request from the user, the container operation authorization request including user information and container address information for which authorization is requested; verifying whether the user has container operation permission based on the user information and the container address information; if so, generating a key pair and injecting the public key in the key pair into the container; and returning the login method and token to the user to complete the operation authorization.
[0009] Optionally, the container access request includes the user's token and, before returning the authorized container address list, further includes:
[0010] The user's identity is verified based on the token.
[0011] Optionally, accessing the second container according to the second container address includes: logging into the second container according to the second container address using a private key in a key pair to access the second container, where the key pair is generated when the user authorizes an operation on the container; if the login fails, regenerating the key pair, injecting the public key in the regenerated key pair into the second container, and logging into the second container using the private key in the regenerated key pair to access the second container.
[0012] According to another aspect of an embodiment of the present invention, a device for accessing a container is provided.
[0013] A container access device comprises: an access request module for receiving a container access request from a user and returning a list of authorized container addresses; a permission verification module for verifying the user's operation permission for a first container address selected by the user; a container selection module for deleting the first container address from the authorized container address list if the verification fails, and returning the deleted authorized container address list to the user, allowing the user to select again until the user passes the operation permission verification for a second container address selected; and a container access module for accessing a second container according to the second container address.
[0014] Optionally, the method authorizes the user to operate the container in the following manner: receiving a container operation authorization request from the user, the container operation authorization request including user information and container address information for which authorization is requested; verifying whether the user has container operation permission based on the user information and the container address information; if so, generating a key pair and injecting the public key in the key pair into the container; and returning the login method and token to the user to complete the authorization.
[0015] Optionally, the container access request includes a token of the user, and the apparatus further includes a token verification module configured to:
[0016] Before returning the authorized container address list, the user's identity is verified based on the token.
[0017] Optionally, the container access module is further configured to: log in to the second container using a private key in a key pair according to the second container address to access the second container, where the key pair is generated when the user authorizes container operations; if the login fails, regenerate the key pair, inject the public key in the regenerated key pair into the second container, and log in to the second container using the private key in the regenerated key pair to access the second container.
[0018] According to yet another aspect of an embodiment of the present invention, a container-accessible electronic device is provided.
[0019] An electronic device for container access includes: one or more processors; and a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the container access method provided by an embodiment of the present invention.
[0020] According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
[0021] A computer-readable medium stores a computer program, which, when executed by a processor, implements a container access method provided by an embodiment of the present invention.
[0022] An embodiment of the above invention has the following advantages or beneficial effects: by receiving a container access request from a user and returning a list of authorized container addresses; verifying the user's operation authority on the first container address based on the first container address selected by the user; if the verification fails, deleting the first container address from the authorized container list, and returning the deleted authorized container address list to the user, so that the user can select again until the user passes the operation authority verification on the selected second container address; accessing the second container based on the second container address solves the authorization and use problems of the bastion host system in the container deployment scenario when the container updates the image or configuration and the container address drifts or remains unchanged, and the container operating environment returns to the initial state, thereby achieving the purpose of securely accessing the container and performing a series of operations after the container updates the image or configuration, improving security, and avoiding the risks of password leakage and pre-prepared super users.
[0023] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.
[0025] Figure 1 1 is a schematic diagram of the main steps of the container access method according to an embodiment of the present invention;
[0026] Figure 2 This is a schematic diagram of a process for processing a user's application for authorization of a container according to an embodiment of the present invention;
[0027] Figure 3 Schematic diagram of the architecture design of the container access method according to an embodiment of the present invention;
[0028] Figure 4 is a schematic diagram of a specific process of a container access method according to an embodiment of the present invention;
[0029] Figure 5 is a schematic diagram of main modules of a container access device according to an embodiment of the present invention;
[0030] Figure 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
[0031] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0033] Bastion host systems, also known as springboard systems, play a significant role in system testing, development, and operations. They primarily provide users with command and instruction operations on the machines where services are deployed. These operations include recording and auditing user operations, preventing losses, and detecting and disabling illegal operations. Using containers to deploy services is more lightweight and resource-efficient than previous deployment methods using physical or virtual machines. Combined with images, they enable the goal of "build once, run everywhere." Due to these unique advantages, container technology is rapidly gaining popularity and adoption.
[0034] When deploying services using containers, there are two issues: After replacing the container image or updating the configuration, the container restarts, causing the container address to change and the original container address to drift. Users are authorized using the container address, which is the only key to identifying user permissions and accounts. If authorization is successful before the restart, this means the user has administrator login and command permissions for that container address. After the restart, the container's current address changes, and the original container address drifts. Users may find that they can still log in and execute commands using the original container address. This is because the mapping is marked in the bastion host system. Even after the container address drifts, the user's operating permissions are still injected. Pre-configuring superusers and permissions in physical machines, virtual machines, or containers poses a significant security risk: the leakage of this superuser's password or key.
[0035] In order to solve the above technical problems existing in the prior art, the present invention provides a method and device for container access, which adds an authorization interface, randomly generates the authorized private key and secret key, and adds salt to avoid the risk of leakage and pre-created super users. When a user logs in to access the container, a permission check is performed on the user's operation on the container to confirm whether the user has the permission to operate the container. When the container is restarted, if the container address has not changed, the user and the container are automatically authorized. If the container address changes, the user is required to resubmit an application for the operation permission for the new container address.
[0036] Figure 1 FIG. 1 is a schematic diagram of the main steps of the container access method according to an embodiment of the present invention. Figure 1 As shown, the container access method according to the embodiment of the present invention mainly includes the following steps S101 to S104.
[0037] Step S101: Receive a container access request from a user and return a list of authorized container addresses;
[0038] Step S102: Verify the user's operation authority for the first container address according to the first container address selected by the user;
[0039] Step S103: If the verification fails, the first container address is deleted from the authorized container address list, and the deleted authorized container address list is returned to the user, so that the user can select again until the user passes the operation permission verification for the second container address selected;
[0040] Step S104: access the second container according to the second container address.
[0041] According to the above steps S101 to S104, when a user needs to access a container, the user's operating authority over the container is verified; if the container address has not changed, the user and the container address are automatically authorized; if the container address has changed, the user is required to resubmit an application for operating authority over the new container address. When the container address drifts after the container image or configuration is updated, the user can be prevented from logging into the previous container address, which solves the authorization and use problems of the bastion host system when the container address drifts or remains unchanged after the container image or configuration is updated in the container deployment scenario, and the container operating environment returns to the initial state. This achieves the purpose of securely accessing the container and performing a series of operations after the container image or configuration is updated, avoiding the risk of password leakage and pre-prepared super users, and improving security.
[0042] According to one embodiment of the present invention, user operation authorization for a container is performed in the following manner: receiving a container access authorization request from the user, the container access authorization request including user information and container address information for which authorization is requested; verifying whether the user has container operation permission based on the user information and the container address information; if so, generating a key pair and injecting the public key in the key pair into the container; and returning the login method and token to the user to complete the authorization.
[0043] According to another embodiment of the present invention, the container access request further includes a user token, and before returning the authorized container address list, the user's identity is verified based on the token.
[0044] According to yet another embodiment of the present invention, accessing the second container according to the second container address further includes logging into the second container using a private key in a key pair according to the second container address to access the second container; if the access fails, regenerating the key pair, injecting the public key in the regenerated key pair into the second container, and logging into the second container using the private key in the regenerated key pair to access the second container.
[0045] Figure 2 FIG. 1 is a schematic diagram of a process flow for processing a user's authorization application for a container according to an embodiment of the present invention. According to the technical solution of the present invention, the process flow for processing a user's authorization application for operating a container is as follows: Figure 2 As shown, it mainly includes:
[0046] 1. Package the user information and the IP address of the container that the user requests to operate into a request and send an authorization request to the bastion host;
[0047] 2. The bastion host verifies the user information and IP information to confirm that the user has the operation authority for the IP;
[0048] 3. The bastion host dynamically generates a key pair for the container, injects the public key in the key pair into the container, and records the correspondence between user information, IP information, and the encrypted key pair;
[0049] 4. Return the user's login method and token for accessing the container, thereby completing the operation authorization.
[0050] Figure 3 This is a schematic diagram of the architecture design of the container access method according to an embodiment of the present invention. Figure 3 As shown, the system architecture for users to access the target container through the bastion host system is shown. According to the technical solution of the present invention, combined with the architectural diagram of the container access method, the process of container access mainly includes:
[0051] 1. When a user requests access to a target container, the operation instruction for the target container and the user token are encapsulated into a container access request and sent to the bastion host system for permission verification;
[0052] 2. The bastion host verifies the user token. If the verification is successful, it returns a list of addresses (IP addresses) of the user's authorized containers for the user to select. When the bastion host authorizes the user, it has saved the corresponding relationship between the user information and the IP addresses of the authorized containers. Therefore, the user's authorized container IP address list can be obtained based on this relationship.
[0053] 3. The user selects the IP address of a specified container to perform operations, such as safety stop loss or other operations;
[0054] 4. The bastion host verifies the user's permission to operate the selected IP. If the container's IP has drifted, it means that the bastion host no longer has permission to operate the IP. It then deletes the user's selected IP from the authorized container's IP list and returns the deleted IP list to the user.
[0055] 5. If the container's IP address has not changed, indicating no IP drift, the system retrieves the container's IP address information (e.g., which application, business group, department, etc.) and user information (e.g., whether the user has permission to the application deployed in the container, which department the user belongs to, etc.) from the information stored in the bastion host system. The public key is then injected into the container. The system then uses the private key and the container access request sent by the user to access the container, perform operations, and return the user's operation results.
[0056] Figure 4 FIG. 1 is a schematic diagram of the main flow of a container access method according to an embodiment of the present invention. Figure 4 In an embodiment of the present invention, the main process of the container access method includes:
[0057] 1. The user uses the token to initiate a login request to the bastion host system;
[0058] 2. The bastion host verifies the token, obtains the user's user information, including the user's authorized IP list, and returns the list;
[0059] 3. The user selects the IP address of the container to be accessed and initiates an operation request;
[0060] 4. The bastion host receives the specified IP operation request and verifies the user's operation authority for the IP based on the user information and IP information. If the user does not have the operation authority for the IP, it means that the user has initialized and updated the container and the IP has drifted. The IP will be deleted from the authorized list and the authorized list will be returned for the user to select again. If the user has the operation authority for the IP, the bastion host will try to log in to the IP and perform the operation.
[0061] 5. If the bastion host fails to log in to the IP address using the private key, it means that the container has been initialized and restarted and the IP address has not drifted, that is, the original IP address has been retained. At this time, the bastion host performs a secondary key injection operation on the IP address. The secondary key injection operation means that the bastion host system regenerates the key pair, then encrypts the public and private keys and stores them in the database, and then injects the public key into the container corresponding to the IP address.
[0062] 6. After the bastion host system verifies the user and IP operation permissions, it enters the container to execute the operation requested by the user and finally returns the execution result.
[0063] Figure 5 Schematic diagram of the main modules of container access according to an embodiment of the present invention. Figure 5 As shown, the container access device 500 according to the embodiment of the present invention mainly includes an access request module 501 , a permission verification module 502 , a container selection module 503 and a container access module 504 .
[0064] Access request module 501, for receiving container access requests from users and returning a list of authorized container addresses;
[0065] The permission verification module 502 is used to verify the user's operation permission on the first container address according to the first container address selected by the user;
[0066] The container selection module 503 is configured to delete the first container address from the authorized container address list if the verification fails, and return the deleted authorized container address list to the user so that the user can select again until the user passes the operation permission verification for the second container address selected;
[0067] The container access module 504 is configured to access the second container according to the second container address.
[0068] According to one embodiment of the present invention, the user authorizes the operation of the container in the following manner:
[0069] Receive a container operation authorization request from the user, which includes user information and the container address information for which authorization is requested; verify whether the user has container operation permissions based on the user information and container address information; if so, generate a key pair and inject the public key in the key pair into the container; return the login method and token to the user to complete the authorization.
[0070] According to another embodiment of the present invention, the container access request includes the user's token, and the apparatus further includes a token verification module (not shown in the figure) configured to:
[0071] Before returning the authorized container address list, the user's identity is verified based on the token.
[0072] According to yet another embodiment of the present invention, the container access module 504 may also be configured to:
[0073] The second container is logged in using the private key in the key pair according to the second container address; the key pair is generated when the user authorizes operation on the container; if the login fails, the key pair is regenerated, and the public key in the regenerated key pair is injected into the second container, and the private key in the regenerated key pair is used to log in to the second container to access the second container.
[0074] According to the technical solution of the embodiment of the present invention, a container access request from a user is received and a list of authorized container addresses is returned; based on the first container address selected by the user, the user's operation authority for the first container address is verified; if the verification fails, the first container address is deleted from the authorized container address list, and the deleted authorized container address list is returned to the user, so that the user can select again until the user passes the operation authority verification for the selected second container address; the technical means of accessing the second container according to the second container address solves the authorization and use problems of the bastion host system in the case where, in the container deployment scenario, after the container image or configuration is updated, the container address drifts or remains unchanged, and the container's operating environment returns to the initial state. It achieves the purpose of securely accessing the container and performing a series of operations after the container image or configuration is updated, improves security, and avoids the risks of password leakage and pre-prepared super users.
[0075] Figure 6An exemplary system architecture 600 is shown to which the container access method or container access apparatus according to an embodiment of the present invention may be applied.
[0076] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0077] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various client applications can be installed on terminal devices 601, 602, and 603, such as container management tools, operation and maintenance applications, testing applications, permission setting tools, software development applications, etc.
[0078] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0079] Server 605 may be a server that provides various services, such as a background management server that determines the permissions of users using terminal devices 601, 602, and 603. The background management server may analyze and process received data such as container address access requests, and feed back the processing results to the terminal device.
[0080] It should be noted that the container access method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the container access device is generally set in the server 605 .
[0081] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0082] Reference below Figure 7 , which shows a schematic structural diagram of a computer system 700 of a terminal device or server suitable for implementing an embodiment of the present invention. Figure 7 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0083] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the system 700 are also stored in the RAM 703. The CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0084] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read therefrom can be installed into the storage section 708 as needed.
[0085] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from a removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0086] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0087] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0088] The units or modules described in the embodiments of the present invention may be implemented in software or hardware. The units or modules described may also be provided within a processor. For example, they may be described as comprising an access request module, a permission verification module, a container selection module, and a container access module. The names of these units or modules do not, in some cases, limit the units or modules themselves. For example, the access request module may also be described as "a module for receiving container access requests from users and returning a list of authorized container addresses."
[0089] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes the following steps: receiving a container access request from a user and returning a list of authorized container addresses; verifying the user's operation authority for the first container address selected by the user; if the verification fails, deleting the first container address from the list of authorized container addresses and returning the deleted list of authorized container addresses to the user, so that the user can select again, until the user passes the operation authority verification for the second container address selected; and accessing the second container according to the second container address.
[0090] According to the technical solution of an embodiment of the present invention, a container access request from a user is received and a list of authorized container addresses is returned. The user's operation authority for the first container address is verified based on the first container address selected by the user. If the verification fails, the first container address is deleted from the authorized container address list, and the deleted authorized container address list is returned to the user, allowing the user to select again until the user passes the operation authority verification for the second container address selected by the user. The technical means of accessing the second container based on the second container address solves the authorization and usage issues that exist in the container deployment scenario when the container address drifts or remains unchanged after the container image or configuration is updated, and the operating environment returns to the initial state. This avoids the risks of leakage and pre-established super users, and improves security and convenience.
[0091] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for accessing a container, It is characterized in that include: Receive container access requests from users and return a list of authorized container addresses; According to the first container address selected by the user, verifying the user's operation authority on the first container address; If the verification fails, the first container address is deleted from the authorized container address list, and the deleted authorized container address list is returned to the user, so that the user can select again, until the user passes the operation authority verification of the second container address selected by the user; accessing the second container according to the second container address; The operation authorization of the container by the user is performed in the following manner: receiving a container operation authorization request sent by the user, the container operation authorization request including user information and container address information for which authorization is requested; verifying whether the user has the container operation authority according to the user information and the container address information; if so, generating a key pair and injecting the public key in the key pair into the container; returning the login method and the token to the user to complete the operation authorization; Accessing the second container according to the second container address includes: according to the second container address, using a private key in a key pair to log in to the second container to access the second container, the key pair being generated when the user authorizes an operation on the container; if the login fails, regenerating the key pair, injecting the public key in the regenerated key pair into the second container, and using the private key in the regenerated key pair to log in to the second container to access the second container.
2. The method according to claim 1, It is characterized in that The container access request includes the user's token and, before returning the authorized container address list, also includes: The user's identity is verified based on the token.
3. A container access device, It is characterized in that include: The access request module is used to receive container access requests from users and return a list of authorized container addresses; An authority verification module, used to verify the user's operation authority on the first container address according to the first container address selected by the user; a container selection module, configured to delete the first container address from the authorized container address list if the verification fails, and return the deleted authorized container address list to the user so that the user can select again until the user passes the operation authority verification for the selected second container address; A container access module, accessing the second container according to the second container address; The operation authorization of the container by the user is performed in the following manner: receiving a container operation authorization request sent by the user, the container operation authorization request including user information and container address information for which authorization is requested; verifying whether the user has the container operation authority according to the user information and the container address information; if so, generating a key pair and injecting the public key in the key pair into the container; returning the login method and the token to the user to complete the authorization; The container access module is further used to: log in to the second container using a private key in a key pair according to the second container address to access the second container, wherein the key pair is generated when a user authorizes an operation on the container; If the login fails, a key pair is regenerated, and the public key in the regenerated key pair is injected into the second container, and the private key in the regenerated key pair is used to log in to the second container to access the second container.
4. The device according to claim 3, It is characterized in that The container access request includes a token of the user, and the device further includes a token verification module, which is used to: Before returning the authorized container address list, the user's identity is verified based on the token.
5. An electronic device for container access, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-2.
6. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Access management method and device, bastion host and readable storage medium
CN111490981A
Method of adding subscriber's security confirmation to simple network management protocol
CN1384642A
