Non-invasive micro-service system authority control method and system

Java Agent technology is used to achieve non-intrusive permission control in the microservice system, and the remote configuration center is used to update authentication rules in real time. This solves the intrusive and real-time problems of the permission control module in the existing technology and achieves stable and flexible permissions. manage.

WO2024212598A1PCT designated stage expired Publication Date: 2024-10-17CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Application Number
PCT/CN2023/142687
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-13
Filing Date
2023-12-28
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

The permission control module of the existing microservice system is intrusive, resulting in increased project coupling and the inability to dynamically manage authentication rules in real time, making it unable to adapt to business adjustments and changes in technical architecture.

Method used

Use Java Agent technology to develop agent programs and provide non-intrusive permission control modules. By registering class converters in the JVM and dynamically adding request interceptors, permission control is achieved, and the remote configuration center is used to update authentication rules in real time and isolate business logic code. .

Benefits of technology

It achieves non-intrusive permission control, supports real-time customized permission management of microservice systems, reduces project coupling, and ensures the stability of the call link under network fluctuations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023142687_17102024_PF_FP_ABST
    Figure CN2023142687_17102024_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of cloud computing, cloud platforms and micro-services. Disclosed are a non-invasive micro-service system authority control method and system. The method specifically comprises: configuring, in a starting parameter for a target application, a corresponding agent program, wherein the configured content may further comprise a remote configuration center address and a local rule address source, and a class name of Premain in the agent program needs to be configured in a MANIFEST.MF file in a jar packet which is generated by the target application; starting the target application, and starting the agent program accordingly, wherein the agent program registers a class converter to a JVM, and adding a request interceptor to serve as an authority control module; the target application receiving an external application request, and the interceptor of the authority control module intercepting the external application request before a service logic processing module; the authority control module performing authentication logic processing on the intercepted external application request, and if authentication is passed, issuing the external application request to the service logic processing module for processing, and executing a service code; and if the authentication is not passed, packaging a request failure response and returning same.
Need to check novelty before this filing date? Find Prior Art

Description

A non-invasive microservice system authority control method and system Technical Field

[0001] The present invention relates to the fields of cloud computing, cloud platforms, and microservice technologies in computers, and specifically to a non-invasive microservice system authority control method and system. Background Art

[0002] The current microservice system deploys multiple applications containing business logic processing modules on the server. During the application operation, the module can receive data for business logic processing. Received external application requests can be intercepted by the interceptor module in the program, thereby verifying the permissions of the request before the business logic processing module. In the microservice scenario, different services will have mutual access call interface relationships. For some services involving core business or data, it is necessary to manage access rights to the services based on business implementation to ensure the stability of the entire microservice system during development and operation and maintenance.

[0003] A common approach to implementing permission control modules is to embed an interceptor authentication module into the application. The overall architecture is shown in Figure 1. In practice, due to potential business adjustments or technical architecture adjustments, the data exchange paths between servers may change. This requires reading all application modules, modifying the interceptor module code, and then redeploying the application. This makes the permission control module intrusive, leading to increased project coupling and preventing dynamic, real-time management of authentication rules.

[0004] Summary of the Invention

[0005] The purpose of the invention provided by the present invention is to provide a data fusion analysis method and system based on the association analysis model, which can clean and organize the large amount of data collected by the industrial Internet cryptographic application to form formatted data, support the on-demand allocation, call and release of related storage and computing resources, and can filter, screen and aggregate the cryptographic application data, thereby having the ability to quickly analyze, process in real time, data mine and perform statistical association analysis on the cryptographic application data.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0007] The first aspect of the present application provides a non-invasive microservice system permission control method, comprising:

[0008] S1. Develop an agent program to provide a general permission control module and application interface monitoring functions;

[0009] S2. Configure the corresponding agent program in the target application startup parameters. The configuration content may also include the remote configuration center address and the local rule address source. The MANIFEST.MF file in the jar package generated by the target application needs to be configured with the class name of Premain in the agent program.

[0010] S3. Start the target application and the agent program. The agent program can register the class converter with the JVM, define the class bytecode file before loading the target application class, and add a request interceptor as an authorization control module.

[0011] S4. The target application receives a request from an external application, and the interceptor of the permission control module intercepts the request before the business logic processing module.

[0012] S5. The interceptor analyzes the restrictions on the path, parameters, and source of external application requests based on the configured rule information;

[0013] S6. The permission control module performs authentication logic processing on the intercepted external application request. If the authentication is successful, the external application request is sent to the business logic processing module for processing and execution of the business code; if the authentication fails, the request failure response is packaged and returned.

