Rear-end scaffold system and method for improving safety and log

By designing security modules and log management modules in the back-end scaffolding system, the problems of insufficient security and poor log management in the prior art are solved, and higher system security and maintainability are achieved.

CN119691755APending Publication Date: 2025-03-25QIMING INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411850087.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing technology back-end scaffolding has shortcomings in security and log management, which can easily lead to system vulnerabilities, information leakage, and the inability to effectively track and solve problems during operation and maintenance.

Method used

Design a back-end scaffolding system including security modules, log management modules and dynamic expansion modules. The security module improves security through mechanisms such as role access control, multi-level encryption, security auditing and automated vulnerability detection and repair; the log management module enhances log management capabilities through centralized management, traceability and link ID, automated classification and filtering, exception detection and labeling.

Benefits of technology

Improve the security of the back-end system through multi-level security mechanisms to prevent data leakage and hacker intrusion; the innovative design of log management allows developers to quickly respond to and deal with online problems, improving the maintainability and traceability of the system; automated vulnerability detection and log exception detection functions reduce manpower investment and improve the stability and security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691755A_ABST
    Figure CN119691755A_ABST
Patent Text Reader

Abstract

The invention discloses a rear-end scaffold system and method for improving safety and logs. The system comprises a safety module, a log management module and a dynamic expansion module. The security module is used for realizing access permission setting of different roles, multi-level data encryption, monitoring of a back end and an alarm mechanism, and automatic detection and vulnerability repair; the log management module realizes unified management of logs, sets traceability and link IDs for the logs, automatically classifies the logs of different levels, filters invalid logs and monitors log abnormity; the dynamic extension module realizes flexible addition or removal of the security module and the log module, and the dynamic extension module function and the method are realized based on the system. According to the invention, the security of a back-end system is improved, and common risks such as data leakage and hacker intrusion are prevented; a developer can quickly respond to and process online problems, and the maintainability and traceability of the system are improved; the human input is reduced, and the stability and safety of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of scaffolding frameworks, and in particular to a back-end scaffolding system and method for improving safety and logging. Background Art

[0002] In the back-end development process, the scaffolding framework is an important tool for quickly building projects, which can improve development efficiency and code standardization.

[0003] However, the scaffolding of existing technologies often has certain deficiencies in security and log management, which can easily lead to system vulnerabilities, information leakage, and the inability to effectively track and solve problems during operation and maintenance.

[0004] Therefore, a back-end scaffolding is needed that can improve system security and enhance log management capabilities. Summary of the invention

[0005] The purpose of the present invention is to propose a backend scaffolding system and method for improving security and logging in response to the above technical problems.

[0006] A back-end scaffolding system for improving security and logging, including a security module, a log management module, and a dynamic expansion module; The security module implements access rights setting for different roles, multi-level data encryption, monitoring backend and alarm mechanism, and automatic detection and repair of vulnerabilities; The log management module realizes unified management of logs, sets traceability and link ID for logs, automatically classifies logs of different levels, filters invalid logs, and monitors log anomalies; The dynamic expansion module can flexibly add or remove security modules and log modules, and dynamically expand module functions.

[0007] Further, a back-end scaffolding system for improving security and logging, the security module includes a role access control submodule, a multi-level encryption mechanism submodule, a security audit submodule, a detection and alarm submodule, and an automated vulnerability detection and repair submodule; The role access control submodule introduces a dynamic permission management model, combines the mapping relationship between users, roles and permissions, and flexibly controls access permissions through automatically generated configuration files; The multi-level encryption mechanism submodule uses encryption algorithms to encrypt sensitive data during storage and transmission, and introduces a key-based dynamic rotation mechanism to prevent the key from being used for a long time, which may lead to security risks. The security audit submodule integrates a full range of security audit functions to monitor backend API calls, user behavior trajectories and potential attack behaviors in real time; When the detection and alarm submodule detects suspicious behavior, it automatically triggers an alarm and generates a detailed security audit log; The automatic vulnerability detection and repair submodule regularly scans the security vulnerabilities in the dependent packages and codes, provides automatic repair suggestions, and prompts developers to repair them.

[0008] Further, a back-end scaffolding system for improving security and logging, wherein the encryption algorithms include AES and RSA; The user's behavior track includes SQL injection; The potential attack behaviors include cross-site scripting attacks (XSS).

