A security policy consistency detection method based on knowledge graph
Through the four-layer structure of the knowledge graph model and intelligent reasoning algorithm, it solves the problems of numerous detection carriers and incomplete strategy fields in the existing technology, achieves systematic and consistent detection and optimization of communication network strategies, and improves detection accuracy. Accuracy and adaptability.
Patent Information
- Application Number
- CN202410446435.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-04-15
AI Technical Summary
Existing security policy consistency detection methods have problems such as numerous detection carriers, incomplete policy fields, and lack of positive feedback optimization mechanisms. It is difficult to achieve systematic and universal consistency detection, especially when it comes to comprehensive policy detection in multiple fields. Contact existing information.
Adopt a four-layer knowledge graph model, including network facility layer, security policy layer, security knowledge layer and detection dependency layer, and build a systematic policy consistency detection through ontology modeling, entity and relationship extraction, intelligent inference and other technologies. Method, algorithms such as centrality algorithm, graph propagation algorithm and hybrid reasoning are used for strategy detection and optimization.
It realizes systematic, comprehensive and efficient consistency detection of four main types of strategies in communication networks, and can conduct comprehensive system detection across knowledge fields and physical equipment, reducing the dependence on human resources and improving the accuracy and adaptability of detection. And optimize strategies through intelligent reasoning capabilities.
Smart Images