[0014] Furthermore, the agent program in step S1 refers to a program using Java Agent technology, which is named as requiring the target application to run in a JAVA virtual machine, i.e., JVM environment. The agent program needs to implement the premain() method so that the agent program runs before the main class of the target application is loaded and before the main method, i.e., main(), is run.

[0015] Furthermore, in step S2, the target application is enhanced and monitored with the help of an agent program, so that the permission control module is isolated from the business logic code.

[0016] Furthermore, the rule information in step S5 is updated and notified by the configuration center, and the permission control module pulls the latest rule information to the local to ensure real-time performance; in the event of network fluctuations, it can also respond immediately based on the local rule information to ensure the stability of the call link.

[0017] Furthermore, after the configured rule information is changed, the Agent agent program.

[0018] A second aspect of the present application provides a non-invasive microservice system permission control system for non-invasively creating a dynamic authentication component. The non-invasive microservice system permission control system includes:

[0019] Business module, used for information configuration of multiple data sources;

[0020] Authentication module, used to verify permissions;

[0021] Agent agent program, the Agent agent program can register the class converter with the JVM;

[0022] In a microservice environment, the remote configuration center stores the configuration information required by the project in the configuration center and reads it directly from the configuration center when needed.

[0023] Furthermore, the Agent program and the target application service are deployed on the same machine, and the Agent program reads local rule configuration or pulls rules from a remote configuration center for parsing according to startup parameters.

[0024] Furthermore, the Agent program automatically enhances the target application service program and adds a permission control module without intrusion.

[0025] Furthermore, the rules of the permission control module include information such as the request source, request path, request parameters, and request header. The permission control module will perform authentication logic processing in the same environment as the target application service according to the rules.

[0026] Furthermore, the remote configuration center supports data pulling and notification of Agent agent programs.

[0027] The present invention provides a non-invasive microservice system permission control method and system. It has the following beneficial effects:

[0028] Compared with the closest existing technology (service access authentication method embedded in the application), no additional framework calls or plug-in registration startup codes are connected to the original project code. Only the agent program needs to be independently developed and maintained, and the target application is enhanced using the agent program. The business logic processing code and the authentication code can be isolated to achieve non-invasive permission control. Compared with the similar technology patents of the same industry, this method is aimed at the access and authentication of services in the microservice system. There is no need to provide external authentication services. It can support real-time customized permission control and local environment authentication logic processing under the microservice system, and provide a real-time and reliable permission control process. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] FIG1 is a diagram showing the architecture of the authentication method system of the present invention;

[0030] FIG2 is a flow chart of the Agent program of the present invention enhancing the target application;

[0031] FIG3 is a flowchart of an external request authentication process of the present invention; DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0033] Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, but are not to be construed as limiting the present invention.

[0034] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0035] Please refer to Figure 2. The present invention provides a technical solution: a non-invasive microservice system authority control method and system, which includes a business module, an authentication module, an agent program, and a remote configuration center;

[0036] Referring to Figure 3, the specific steps of a non-invasive microservice system permission control method are as follows:

[0037] Deploy the Agent program and the target application on the same machine, configure the startup parameters and properties of the target application, including the source of the Agent program and authentication rule information.

[0038] During the application startup process, the Agent program will start and connect to the target application according to the configuration, and monitor and record the interface through which the application receives requests.

[0039] The Agent then reads local rule configuration or pulls rules from the remote configuration center for parsing based on startup parameters, eliminating the need for developers to add code parsing rules to their projects. The Agent automatically enhances the target application and non-invasively adds a permission control module. The authentication module's rules can include information such as the request source, request path, request parameters, and request headers, enabling authentication requirements in multiple service call scenarios. The remote configuration center must support data pulling and notifications from the Agent.

[0040] After the target application receives the request, the permission control module performs authentication logic according to the rules in the same environment as the target application. If the authentication result is unsuccessful, the permission control module intercepts the request, packages a response indicating the error request, and passes it back to the accessing service through the application. If the authentication result is successful, the external request is sent to the business module for further processing, and the application continues to operate according to the original logic without affecting the existing business. When the rules are changed, the remote configuration center notifies the agent program to pull the rules again and update the rule information of the authentication module.

[0041] A specific implementation mode 1 of the present invention may be:

[0042] Step 1: Develop an agent program to provide a universal permission control module and application interface monitoring capabilities. This agent program uses JavaAgent technology and requires the target application to run in a JAVA virtual machine (JVM) environment. The agent program must implement the premain() method to execute before the target application's main class is loaded and before the main method (main()) is executed.

[0043] Specifically, in the Java virtual machine, the main() method is the entry method of a Java application. That is to say, when the program is running, the first method executed is the main() method. This method is very different from other methods. For example, the method name must be main, the method must be of public static void type, and the method must receive a string array parameter, etc. In this solution, programs that need to use JavaAgent technology must first implement the premain() method, that is, run before the main() method runs.