[0009] Further, a back-end scaffolding system for improving security and logs, the log management module includes a centralized log management submodule, a traceability and link log submodule, a log automatic classification submodule, a log filtering submodule, a log anomaly detection submodule, and a log anomaly marking submodule; The centralized log management submodule integrates ELK or Prometheus log collection and visualization tools to achieve unified log management and provide real-time analysis and display; The traceability and link log submodules have built-in distributed tracing functions. By assigning a unique request ID to each request, tracking the flow path of each request, and recording detailed link logs, it ensures that the source of the problem can be traced in a complex microservice architecture. The log automatic classification submodule realizes the classification and storage of logs based on different levels; The log filtering submodule automatically filters out important log information based on keywords and time period dimensions, reducing the impact of redundant logs on problem location; The log anomaly detection submodule uses a machine learning algorithm to train historical log data and automatically identify abnormal patterns and error types in the logs; When an unexpected abnormal log appears in the log abnormality marking submodule, an alarm is automatically triggered and possible abnormal points are marked.

[0010] Furthermore, a backend scaffolding system for improving security and logging, wherein the integrated ELK includes Elasticsearch, Logstash, and Kibana; The different levels of logs include INFO, WARN, and ERROR.

[0011] A backend scaffolding method for improving security and logging includes the following sub-steps: User login: User authentication uses the password mode in Oauth2. After successful system authentication, SpringSecurity is used to authenticate access resources to determine whether the user has permission to access the interface. Storing data: Design sensitive information to be encrypted and stored in a list in a masked form; The sensitive information includes mobile phone number, ID number, and email address; Platform display: Microservices collect data through filebeat by mounting the sidecar container, filter the log information through logstash, aggregate it into ES for storage, and display it on the monitoring platform; Log identification: log identification of exceptions thrown by the system and identification of log information with special identification; The special identifier includes a system-defined error identifier; Collect log information: collect user login log information, operation log information, and record suspicious attack operation log information through AOP tracking; Link tracking: When the microservice is started, add javaagent to collect link data and aggregate it into skywalking to track the service link; Alarm notification: When the service abnormality exceeds the critical value, the alarm information will be pushed to the service administrator via email; Problem troubleshooting: Managers troubleshoot service problems through the monitoring platform.

[0012] The beneficial effects of the present invention are as follows: a back-end scaffolding system and method for improving security and logging, which improves the security of the back-end system through a multi-level security mechanism and prevents common risks such as data leakage and hacker intrusion; the innovative design of log management enables developers to quickly respond to and handle online problems, improving the maintainability and traceability of the system; the automated vulnerability detection and log anomaly detection functions reduce manpower investment and improve the stability and security of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a structural diagram of a backend scaffolding system that improves security and logging.

[0014] Figure 2 It is a flowchart of a backend scaffolding method for improving security and logging. DETAILED DESCRIPTION

[0015] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.

[0016] As attached Figure 1As shown, a back-end scaffolding system for improving security and logs includes a security module, a log management module, and a dynamic expansion module; The security module implements access rights setting for different roles, multi-level data encryption, monitoring backend and alarm mechanism, and automatic detection and repair of vulnerabilities; The log management module realizes unified management of logs, sets traceability and link ID for logs, automatically classifies logs of different levels, filters invalid logs, and monitors log anomalies; The dynamic expansion module can flexibly add or remove security modules and log modules, and dynamically expand module functions.

[0017] Further, a back-end scaffolding system for improving security and logging, the security module includes a role access control submodule, a multi-level encryption mechanism submodule, a security audit submodule, a detection and alarm submodule, and an automated vulnerability detection and repair submodule; The role access control submodule introduces a dynamic permission management model, combines the mapping relationship between users, roles and permissions, and flexibly controls access permissions through automatically generated configuration files to ensure data security; The multi-level encryption mechanism submodule uses encryption algorithms to encrypt sensitive data during storage and transmission, and introduces a key-based dynamic rotation mechanism to prevent the key from being used for a long time, which may lead to security risks. The security audit submodule integrates a full range of security audit functions to monitor backend API calls, user behavior trajectories and potential attack behaviors in real time; When the detection and alarm submodule detects suspicious behavior, it automatically triggers an alarm and generates a detailed security audit log; The automatic vulnerability detection and repair submodule regularly scans the security vulnerabilities in the dependent packages and codes, provides automatic repair suggestions, and prompts developers to repair them.

[0018] Further, a back-end scaffolding system for improving security and logging, wherein the encryption algorithms include AES and RSA; The user's behavior track includes SQL injection; The potential attack behaviors include cross-site scripting attacks (XSS).

[0019] Further, a back-end scaffolding system for improving security and logs, the log management module includes a centralized log management submodule, a traceability and link log submodule, a log automatic classification submodule, a log filtering submodule, a log anomaly detection submodule, and a log anomaly marking submodule; The centralized log management submodule integrates ELK or Prometheus log collection and visualization tools to achieve unified log management, provide real-time analysis and display, and facilitate developers and operation and maintenance personnel to quickly locate and solve problems; The traceability and link log submodules have built-in distributed tracing functions. By assigning a unique request ID to each request, tracking the flow path of each request, and recording detailed link logs, it ensures that the source of the problem can be traced in a complex microservice architecture. The log automatic classification submodule realizes the classification and storage of logs based on different levels; The log filtering submodule automatically filters out important log information based on keywords and time period dimensions, reducing the impact of redundant logs on problem location; The log anomaly detection submodule uses a machine learning algorithm to train historical log data and automatically identify abnormal patterns and error types in the logs; When an unexpected abnormal log appears in the log abnormality marking submodule, an alarm is automatically triggered and possible abnormal points are marked.