Figure CN118337441B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security and provides a security policy consistency detection method based on a knowledge graph. Background Art
[0002] Security policy consistency detection is an important part of information network management. Security policy consistency detection refers to the consistency detection of network security policies and actual conditions (the consistency between the static configuration and dynamic rules of the detection policy and the actual network). At the same time, knowledge graph technology can display complex knowledge fields through data mining, information processing, knowledge measurement and graphics drawing, thereby revealing the static and dynamic conditions of the knowledge field. It not only acts as a data carrier, but also minimizes the time required to organize multiple different data sources into meaningful relationships, and also has intelligent computing and reasoning capabilities.
[0003] There are three main types of security policy consistency detection solutions:
[0004] Rule matching detection: The policy objectives are converted into a specific target configuration rule base through the experience and knowledge of experts. During detection, the actual configuration is brought into the rule base for matching one by one.
[0005] Feature use case detection: Predefine and write reasonable test cases based on the target strategy requirements that need to be detected, apply the test cases in a real or simulated environment, and compare the differences between the actual results of the test cases and the expected results.
[0006] Real-time monitoring detection: collect real-time system configuration information and operation status through product logs, traffic monitoring, etc., and compare the impact of abnormal information with policy requirements.
[0007] These solutions all have certain limitations:
[0008] First, there are many detection carriers. The rule bases for rule matching detection are diverse. Security policies involving different fields will have different forms of rule bases. The use cases for feature use case detection will have different forms of structured (such as various scripts) or unstructured (such as plain text, tables) carriers. The information collected by real-time monitoring detection has rich carrier forms such as logs, traffic packages, and surveillance videos. Even for the same log, the format of different manufacturers of the same type of equipment will be different. Storing unstructured or inconsistently structured carriers in traditional relational databases will result in information redundancy, irrelevant information is difficult to eliminate, and detection methods are difficult to update synchronously after the policy is updated.
[0009] Secondly, the detection strategy is not comprehensive. The rule matching detection method currently performs well in the consistency detection of operation service security policy and data security policy, and there are many related studies. However, in other fields, not only is it difficult to write rule sets, but there are relatively few related studies. The feature use case detection method has a good effect on the consistency detection of operation service security policy and data security policy in an ideal situation. However, in reality, due to the overall level of the use case writing team, human resources, and time pressure, there are very few use case sets that can better reflect the requirements of various policies. The real-time monitoring detection method has some performance in the consistency detection of physical security policy, operation service security policy, and content security policy. However, if real-time monitoring is comprehensive, the monitoring network load will be quite large, which is complicated in practice. At the same time, the prevention effect of real-time monitoring on hazards is relatively poor, which loses the meaning of policy inconsistency detection to a certain extent. The incompleteness of the detection strategy field of the above three methods is also reflected in the inconsistency detection of comprehensive policies in multiple fields. In the case of multiple fields, it requires the integration of multiple knowledge. Traditional methods cannot intelligently and widely connect existing information, and experts are required to rewrite rule logic or test cases. Although there are cases where the three existing detection methods are used in combination in current actual strategy detection operations, due to the unsystematic methods, too many detection factors, imprecise logical transformation, and no standard weight indicators, these cases are mostly consistency detection of a specific strategy or a class of strategies with distinct characteristics, and the methods are not universal and systematic.
[0010] Finally, the results of policy consistency detection should not only detect the consistency between the static configuration and dynamic rules of the detection policy and the actual network, but also ensure that the detection results can optimize the existing policy and reflect the security situation or key features of the existing information environment through positive feedback. This higher-level requirement is obviously not met by the above three existing methods. Summary of the invention
[0011] This technical solution aims to solve the problem of consistency detection of communication network security policies in the field of information security. Through the innovative use of knowledge graph technology, a new four-layer structure knowledge graph model is proposed, which can systematically, comprehensively and efficiently detect the consistency of four major policies in the communication network. This solution solves the problems of the existing technology such as the large number of detection carriers, the incomplete detection strategy field, and the lack of positive feedback optimization mechanism. It is universal and systematic, and can deeply understand and optimize the security association from the local to the whole network based on the intelligent reasoning function of the knowledge graph.
[0012] In order to achieve the above purpose, the present invention adopts the following technical means:
[0013] The present invention provides a security policy consistency detection method based on knowledge graph, comprising the following steps:
[0014] Step 1: Build a knowledge graph, which includes the following four layers:
[0015] Network Infrastructure Layer Map MAP infrastructure , security policy layer map MAP strategy , Security Knowledge Layer MAP knowledge , detection dependency layer map MAP detection ,Before construction, ontology modeling needs to be carried out and entities, attributes and ,relationships should be standardized;
[0016] Step 2: Use the constructed knowledge graph to perform policy consistency detection and intelligent inference. Intelligent inference is an important functional feature that distinguishes knowledge graphs from other data forms. Intelligent inference can assist in the consistency detection of security policies and even help us modify unreasonable policies according to actual conditions. For example, by applying the centrality algorithm to the detection dependency layer graph, we can get the importance of each policy; applying the community discovery algorithm to the network facility layer graph can get the clustering degree of network nodes, which helps us use test cases in batches for similar detection subjects in the cluster during detection; applying the R-GCN method that introduces weight sharing and coefficient constraints to the security knowledge layer graph for relationship prediction can warn of unreasonable relationships. If these unreasonable relationships are used in policy detection, it is necessary to manually check whether the policy is reasonable or modify the security knowledge layer graph.
[0017] In the above technical solution, step 1 specifically includes the following steps:
[0018] Step 1.1: Ontological modeling: create an ontological model M of four main policies according to the target policy scenario. The ontological model M is used to guide the construction of the subsequent four-layer graph. The four main policies are physical security policy, operation service security policy, data security policy, and content security policy.
[0019] Step 1.2: Based on the entity model M, abstract the network infrastructure topology and construct the network infrastructure layer map MAP infrastructure , ensuring the standardization of network devices and their relationships;
[0020] Step 1.3: Based on the embodied model M, the security policy layer map MAP strategy Build,extract information from policy text through entity extraction and relation extraction,,ensuring policy standardization;
[0021] Step 1.4: Based on the embodied model M, the security knowledge layer map MAP knowledge Construct,process the attack dimension, asset dimension, and vulnerability dimension data sources through knowledge extraction and knowledge fusion, and further fuse the information extracted in step 1.3;
[0022] Step 1.5: According to the integrated model M, detect the dependent layer map MAP detection Build, write the basic logic and association logic of the strategy, and use the strategy information extracted in step 1.3 to formalize the relationship between strategies;
[0023] Step 1.6: Combine the four-layer graphs. Combine the four-layer graphs from step 1.2 to step 1.5 to form a complete knowledge graph, which is the knowledge graph used in the subsequent step 2.
[0024] In the above technical solution, step 1.1 specifically includes the following steps:
[0025] For the four main policies, namely physical security policy, operation service security policy, data security policy, and content security policy, ontological modeling M=(P, R, D, C) that conforms to the target policy scenario is performed, and four types of modeling are obtained:
[0026] Physical security ontology modeling scheme P=(P0, P1,…, P i , P n , P 0 , P 1 ,…, P i ,…, P m ), P i The i-th entity type modeled for the physical security ontology, n means the total number of entities, P i The i-th relationship type modeled for the physical security ontology, m means the total number of relationships;
[0027] Operation service security ontology modeling scheme R=(R0, R1,…, R i ,…, R n , R 0 , R 1 ,…, R i ,…, R m ), R i The i-th entity type modeled for the operational service security ontology, n means the total number of entities, R i The i-th relationship type modeled for the operational service security ontology, m means the total number of relationships;
[0028] Data security ontology modeling scheme D=(D0, D1, …, D i ,…,D n , D 0 , D 1 ,…, D i ,…, D m ), D i The i-th entity type modeled for the data security ontology, n means the total number of entities, Di The i-th relationship type modeled for the data security ontology, m means the total number of relationships;
[0029] Content security ontology modeling scheme C=(C0, C1, …, C i ,…, C n , C 0 , C 1 ,…, C i ,…, C m ), C i The i-th entity type modeled for the content security ontology, n means the total number of entities, C i The i-th relationship type modeled for the content security ontology, m means the total number of relationships.
[0030] In the above technical solution, step 1.2 specifically includes the following steps:
[0031] Step 1.2: Perform topological abstraction on the network infrastructure that needs consistency detection and obtain network infrastructure information in a summarized manner. Obtain the network infrastructure layer map MAP based on the topology and network infrastructure information. infrastructure =(inf0, inf1,…, inf i ,…, inf n )∪(inf 0 , inf 1 ,…, inf j ,…, inf m )∪(…, <inf i , inf j , inf k >,…), where inf i MAP infrastructure The i-th entity in j MAP infrastructure The jth relationship in <inf i ,inf j , inf k > for MAP infrastructure A triple in , indicating the entity inf i with entity inf k There is a relationship between j .
[0032] In the above technical solution, step 1.3 specifically includes the following steps:
[0033] Step 1.3: The policy to be checked for consistency is unstructured text content. Entity extraction and relationship extraction are performed automatically or manually, and then combined into a security policy layer map MAP. strategy=(str0, str1, …, str i ,…, str n )∪(str 0 , str 1 ,…, str j ,…, str m )∪(…, <str i , str j , str k >,…), where str i MAP strategy The i-th entity in str j MAP strategy The jth relationship in <str i , str j , str k > for MAP strategy A triple in , representing the entity str i With entity str k There is a relationship between str j .
[0034] The present invention provides a method for automatic entity extraction using deep learning as follows: using a word vector that combines the features of Chinese character radicals and a BERT pre-trained model as the feature input of the network, using a Transformer network for the NER task to extract features, and finally introducing a CRF layer for label prediction. After training, the extracted Chinese entity results can be obtained. A method for automatic relationship extraction is as follows: The R-BERT model defines entities in a sentence using special marking symbols, which allows it to still locate the position information of two target entities after output from the BERT pre-trained model. Therefore, the embedding vectors of entities and sentence beginning tags and sentence encodings are selected as the input of the multi-layer neural network, and the relationship classifier of the R-BERT model improved for the policy text form is used. The classifier maps the relationship output, and the extracted Chinese relationship results can be obtained after training. The automatically extracted entities and relationships will inevitably have certain redundancies or omissions. In the actual construction of MAP strategy Manual review and modification are also necessary.
[0035] In the above technical solution, step 1.4 specifically includes the following steps:
[0036] Security Knowledge Layer Map MAP knowledge =(kno0, kno1, …, kno i ,…, kno n )∪( kno 0 ,kno 1,…, kno j ,…, kno m )∪(…, <kno i , kno j , kno k >,…), where kno i MAP knowledge The i-th entity in kno j MAP knowledge The jth relationship in <kno i , kno j , kno k > for MAP knowledge A triple in , representing the entity kno i With entity kno k There is a relationship between kno j .
[0037] Step 1.4.1: Data source integration
[0038] Security Knowledge Layer Map MAP knowledge The data sources include attack dimension, asset dimension, and vulnerability dimension. The attack dimension has the attack behavior knowledge base ATT&CK and the common attack pattern enumeration and classification knowledge base CAPEC; the asset dimension has the common platform enumeration database CPE; the vulnerability dimension has the public vulnerability and exposure database CVE and the common weakness enumeration database CWE;
[0039] Step 1.4.2: Knowledge Extraction
[0040] Extract entities and relationships from integrated data sources;
[0041] Step 1.4.3: Knowledge Fusion
[0042] The entities are aligned using feature matching based on similarity functions, as follows: After preprocessing the contexts of the two entities, the bag-of-words model is used to vectorize the texts of the two entities, and the cosine value between the two vectors is calculated as the semantic similarity of the two entity texts. The larger the similarity value, the more similar the two entities are.
[0043] In the above technical solution, step 1.5 specifically includes the following steps:
[0044] The relationships among the physical security policies, operation service security policies, data security policies, and content security policies to be tested in the policy set are sorted out. Each policy is taken as an entity, and the "inclusion relationship", "priority relationship", and "pre-default conditions" between policies are taken as relationships to obtain the detection dependency layer map MAP detection =(det0, det1, …, det i ,…,detn )∪(det 0 , det 1 ,…, det j ,…, det m )∪(…, <det i , det j , det k >,…), where det i MAP detection The i-th entity in det j MAP detection The jth relationship in <det i , det j , det k > for MAP detection A triple in det, representing the entity i With entity det k There is a relationship between j .
[0045] In the above technical solution, step 2 specifically includes the following steps:
[0046] Step 2.1: Strategy consistency detection: Use the knowledge graph obtained in step 1 to detect the consistency of the strategy through graph query and algorithm analysis;
[0047] Step 2.2: Intelligent inference function, expands the use of knowledge graphs through algorithms, including centrality algorithm, graph propagation algorithm, rule-based reasoning algorithm AMIE, and hybrid reasoning ConMask.
[0048] In the above technical solution, step 2.1 specifically includes the following steps:
[0049] Step 2.1: The detailed process of using the graph to perform policy consistency detection is as follows:
[0050] For the single policy consistency test process: first start with MAP detection Extract the strategy information by ID, traverse the detection subject sub involved in the ontology modeling, and then find the detection subject sub in MAP strategy Get the detection target tar, and then according to MAP knowledge The path from the detection subject sub to the detection target tar, the path finding detection requirement set req = {req1, ..., req i ,…,req n} until you get an indivisible req i So far, according to the req i To MAP infrastructureThe detection information and detection scheme{} corresponding to the positioning of the detection node;
[0051] The detection target tar of the detection subject sub is in the security policy layer map MAP strategy Stored in MAP strategy A triple in <str i , str j , str k >, str i Is the detection subject sub, str k It is to detect the target tar. A subject may have multiple targets, and several targets may also correspond to multiple subjects, so the relationship str j The number, category and other information of the relevant policies will be recorded. For example, the triplet <camera (location attribute: inside the computer room), has functions (function category: additional function; policy category: monitoring policy; policy number: 1107), night vision function>.
[0052] The detection function is one of the three methods: configuration comparison, use case call, and monitoring feedback. The detection scheme{detectioninformation} is obtained by calling detection scheme{} with detectioninformation as the parameter. The "0 / 1" result indicates that the consistency check fails or passes, that is, the single strategy detection result;
[0053] For the consistency check of the combined strategy, in MAP detection The logical relationship x between the sub-strategies of the combined strategy is obtained. The logical relationship x is "and", "or", "not" and their combinations. First, a "0 / 1" result is obtained for each sub-strategy according to a single detection method, and the results of the sub-strategies are combined using the logical relationship x. The obtained "0 / 1" result is the detection result of the combined strategy.
[0054] In the above technical solution, step 2.2 specifically includes the following steps:
[0055] Step 2.2: The intelligent inference function of knowledge graph expansion depends on the algorithm. The applicable algorithms and their roles in the knowledge graph are as follows:
[0056] Centrality algorithm in MAP detection The importance of each strategy is obtained by applying
[0057] In MAP detectionThe centrality algorithm is applied in MAP because each node (entity) in the graph corresponds to a strategy. By using point centrality, middle centrality and close centrality indicators separately or in a weighted combination, the centrality of each node in the graph can be calculated. In other words, the larger the centrality value of a node, the more connections it has with other nodes, and the strategy corresponding to the node is more widely connected in all our strategies, and the more likely it is to become a sub-strategy of a composite strategy or a pre-strategy of a large number of strategies. Therefore, "the centrality algorithm is used in MAP detection The importance of each strategy is obtained through application.
[0058] Importance can be annotated as an entity attribute in MAP detection It helps us to prioritize possible sub-strategies or pre-strategies when clarifying the logical relationship between the sub-strategies of the combination strategy. In practice, batch testing of a large set of strategies can save a lot of time by prioritizing the detection of strategies with high importance.
[0059] MAP strategy With MAP infrastructure The application obtains the centralized and decentralized characteristics of the strategy and network topology;
[0060] The graph propagation algorithm does not have a clear paradigm or goal. In practice, a labeled graph propagation algorithm with overlapping community discovery as the goal is used. This graph propagation algorithm can find MAP strategy With MAP infrastructure A highly concentrated node (entity) community, where nodes within the community are highly connected, but have relatively few connections with other nodes in the graph. In some tasks that focus on tasks outside the community, all nodes in a community can be considered as a whole with little difference. In some tasks that focus on nodes within the community, the relationship between "in" and "out" of the community can be expanded to all nodes in the community.
[0061] MAP strategy In the detection subject community discovery of the strategy, a class of detection subjects with similar detection targets can be found. Their detection processes will be similar. You can call detection cases or configuration controls with only a few different parameters to complete their detection logic writing and detection operations in batches. Similarly, you can discover the detection target community of the strategy and find a class of detection targets with similar detection subjects, and complete the detection in batches. Add the class number that can perform batch detection as an attribute to MAP strategy Long-term memory can be achieved in the entity attributes of MAP infrastructure The application in is similar. The graph propagation algorithm can be used to find a class of similar attack methods, a class of device models with the same characteristics, a class of vulnerabilities with the same principle, etc.
[0062] In MAPknowledge and MAP infrastructure The standard is introduced and the rule-based reasoning algorithm AMIE is applied to conduct risk assessment for network situation;
[0063] In literature survey and practice, network situation risk assessment can be compared with MAP knowledge The existing vulnerability set, attack feature set, security event set, etc. predict MAP infrastructure Network nodes or dangerous data flows that may pose security risks in the future. If these network nodes or dangerous data flows that may pose security risks are under the concern of our strategy, then they can be marked before detection and focused on detection, so that we can be targeted and prevent problems before they happen. We can also use network situation to conduct risk assessment and discover MAP knowledge With MAP strategy After manual review, it can be determined that the MAP is modified. knowledge Correct the MAP error information. strategy Unreasonable strategies in .
[0064] Use hybrid reasoning ConMask for "open world knowledge graph completion" to improve MAP knowledge and MAP strategy , so that the knowledge graph has the ability to deal with external unknown new entities.
[0065] Because the present invention adopts the above technical means, it has the following beneficial effects:
[0066] 1. Compared with the existing structured or semi-structured policy inconsistency detection carriers, the detection based on the knowledge graph as the carrier of the present invention can not only intuitively display the relationship between the policy, device configuration, and knowledge base information, but also widely connect the detection information, so as to achieve comprehensive and systematic detection across knowledge fields, physical devices, and detection methods that are difficult to achieve with traditional methods. This is because the knowledge graph technology has the intuitive structural form of the graph database and the ability to widely connect various types of knowledge information.
[0067] 2. Compared with the existing three types of detection methods and their combination methods, the method of the present invention can not only automatically and accurately select the most effective detection method according to the knowledge base, avoiding the shortcomings of each type of detection method, but also the graph construction work is mostly completed by automated methods such as crawlers and neural network methods, avoiding the shortcomings of the existing technology of manually constructing rule bases that rely too much on expert experience and wisdom and consume a lot of manpower.
[0068] 3. Existing consistency detection methods are only for detection and have no derivative expansion functions. The knowledge graph constructed in the present invention only needs to use the new hybrid reasoning ConMask method to expand entities and relationships based on the original graph to detect new strategies and new devices, thus avoiding the cost of re-adapting the rule set of existing methods. At the same time, the detection method of the present invention can also help users grasp the security association from the local to the whole network based on the graph algorithm and intelligent reasoning function of the knowledge graph, and even conversely, these actual network conditions and knowledge bases can help the strategy to be improved more in accordance with local conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 : Four-layer structure knowledge graph concept map;
[0070] Figure 2 : A simple example of operational service security ontology modeling;
[0071] Figure 3 : An example of using knowledge graphs for policy consistency detection. DETAILED DESCRIPTION
[0072] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions made to the present invention should all be included in the scope of the claims of the present invention.
[0073] In addition, in order to better illustrate the present invention, numerous specific details are given in the following specific embodiments. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.
[0074] Based on the purpose of being able to perform systematic, comprehensive and efficient consistency detection of the four main types of policies in the communication network (physical security policy, operation service security policy, data security policy, and content security policy), this new method is based on the existing method and uses the knowledge graph as a tool. Aiming at the task characteristics of policy inconsistency detection, this method innovatively stores the detection logic in the graph and constructs a four-layer knowledge graph. With the help of the knowledge graph, multiple different data sources can be widely and tightly organized into meaningful relationships. At the same time, the characteristics of intelligent computing and reasoning can be used to perform policy consistency detection. This method specifically includes two stages: the graph construction stage and the graph use stage:
[0075] Step 1: Graph construction phase. Figure 1The constructed knowledge map (MAP) is divided into four layers. Before the map is constructed, ontological modeling must be carried out according to the target strategy. The entities, attributes, and relationships of the four-layer map must be standardized according to this modeling. The network infrastructure that needs consistency detection is topologically abstracted, and the information is summarized to obtain the network infrastructure layer map (MAP infrastructure ); Extract entities and relationships from the target policy text to obtain a security policy layer graph (MAP strategy ); extract and fuse the known and collectible attack dimension, asset dimension, and vulnerable dimension data sources to obtain a security knowledge layer map (MAP knowledge ); Write the basic logic and associated logic for each strategy that needs consistency detection to obtain the detection dependency layer map (MAP detection ). Figure 1 A conceptual diagram of a four-layer knowledge graph is given.
[0076] Step 2: Graph usage phase. Through basic graph search, traversal, path search, centrality, graph propagation algorithms and other algorithms, consistency detection functions and scalable intelligent inference functions can be achieved.
[0077] The above step 1 specifically includes the following steps:
[0078] Step 1.1: Carry out ontological modeling M=(P, R, D, C) in accordance with the target strategy scenarios for the four main strategies, and obtain four types of modeling: Physical security ontology modeling scheme P=(P0, P1,…, P i , P n , P 0 , P 1 ,…, P i ,…,P m )(P i The ith entity type modeled for the physical security ontology, P i The i-th relationship type modeled for the physical security ontology, and the subsequent modeling schemes are similar), running the service security ontology modeling scheme R= (R0, R1,…, R i ,…, R n , R 0 , R 1 ,…,R i ,…, R m ), data security ontology modeling scheme D=(D0, D1, …, D i ,…,D n , D 0 , D 1 ,…, D i ,…, D m ), content security ontology modeling scheme C=(C0, C1, …, Ci ,…, C n , C 0 , C 1 ,…, C i ,…, C m ). It should be noted that the ontological modeling M is used to guide the construction of the knowledge graph. The entities and relationships of the subsequent four layers of the graph (i.e., steps 1.2 to 1.5) must conform to the types defined in M (M can also be added, deleted, and modified appropriately according to actual conditions during the graph construction process). Figure 2 A simple example of operational service security ontology modeling is given.
[0079] Step 1.2: Perform topological abstraction on the network infrastructure to be checked for consistency and obtain network infrastructure information. Obtain a network infrastructure layer map (MAP) based on the topology and network infrastructure information. infrastructure ) = (inf0, inf1, …, inf i ,…, inf n )∪(inf 0 , inf 1 ,…, inf j ,…, inf m )∪(…, <inf i ,inf j , inf k >,…)(inf i MAP infrastructure The i-th entity in j MAP infrastructure The jth relationship in <inf i ,inf j , inf k > for MAP infrastructure A triple in , indicating the entity inf i with entity inf k There is a relationship between j , and the description of the subsequent three-layer graph is similar). It should be noted that due to the characteristics of the strategy detection task, MAP infrastructure It should not only include conventional network devices such as hosts, servers, routers, firewalls, etc., but also unconventional devices such as IoT devices and sensors. This should also be reflected in the design of M in step 1.1.
[0080] Step 1.3: The policies to be checked for consistency are usually informal texts. We need to automatically or manually extract entities and relationships and then combine them into a security policy layer map (MAP). strategy) = (str0, str1, …, str i ,…, str n )∪(str 0 , str 1 ,…, str j ,…, str m )∪(…, <str i ,str j , str k >,…). A method for automated entity extraction using deep learning is as follows: the word vector combining the features of Chinese character radicals and the BERT pre-trained model is used as the feature input of the network, and the Transformer network for the NER task is used for feature extraction. Finally, the CRF layer is introduced for label prediction. After training, the extracted Chinese entity results can be obtained. A method for automated relationship extraction is as follows: The R-BERT model defines entities in sentences using special marking symbols, which allows it to locate the position information of the two target entities after output from the BERT pre-trained model. Therefore, the embedding vectors of entities and sentence beginning tags and sentence encodings are selected as the input of the multi-layer neural network, and the relational classifier of the R-BERT model improved for the policy text form is used. The classifier maps the relational output, and the extracted Chinese relational results can be obtained after training. The automatically extracted entities and relationships will inevitably have certain redundancies or omissions. In the actual construction of MAP strategy Manual review and modification are also necessary.
[0081] Step 1.4: Security Knowledge Layer Map (MAP knowledge )=(kno0, kno1, …, kno i ,…, kno n )∪(kno 0 , kno 1 ,…, kno j ,…, kno m )∪(…, <kno i , kno j , kno k>,…) include attack dimension, asset dimension and vulnerable dimension. These data sources can come from public databases, encyclopedia blogs, technical manuals, etc. Considering that semi-structured data sources are more convenient for knowledge extraction, simple crawler methods can achieve good results, so it is recommended to use existing knowledge bases or rule bases, such as the attack behavior knowledge base ATT&CK and the common attack pattern enumeration and classification knowledge base CAPEC in the attack dimension; the common platform enumeration database CPE in the asset dimension; the public vulnerability and exposure database CVE and the common weakness enumeration database CWE in the vulnerable dimension. Encyclopedia blogs, technical manuals, etc. can be used as auxiliary supplementary data sources. The entities and relationships obtained after knowledge extraction cannot be directly used for graph construction as in step 1.3, and knowledge fusion is also required (the reason is that MAP knowledge The data sources of MAP are widely available. strategy Knowledge fusion in MAP knowledge The main purpose of the method is to align entities. In addition to manual alignment, the main method can also be achieved by using feature matching based on similarity functions. Here is an effective similarity function: after preprocessing the context of the two entities, the text of the two entities is vectorized using the bag-of-words model, and the cosine value between the two vectors is calculated as the semantic similarity of the two entity texts. The larger the similarity value, the more similar the two entities are. You can also use multiple text similarity functions for weighted calculations to obtain a more accurate entity alignment effect.
[0082] Step 1.5: Sort out the relationship between each strategy. Under normal circumstances, the directory of the strategy text shows the general structure of their relationship, and the total number of strategies is usually not too many or disordered, so they can be manually summarized. Take each strategy as an entity, and the "inclusion relationship", "priority relationship", "pre-default condition" and other relationships between strategies as relationships to obtain the detection dependency layer map (MAP detection ) = (det0, det1, …, det i ,…, det n )∪(det 0 , det 1 ,…, det j ,…,det m )∪(…, <det i , det j , det k >,…).
[0083] Step 1.6: Combining the four layers of graphs from step 1.2 to step 1.5 together is the knowledge graph used in the subsequent step 2. The above step 2 specifically includes the following steps:
[0084] Step 2.1: The detailed process of using the graph to perform policy consistency detection is as follows. For the process of single policy consistency detection: First, start with MAP detection Extract the strategy information by ID, traverse the ontology modeling scheme to locate the detection subject (sub), and then find the sub in MAP strategy Get the detection target (tar) from the MAP knowledge The detection requirement set req = {req1, ..., req i ,…,req n} (Note that the req i It must be an inseparable requirement. If it is divisible, it should be in MAP knowledge Continue to find the path until it cannot be split), according to the ontological modeling, based on the req at this time i You can go to MAP infrastructure The corresponding detection node information (detection information) and detection function (detection scheme{}) are located in the detection information (usually three methods: configuration comparison, use case call, and monitoring feedback). The detection scheme{detectioninformation} obtained by calling detection scheme{} with detection information as a parameter (the result of "0 / 1" indicates that the consistency check fails or passes) is the single strategy detection result. For the consistency check of the combined strategy, you need to first detection The logical relationship of the sub-strategies ("and", "or", "not" relationship) is obtained in the above formula. First, a "0 / 1" result is obtained for each sub-strategy according to a single detection method. The results of these sub-strategies are combined using the same logical relationship. The "0 / 1" result obtained is the detection result of the combined strategy. Figure 3 An example of using knowledge graph to detect policy consistency is given.
[0085] Step 2.2: The scalable intelligent inference function of the knowledge graph depends on the algorithm used. Here are some applicable algorithms and the role they can play in the previously constructed knowledge graph (MAP): The centrality algorithm can be used in MAP detection The importance of each strategy can be obtained by applying the graph propagation algorithm in MAP strategy With MAP infrastructure The application of the strategy and network topology to obtain the centralized and distributed characteristics; in MAP knowledge and MAP infrastructureIntroducing appropriate standards, applying the rule-based reasoning algorithm AMIE can be used to assess the risk of network situation; using the new hybrid reasoning ConMask to perform "open world knowledge graph completion" to improve MAP knowledge and MAP strategy , which enables the knowledge graph to cope with external unknown new entities and improves maintainability.
[0086] This technical proposal has the following features:
[0087] Because the knowledge graph serves as a carrier for policy consistency detection, this technical proposal can not only intuitively display the relationship between policies, device configurations, and knowledge base information, but also widely connect detection information to achieve comprehensive and systematic detection across knowledge fields, physical devices, and detection methods that is difficult to achieve with traditional methods.
[0088] Because the graph construction work is mostly completed by automated methods such as crawlers and neural network methods, it avoids the shortcomings of the existing technology of manually constructing rule bases that rely too much on expert experience and wisdom and consumes a lot of manpower. It can also automatically and accurately select the most effective detection means based on the knowledge base, avoiding the shortcomings of each type of detection means.
[0089] Because this technical proposal takes advantage of the characteristics of intelligent reasoning of knowledge graphs, the knowledge graph constructed in the present invention has powerful expansion functions. For example, when faced with the detection of new policies and new equipment, the knowledge graph constructed in the present invention only needs to use the new hybrid reasoning ConMask method on the basis of the original graph to expand entities and relationships, thus avoiding the cost of re-adapting the rule set of existing methods. The knowledge graph constructed in the present invention can also help users grasp the security association from local to overall network based on the graph algorithm and intelligent reasoning function of the knowledge graph, and even conversely, these actual network conditions and knowledge bases can help strategies to be improved more in accordance with local conditions.
[0090] In summary, the technical solution provided by the present invention has the following technical effects as a whole:
[0091] Innovation in the graph construction phase: This method achieves a systematic representation of the four main types of policies in the communication network by constructing a four-layer knowledge graph, including the network facility layer graph, the security policy layer graph, the security knowledge layer graph, and the detection dependency layer graph. This structured representation method standardizes entities, attributes, and relationships through ontological modeling, thereby improving the accuracy and efficiency of policy consistency detection. Compared with existing technologies, this structured method reduces information redundancy and improves the comprehensiveness and systematicness of detection.
[0092] Combination of automation and intelligence: In the graph construction stage, the method combines automation technology and neural network methods, such as deep learning and BERT models, for the extraction of entities and relationships, reducing the need for manual intervention. This combination of automation and intelligence improves the efficiency of knowledge graph construction while reducing the reliance on expert experience in traditional methods.
[0093] Application of knowledge graph in detection: This method uses knowledge graph to detect policy consistency. Through graph algorithms and intelligent reasoning functions, such as centrality algorithm and graph propagation algorithm, it not only realizes policy detection, but also performs risk assessment and policy optimization of network situation. This application expands the function of knowledge graph, enabling it to not only detect consistency, but also provide in-depth analysis of network security.
[0094] Comprehensive and systematic policy consistency detection: Through the breadth of knowledge graphs and deep reasoning capabilities, this method can achieve comprehensive and systematic detection across knowledge domains, physical devices, and detection methods. This comprehensiveness and systematicity is difficult to achieve with existing technologies, especially when dealing with inconsistency detection of comprehensive policies in multiple fields.
[0095] Adaptability and scalability: This method uses a new hybrid reasoning ConMask method to achieve dynamic expansion of the knowledge graph, enabling it to adapt to new policies and devices. This adaptability and scalability reduces the additional cost and workload caused by policy updates and device changes.
[0096] Overall, this method improves the efficiency, accuracy, and systematicity of security policy consistency detection through the innovative use of knowledge graph technology, while enhancing the adaptability and intelligence level of the detection method.
Claims
1. A security policy consistency detection method based on knowledge graph, characterized in that: The following steps are involved: Step 1: Build a knowledge graph, which includes the following four layers: Network Infrastructure Layer Map MAP infrastructure , security policy layer map MAP strategy , Security Knowledge Layer MAP knowledge , detection dependency layer map MAP detection ,Before construction, ontology modeling is carried out and entities, attributes and relationships are standardized; Step 2: Use the constructed knowledge graph to perform policy consistency detection and scalable intelligent inference functions; Step 1 specifically includes the following steps: Step 1.1: Ontological modeling: create an ontological model M of four main policies according to the target policy scenario. The ontological model M is used to guide the construction of the subsequent four-layer graph. The four main policies are physical security policy, operation service security policy, data security policy, and content security policy. Step 1.2: Based on the ontological model M, abstract the network infrastructure topology and construct the network infrastructure layer map MAP infrastructure , ensuring the standardization of network devices and their relationships; Step 1.3: Based on the ontological model M, the security policy layer map MAP strategy Build,extract policy information from policy text through entity extraction and,relation extraction to ensure policy standardization; Step 1.4: Based on the ontology model M, the security knowledge layer map MAP knowledge Construct, through knowledge extraction and knowledge fusion to process the attack dimension, asset dimension, and vulnerability dimension data sources, and further fuse the policy information extracted in step 1.3; Step 1.5: According to the ontological model M, detect the dependency layer map MAP detection Build, write the basic logic and association logic of the strategy, and use the strategy information extracted in step 1.3 to formalize the relationship between strategies; Step 1.6: Combine the four-layer graphs. Combine the four-layer graphs from step 1.2 to step 1.5 together to form a complete knowledge graph.
2. According to the method for detecting the consistency of security policies based on knowledge graph in claim 1, it is characterized in that: Step 1.1 specifically includes the following steps: For the four main policies, namely physical security policy, operation service security policy, data security policy, and content security policy, ontological modeling M=(P, R, D, C) that conforms to the target policy scenario is performed, and four types of modeling are obtained: Physical security ontology modeling scheme P=(P0, P1,…, P i , P n , P 0 , P 1 ,…, P i ,…, P m ), P i The i-th entity type modeled for the physical security ontology, n means the total number of entities, P i The i-th relationship type modeled for the physical security ontology, m means the total number of relationships; Operation service security ontology modeling scheme R=(R0, R1,…, R i ,…, R n , R 0 , R 1 ,…, R i ,…, R m ), R i The i-th entity type modeled for the operational service security ontology, n means the total number of entities, R i The i-th relationship type modeled for the operational service security ontology, m means the total number of relationships; Data security ontology modeling scheme D=(D0, D1, …, D i ,…,D n , D 0 , D 1 ,…, D i ,…, D m ), D i The i-th entity type modeled for the data security ontology, n means the total number of entities, D i The i-th relationship type modeled for the data security ontology, m means the total number of relationships; Content security ontology modeling scheme C=(C0, C1, …, C i ,…, C n , C 0 , C 1 ,…, C i ,…, C m ), C i The i-th entity type modeled for the content security ontology, n means the total number of entities, C i The i-th relationship type modeled for the content security ontology, m means the total number of relationships.
3. According to a security policy consistency detection method based on knowledge graph according to claim 1, it is characterized in that: Step 1.2 specifically includes the following steps: Step 1.2: Perform topological abstraction on the network infrastructure that needs consistency detection and obtain network infrastructure information in a summarized manner. Obtain the network infrastructure layer map MAP based on the topology and network infrastructure information. infrastructure =(inf0, inf1, …,inf i ,…, inf n )∪(inf 0 , inf 1 ,…, inf j ,…, inf m )∪(…, <inf i , inf j , inf k >,…), where inf i MAP infrastructure The i-th entity in j MAP infrastructure The jth relationship in <inf i ,inf j , inf k > for MAP infrastructure A triple in , indicating the entity inf i with entity inf k There is a relationship between j , n means the total number of entities, and m means the total number of relationships.
4. According to a security policy consistency detection method based on knowledge graph according to claim 1, it is characterized in that: Step 1.3 specifically includes the following steps: Step 1.3: The policy to be checked for consistency is unstructured text content. Entity extraction and relationship extraction are performed automatically or manually, and then combined into a security policy layer map MAP. strategy =(str0, str1, …, str i ,…,str n )∪(str 0 , str 1 ,…, str j ,…, str m )∪(…, <str i , str j , str k >,…), where str i MAP strategy The i-th entity in str j MAP strategy The jth relationship in <str i , str j , str k > for MAP strategy A triple in , representing the entity str i With entity str k There is a relationship between str j , n means the total number of entities, and m means the total number of relationships.
5. According to a security policy consistency detection method based on knowledge graph according to claim 1, it is characterized in that: Step 1.4 specifically includes the following steps: Security Knowledge Layer Map MAP knowledge =(kno0, kno1, …, kno i ,…, kno n )∪( kno 0 , kno 1 ,…,kno j ,…, kno m )∪(…, <kno i , kno j , kno k >,…), where kno i MAP knowledge The i-th entity in kno j MAP knowledge The jth relationship in <kno i , kno j , kno k > for MAP knowledge A triple in , representing the entity kno i With entity kno k There is a relationship between kno j , ,n means the total number of entities, m means the total number of relations; Step 1.4.1: Data source integration Security Knowledge Layer Map MAP knowledge The data sources include attack dimension, asset dimension, and vulnerability dimension. The attack dimension has the attack behavior knowledge base ATT&CK and the common attack pattern enumeration and classification knowledge base CAPEC; the asset dimension has the common platform enumeration database CPE; the vulnerability dimension has the public vulnerability and exposure database CVE and the common weakness enumeration database CWE; Step 1.4.2: Knowledge Extraction Extract entities and relationships from integrated data sources; Step 1.4.3: Knowledge Fusion The entities are aligned using feature matching based on similarity functions, as follows: After preprocessing the contexts of the two entities, the bag-of-words model is used to vectorize the texts of the two entities, and the cosine value between the two vectors is calculated as the semantic similarity of the two entity texts. The larger the similarity value, the more similar the two entities are.
6. According to a security policy consistency detection method based on knowledge graph according to claim 1, it is characterized in that: Step 1.5 specifically includes the following steps: The relationships among the physical security policies, operation service security policies, data security policies, and content security policies to be tested in the policy set are sorted out. Each policy is taken as an entity, and the "inclusion relationship", "priority relationship", and "pre-default conditions" between policies are taken as relationships to obtain the detection dependency layer map MAP. detection =(det0, det1, …, det i ,…, det n )∪(det 0 , det 1 ,…, det j ,…, det m )∪(…,< det i , det j , det k >,…), where det i MAP detection The i-th entity in det j MAP detection The jth relationship in <det i , det j , det k > for MAP detection A triple in det, representing the entity i With entity det k There is a relationship between j , n means the total number of entities, and m means the total number of relationships.
7. According to a security policy consistency detection method based on knowledge graph according to claim 1, it is characterized in that: The above step 2 specifically includes the following steps: Step 2.1: Strategy consistency detection: Use the knowledge graph obtained in step 1 to detect the consistency of the strategy through graph query and algorithm analysis; Step 2.2: Intelligent inference function, expands the use of knowledge graphs through algorithms, including centrality algorithm, graph propagation algorithm, rule-based reasoning algorithm AMIE, and hybrid reasoning ConMask.
8. According to the method for detecting the consistency of security policies based on knowledge graph according to claim 7, it is characterized in that: The above step 2.1 specifically includes the following steps: Step 2.1: The detailed process of using the graph to perform policy consistency detection is as follows: For the single policy consistency test process: first start with MAP detection Extract the strategy information by ID, traverse the detection subject sub involved in the ontology modeling, and then strategy Get the detection target tar, and then according to MAP knowledge The path from the detection subject sub to the detection target tar, the path finding detection requirement set req = {req1, ..., req i ,…,req n } until you get an indivisible req i So far, according to the req i To MAP infrastructure The detection information and detection scheme{} corresponding to the positioning; The detection function is one of the three methods: configuration comparison, use case call, and monitoring feedback. The detection scheme{detectioninformation} is obtained by calling detection scheme{} with detectioninformation as the parameter. The "0 / 1" result indicates that the consistency check fails or passes, which is the single strategy detection result. For the consistency check of the combined strategy, in MAP detection The logical relationship x between the sub-strategies of the combined strategy is obtained. The logical relationship x is "and", "or", "not" and their combinations. First, a "0 / 1" result is obtained for each sub-strategy according to a single detection method, and the results of the sub-strategies are combined using the logical relationship x. The obtained "0 / 1" result is the detection result of the combined strategy.
9. According to the method for detecting the consistency of security policies based on knowledge graph according to claim 7, it is characterized in that: The above step 2.2 specifically includes the following steps: Step 2.2: The intelligent inference function of knowledge graph expansion depends on the algorithm. The applicable algorithms and their roles in the knowledge graph are as follows: Centrality algorithm in MAP detection The importance of each strategy is obtained by applying MAP strategy With MAP infrastructure The application obtains the centralized and decentralized characteristics of the strategy and network topology; In MAP knowledge and MAP infrastructure The standard is introduced and the rule-based reasoning algorithm AMIE is applied to conduct risk assessment for network situation; Use hybrid reasoning ConMask to complete the open world knowledge graph and improve MAP knowledge and MAP strategy , so that the knowledge graph has the ability to deal with external unknown new entities.