[0044] Step 2: Configure the corresponding JavaAgent agent in the target application startup parameters. This configuration may also include the remote configuration center address and the local rule address source. The MANIFEST.MF file in the generated JAR file of the target application must contain the class name of the agent's Premain.

[0045] It should be noted that the Java Agent is a feature provided by the Java Virtual Machine that allows dynamic modification of bytecode and manipulation of Java applications while the program is running. Java Agent is typically used in the following scenarios:

[0046] Perform code performance analysis and debugging.

[0047] Dynamically modify Java bytecode to implement functions such as AOP (Aspect-Oriented Programming).

[0048] Dynamically modify the behavior of an application while it is running.

[0049] Specifically, the MANIFEST.MF file is a required file in Java packaging tools (such as jar, war, ear, etc.) and is used to describe the metadata of the packaged file. Its main functions are as follows:

[0050] 1. Specify the main class in the package file

[0051] The Main-Class attribute in the MANIFEST.MF file specifies the main class in the packaged file. This main class will be started at runtime. When we run a JAR file using the java -jar command, the Java runtime reads the MANIFEST.MF file, finds the class specified by the Main-Class attribute, and executes the main() method of that class.

[0052] 2. Storing metadata of packaged files

[0053] The MANIFEST.MF file can also contain other custom attributes to store metadata about the packaged file. For example, you can specify the version number, author, description, and so on. These attributes can be read at runtime to provide more application information.

[0054] Step 3: Start the target application, and the JavaAgent agent will also start. The agent registers a class converter with the JVM, defines the class bytecode file before loading the target application class, and adds a request interceptor as the permission control module. With the agent's enhancement and monitoring, the permission control module is isolated from the business logic code, achieving zero intrusion. The target application interface is updated in real time to ensure the legitimacy of the rules.

[0055] Step 4: The target application receives a request from an external application, and the interceptor of the permission control module intercepts the request before the business logic.

[0056] Step 5: The interceptor analyzes the restrictions on the request path, parameters, and source based on the configured rule information. In this embodiment, the configuration center can notify the user of rule updates, and the permission control module can pull the latest rules locally to ensure real-time response. In the event of network fluctuations, the interceptor can also respond immediately based on local rules to ensure the stability of the call link.

[0057] Step 6: The permission control module performs authentication logic on the intercepted request. If the authentication passes, the request is sent to the business code for processing; if the authentication fails, the request is packaged as a failure response and returned.

[0058] A specific implementation mode 2 of the present invention may be:

[0059] Step 1: Develop an agent program to provide a universal permission control module and application interface monitoring capabilities. In this embodiment, the agent program uses JavaAgent technology and requires the target application to run in a JVM environment. The agent program must implement the second method, agentmain(), to connect to the JVM after the target application class is loaded and the main method, main(), is executed.

[0060] Specifically, JVM stands for Java Virtual Machine. A JVM is a specification for computing devices—a fictional computer that emulates various computer functions on an actual computer. The Java Virtual Machine includes a bytecode instruction set, a set of registers, a stack, a garbage-collected heap, and a method storage area. The JVM shields information related to specific operating systems, allowing Java programs to run unmodified on a variety of platforms simply by generating target code (bytecode) that runs on the Java Virtual Machine. When executing bytecode, the JVM ultimately interprets it as platform-specific machine instructions.

[0061] Step 2: Configure the agent properties in the target application configuration file, including the remote configuration center address and the local rule address source. The agent program uses the attach() method to connect to the target application's JVM. The MANIFEST.MF file in the target application's generated JAR file must contain the name of the agent's agentmain class.

[0062] Specifically, the Attach method is a file upload and download technology based on the HTTP protocol. Its basic principle is to send file data to the server via an HTTP POST request, which then stores the file data in a specified directory on the server. Simultaneously, the file data in the specified directory on the server is sent back to the client via an HTTP GET request.

[0063] Implementing the Attach method requires cooperation between the client and the server. The client must implement functions such as file selection, file upload, and file download, while the server must implement functions such as file storage and file download. The Attach method is very simple to use and is suitable for a wide variety of applications.

[0064] Step 3: Start the target application, and the JavaAgent agent will be launched and connected. The JavaAgent agent registers the class converter with the JVM, redefines the class bytecode file, and adds a request interceptor as the permission control module. With the agent's enhancement and monitoring, the permission control module is isolated from the business logic code, achieving zero intrusion. The target application interface is updated in real time to ensure the legitimacy of the rules.

[0065] Step 4: The target application receives a request from an external application, and the interceptor of the permission control module intercepts the request before the business logic.

