A security requirement acquisition method and system for natural language requirements
Through natural language processing and deep learning technology, security requirement templates are automatically extracted and matched, which solves the shortcomings of reliance on expert knowledge and manual processing in traditional methods, and improves the automation and efficiency of security requirement acquisition.
Patent Information
- Application Number
- CN202210427177.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-04-22
AI Technical Summary
Traditional security requirements acquisition methods rely on expert knowledge in the security field and require manual processing of a large amount of natural language requirement text, resulting in a low degree of automation and difficulty in ensuring efficiency and accuracy.
Using natural language processing technology and deep learning technology, by extracting entity and action relationships in the requirement text, using a multi-label classification model to predict the security target set, and matching and instantiating the security requirement template constructed according to the CC standard, reducing the need for expert knowledge dependence and improve automation.
The parameterized security requirements template based on CC standards is implemented, which improves the automation of security requirements acquisition, reduces the dependence on expert knowledge, and improves the reusability and acquisition efficiency of security knowledge.
Smart Images

Figure CN114879936B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of security requirement engineering technology, and specifically relates to a method for automatically obtaining security requirements from English natural language requirements by combining natural language processing technology and deep learning technology. Background Art
[0002] Security Requirements Engineering (SRE) is the process and method of obtaining the security requirements of software systems, focusing on security analysis of software systems in the early stages of the requirements phase. There are several typical methods for obtaining security requirements:
[0003] 1) Misuse case-based approach: Model the software system and security-related elements by extending the use case to obtain security requirements. For example, misuse cases obtain security requirements by describing the behavior that an entity or a system should not have.
[0004] 2) Common Criteria (CC)-based method: The full name of the CC standard is Common Criteria for Information Technology Security Evaluation, which is widely used in various analysis and acquisition stages of security requirements.
[0005] 3) Threat / risk oriented approach: By analyzing the threats, risks or attacks that the software system may face, corresponding mitigation measures are provided to obtain security requirements.
[0006] 4) Goal-oriented approach: By analyzing the security goals of the software system, we can obtain the measures that the software system should take and then form security requirements.
[0007] The CC standard is also known as the ISO / IEC 15408 standard, and the latest version is V3.1. The CC standard consists of the following three parts: Introduction and General Model, Security Functional Components, and Security Assurance Components. The second part of CC is a directory of security functional components, which can be used to specify the security functional requirements of an evaluation object (TOE, Targets of Evaluation). The CC security functional components have a total of 11 security classes (Security Class), each of which contains multiple security components (Security Component), and each security component contains multiple security elements (Security Element), where each security element is self-contained, and a security element is a security requirement after being instantiated.
[0008] Traditional security requirements acquisition methods mostly rely on expert knowledge in the security field and need to be performed manually, especially requiring manual processing of a large amount of natural language requirements text. In the related research of security requirements engineering, traditional methods often require manual acquisition of security requirements, such as Security Use Cases, Abuse Cases, Misuse Cases, as well as methods and techniques such as fault trees and attack trees, and these methods require requirements engineers to have expert knowledge in software security. Most methods are often accompanied by a large amount of manual processing of natural language requirements when conducting security analysis: requirements specification or software modeling of natural language requirements, for example: Microsoft's threat modeling tool must first establish a data flow diagram for the software; the attack tree needs to first model the attack path, etc. Summary of the invention
[0009] Purpose of the invention: In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a security requirement acquisition method and system for natural language requirements, reduce the dependence of the security requirement acquisition method on the knowledge of security experts, and improve the degree of automation of the security requirement acquisition method.
[0010] Technical solution: To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0011] A security requirement acquisition method for natural language requirements includes the following steps:
[0012] Extract the entities and action relationships contained in each requirement statement in the requirement text based on natural language processing;
[0013] Use a multi-label classification model based on deep learning to predict the set of security goals for each requirement statement;
[0014] According to the entity and action relationship and security goal set, the security requirement template built based on the CC standard is matched through matching conditions; one security goal is mapped to multiple security requirement templates, and the matching conditions in the security requirement template are judged based on the entity and action relationship extracted from the requirement statement;
[0015] Fill in the parameters in the matched security requirement template according to the entity, action or constructed short sentence, and instantiate the security requirement template.
[0016] Preferably, extracting entities and action relationships based on natural language processing includes:
[0017] Use Stanford CoreNLP to preprocess the required text, including tokenization, sentence splitting, stemming, and part-of-speech tagging;
[0018] Use the dependency-type-based heuristic rules constructed by iMER to extract entities and entity relationships;
[0019] Use Stanford CoreNLP's openIE tagger for entity relationship extraction;
[0020] Take the union of all extraction results, remove stop words, remove relations that do not include verbs, and use the longest principle to select the entity with the longest word string and the relation with the longest word string.
[0021] As a preferred method, the method of selecting entities / relationships using the longest principle is:
[0022] Create an empty set to store the longest entity / entity relationship triples, denoted as MaxEntities / MaxER;
[0023] Compare each extracted entity / entity relationship triple with all entity / entity relationship triples in MaxEntities / MaxER: if entity nesting occurs, only the entity / entity relationship triple with the longest word string is stored in MaxEntities / MaxER; if entity nesting never occurs, the entity / entity relationship triple is stored in MaxEntities / MaxER.
[0024] Preferably, the multi-label classification model adopts the BERT-TextCNN model, and the classification labels include "Confidentiality", "Integrity", "Availability", "Identification & Authentication", "Privacy" and "Accountability".
[0025] Preferably, each security requirement template is a description of a target security function TSF, which can meet one or more security goals; each TSF includes a function name, a function description, and one or more security scopes; each security scope contains a set of matching conditions, a security requirement template, and one or more security goals met by the template.
[0026] As a preference, the matching conditions of the security requirement template <subjects> 、 <objects> 、 <actions>Extracted from the requirement statement <subjects> 、 <objects> 、 <actions> ; <users>Extract from the entity set, <information>To filter out <objects>Appeared inside <system> 、 <resources> 、 <users>Afterwards, the remaining entity sets.
[0027] As a preferred method, the method for judging whether the matching condition in the security requirement template is satisfied is: if all matching conditions in a group of matching conditions corresponding to the security requirement template are satisfied, then the group of matching conditions is satisfied; otherwise, the group of matching conditions is not satisfied. The specific method for judging whether each matching condition is satisfied is:
[0028] If the matching condition is expressed as a single basic parameter type, then if the parameter type information exists in the input requirement statement, the matching condition is met; otherwise, the matching condition is not met;
[0029] If the matching condition is expressed as an assignment statement of basic parameters, then as long as there is a word on the right side of the equal sign in the input requirement statement, the matching condition is met; if all words do not exist, the matching condition is not met;
[0030] If the matching condition is expressed as "and" of multiple basic parameters, where "and" represents a logical AND operation, then if the words of these parameter types exist at the same time in the extracted information, the matching condition is met; otherwise, the matching condition is not met;
[0031] If the matching condition is expressed as "or" of multiple basic parameters, where "or" represents a logical OR operation, then as long as there is a word of the parameter type in the extracted information, the matching condition is met; if all words of the parameter type do not exist, the matching condition is not met.
[0032] As a preferred method, when instantiating a security requirement template, regular expressions are used to find the parameters that need to be instantiated in the security requirement template, and values are assigned to the parameters. Parameters that have not been assigned values are kept as they are. In addition to the parameters in the matching conditions, the parameters that can be automatically filled in also include <events>,Will <events>The assignment is a subject-predicate-object short sentence consisting of the action subject, action, and action object.
[0033] A security requirement acquisition system for natural language requirements, comprising:
[0034] The entity and action relationship extraction module is used to extract the entity and action relationship contained in each requirement statement of the requirement text based on natural language processing;
[0035] The safety goal classification module is used to predict the safety goal set of each requirement statement using a multi-label classification model based on deep learning;
[0036] The security requirement template matching module is used to match the security requirement template built based on the CC standard through matching conditions according to the entity and action relationship and the security goal set; one security goal is mapped to multiple security requirement templates, and the matching conditions in the security requirement template are judged based on the entity and action relationship extracted from the requirement statement;
[0037] And, a security requirement template instantiation module is used to fill in the parameters in the matched security requirement template according to the entity, action or constructed short sentence, and instantiate the security requirement template.
[0038] A computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the method for acquiring security requirements oriented to natural language requirements is implemented.
[0039] Beneficial effects: Compared with the prior art, the present invention establishes a set of parameterized security requirement templates based on the CC standard, realizes the reuse of security knowledge, and uses natural language processing technology and deep learning technology to automatically match security requirement templates and instantiate security requirement templates, effectively improving the degree of automation of the security requirement acquisition method. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is an overall flow chart of an embodiment of the present invention.
[0041] Figure 2 It is an example diagram of the graphical output of dependency parsing in an embodiment of the present invention.
[0042] Figure 3 This is an example diagram of the graphical output results of open information extraction in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to facilitate the understanding of those skilled in the art, the present invention is further described below in conjunction with the embodiments and drawings. Before describing the specific process of the embodiments of the present invention in detail, the natural language processing technology and deep learning technology involved are first introduced.
[0044] Natural Language Processing (NLP) technology can extract information such as entities and relationships between entities from natural language texts and structure this information. NLP technology can be used to process demand texts described in natural language, and the extracted demand elements are used in the security demand process. The embodiments of the present invention mainly involve two natural language processing technologies: dependency parsing and open domain information extraction. Dependency parsing refers to identifying the interdependencies between words in a sentence. The output of dependency parsing can be represented as a directed acyclic graph between words, and the dependency relationships are marked between words. An example of a dependency relationship is nsubj (evaluate{4}, doctor{2}), which means that "doctor" is the subject of the verb "evaluate", and the number in the curly brackets "{}" is the sequence number of the corresponding word in the sentence. Open domain information extraction extracts open domain relationship triples from a sentence: the subject of the relationship, the relationship, and the object of the relationship. It consists of a noun phrase and a verb phrase that indicates the semantic relationship between them, and is usually expressed in the form of <entity 1; relationship; entity 2>.
[0045] Multi-label text classification technology is a branch of deep learning technology. It refers to predicting multiple label categories for a given text. It is mainly used in topic identification, sentiment analysis, question-answering systems, etc. In an embodiment of the present invention, the input of the multi-label text classification task is an English natural language requirement, and the output is multiple security target label categories of this requirement.
[0046] A security object is a security property expected by the system. By identifying the security object expressed or implied by a specific sentence in a document, we can understand the intent of the sentence and establish possible security functions and requirements for the intent. The embodiment of the present invention uses six security objects, which mainly focus on the implementation technology of the software system. The definitions of the six security objects are as follows:
[0047] 1) Confidentiality (C): The extent to which data is disclosed only as intended.
[0048] 2) Integrity (I): The degree to which a system or component prevents inappropriate modification or destruction of computer programs or data.
[0049] 3) Identification and Authentication (IA): It is necessary to ensure that the declared identity is valid for the user, process or device.
[0050] 4) Availability (A): The operability and accessibility of a system or component when it is needed.
[0051] 5) Accountability (AY): The extent to which actions affecting software assets can be traced back to the actor responsible for that action.
[0052] 6) Privacy (P): The extent to which participants understand and control how their information is used.
[0053] like Figure 1 As shown, an embodiment of the present invention discloses a method for obtaining security requirements for natural language requirements, which mainly includes four steps: first, extracting entities and action relationships contained in each requirement statement based on natural language processing; then, using a multi-label classification model based on deep learning to predict the security goal set of each requirement statement; secondly, according to the outputs of the first two steps: entity and action relationship, security goal set, matching the security requirement template through matching conditions, our security requirement template is built based on the CC standard; finally, filling in the parameters in the matched security requirement template.
[0054] 1. Entity and action extraction based on natural language processing
[0055] Extracting entities and actions between entities from the requirement text can not only be used to match the conditions of the security requirement template in step 3 of the method of this embodiment, but also can be used to instantiate the security requirement template in step 4. This embodiment is based on iMER (Javed M, Lin Y. iMER: Iterative Process of Entity Relationship and Business Process Model Extraction from the Requirements [J]. Information and Software Technology, 2021, 135 (6): 106558) and the natural language processing tool Stanford CoreNLP to extract entities and entity relationships, and further filter out the desired entities and actions between entities.
[0056] First, Stanford CoreNLP is used to preprocess the demand text, including tokenizing, splitting sentences, lemmatizing, and part of speech tagging. The demand text R1 below is an example throughout the process of the present invention. Figure 2 It is a graphical representation of the dependency relationship of the requirement text R1 after being processed by Stanford CoreNLP.
[0057] R1: "The doctor shall evaluate the results of tests taken over by the patient in the hospital."
[0058] Secondly, the heuristic rules based on dependency types constructed by iMER are used to extract entities and entity relationships. In the requirement text R1, the entity set extracted by iMER is: ['tests', 'results', 'doctor', 'hospital', 'patient'], and the entity relationship set is: [{subject': 'doctor', 'relation': 'evaluate', 'object': 'results'}].
[0059] Then, we use Stanford CoreNLP's openIE tagger to extract entity relationships. Figure 3 It is the graphical representation of the entity relationship of the requirement text R1 after being processed by Stanford CoreNLP. The extracted entity sets are: ['doctor','results of tests','results'], and the extracted entity relations and sets are: [{'subject':'doctor','relation':'shall evaluate','object':'results of tests'},{'subject':'patient','relation':'is in','object':'hospital'},{'subject':'doctor','relation':'shall evaluate','object':'results'}].
[0060] Finally, take the union of all the extraction results to extract as many potential entities and entity relationships as possible. After taking the union, some stop words need to be removed, such as "shall", "should", "the", etc. It is particularly noteworthy that among the extracted entities, the word string of one entity may be a substring of the word string of another entity, that is, there will be entity nesting between entities, for example: the entity "drugs" is a substring of the entity "list of durgs"; the entity "results" is a substring of the entity "results of tests". In order to avoid repetition, this embodiment adopts the longest principle: select the entity with the longest word length, that is, "list of durgs" and "results of tests". This embodiment gives an algorithm for selecting the longest entity when entities are nested, as shown in Algorithm 1:
[0061] Algorithm 1. SelectMaximizeEntities
[0062] Input:Entities
[0063] Output:MaxEntities
[0064]
[0065] Since we need actions between entities, which are used to match security requirement templates in subsequent steps, if an entity relationship does not contain a verb, the relationship will be discarded. For example, Figure 3 The relations in {'subject':'patient','relation':'is in','object':'hospital'} will be discarded. Secondly, when screening action relations between entities, if there is nesting between two relations: the "relation" in one relation is part of the "relation" in another relation, or the entity in one relation is part of the entity in another relation. For example: the 'object' of the entity-relation triple {'subject':'doctor','relation':'shall evaluate','object':'results'} is a substring of the 'object' of the entity-relation triple {'subject':'doctor','relation':'shall evaluate','object':'results of tests'}, that is, 'results' is a substring of 'results of tests'. In order to avoid repetition, this embodiment also adopts the longest principle: select the relation with the longest word length.
[0066] After the first step of processing, the entity sets extracted from the requirement text R1 are: ['results of tests', 'doctor', 'hospital', 'patient'], and the action sets are: [{'subject': 'doctor', 'relation': 'evaluate', 'object': 'results of tests'}], which will also serve as the input of the third step of the method of this embodiment.
[0067] 2. Multi-label classification of security targets based on deep learning
[0068] In this step, a security goal multi-label classification model based on deep learning is used to obtain the security goal set of each requirement statement, which may contain 0, 1 or more security goals. In the embodiment of the present invention, a total of six typical security goals are used: "Confidentiality", "Integrity", "Availability", "Identification & Authentication", "Privacy", and "Accountability", among which the most common security goals are "Confidentiality, Integrity, Availability", which are also referred to as "CIA triples".
[0069] In order to achieve excellent multi-label classification efficiency for security targets, we trained a classification model "BERT-TextCNN": this model uses the excellent pre-trained language model BERT to obtain the word vector of each English word in the requirement sentence, and then uses TextCNN as a downstream task to output the probability of each security target label.
[0070] The security target category of the requirement text R1 predicted by BERT-textCNN is "Confidentiality, Integrity", which is in line with our expectations: because doctors need to evaluate the patient's examination results, which involves the confidentiality of the patient's data and the integrity of the examination results.
[0071] 3. Matching of security requirement templates
[0072] After obtaining the entities of the requirement statement, the actions between entities, and the security goal set, we need to use this information to match the security requirement template, so we first introduce the security requirement template we established.
[0073] 3.1 Security Requirements Template
[0074] The security requirement template established in the embodiment of the present invention is based on the security function components in the second part of the CC standard. However, since the standard is not easy for requirements engineers with non-security backgrounds to interpret and apply, we have streamlined some of the security function components, and finally formed 36 target security functions (TSF: Target Security Function) and 40 security requirement templates (Security Requirements Template). Each TSF can correspond to a security family of the security function components of CC. Therefore, this embodiment retains the name of the security family in CC as the unique identifier of the corresponding TSF. Each security requirement template is obtained by screening, simplifying, and merging the security elements under the security family. We choose the security family as the corresponding TSF because the security family is the second-level directory of the security function components, that is, the middle level. It is more refined than the security class and has better generalization and expression capabilities than the security component.
[0075] 3.1.1 Organizational Structure of Security Requirements Template
[0076] Each security requirement template is a description of the target security function (TSF), that is, the security function that the system should implement. At the same time, each template can also meet specific security goals. Each TSF contains the name of a function, an introduction to the function, and one or more security scopes. Each security scope contains a set of matching conditions, a security requirement template, and one or more security goals met by the template. The security scope is defined by the subject, object, and action targeted by the TSF, and it is represented by the matching conditions of the security requirement templates it contains. The same TSF may have multiple security scopes, that is, multiple security requirement templates, due to different choices in actual applications (different subjects, objects, or actions). We use the matching conditions of the security requirement template to express the security scope, that is, the matching conditions are used to determine whether the current security requirement template is applicable to the input requirement text.
[0077] The following is a complete example of a TSF that provides data validation capabilities to determine the validity of the data:
[0078]
[0079]
[0080] We also provide a set of mapping relationships between security goals and security requirement templates, as shown in Table 1. The first column in the table is the security goal (SO: Security Object). Since there is no clear classification of security scopes, and considering that security requirement templates are organized by security functions, we have established a mapping relationship between security goals and TSFs. Therefore, a given security goal can be mapped to a specific TSF, and then by traversing the security scope under the TSF, a specific security requirement template can be obtained, and finally the security requirement template that meets the original requirements can be screened out through matching conditions.
[0081] Table 1 Mapping relationship between security goals and TSF
[0082]
[0083] 3.1.2 Matching conditions of security requirement templates
[0084] A set of matching conditions can include multiple separate matching conditions. When each condition is met, the set of conditions is considered to be met, that is, the current demand template is matched successfully. All matching conditions have eight basic parameters and four grammatical forms.
[0085] 1) Eight basic parameters: All matching conditions have the following eight basic parameters:<key words> , <subjects> 、 <objects> 、 <actions> 、 <information> 、 <users> 、 <system> 、 <resources>Each basic parameter represents a type of words with specific semantics. These words need to be extracted from the original requirement statement and will be used to fill in the security requirement template.<key words> Refers to the keywords that should be in the original requirement statement, and only applies to the second grammatical form below; <subjects> , <objects> , <actions>It is relative to an action. An action has a subject that initiates the action and an object that carries the action; <information>Refers to the information used for transmission, processing, and storage in the system; <users>Refers to the users who interact with the system; <system>It refers to the system as a whole; <resources>Refers to "resource" and "service".
[0086] 2) Four grammatical forms: All matching conditions have the following four grammatical forms, where "and" represents a logical AND operation, "or" represents a logical OR operation, and "=" represents an assignment operation. 、 Represents one of the eight basic parameters, and W represents a set of words:
[0087] a. : When the condition is a basic parameter, it means that if the original requirement statement contains information of this parameter type, the condition is met;
[0088] b. =W: When the condition is a basic parameter assignment statement, it means that if the word on the right side of the equal sign exists in the original requirement statement, the condition is met. Parameter<key words> , <system> , <resources>This condition applies where<key words> Its value will vary depending on the template. <system> , <resources>The value of is fixed;
[0089] c.< / resources> < / system> < / resources> < / system> and : When the condition is "and" of multiple basic parameters, it means that if the information of these parameter types exists at the same time in the extracted information, the condition is met;
[0090] d. or : When the condition is "or" of multiple basic parameters, it means that if information of one of the parameter types exists in the extracted information, the condition is met.
[0091] 3.2 Security Requirements Template Matching
[0092] According to the mapping relationship between security goals and TSF, the security goal set obtained in the second step can obtain a set of security requirement templates. However, whether these templates are suitable for the input requirement statements needs to be judged based on the matching conditions of each template.
[0093] To determine whether the matching condition is met, you first need to identify word instances of the eight basic parameters of the matching condition from the input requirement text.
[0094] From the previous introduction to the 8 basic parameters, we know that only five of them need to be identified: <subjects> 、 <objects> 、 <actions> 、 <information> 、 <users>, and the entities and actions between entities extracted in the first step include the following parameters: <subjects> 、 <objects> 、 <actions>.for <users>, this embodiment adopts two extraction rules and extracts in the entity set:
[0095] 1) Recognize through the English affixes '-er' and '-or';
[0096] 2) Create some user-related keywords, such as professionals and titles for people in specific fields (patient in the medical field).
[0097] for <information>This embodiment believes that this type of words usually appear in <objects>In the class, <users> 、 <system> 、 <resources>Also often appears in <objects>So this embodiment considers filtering out <objects>Appeared inside <system> 、 <resources> 、 <users>After that, the remaining entity sets belong to <information>.
[0098] For the requirement text R1, this embodiment extracts the following parameters and word instances of the parameters from the output of the first step:
[0099] 1) <subjects>:"doctor”;
[0100] 2) <objects>:"results of tests”;
[0101] 3) <actions>:"evaluate”;
[0102] 4) <information>:"results of tests”;
[0103] 5) <users>: "patient", "doctor".
[0104] For requirement text R1, the security goal "Confidentiality" obtained in the second step can be mapped to TSF.5 Access control policy, and finally a security requirement template that satisfies "Confidentiality" and its matching conditions can be obtained:
[0105] Matching conditions: <subjects>and <actions>and <objects>
[0106] Security requirement:The TSF shall enforce the[assignment:<accesscontrol SFP>]on[assignment: <events>].
[0107] Therefore, the matching condition is established, which means that the security requirement template is matched successfully and is applicable to the requirement text R1. This security requirement template (hereinafter referred to as SRQ1) will be completed in the next step of the method.
[0108] We give an algorithm for determining whether the matching condition is met, as shown in Algorithm 2. The input "BasicParameters" of Algorithm 2 refers to the eight basic parameters and their word instances identified from the input requirement text.
[0109] Algorithm 2.JudgeMatchingConditions
[0110] Input: MatchingConditions,BasicParameters,ReqSentence
[0111] Return: isMatching
[0112]
[0113]
[0114] 4. Instantiation of security requirement template
[0115] We use a set of string regular expressions to find the parameters that need to be instantiated in the security requirement template, that is, the parameters with angle brackets in ['assignment:'], and separate the parameters that can be assigned with "< / events> < / objects> < / actions> < / subjects> < / users> < / information> < / actions> < / objects> < / subjects> < / information> < / users> < / resources> < / system> < / objects> < / objects> < / resources> < / system> < / users> < / objects> < / information> < / users> < / actions> < / objects> < / subjects> < / users> < / information> < / actions> < / objects> < / subjects> = string value". Parameters without values are left as they are. In fact, due to the lack of relevant security background knowledge, it may be difficult for the demand personnel to fill in the parameters of specific security technologies, such as encryption standards.<encryption standard> , access control policy<access control policy> However, these parameters have actual semantics and do not affect the overall understanding of security requirements by software developers and designers, so this embodiment retains these parameters as they are. All parameters that can be automatically filled in are basically the basic parameters in the matching conditions, but there is another parameter: <events> , <events>Refers to an event, whose instance is a simple subject-predicate-object sentence consisting of the subject, action, and object of action.
[0116] The following is the completed security requirement template SRQ1:
[0117] The TSF shall enforce the[assignment:<access control policy> on[assignment: <events>="doctor evaluate results of tests"].
[0118] As follows, the method of the present invention is analyzed and compared with the existing methods in terms of the description form, applicability, reusability, degree of automation, effectiveness, etc. of the security requirements of the security requirements acquisition method. The results are shown in Table 2.
[0119] 1) Degree of automation: Is there tool support, manual, semi-automatic or automatic?
[0120] 2) Applicability: the context in which the method is applicable.
[0121] 3) Validity: Whether the obtained security requirements are valid.
[0122] 4) Description form: the description form used for the method results, such as natural language, formalization, semi-formalization, etc.
[0123] 5) Reusability: Are there reusable resources in the execution results of the method as security knowledge in the domain?
[0124] Table 2 Comparison of the method of the present invention with other methods
[0125]
[0126] The method of the present invention performs multi-label text classification on English natural language demand text based on deep learning technology. Table 3 shows the evaluation results of other classification methods on the English natural language demand dataset, where bold indicates the best result. It can be seen that the "BERT-TextCNN" model used by the method of the present invention has achieved the best results in all indicators.
[0127] Table 3 Average experimental results of the multi-label classification model used by the method of the present invention and other benchmark methods
[0128]
[0129] Based on the same inventive concept, an embodiment of the present invention discloses a security requirement acquisition system for natural language requirements, including: an entity and action relationship extraction module, which is used to extract the entities and action relationships contained in each requirement statement of the requirement text based on natural language processing; a security goal classification module, which is used to predict the security goal set of each requirement statement using a multi-label classification model based on deep learning; a security requirement template matching module, which is used to match the security requirement template built based on the CC standard through matching conditions according to the entity and action relationship and the security goal set; one security goal is mapped to multiple security requirement templates, and whether the matching conditions in the security requirement template are met is judged according to the entity and action relationship extracted from the requirement statement; and a security requirement template instantiation module, which is used to fill in the parameters in the matched security requirement template according to the entity, action or constructed short sentence, and instantiate the security requirement template.
[0130] The specific working process of each module described above can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here. The module division is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system.
[0131] Based on the same inventive concept, an embodiment of the present invention discloses a computer system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded into the processor, the method for obtaining security requirements oriented to natural language requirements is implemented.
[0132] Those skilled in the art can understand that the technical solution of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer system (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present invention. The storage medium includes: various media that can store computer programs, such as a USB flash drive, a mobile hard disk, a read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.< / events> < / events> < / events> < / resources> < / system> < / users> < / information> < / actions> < / objects> < / subjects> < / resources> < / system> < / users> < / information> < / actions> < / objects> < / subjects> < / events> < / events> < / users> < / resources> < / system> < / objects> < / information> < / users> < / actions> < / objects> < / subjects> < / actions> < / objects> < / subjects>
Claims
1. A security requirement acquisition method for natural language requirements, It is characterized in that The steps include: Extract the entities and action relationships contained in each requirement statement in the requirement text based on natural language processing; Use a multi-label classification model based on deep learning to predict the set of security goals for each requirement statement; According to the entity and action relationship and security goal set, the security requirement template built based on the CC standard is matched through matching conditions; One of the security goals is mapped to multiple security requirement templates, and the matching conditions in the security requirement templates are judged based on the entities and action relationships extracted from the requirement statements; Fill in the parameters in the matched security requirement template according to the entity, action or constructed short sentence, and instantiate the security requirement template; Entity and action relationships extracted based on natural language processing include: Preprocess the required text, including tokenization, sentence splitting, stemming, and part-of-speech tagging; Extract entities and entity relationships based on heuristic rules of dependency types; Use taggers to extract entity relationships; Take the union of all extraction results, remove stop words, remove relations that do not include verbs, and use the longest principle to select the entity with the longest word string and the relation with the longest word string; The method of selecting entities / relationships using the longest principle is: Create an empty set to store the longest entity / entity relationship triples, denoted as MaxEntities / MaxER; Compare each extracted entity / entity relationship triple with all entity / entity relationship triples in MaxEntities / MaxER: If entity nesting occurs, only the entity / entity relationship triple with the longest word string is stored in MaxEntities / MaxER; if entity nesting does not occur, the entity / entity relationship triple is stored in MaxEntities / MaxER; Each security requirement template is a description of the target security function TSF, which can meet one or more security goals; each TSF includes a function name, a function description, and one or more security scopes; each security scope contains a set of matching conditions, a security requirement template, and one or more security goals met by the template; When instantiating a security requirement template, regular expressions are used to find the parameters that need to be instantiated in the security requirement template, and values are assigned to the parameters. Parameters that have not been assigned values are kept as they are. In addition to the parameters in the matching conditions, the parameters that can be automatically filled in also include <events>,Will <events> The assignment is a subject-predicate-object short sentence consisting of the action subject, action, and action object.< / events> < / events> 2. According to the security requirement acquisition method for natural language requirements according to claim 1, It is characterized in that The multi-label classification model uses the BERT-TextCNN model, and the classification labels include "Confidentiality", "Integrity", "Availability", "Identification & Authentication", "Privacy" and "Accountability".
3. The method for obtaining security requirements oriented to natural language requirements according to claim 1, It is characterized in that The matching conditions of the security requirement template <subjects> 、 <objects> 、 <actions>Extracted from the requirement statement <subjects> 、 <objects> 、 <actions> ; <users>Extract from the entity set, <information>To filter out <objects>Appeared inside <system> 、 <resources> 、 <users> Afterwards, the remaining entity sets.< / users> < / resources> < / system> < / objects> < / information> < / users> < / actions> < / objects> < / subjects> < / actions> < / objects> < / subjects> 4. The method for obtaining security requirements oriented to natural language requirements according to claim 1, It is characterized in that Use Stanford CoreNLP to preprocess the requirement text; use the dependency type-based heuristic rules constructed by iMER to extract entities and entity relationships; use Stanford CoreNLP's openIE tagger to extract entity relationships.
5. The method for obtaining security requirements oriented to natural language requirements according to claim 1, It is characterized in that The method for judging whether the matching conditions in the security requirement template are satisfied is as follows: if all matching conditions in a set of matching conditions corresponding to the security requirement template are satisfied, then the set of matching conditions is satisfied; otherwise, the set of matching conditions is not satisfied. The specific method for judging whether each matching condition is satisfied is as follows: If the matching condition is expressed as a single basic parameter type, then if the information of the parameter type exists in the input requirement statement, the matching condition is met; Otherwise, the matching condition does not hold; If the matching condition is expressed as an assignment statement of basic parameters, then as long as there is a word on the right side of the equal sign in the input requirement statement, the matching condition is met; if all words do not exist, the matching condition is not met; If the matching condition is expressed as "and" of multiple basic parameters, where "and" represents a logical AND operation, then if words of these parameter types exist at the same time in the extracted information, the matching condition is met; Otherwise, the matching condition does not hold; If the matching condition is expressed as "or" of multiple basic parameters, where "or" represents a logical OR operation, then as long as there is a word of the parameter type in the extracted information, the matching condition is met; if all words of the parameter type do not exist, the matching condition is not met.
6. A security requirements acquisition system for natural language requirements, It is characterized in that include: The entity and action relationship extraction module is used to extract the entity and action relationship contained in each requirement statement of the requirement text based on natural language processing; The safety goal classification module is used to predict the safety goal set of each requirement statement using a multi-label classification model based on deep learning; The security requirement template matching module is used to match the security requirement template built based on the CC standard through matching conditions according to the entity and action relationship and security goal set; One of the security goals is mapped to multiple security requirement templates, and the matching conditions in the security requirement templates are judged based on the entities and action relationships extracted from the requirement statements; and, a security requirement template instantiation module, for filling in the parameters in the matched security requirement template according to the entity, action or constructed short sentence, and instantiating the security requirement template; Entity and action relationships extracted based on natural language processing include: Preprocess the required text, including tokenization, sentence splitting, stemming, and part-of-speech tagging; Extract entities and entity relationships based on heuristic rules of dependency types; Use taggers to extract entity relationships; Take the union of all extraction results, remove stop words, remove relations that do not include verbs, and use the longest principle to select the entity with the longest word string and the relation with the longest word string; The method of selecting entities / relationships using the longest principle is: Create an empty set to store the longest entity / entity relationship triples, denoted as MaxEntities / MaxER; Compare each extracted entity / entity relationship triple with all entity / entity relationship triples in MaxEntities / MaxER: If entity nesting occurs, only the entity / entity relationship triple with the longest word string is stored in MaxEntities / MaxER; if entity nesting does not occur, the entity / entity relationship triple is stored in MaxEntities / MaxER; Each security requirement template is a description of the target security function TSF, which can meet one or more security goals; each TSF includes a function name, a function description, and one or more security scopes; each security scope contains a set of matching conditions, a security requirement template, and one or more security goals met by the template; When instantiating a security requirement template, regular expressions are used to find the parameters that need to be instantiated in the security requirement template, and values are assigned to the parameters. Parameters that have not been assigned values are kept as they are. In addition to the parameters in the matching conditions, the parameters that can be automatically filled in also include <events>,Will <events> The assignment is a subject-predicate-object short sentence consisting of the action subject, action, and action object.< / events> < / events> 7. A computer system comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the computer program is loaded into a processor, the method for obtaining security requirements oriented to natural language requirements according to any one of claims 1 to 5 is implemented.