[0020] Furthermore, a backend scaffolding system for improving security and logging, wherein the integrated ELK includes Elasticsearch, Logstash, and Kibana; The different levels of logs include INFO, WARN, and ERROR.

[0021] As attached Figure 2 As shown, a backend scaffolding method for improving security and logging includes the following sub-steps: User login: User authentication uses the password mode in Oauth2. After successful system authentication, SpringSecurity is used to authenticate access resources to determine whether the user has permission to access the interface. Storing data: Design sensitive information to be encrypted and stored in a list in a masked form; The sensitive information includes mobile phone number, ID number, and email address; Platform display: Microservices collect data through filebeat by mounting the sidecar container, filter the log information through logstash, aggregate it into ES for storage, and display it on the monitoring platform; Log identification: log identification of exceptions thrown by the system and identification of log information with special identification; The special identifier includes a system-defined error identifier; Collect log information: collect user login log information, operation log information, and record suspicious attack operation log information through AOP tracking; Link tracking: When the microservice is started, add javaagent to collect link data and aggregate it into skywalking to track the service link; Alarm notification: When the service abnormality exceeds the critical value, the alarm information will be pushed to the service administrator via email; Problem troubleshooting: Managers troubleshoot service problems through the monitoring platform.

[0022] Specific embodiment 1 The core code of role-based access control RBAC is: public class RBACSecurity { / / User role and permission mapping table private static Map <String, List <string>>rolePermissions = newHashMap<>(); / / Initialize roles and permissions static { rolePermissions.put("admin", List.of("read", "write", "delete","update")); rolePermissions.put("user", List.of("read")); } / / Check if the user has permission to access the resource public static boolean hasPermission(String role, String action) { List <string>permissions = rolePermissions.get(role); return permissions != null&&permissions.contains(action); } public static void main(String[] args) { String role = "user"; / / Assume user role String action = "write"; / / The action the user wants to perform if (hasPermission(role, action)) { System.out.println("Access allowed"); } else { System.out.println("Access denied"); } } }.

[0023] Specific embodiment 2 The core code of the multi-level encryption mechanism is: public class EncryptionUtil { / / AES encryption public static byte[] encryptAES(String data, SecretKey secretKey)throws Exception { Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, secretKey); return cipher.doFinal(data.getBytes()); } / / RSA encrypted AES key public static byte[] encryptRSA(SecretKey aesKey, PublicKeypublicKey) throws Exception { Cipher cipher = Cipher.getInstance("RSA"); cipher.init(Cipher.ENCRYPT_MODE, publicKey); return cipher.doFinal(aesKey.getEncoded()); } public static void main(String[] args) throws Exception { / / Generate AES key KeyGenerator keyGen = KeyGenerator.getInstance("AES"); keyGen.init(256); / / 256-bit AES encryption SecretKey aesKey = keyGen.generateKey(); / / Generate an RSA key pair KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(2048); / / 2048-bit RSA KeyPair keyPair = keyPairGen.generateKey(); / / Data encryption String sensitiveData = "Sensitive Information"; byte[] encryptedData = encryptAES(sensitiveData, aesKey); System.out.println("Encrypted data: " + Base64.getEncoder().encodeToString(encryptedData)); / / AES key encryption byte[] encryptedKey = encryptRSA(aesKey, keyPair.getPublic()); System.out.println("Encrypted AES key: " + Base64.getEncoder().encodeToString(encryptedKey));。

[0024] Specific Embodiment 3 The core code for log classification and filtering is as follows: <!-- logback.xml configuration --> <configuration> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern> %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n< / pattern> < / encoder> < / appender> <!-- Define logs at different levels --> <logger name="com.example" level="DEBUG" additivity="false"> <appender-ref ref="CONSOLE" / > < / logger> <root level="INFO"> <appender-ref ref="CONSOLE" / > < / root> < / configuration> public class LogExample { private static final Logger logger = LoggerFactory.getLogger(LogExample.class); public static void main(String[] args) { logger.info("INFO level log - General system operation information"); logger.warn("WARN level log - Potential problems may exist"); logger.error("ERROR level log - System error occurred"); } }。

[0025] Specific Embodiment 4 The core code for log tracing and centralized management is as follows: / / Send the log to a remote server (pseudo-code) public class LogService { public static void sendLog(String logMessage) { / / Connect to the Logstash service in ELK and send the log information / / Example of sending log data via HTTP HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("http: / / logstash-server:5044")) .POST(HttpRequest.BodyPublishers.ofString(logMessage)) .build(); client.sendAsync(request, HttpResponse.BodyHandlers.ofString()) .thenAccept(response ->System.out.println("Log sent: " + response.statusCode())); } }.