[0066] Step 5: The interceptor analyzes the restrictions on the request path, parameters, and source based on the configured rule information. In this embodiment, the configuration center can notify the user of rule updates, and the permission control module can pull the latest rules locally to ensure real-time response. In the event of network fluctuations, the interceptor can also respond immediately based on local rules to ensure the stability of the call link.

[0067] Step 6: The permission control module performs authentication logic on the intercepted request. If the authentication passes, the request is sent to the business code for processing; if the authentication fails, the request is packaged as a failure response and returned.

[0068] An embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to implement various processing flows of the aforementioned terminal in a hybrid cloud adaptive resource management solution.

[0069] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.

[0070] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0071] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0072] In the several embodiments provided by the present invention, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is merely a logical functional division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0073] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0074] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0075] If the above-mentioned 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 computer-readable memory. Based on this understanding, the technical solution of the present invention, 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. The computer software product is stored in a memory and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the above-mentioned methods of each embodiment of the present invention. The aforementioned memory includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0076] The embodiments of the present invention are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A non-intrusive microservice system permission control method, It is characterized in that include: S1. Develop an agent program to provide a general permission control module and application interface monitoring functions; S2. Configure the corresponding agent program in the target application startup parameters. The configuration content may also include the remote configuration center address and the local rule address source. The class name of Premain in the agent program needs to be configured in the MANIFEST.MF file in the jar package generated by the target application. S3. Start the target application and the agent program. The agent program can register the class converter with the JVM, define the class bytecode file before the target application class is loaded, and add the request interceptor as the permission control module. S4, the target application receives an external application request, and the interceptor of the permission control module intercepts the external application request before the business logic processing module; S5. The interceptor analyzes the restrictions on the path, parameters, source, etc. of the external application request according to the configured rule information; S6. The permission control module performs authentication logic processing on the intercepted external application request. If the authentication is successful, the external application request is sent to the business logic processing module for processing and execution of the business code; if the authentication fails, the request failure response is packaged and returned.

2. According to the non-intrusive microservice system permission control method of claim 1, Features: The agent program in step S1 refers to a program using Java Agent technology, which is named as requiring the target application to run in a JAVA virtual machine, i.e., JVM environment. The agent program needs to implement the premain() method so that the agent program runs before the main class of the target application is loaded and before the main method, i.e., main(), is run.

3. According to the non-intrusive microservice system permission control method of claim 1, Features: In step S2, the target application is enhanced and monitored with the help of an agent program, so that the permission control module is isolated from the business logic code.

4. According to the non-intrusive microservice system permission control method of claim 1, Features: The rule information in step S5 is updated and notified by the configuration center, and the permission control module pulls the latest rule information to the local to ensure real-time performance; in the event of network fluctuations, it can also respond instantly based on the local rule information to ensure the stability of the call link.

5. According to the non-intrusive microservice system permission control method of claim 1, Features: If the configured rule information is changed, the Agent program.

6. A non-intrusive microservice system permission control system for non-intrusive creation of dynamic authentication components, It is characterized in that include; Business module, used for information configuration of multiple data sources; Authentication module, used to verify permissions; An Agent program, wherein the Agent program can register a class converter with the JVM; In a microservice environment, the remote configuration center stores the configuration information required by the project in the configuration center and reads it directly from the configuration center when needed.

7. A non-intrusive microservice system authority control system according to claim 6, Features: The Agent program and the target application service are deployed on the same machine. The Agent program reads the local rule configuration or pulls the rules from the remote configuration center for parsing according to the startup parameters.

8. A non-intrusive microservice system authority control system according to claim 7, Features: The Agent program automatically enhances the target application service program and adds a permission control module without intrusion.

9. A non-intrusive microservice system authority control system according to claim 8, Features: The rules of the permission control module include information such as request source, request path, request parameters, request header, etc. The permission control module will perform authentication logic processing in the same environment as the target application service according to the rules.

10. A non-intrusive microservice system authority control system according to claim 1, Features: The remote configuration center supports the data pulling of the Agent program and the notification to the Agent program.

Citation Information

Patent Citations

  • High-availability non-invasive system architecture

    CN109688005A

  • Micro-service treatment system

    CN110554856A

  • Service authentication method, device, equipment and system and storage medium

    CN111835789A

  • Network services controller for cloud-based control of connectivity for heterogeneous network infrastructure

    US20210051213A1

Cited By

  • Micro-service authentication method and device, computer equipment and storage medium

    CN119496653A

  • Microservice authentication methods, devices, computer equipment, and storage media

    CN119496653B

  • Intelligent substation configuration file management method and system, medium and terminal

    CN119538287A

  • Safety control method and device based on JDK layer IO stream processing

    CN121711198A