Security design scheme generation method and device, and storage medium
Patent Information
- Application Number
- CN202510475649.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2026-10-23
AI Technical Summary
[0006]在本申请实施例中,利用目标应用的数据流图进行威胁建模,得到目标应用涉及的各应用组件对应的潜在威胁;然后将潜在威胁和推荐规则提示词作为第一大语言模型的输入,使第一大语言模型在推荐规则提示词的约束和引导下,从安全策略知识库中筛选出与潜在威胁匹配且符合目标应用设计需求的推荐安全策略,进而生成准确的、符合预期的安全设计方案。本申请实施例提供的方案可以降低安全设计方案对人工的依赖,显著提升安全设计方案的生成效率,并可以确保安全设计方案的准确性,为目标应用的安全设计工作提供了高效、可靠的解决方案。
Smart Images

Figure CN122964882A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to, but are not limited to, the field of computer technology, and in particular to a method for generating a security design scheme, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] In the context of the ongoing and in-depth advancement of digital transformation, application software, as a key carrier of data interaction and business operations, is facing increasing importance in terms of cybersecurity design. Threat modeling, as a systematic security analysis method, has been widely applied in the early stages of application software development. Its core lies in accurately identifying and deeply analyzing potential security threats, and then formulating corresponding security strategies. Through threat modeling tools, development teams can keenly identify the system's attack surface during the design phase, promptly discover potential security vulnerabilities, and formulate highly targeted security design solutions accordingly.
[0003] However, existing threat modeling tools have certain limitations in practical applications. These tools typically output a lengthy and complex threat list with numerous entries, many of which do not match the actual design requirements and are unnecessary for inclusion in the security design plan. This forces technical personnel to manually filter each item in the threat list based on the actual plan to ultimately create a security design that meets the requirements. This process not only requires implementation personnel to possess certain security design knowledge but also demands significant manpower and time, resulting in low efficiency. Furthermore, the manual screening process is prone to omissions and biases, affecting the quality and accuracy of the security design plan. Summary of the Invention
[0004] This application provides a method for generating a security design scheme, an electronic device, a computer-readable storage medium, and a computer program product, aiming to improve the efficiency and accuracy of generating security design schemes.
[0005] In a first aspect, embodiments of this application provide a method for generating a security design scheme, the method comprising: Threat modeling is performed based on the data flow diagram of the target application to obtain the potential threats corresponding to each application component involved in the target application; The first large language model determines recommended security policies from the security policy knowledge base based on the potential threats and recommended rule prompts corresponding to each application component, and generates a security design scheme corresponding to the target application based on the recommended security policies.
[0006] In this embodiment, threat modeling is performed using the data flow graph of the target application to obtain the potential threats corresponding to each application component involved in the target application. Then, the potential threats and recommended rule prompts are used as input to a first language model. Under the constraint and guidance of the recommended rule prompts, the first language model filters recommended security policies from the security policy knowledge base that match the potential threats and meet the design requirements of the target application, thereby generating an accurate and expected security design scheme. The solution provided in this embodiment can reduce the reliance on manual intervention in security design, significantly improve the efficiency of security design generation, and ensure the accuracy of the security design, providing an efficient and reliable solution for the security design work of target applications.
[0007] Secondly, embodiments of this application also provide an electronic device, including: at least one processor; at least one memory for storing at least one program; at least one program is executed by at least one processor to perform the security design scheme generation method described in the first aspect above.
[0008] Thirdly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions, which are used to execute the security design scheme generation method described in the first aspect above.
[0009] Fourthly, embodiments of this application also provide a computer program product, including a computer program or computer instructions, wherein the computer program or computer instructions are stored in a computer-readable storage medium, a processor of an electronic device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, causing the electronic device to perform the security design scheme generation method described in the first aspect above.
[0010] For a description of the beneficial effects of any of the second to fourth aspects, please refer to the description of the beneficial effects of the first aspect, which will not be repeated here.
[0011] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description
[0012] Figure 1 A schematic diagram of the architecture of a security design scheme generation system applicable to the embodiments of this application; Figure 2 A flowchart illustrating a method for generating a security design scheme provided in this application embodiment. Figure 1 ; Figure 3 A schematic diagram of a data flow graph provided in an embodiment of this application; Figure 4 A flowchart illustrating a method for generating a security design scheme provided in this application embodiment. Figure 2 ; Figure 5 A schematic diagram of a data flow diagram described in text format, provided for an embodiment of this application; Figure 6 A flowchart illustrating a method for generating a security design scheme provided in this application embodiment. Figure 3 ; Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0013] To make the objectives, technical methods, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0014] It should be noted that although the flowchart shows a logical order, in some cases, the steps shown or described may be performed in a different order than that shown in the flowchart. In the description of the specification, claims, and the foregoing drawings, "at least one" means one or more; "more than" means two or more; "greater than," "less than," and "exceeding" are understood to exclude the stated number; "above," "below," and "within" are understood to include the stated number. The use of terms such as "first," "second," etc., is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly specifying the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0015] In this embodiment, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: the existence of a alone, the existence of b alone, the existence of c alone, the simultaneous existence of a and b, the simultaneous existence of a and c, the simultaneous existence of b and c, or the simultaneous existence of a, b, and c, where a, b, and c can be single or multiple.
[0016] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0017] To better understand and explain the solutions of the embodiments of this application, some technical terms involved in the embodiments of this application will be briefly explained below.
[0018] Large Language Model (LLM) is an artificial intelligence model based on deep learning technology, which has powerful language understanding, generation and processing capabilities.
[0019] In large models, a knowledge base refers to a collection of information and data used to train and optimize the model. A knowledge base typically contains textual content covering a wide range of topics, domains, and questions, which helps the model learn language patterns, grammatical structures, and how to generate meaningful responses.
[0020] A cue word is a text describing a task that is input by the user when interacting with a large language model.
[0021] A Data Flow Diagram (DFD) is a graphical tool used to describe and visualize the data processing flow of an information system. It is used in the system analysis and design phases, particularly in structured and object-oriented design, to help understand the system's functions, components, and how they interact with each other. It plays a crucial role in security design, helping to identify system security risks, understand potential weaknesses in the data processing flow, and design effective defense strategies. It's important to understand that a data flow diagram primarily consists of four basic elements: External Entities, Processes, Data Stores, and Data Flows. External Entities represent entities outside the system, such as users, other systems, or devices. These entities are the sources or destinations of data; they interact with the system but are not part of the system itself, and are typically represented by rectangles. Processes represent functional modules within the system that process or transform data. Processes include receiving input data, processing it, and outputting results; they are typically represented by circles or ellipses. Data storage refers to the location where data is stored in a system, such as a database, file, or data table. Data storage is an internal data temporary storage area used to store data needed during processing. Data storage is usually represented by a cylinder. Data flow represents the direction and content of data flowing in a system. Data flow connects external entities, processing procedures, and data storage, indicating the data transmission path. Data flow is often represented by arrows, with the name or description of the data marked on the arrow.
[0022] Threat modeling is a systematic threat analysis method used to identify, assess, and mitigate potential threats that may affect the security of a system or application. It analyzes the system's functions, components, data flows, and operational processes to determine which parts are most vulnerable to attack and propose corresponding defensive measures.
[0023] Security design refers to the use of a series of technologies and strategies to ensure the security of a system, product, or service during its development. It is a comprehensive process designed to prevent, detect, and respond to various potential security threats while meeting business needs and compliance requirements.
[0024] To better understand the solution provided in the embodiments of this application, the solution will be described below in conjunction with a specific application scenario.
[0025] Please see Figure 1 This is a schematic diagram of the architecture of a security design scheme generation system applicable to embodiments of this application. It is understood that the security design scheme generation method provided in this application can be applied to, but is not limited to, applications such as... Figure 1 In the application scenarios shown.
[0026] like Figure 1 As shown, the architecture of the security design scheme generation system in this example may include, but is not limited to, server 10, terminal 20, and database 30. Server 10, terminal 20, and database 30 can interact via network 40.
[0027] Server 10 performs threat modeling based on the data flow diagram of the target application, obtaining the potential threats corresponding to each application component involved in the target application. Server 10 then uses a first language model to determine recommended security policies from the security policy knowledge base based on the potential threats corresponding to each application component and recommended rule prompts. Based on the recommended security policies, server 10 generates a security design scheme corresponding to the target application. Server 10 sends the security design scheme to terminal 20, which displays the security design scheme to the user. Server 10 then stores the security design scheme in database 30.
[0028] It is understood that the above is only one example, and this embodiment is not limited here.
[0029] Terminals include, but are not limited to, smartphones (such as Android phones, iOS phones, etc.), mobile phone emulators, tablets, laptops, digital broadcast receivers, MIDs (Mobile Internet Devices), PDAs (Personal Digital Assistants), smart voice interaction devices, smart home appliances, and in-vehicle terminals.
[0030] A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0031] The aforementioned networks may include, but are not limited to, wired networks and wireless networks. Wired networks include local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). Wireless networks include Bluetooth, Wi-Fi, and other networks that enable wireless communication. Specific details can be determined based on actual application scenario requirements and are not limited here.
[0032] Please see Figure 2 This is a flowchart illustrating a method for generating a security design scheme according to an embodiment of this application. Figure 1This method can be executed by any electronic device, such as a server; as an optional implementation, the method can be executed by a server in a security design scheme generation system. For ease of description, the following descriptions of some optional embodiments will use a server as the execution subject of the method. Figure 2 As shown, the method for generating a security design scheme provided in this embodiment includes the following steps: Step S101: Perform threat modeling based on the data flow diagram of the target application to obtain the potential threats corresponding to each application component involved in the target application.
[0033] Specifically, the target application can be application software or application system designed to meet specific user needs, such as desktop application software running on personal computers, mobile application software running on smartphones or tablets, and online applications accessed through a browser; or software systems running on embedded devices, such as car navigation systems.
[0034] A data flow diagram of the target application is used to describe the data flow and processing within the target application. For example, Figure 3 This illustration shows a data flow diagram provided in an embodiment of this application. In this example, the client is an external entity, the security module is a process, and the database is a data store. In this embodiment, the external entity, the process, and the data store are all treated as application components, and the arrow connecting the application components represent data flow.
[0035] This application embodiment utilizes data flow graphs for threat modeling. Specifically, it involves analyzing each element in the data flow graph using threat modeling tools to identify potential threats to each element, such as data leakage (theft during data transmission or storage), data tampering (unauthorized modification of data during flow), and the vulnerability of the client's user interface to malicious attacks based on user input. The threat modeling tool generates a threat list based on the identified potential threats. This threat list may include potential threats associated with various application components, as well as corresponding mitigation measures for each potential threat. In a specific example, the threat list may be as shown in Table 1 below: Table 1 - Example of a Threat List
[0036] The threat list shown in Table 1 includes multiple application components (client, security module, and database) and the potential threats corresponding to each application component.
[0037] For example, the threat modeling tools mentioned above can be STRIDE model, PASTA model, CVSS model, etc.
[0038] Step S102: Based on the potential threats and recommended rule prompts corresponding to each application component, the first language model determines the recommended security policy from the security policy knowledge base, and generates the security design scheme corresponding to the target application based on the recommended security policy.
[0039] For example, in specific implementation of the embodiments of this application, a security policy knowledge base can be pre-built. The security policy knowledge base may include multiple security policies, threats that each security policy can mitigate, and recommended attributes of each security policy.
[0040] In a specific example, the security policy knowledge base can be shown in Table 2 below: Table 2 - Examples of Security Policy Knowledge Bases
[0041] Table 2 shows a security policy knowledge base storing various security policies, including WAF firewalls, content security policies, user input validation, user lockout mechanisms, and key rotation. For each security policy, the knowledge base records the threats it can mitigate, configuration attributes, and priority attributes. Configuration attributes define whether a security policy is a default or optional security capability on the system; priority attributes determine whether a security policy is a general or application-specific policy. It should be noted that in this embodiment, the configuration and priority attributes of the security policy are considered recommended attributes. These recommended attributes in the security policy knowledge base can provide a basis for the first language model to decide whether to include the corresponding security policy in the security design scheme.
[0042] For example, in the specific implementation of this application embodiment, recommendation rule prompts can be pre-constructed. These prompts are primarily used to provide the first major language model with rules for filtering security policies written into security design schemes based on recommendation attributes. Taking the security policy knowledge base shown in Table 2 as an example, the recommendation rule prompts can be as follows: security policies marked as "general" and "optional" are used as recommended security design scheme entries; security policies marked as "application" are used as mandatory security design scheme entries; and security policies marked as "default" are considered security capabilities already possessed by the system and are not included in the content output of the security design scheme.
[0043] As shown in Table 2, the security policy knowledge base includes multiple security policies, threats that each security policy can mitigate, and recommended attributes for each security policy. Recommended security policies meet the following conditions: the threats that the recommended security policy can mitigate include potential threats; and the recommended attributes of the recommended security policy conform to the indications of the recommendation rule prompts. In this embodiment, the potential threats output from threat modeling and the recommendation rule prompts are used as input to the first large language model. Under the constraint and guidance of the recommendation rule prompts, the first large language model selects recommended security policies from the security policy knowledge base that match potential threats and meet the design requirements of the target application, thereby generating an accurate and expected security design scheme.
[0044] Specifically, the first major language model first searches for candidate security policies associated with potential threats in the security policy knowledge base. Then, based on recommendation rule prompts and the recommendation attributes of the candidate security policies, it filters out recommended security policies from the candidate security policies. Finally, it generates a security design scheme based on the recommended security policies. The solution provided in this application can reduce the dependence on manual processing for security design schemes, significantly improve the efficiency of generating security design schemes, and ensure the accuracy of security design schemes, providing an efficient and reliable solution for the security design work of target applications.
[0045] For example, if the threat modeling output includes potential threats related to security modules such as "SQL remote injection," and the first language model searches the security policy knowledge base for a security policy that can mitigate "SQL remote injection," finding "deploying a WAF firewall" as the solution, and the recommended attributes for "deploying a WAF firewall" recorded in the security policy knowledge base are "general" and "optional," then "deploying a WAF firewall" will be included as a recommended item in the security design scheme. As another example, if potential threats related to security modules also include "password brute-force attacks," and the first language model searches the security policy knowledge base for a security policy that can mitigate "password brute-force attacks," finding "key rotation" as the solution, and the recommended attribute for "key rotation" recorded in the security policy knowledge base is "default," then "key rotation" will be considered a security capability already present in the system and will not be included in the security design scheme output; in other words, it will not be written into the security design scheme.
[0046] In one possible implementation of this application, the data flow diagram includes attribute descriptions corresponding to application components and attribute descriptions corresponding to data flows. The threat modeling tool analyzes the application components, the data flows between application components, the attribute descriptions corresponding to the application components, and the attribute descriptions corresponding to the data flows, and outputs corresponding threat modeling results. For example, the attribute descriptions include at least one of the following: element type, scenario type, function description, technology type, and protocol type. For instance, in one example, the attribute descriptions for the application component "Security Module" include: "Element Type: Processing Procedure," "Scenario Type: Mine," "Function Description: Function for Handling Confidential Data_UI," and "Technology / Protocol Type: HTTPS_OAUTH_JDBC"; the attribute descriptions for the data flow "Login" include: "Scenario Type: Mine" and "Technology / Protocol Type: HTTPS_OAUTH."
[0047] It should be understood that even the same application component or data flow may employ different technologies and protocols in different scenario types. Clearly, this difference will affect the results of threat modeling. For example, the threats faced by the "security module" in a "mining scenario" are different from those faced in a "centralized management scenario." In this embodiment, by combining scenario-based threat modeling, the final generated security design scheme can be more accurate and better meet expectations.
[0048] Please see Figure 4 This is a flowchart illustrating a method for generating a security design scheme according to an embodiment of this application. Figure 2 .like Figure 4 As shown, in some embodiments, the security design scheme generation method of this application further includes: Step S201: Obtain the design scheme text corresponding to the target application. The design scheme text is used to describe the multiple application components involved in the target application and the data flow between the application components.
[0049] In a specific example, the design proposal text for the target application is as follows: ToB Network Management Login Function: In a mining scenario, users initiate a login request to the ToB network management server by entering their username and password through the client interface. The system provides an authentication and accurate feedback mechanism by comparing the username and password. Upon successful authentication, the user should be able to gain legitimate access to the system; conversely, upon authentication failure, the system should provide a clear and concise error message to the client. The system involves the following elements: client, security module, and database.
[0050] In the example above, the design document describes the data transmission and processing flow within the system, as well as the elements involved—client, security module, and database. Based on the description in the design document, the multiple application components involved in the target application and the data flow between these components can be identified, thereby generating a data flow diagram corresponding to the target application.
[0051] Step S202: Generate a data flow diagram based on the multiple application components involved in the target application and the data flow between the application components using the second language model.
[0052] This application embodiment generates a data flow diagram (DFD) corresponding to the target application through a second language model. Specifically, the design scheme text of the target application is input into the second language model, which uses its natural language understanding and reasoning analysis capabilities to automatically parse out the application components involved in the target application design scheme and the data flow between these components, thereby generating a data flow diagram (DFD), which greatly improves the efficiency of data flow diagram generation.
[0053] In one possible implementation of this application, the data flow diagram is described in text format, that is, the traditional graphical data flow diagram is replaced with a text description, so as to describe the elements contained in the data flow diagram and the relationships between the elements through text.
[0054] For example, Figure 5 This illustration shows a data flow diagram described in text format according to an embodiment of this application. It is understood that... Figure 5 The example is with Figure 3 The graphical data flow diagram shown corresponds to a text-formatted description of the data flow diagram. In this example, the target application involves multiple application components, including a client, a security module, and a database. These components are represented by their shapes in the graphical data flow diagram, allowing us to distinguish the element types corresponding to each component. This example also describes the data flow path within the system, such as "login" data flowing from the "client" to the "security module."
[0055] like Figure 5As shown, data flow diagrams described in text format can also include attribute descriptions for each application component and the data flow itself. For example, the attribute descriptions for the component "Client" include: "Element type: external_entity", "Functions: user input_page click", and "Technology type: HTTPS_OAUTH"; the attribute descriptions for the data flow "Login" from "Client" to "Security Module" include: "Element type: data flow" and "Protocol type: HTTPS_OAUTH".
[0056] like Figure 5 As shown, data flow diagrams described in text format can also include scene type descriptions, such as marking the scene type as "mine" in the text.
[0057] It should be understood that most existing threat modeling tools use proprietary data formats, which have high barriers to understanding and are inconvenient to edit. In contrast, this application's embodiment presents the data flow diagram in text format, offering the following advantages: First, it conforms to the UML standard and is highly versatile; second, its structure is clearly hierarchical and logically sound, greatly reducing the difficulty of understanding and helping system analysts, developers, and security experts understand the system's functions, components, and the data interaction methods between them; third, it is compatible with various visualization tools, providing excellent flexibility and scalability in data display and analysis.
[0058] It should be understood that, in order for threat modeling tools to be compatible with data flow diagrams described in text format, threat modeling element definitions can be pre-defined during implementation. These definitions indicate the corresponding attribute descriptions of each threat modeling element in the data flow diagram. When performing threat modeling, the relevant elements used for threat modeling can be extracted from the text-formatted data flow diagram based on the pre-defined threat modeling element definitions.
[0059] In a specific example, the threat modeling elements can be defined as shown in Table 3 below.
[0060] Table 3 - Examples of Threat Modeling Element Definitions
[0061] The following is combined Figure 5 The data flow diagram described in text format shown in Figure 3 and the threat modeling element definitions shown in Table 3 illustrate how to extract threat modeling elements from the data flow diagram.
[0062] In the threat modeling element definition examples provided in Table 3, threat modeling elements include elements, component functions, technologies, and protocols. Each threat modeling element has a corresponding extended attribute name and a description of its values. For example, for the threat modeling element "element," its... Figure 5 The extended attribute name in the data flow diagram described in text format shown is "element", and the corresponding value can be any one of "external_entity", "flow", "process" or "data_storage".
[0063] For example, threat modeling based on the data flow diagram of the target application may include: extracting elements from the data flow diagram of the target application according to a preset threat modeling element definition to obtain multiple threat modeling elements, wherein the threat modeling element definition is used to indicate the attribute description corresponding to each threat modeling element in the data flow diagram; and performing threat modeling based on the threat modeling elements to obtain the potential threats corresponding to each application component involved in the target application.
[0064] In practical implementation, the aforementioned text-formatted data flow diagram can be generated using UML modeling tools such as StarUML. Taking the generation of a text-formatted data flow diagram using StarUML as an example, StarUML is a text-based modeling tool. In its environment, it generally uses PlantUML syntax to generate corresponding diagrams based on text content. In this embodiment, a method of extending the StarUML format description is adopted to construct a text-based data flow diagram suitable for threat modeling. Specifically, in the PlantUML syntax text, corresponding attribute descriptions are added for components and data flows, such as extended attributes like functions, technologies, and protocols, thereby covering all the elements required for threat modeling. Simultaneously, based on pre-set threat modeling element definitions, the attribute descriptions in the text-formatted data flow diagram are aligned with the format of the threat modeling element definitions to ensure compatibility and smooth operation with threat modeling tools.
[0065] In one possible implementation of this application, a data flow diagram is generated using a second language model based on multiple application components involved in the target application and the data flow between application components. The specific process may include: obtaining attribute descriptions corresponding to each application component and attribute descriptions corresponding to the data flow between application components from an application component knowledge base using the second language model; and generating a data flow diagram described in text format based on the attribute descriptions corresponding to each application component and the attribute descriptions corresponding to the data flow between application components.
[0066] Specifically, the application component knowledge base stores attribute information for various components, including element type, function name, and the type of technology / protocol used. In this example, the second language model uses the component attribute information provided by the application component knowledge base to determine the attribute descriptions of each application component involved in the target application, as well as the attribute descriptions of the data flow between application components, and then generates a data flow diagram described in text format.
[0067] In a specific example, the application component knowledge base can be as shown in Table 4.
[0068] Table 4 - Examples of Application Component Knowledge Bases
[0069] In the application component knowledge base example provided in Table 4, the content of the application component knowledge base includes: component name, element type, scenario type, function name, and technology / protocol. In practical implementation, the second language model, leveraging its natural language understanding and reasoning capabilities, can parse the application components involved in the target application and the data flow transmitted between these components based on the design scheme text. It can then search for the attribute descriptions of the corresponding components in the application component knowledge base, including the component's element type, function, and the technology used. The attribute descriptions of the data flow mainly include the protocols used by the data flow, which can be determined based on the technologies used by the components at both ends of the data flow.
[0070] It should be understood that the attributes of the same component may differ in different scenarios. Taking the application component knowledge base provided in Table 4 as an example, the "Security Module" uses "HTTPS_OAUTH" technology in the "Mining" scenario, while it uses "HTTPS" technology in the "Centralized Management" scenario. This difference will ultimately affect the results of threat modeling. For example, because the "Security Module" uses different technologies in the "Mining" and "Centralized Management" scenarios, the threats it faces in the "Mining" scenario and the threats it faces in the "Centralized Management" scenario will also differ. To ensure that the data flow diagram used for threat modeling closely matches the specific scenario, in this example, the scenario type is first clearly defined in the application component knowledge base. Subsequently, the second language model extracts the attribute descriptions corresponding to each application component and the data flow transmitted between them from the application component knowledge base based on the scenario type.
[0071] In one possible implementation of this application, the design text is also used to describe the scenario types involved in the target application; the attribute descriptions corresponding to each application component and the attribute descriptions corresponding to the data flow transmitted between application components are obtained from the application component knowledge base through the second large language model. The specific process may include: obtaining the attribute descriptions corresponding to each application component and the attribute descriptions corresponding to the data flow transmitted between application components from the application component knowledge base according to the scenario type through the second large language model.
[0072] In other words, in this example, the target application scenario types are clearly defined in the design solution text. The second language model extracts the attribute descriptions corresponding to each application component and the data flow between them from the application component knowledge base based on the scenario types described in the design solution text.
[0073] In one possible implementation of this application, a recommended security policy is determined from a preset security policy knowledge base using a first major language model based on the potential threats and recommendation rule prompts corresponding to each application component. The specific process may include: determining the recommended security policy from a preset security policy knowledge base using a first major language model based on the design scheme text of the target application, the potential threats and recommendation rule prompts corresponding to each application component.
[0074] In this example, the input to the first language model includes: the design scheme text of the target application, the potential threats corresponding to each application component, and the recommended rule prompts. Based on the above input, the first language model determines the recommended security policy from the preset security policy knowledge base.
[0075] It should be understood that in this example, the input to the first language model includes a design scheme text, which describes information about the target application's functionality, architecture, processes, data flow, etc. This forms the basis of the security design. The first language model can use this information to understand the specific circumstances of the target application and thus generate a targeted security design scheme. Furthermore, the design scheme text can limit the scope of the security design scheme generated by the first language model. The model will generate matching security design recommendations based on the specific characteristics and requirements of the target application described in the design scheme text, avoiding the generation of content that is irrelevant or inapplicable to the actual application. For example, if the design scheme text limits the design of the target application to only the internal system, in this case, the security design scheme can only focus on the internal components of the system (i.e., components within the server), without providing security recommendations for external entities (clients). In other words, the recommended security strategy determined by the first language model should conform to the instructions in the target application's design scheme text.
[0076] Specifically, the security policy knowledge base can include: multiple security policies, threats that each security policy can mitigate, and recommended attributes of each security policy; therefore, the recommended security policy selected by the first language model from the security policy knowledge base should meet the following conditions: the threats that the recommended security policy can mitigate include potential threats; the recommended attributes of the recommended security policy conform to the indications of the recommendation rule prompts; and the recommended security policy conforms to the indications of the design scheme text of the target application.
[0077] In this example, the input to the first language model includes the design scheme text of the target application, the potential threats obtained through threat modeling, and the recommended rule prompts. These three factors together guide the first language model in generating security design schemes, making the security design schemes generated by the model more targeted and more in line with the requirements of actual application scenarios.
[0078] Please see Figure 6 This is a flowchart illustrating a method for generating a security design scheme according to an embodiment of this application. Figure 3 .like Figure 6 As shown, in some embodiments, the security design scheme generation method of this application includes: Step S301: Obtain the design scheme text of the target application.
[0079] Specifically, the above design scheme text describes the types of scenarios involved in the target application, the multiple application components involved in the target application, and the data flow between the application components.
[0080] Step S302: Input the design scheme text into the second language model, and generate a data flow diagram described in text format through the second language model.
[0081] Specifically, the second language model can obtain the attribute descriptions of each application component and the attribute descriptions of the data flow between application components from the pre-set application component knowledge base according to the scenario type, and generate a data flow diagram described in text format.
[0082] Furthermore, the data flow diagram described in text format includes attribute descriptions of application components (such as element type, function description, and technology used) and attribute descriptions of data flows (such as element type and protocol used).
[0083] Step S303: Based on the data flow diagram described in text format, threat modeling is performed to obtain the potential threats corresponding to each application component involved in the target application.
[0084] Step S304: Input the design scheme text of the target application, the potential threats and recommendation rule prompts corresponding to each application component involved in the target application into the first language model, and generate the security design scheme corresponding to the target application through the first language model.
[0085] Specifically, the first major language model determines recommended security policies from a pre-set security policy knowledge base based on the design scheme text of the target application, the potential threats corresponding to each application component, and the recommended rule prompts, and then generates a security design scheme based on the recommended security policies.
[0086] It should be noted that in some embodiments, after completing the above steps S301-S304, the scenario type in the design scheme text is modified, and then the above steps S301-S304 are re-executed, so that a security design scheme for the target application in another scenario can be obtained.
[0087] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0088] The embodiments of this application can be applied to the security design scenarios of ToB network management systems (network management systems for enterprises).
[0089] It should be understood that with the continuous expansion of 5G network scale and the rapid development of 5G-related technologies, the concept of "5G empowering all industries and facilitating digital transformation" has gained widespread acceptance. Integrated applications based on high-performance 5G communication networks have become the preferred solution for various industries in their industrial informatization development and intelligent upgrading evolution. However, given the cross-industry characteristics and diverse networking methods of ToB networks, their security issues face a complex situation of multiple standards and scenarios, and the security threats they encounter are also different.
[0090] Traditional security design solutions require system engineers to first use industry-standard threat modeling tools to create data flow diagrams, then use these tools to generate a threat list, followed by manual risk analysis based on specific solutions, and finally, the development of mitigation measures and security solutions. This approach not only struggles to handle the complexities of multi-industry, multi-scenario B2B environments but also easily overlooks potential threats.
[0091] This application provides a flexible and efficient method for generating security design schemes. This method fully leverages the powerful understanding and generation capabilities of large models, automating the chaining of key node outputs to ultimately generate a security design scheme. This method significantly lowers the technical threshold for security design, greatly improves the degree of automation, effectively reduces the probability of human error, and also significantly reduces the workload of security design.
[0092] When generating a security design scheme for a ToB network management system using the method provided in this application, the second major language model can be used first to generate corresponding text-format data flow diagrams for various scenarios of the ToB network management system. Next, threat modeling is performed based on the text-format data flow diagrams corresponding to each scenario, thereby accurately obtaining the corresponding threat modeling results for each scenario. Then, based on the threat modeling results generated for each scenario using the first major language model, a highly adaptable security design scheme for the ToB network management system is customized for the corresponding scenario. Through this process, personalized security design schemes can be automatically and intelligently generated for the differentiated security threats faced by different industries in the ToB field. This not only greatly reduces the heavy workload of manual analysis, but more importantly, it can comprehensively cover various complex and ever-changing security scenarios, ensuring that the ToB network management system can obtain comprehensive, accurate, and effective security protection design in different industry applications.
[0093] Please see Figure 7 This application also provides an electronic device, the electronic device 1100 including: At least one processor 1101; At least one memory 1102 is used to store at least one program; At least one program is executed by at least one processor 1101 to implement the security design scheme generation method of any of the foregoing embodiments.
[0094] This application also provides a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. The processor of an electronic device reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the electronic device to perform the security design scheme generation method of any of the foregoing embodiments.
[0095] This application also provides a computer-readable storage medium storing computer-executable instructions for executing the security design scheme generation method of any of the foregoing embodiments.
[0096] It should be understood that in the embodiments of this application, the processor can be a central processing unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0097] In addition, the processor may include one or more of the following: a central processing unit (CPU), a baseband processor, a digital signal processor (DSP), a microprocessor unit (MPU), a microcontroller unit (MCU), a graphics processing unit (GPU), a field programmable gate array (FPGA), an artificial intelligence processor (AI processor), or a neural processing unit (NPU).
[0098] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced synchronous SDRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0099] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0100] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0101] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0102] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0103] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the above functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0104] The above is a detailed description of the preferred embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for generating a security design scheme, the method comprising: Threat modeling is performed based on the data flow diagram of the target application to obtain the potential threats corresponding to each application component involved in the target application; The first language model determines recommended security policies from the security policy knowledge base based on the potential threats and recommendation rule prompts corresponding to each application component, and generates a security design scheme corresponding to the target application based on the recommended security policies.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the design scheme text corresponding to the target application. The design scheme text is used to describe the multiple application components involved in the target application and the data flow transmitted between the application components. The data flow graph is generated using a second language model based on the multiple application components involved in the target application and the data flow transmitted between the application components.
3. The method according to claim 2, characterized in that, The data flow diagram is described in text format and includes attribute descriptions corresponding to the application components and attribute descriptions corresponding to the data flows. The step of generating the data flow graph using the second language model based on the multiple application components involved in the target application and the data flow transmitted between the application components includes: The second language model is used to obtain the attribute descriptions corresponding to each application component and the attribute descriptions corresponding to the data flow transmitted between the application components from the application component knowledge base. Based on the attribute descriptions corresponding to each application component and the attribute descriptions corresponding to the data flow transmitted between the application components, the data flow diagram described in text format is generated.
4. The method according to claim 3, characterized in that, The design scheme text is also used to describe the scenario types involved in the target application; the step of obtaining the attribute descriptions corresponding to each application component and the attribute descriptions corresponding to the data streams transmitted between the application components from the application component knowledge base through the second large language model includes: Based on the scenario type, the second language model retrieves the attribute descriptions corresponding to each application component and the attribute descriptions corresponding to the data streams transmitted between the application components from the application component knowledge base.
5. The method according to claim 3 or 4, characterized in that, The attribute description includes at least one of the following: element type, scene type, function description, technology type, and protocol type.
6. The method according to claim 1, characterized in that, The data flow diagram is described in text format and includes attribute descriptions of each application component involved in the target application and attribute descriptions of the data flow transmitted between the application components. The threat modeling based on the target application's data flow graph includes: Based on the preset threat modeling element definition, the data flow graph of the target application is subjected to element extraction to obtain multiple threat modeling elements, wherein the threat modeling element definition is used to indicate the attribute description corresponding to each threat modeling element in the data flow graph; Threat modeling is performed based on the aforementioned threat modeling elements to obtain the potential threats corresponding to each application component involved in the target application.
7. The method according to claim 1, characterized in that, The security policy knowledge base includes: multiple security policies, threats that each security policy can mitigate, and recommended attributes of each security policy; The recommended security strategy meets the following conditions: The threats that the recommended security strategy can mitigate include the potential threats mentioned above; The recommended attributes of the security policy conform to the indications of the recommendation rule prompts.
8. The method according to claim 1, characterized in that, The step of determining recommended security policies from a preset security policy knowledge base using the first large language model based on potential threats and recommendation rule prompts corresponding to each application component includes: The first large language model determines the recommended security policy from a preset security policy knowledge base based on the design scheme text of the target application, the potential threats corresponding to each application component, and the recommendation rule prompts.
9. The method according to claim 8, characterized in that, The recommended security policy conforms to the instructions in the design scheme text of the target application.
10. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; At least one of the programs is executed by at least one of the processors to perform the security design generation method according to any one of claims 1 to 9.
11. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the security design scheme generation method according to any one of claims 1 to 9.
12. A computer program product, comprising a computer program or computer instructions, characterized in that, The computer program or the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer program or the computer instructions from the computer-readable storage medium and executes the computer program or the computer instructions, causing the electronic device to perform the security design scheme generation method according to any one of claims 1 to 9.