[0026] This solution implements a multi-level security mechanism through a back-end scaffolding system and method for improving security and logging, thereby improving the security of the back-end system and preventing common risks such as data leakage and hacker intrusion. The innovative design of log management enables developers to quickly respond to and handle online problems, improving the maintainability and traceability of the system. The automated vulnerability detection and log anomaly detection functions reduce manpower investment and improve the stability and security of the system.

[0027] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.< / string> < / string>

Claims

1. A back-end scaffolding system for improving security and logging, characterized in that: Including security module, log management module and dynamic expansion module; The security module implements access rights setting for different roles, multi-level data encryption, monitoring backend and alarm mechanism, and automatic detection and repair of vulnerabilities; The log management module realizes unified management of logs, sets traceability and link ID for logs, automatically classifies logs of different levels, filters invalid logs, and monitors log anomalies; The dynamic expansion module can flexibly add or remove security modules and log modules, and dynamically expand module functions.

2. A back-end scaffolding system for improving safety and logging according to claim 1, characterized in that: The security module includes a role access control submodule, a multi-level encryption mechanism submodule, a security audit submodule, a detection and alarm submodule, and an automated vulnerability detection and repair submodule; The role access control submodule introduces a dynamic permission management model, combines the mapping relationship between users, roles and permissions, and flexibly controls access permissions through automatically generated configuration files; The multi-level encryption mechanism submodule uses encryption algorithms to encrypt sensitive data during storage and transmission, and introduces a key-based dynamic rotation mechanism to prevent the key from being used for a long time, which may lead to security risks. The security audit submodule integrates a full range of security audit functions to monitor backend API calls, user behavior trajectories and potential attack behaviors in real time; When the detection and alarm submodule detects suspicious behavior, it automatically triggers an alarm and generates a detailed security audit log; The automatic vulnerability detection and repair submodule regularly scans the security vulnerabilities in the dependent packages and codes, provides automatic repair suggestions, and prompts developers to repair them.

3. A back-end scaffolding system for improving safety and log according to claim 2, characterized in that: The encryption algorithms include AES and RSA; The user's behavior track includes SQL injection; The potential attack behaviors include cross-site scripting attacks (XSS).

4. A back-end scaffolding system for improving safety and log according to claim 1, characterized in that: The log management module includes a centralized log management submodule, a traceability and link log submodule, a log automatic classification submodule, a log filtering submodule, a log anomaly detection submodule, and a log anomaly marking submodule; The centralized log management submodule integrates ELK or Prometheus log collection and visualization tools to achieve unified log management and provide real-time analysis and display; The traceability and link log submodules have built-in distributed tracing functions. By assigning a unique request ID to each request, tracking the flow path of each request, and recording detailed link logs, it ensures that the source of the problem can be traced in a complex microservice architecture. The log automatic classification submodule realizes log classification storage based on different levels; The log filtering submodule automatically filters out important log information based on keywords and time period dimensions, reducing the impact of redundant logs on problem location; The log anomaly detection submodule uses a machine learning algorithm to train historical log data and automatically identify abnormal patterns and error types in the logs; When an unexpected abnormal log appears in the log abnormality marking submodule, an alarm is automatically triggered and possible abnormal points are marked.

5. A back-end scaffolding system for improving safety and log according to claim 4, characterized in that: The integrated ELK includes Elasticsearch, Logstash, and Kibana; The different levels of logs include INFO, WARN, and ERROR.

6. A back-end scaffolding method for improving security and logging, implemented based on a back-end scaffolding system for improving security and logging as described in any one of claims 1 to 5, characterized in that: It includes the following sub-steps: User login: User authentication uses the password mode in Oauth2. After successful system authentication, SpringSecurity is used to authenticate access resources to determine whether the user has permission to access the interface. Storing data: Design sensitive information to be encrypted and stored in a list in a masked form; The sensitive information includes mobile phone number, ID number, and email address; Platform display: Microservices collect data through filebeat by mounting the sidecar container, filter the log information through logstash, aggregate it into ES for storage, and display it on the monitoring platform; Log identification: log identification of exceptions thrown by the system and identification of log information with special identification; The special identifier includes a system-defined error identifier; Collect log information: collect user login log information, operation log information, and record suspicious attack operation log information through AOP tracking; Link tracking: When the microservice is started, add javaagent to collect link data and aggregate it into skywalking to track the service link; Alarm notification: When the service abnormality exceeds the critical value, the alarm information will be pushed to the service administrator via email; Problem troubleshooting: Managers troubleshoot service problems through the monitoring platform.