[go: up one dir, main page]

WO2024169388A1 - Security requirement generation method and apparatus based on stride model, electronic device and medium - Google Patents

Security requirement generation method and apparatus based on stride model, electronic device and medium Download PDF

Info

Publication number
WO2024169388A1
WO2024169388A1 PCT/CN2023/140017 CN2023140017W WO2024169388A1 WO 2024169388 A1 WO2024169388 A1 WO 2024169388A1 CN 2023140017 W CN2023140017 W CN 2023140017W WO 2024169388 A1 WO2024169388 A1 WO 2024169388A1
Authority
WO
WIPO (PCT)
Prior art keywords
requirement
security
requirements
candidate
similarity
Prior art date
Application number
PCT/CN2023/140017
Other languages
French (fr)
Chinese (zh)
Inventor
崔佳玲
Original Assignee
天翼云科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 天翼云科技有限公司 filed Critical 天翼云科技有限公司
Publication of WO2024169388A1 publication Critical patent/WO2024169388A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Definitions

  • the present application relates to the field of computer technology, and in particular to a method, device, electronic device and medium for generating security requirements based on a STRIDE model.
  • the purpose of the embodiments of the present application is to provide a method, device, electronic device and medium for generating security requirements based on the STRIDE model to solve the above problems.
  • the specific technical solution is as follows:
  • a method for generating security requirements based on the STRIDE model is first provided, and the method may include:
  • the requirement description set including requirement descriptions corresponding to each model dimension, the requirement description set being obtained based on the division of the STRIDE model;
  • executable reference security data is divided to obtain a reference security requirement set;
  • the reference security requirement set includes security requirements corresponding to each of the model dimensions;
  • the security requirement to be selected is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
  • a target security requirement set is generated based on the target security requirements corresponding to each of the requirement descriptions.
  • a device for generating safety requirements based on a STRIDE model may include:
  • a requirement description acquisition module is used to acquire a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the division of the STRIDE model;
  • a security data partitioning module used to partition executable reference security data based on the STRIDE model to obtain a reference security requirement set;
  • the reference security requirement set includes security requirements corresponding to each of the model dimensions;
  • a first similarity acquisition module is used to acquire, for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement;
  • the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
  • a selection module configured to select, based on a first similarity between the requirement description and each of the candidate security requirements, a candidate security requirement corresponding to the requirement description as a target security requirement;
  • the target security requirement set generating module is used to generate a target security requirement set based on the target security requirements corresponding to each of the requirement descriptions.
  • an electronic device including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
  • Memory used to store computer programs
  • the processor is used to perform the method described in the first aspect when executing the program stored in the memory.
  • a computer-readable storage medium is further provided, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer performs the method described in the first aspect above.
  • a computer program product comprising instructions, which, when executed on a computer, enables the computer to perform any of the methods described in the first aspect above.
  • the embodiment of the present application obtains a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model; executable reference security data is divided based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions; for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement is obtained; the candidate security requirement is a security requirement whose model dimension corresponding to the reference security requirement set is consistent with the model dimension corresponding to the requirement description; based on the first similarity between the requirement description and each candidate security requirement, a candidate security requirement corresponding to the requirement description is selected as a target security requirement; and a target security requirement set is generated based on the target security requirements corresponding to each of the requirement descriptions.
  • the first similarity between the requirement description and the candidate security requirement under the same model dimension can be obtained according to the model dimension, thereby improving the accuracy of the first similarity calculation.
  • the target security requirement corresponding to the requirement description is selected through the first similarity between the requirement description and the candidate security requirement, and a target security requirement set is generated.
  • the obtained target security requirement is consistent with the requirement description, and there is no need to manually edit the security requirement. Only the security requirement that meets the requirements can be selected according to the first similarity, thereby improving the efficiency of generating the target security requirement set.
  • FIG1 is a flowchart of a method for generating security requirements based on a STRIDE model provided in an embodiment of the present application
  • FIG2 is a schematic diagram of a clustering operation provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a text vector calculation provided by an embodiment of the present application.
  • FIG4 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • FIG5 is a flowchart of another method for generating security requirements based on the STRIDE model provided in an embodiment of the present application
  • FIG6 is a structural block diagram of a security requirement generation device based on a STRIDE model provided in an embodiment of the present application.
  • FIG. 1 is a flowchart of a method for generating security requirements based on a STRIDE model provided in an embodiment of the present application. As shown in FIG. 1 , the method may include the following steps:
  • Step 101 Obtain a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model division.
  • the above-mentioned requirement description set refers to a set containing requirement descriptions, which may be in the form of a list.
  • the above-mentioned requirement description refers to the business process designed in the design phase of software development, the possible attack information and the protection operations that need to be performed for the attack information, that is, the requirement description may include a threat description and a suggestion description, usually in text form, and each threat description and each suggestion description usually correspond one to one.
  • the above-mentioned business process may be designed for the World Wide Web system (WEB) or for host-type software.
  • WEB World Wide Web system
  • the embodiment of the present application does not limit the type of software.
  • the above-mentioned STRIDE model is a threat modeling, which can divide threats into spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege, six model dimensions. Accordingly, the embodiment of the present application can classify the above-mentioned requirement description according to the dimensions of the STRIDE model to obtain requirement descriptions corresponding to different dimensions. In some embodiments, the embodiment of the present application can further divide the requirement descriptions of different dimensions into different subsets according to the model dimensions where each requirement description is located, so that the above-mentioned requirement description set can include subsets of different model dimensions.
  • the embodiment of the present application can obtain the above-mentioned requirement description set through a threat modeling tool (threat modeling tool), the core of which is the STRIDE modeling method.
  • a threat modeling tool the core of which is the STRIDE modeling method.
  • the designed business process can be input into the above-mentioned threat modeling tool.
  • the threat modeling tool can identify and determine the possible threats in each process, and generate corresponding suggestions based on the threats, so that the requirement description set can be obtained according to the generated threats and suggestions.
  • Step 102 Based on the STRIDE model, executable reference security data is divided to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions.
  • the executable reference security data refers to the security requirement data that can be determined to provide reference for software development, which can be the security requirements of historical software development projects, or the reference security requirements directly obtained from the Internet. They are usually security requirements that can provide reference for developers in other software development processes. Therefore, the reference security data is executable. Compared with the recommended description in the above requirement description, it is usually more detailed and can provide developers with a more accurate and detailed reference.
  • the above security requirements refer to the development requirements proposed in the design stage in order to ensure the security of the designed software or system in all aspects (for example, the security of servers and data, the security of information transmission between servers and users, and the security of application clients and environments, etc.). Developers will refer to the security requirements to complete the security function development or design of the system or software.
  • the above-mentioned reference security data usually includes a large amount of security requirement data, and is usually security requirement data that provides reference in different aspects.
  • the model dimension of each reference security data can be determined according to the role played by different reference security data.
  • the above-mentioned reference security data is also in text form.
  • the embodiment of the present application can determine the model dimension of each reference security data through the semantic description of each reference security data, or it can also obtain the model dimension of each reference security data by receiving the input information of the staff for different reference security data. The embodiment of the present application does not limit this.
  • reference security data of different dimensions can be further divided into different subsets according to the model dimensions of each reference security data, so that the above-mentioned reference security requirement set can include the security requirement subsets corresponding to each model dimension.
  • Step 103 For any requirement description in the requirement description set, obtain a first similarity between the requirement description and each candidate security requirement; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description.
  • the above-mentioned first similarity can be the similarity between the semantics of the requirement description and the semantics of each candidate security requirement, which can characterize the degree of matching between the requirement description and each candidate security requirement.
  • the higher the similarity the higher the degree of matching. Accordingly, the higher the probability that the candidate security requirement can avoid the threat in the requirement description, and the better the effect of the candidate security requirement as the security requirement corresponding to the requirement description.
  • the first similarity may be the cosine similarity between the requirement description and the selected security requirement.
  • it may also be calculated using other similarity algorithms, which is not limited in this embodiment of the present application.
  • the embodiments of the present application may set the above-mentioned reference security requirements and take the security requirements with the same model dimension corresponding to the above-mentioned requirement description as candidate security requirements. Since the model dimension can characterize the threat dimension targeted by the requirement description and the security requirement, the first similarity between the two can be calculated under the same threat dimension, thereby improving the accuracy of the similarity calculation.
  • Step 104 Based on the first similarity between the requirement description and each candidate security requirement, select the candidate security requirement corresponding to the requirement description as the target security requirement.
  • Step 105 Generate a target security requirement set based on the target security requirements corresponding to each of the requirement descriptions.
  • the embodiments of the present application can select the security requirement with the highest first similarity to the requirement description from the above-mentioned candidate security requirements as the target security requirement, or can also set a selection threshold and use the candidate security requirement with a first similarity greater than the above-mentioned selection threshold as the above-mentioned target security requirement. It can be set according to the actual situation, and the embodiments of the present application do not limit this.
  • the target security requirement set is a set including the generated security requirements.
  • the embodiment of the present application obtains a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model division; executable reference security data is divided based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions; for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement is obtained; the candidate security requirement is a security requirement whose model dimension corresponding to the reference security requirement set is consistent with the model dimension corresponding to the requirement description; based on the requirement Calculate the first similarity between the description and each candidate security requirement, select the candidate security requirement corresponding to the requirement description as the target security requirement; generate a target security requirement set based on the target security requirements corresponding to each requirement description.
  • the first similarity between the requirement description and the candidate security requirement under the same model dimension can be obtained according to the model dimension, thereby improving the accuracy of the first similarity calculation.
  • the target security requirement corresponding to the requirement description is selected through the first similarity between the requirement description and the candidate security requirement, and a target security requirement set is generated.
  • the obtained target security requirement is consistent with the requirement description, and there is no need to manually edit the security requirement.
  • the security requirement that meets the requirements can be selected according to the first similarity, thereby improving the efficiency of generating the target security requirement set.
  • the embodiments of the present application may specifically include the following steps:
  • Step 201 For any of the model dimensions, classify the security requirements in the reference security requirement set corresponding to the model dimension to obtain different categories of security requirements under the model dimension; any category of security requirements includes central requirements.
  • the security requirements of any model dimension may correspond to different functional modules of the software. Therefore, the above classification can be classified according to the functional modules corresponding to each security requirement, and the security requirements corresponding to the same functional module can be classified into the same category.
  • other classification rules can also be set according to actual needs, and the embodiments of the present application are not limited to this.
  • a central requirement can be selected from the security requirements of each category, wherein the similarity between any security requirement and other security requirements can be calculated under the same category, and the security requirement with the greatest similarity to other security requirements can be used as the central requirement.
  • the above classification and determination of the central requirements of each category can be achieved through the K-means clustering algorithm (k-means clustering algorithm, K-means). It can be understood that the central requirements of each category obtained in the above manner are relatively close to other security requirements, so the central requirement is a more representative security requirement in the category.
  • the operation of selecting the candidate security requirement corresponding to the requirement description based on the first similarity between the requirement description and each candidate security requirement may specifically include the following steps:
  • Step 202 Obtain a second similarity between the requirement description and each target central requirement as a similarity threshold of each category; the target central requirement is a central requirement in a category under the model dimension corresponding to the selected security requirement.
  • Step 203 Based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category, select a candidate security requirement corresponding to the requirement description.
  • the embodiment of the present application can obtain the second similarity between the requirement description and the central requirement of each category under the same model dimension. Since the central requirement of each category is a more representative security requirement in each category, the second similarity of each central requirement can be used as the similarity threshold of each category under the model dimension to screen other security requirements. Among them, the above-mentioned second similarity can also be the cosine similarity between the text of the requirement description and the text of the central requirement, and of course it can also be calculated by other similarity algorithms, which is not limited by the embodiment of the present application.
  • the similarity threshold corresponding to each candidate security requirement can be used as a selection condition, and the candidate security requirement whose first similarity is greater than the similarity threshold is used as the candidate security requirement corresponding to the requirement description. It can be understood that when the first similarity between the candidate security requirement and the requirement description is not greater than the corresponding similarity threshold, it indicates that the candidate security requirement does not match the actual requirement of the current software or system, and thus it can be excluded. It is a candidate security requirement corresponding to the requirement description. Accordingly, when the first similarity between the candidate security requirement and the requirement description is greater than the corresponding similarity threshold, it indicates that the candidate security requirement matches the actual requirement of the current software or system, and thus it can be used as the candidate security requirement corresponding to the requirement description.
  • any category of security requirements includes central requirements; the second similarity between the requirement description and each target central requirement is obtained as the similarity threshold of each category; the target central requirement is the central requirement in the category under the model dimension corresponding to the candidate security requirement; based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category, the candidate security requirement corresponding to the requirement description is selected.
  • the reference security requirements under each model dimension are classified, and the central requirement is determined in each category, and the reference security requirements in the same model dimension can be clustered to facilitate subsequent calculations.
  • the matching between the candidate security requirement and the requirement description can be further improved, and the accuracy of generating the target security requirement set can be improved.
  • FIG. 2 is a schematic diagram of a clustering operation provided in an embodiment of the present application.
  • the operation of classifying the security requirements corresponding to the model dimension in the reference security requirement set to obtain different categories of security requirements under the model dimension may specifically include the following steps:
  • Step 301 Select multiple initial central requirements from the security requirements corresponding to the model dimension in the reference security requirement set as candidate central requirements; one candidate central requirement corresponds to one of the categories.
  • the above initial central requirements can be randomly selected from the security requirements under the same model dimension.
  • the security requirements under the same model dimension can be randomly divided into K groups, and an initial central requirement is randomly selected from each group, thereby obtaining K initial central requirements, and accordingly, K categories can be obtained.
  • K value can be set according to actual needs, and the embodiment of the present application does not limit this.
  • Step 302 For any security requirement in the reference security requirement set corresponding to the model dimension, obtain a third similarity between the security requirement and each of the candidate center requirements.
  • Step 303 Classify the security requirements into the categories represented by the corresponding candidate center requirements with the largest third similarity.
  • the proximity between each security requirement and each candidate central requirement can be obtained.
  • each security requirement can be assigned to the category of the candidate central requirement with the largest third similarity, and clustering can be achieved to obtain security requirements of different categories under each model dimension and the central requirement of the security requirements of this category.
  • the above third similarity can also be the cosine similarity between the two texts, and of course it can also be calculated by other similarity algorithms, which is not limited in the embodiments of the present application.
  • Step 304 Based on the security requirements contained in each category, reselect multiple center requirements as the candidate center requirements, and re-execute the operation of obtaining the third similarity between the security requirements and each of the candidate center requirements based on the candidate center requirements until the preset termination condition is reached, and use the current candidate center requirements as the target center requirements, and use the current classification result as the final classification result.
  • the central requirements of each category can be reselected from the security requirements contained in the current categories as New candidate center requirements.
  • the security requirements included in the above categories include the center requirements of each category and other security requirements in each category except the center requirements.
  • the above-mentioned operation of reselecting multiple central requirements can be to recalculate the similarity between any security requirement and other security requirements in the category based on the security requirements included in the current category, and further obtain new candidate central requirements of different categories.
  • the mean similarity between the security requirement and the other security requirements can be further obtained, that is, the sum of the similarities between the security requirement and the other security requirements is divided by the number of other security requirements to obtain the mean similarity of the security requirement. Accordingly, each security requirement in the category can obtain the corresponding mean similarity through the above-mentioned operation, and the security requirement with the smallest mean similarity can be used as the new candidate central requirement.
  • the third similarity between each candidate center requirement and other security requirements in the reference security requirement set under the same model dimension as each candidate center requirement can be obtained again, and other security requirements can be classified into the corresponding category of the candidate center requirement with the largest third similarity.
  • the above-mentioned preset termination condition can be that the re-selected candidate center demand is consistent with the original candidate center demand, or the number of times the candidate center demand is selected reaches a preset number threshold, and the embodiment of the present application does not limit this.
  • the preset termination condition it indicates that the current classification result has met the requirements, so that the current classification result can be used as the final classification result, and the current candidate center demand is used as the target center demand.
  • the security requirements contained in the category represented by each target center demand are used as the security requirements of the category.
  • multiple initial central requirements are selected from the security requirements corresponding to the model dimension in the reference security requirement set as the central requirements to be selected; one central requirement to be selected corresponds to one category; for any security requirement in the security requirements corresponding to the model dimension in the reference security requirement set, the third similarity between the security requirement and each central requirement to be selected is obtained; the security requirement is divided into the category represented by the central requirement to be selected with the largest corresponding third similarity; based on the security requirements contained in each category, multiple central requirements are re-selected as the central requirements to be selected, and the operation of obtaining the third similarity between the security requirement and each central requirement to be selected is re-executed based on each central requirement to be selected, until the preset termination condition is reached, the current central requirements to be selected are used as the target central requirements, and the current classification result is used as the final classification result.
  • the security requirements under the same model dimension can be classified, and the relatively close security requirements can be classified into the same category to achieve clustering, so as to facilitate the matching of the requirement description and the security requirement under the same model dimension and the same category, and further improve the accuracy of the matching.
  • the operation of selecting the candidate security requirement corresponding to the requirement description based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category may specifically include the following steps:
  • Step 401 For any of the security requirements to be selected, a similarity threshold of the category to which the security requirement to be selected belongs is obtained from the similarity thresholds of the categories as a target similarity threshold corresponding to the security requirement to be selected.
  • Step 402 If the first similarity between the candidate security requirement and the requirement description is not lower than a target similarity threshold corresponding to the candidate security requirement, determine the candidate security requirement as the candidate security requirement corresponding to the requirement description.
  • the similarity threshold of the category can be selected as the similarity threshold of the security requirement to be selected.
  • the target similarity threshold is obtained, so that the target similarity threshold corresponding to each candidate security requirement can be obtained.
  • the first similarity between each candidate security requirement and the requirement description may be compared with the target similarity threshold of each candidate security requirement, and the candidate security requirement whose first similarity is not lower than the corresponding target similarity threshold may be determined as the candidate security requirement corresponding to the requirement description.
  • the similarity threshold of the category to which the security requirement to be selected belongs is obtained from the similarity thresholds of each category as the target similarity threshold corresponding to the security requirement to be selected; when the first similarity between the security requirement to be selected and the requirement description is not lower than the target similarity threshold corresponding to the security requirement to be selected, the security requirement to be selected is determined as the security requirement to be selected corresponding to the requirement description. In this way, by selecting a security requirement to be selected whose first similarity threshold is not lower than the target similarity threshold, the matching degree between the selected security requirement to be selected and the requirement description can be improved.
  • the security requirements to be selected can be screened under the same category of the same model dimension, so that the screening of the security requirements to be selected is more refined, and the accuracy of the selected security requirements to be selected is further improved.
  • the operation of obtaining the first similarity between the requirement description and each candidate security requirement may include the following steps:
  • Step 501 Obtain a first text vector corresponding to each of the to-be-selected security requirements and a second text vector corresponding to the requirement description.
  • Step 502 Determine a first similarity between the requirement description and each of the security requirements to be selected based on the second text vector and the first text vector corresponding to each of the security requirements to be selected.
  • the above-mentioned text vector is a vector that can represent the semantics or theme of the text. Therefore, the embodiment of the present application obtains the first text vector of each candidate security requirement and the second text vector corresponding to the requirement description respectively, and then calculates the similarity between the two.
  • the first text vector and the second text vector can be calculated by a text vector algorithm (for example, doc2vec).
  • FIG3 is a schematic diagram of a text vector calculation provided by an embodiment of the present application. As shown in FIG3, the texts of each selected security requirement and the requirement description can be input into the word segmenter to obtain the word segmentation (Information-Dispersal Scheme, ids) of each text, and then the word segmentation is used as input to obtain the text vector through the vector mapping function (nn.Embedding).
  • ids Information-Dispersal Scheme
  • the first similarity can be obtained by calculating the cosine similarity between the first text vector and the second text vector.
  • the cosine similarity can measure the similarity between the two vectors by measuring the cosine value of the angle between the two vectors, wherein, since the cosine value of the 0-degree angle is 1, the cosine values of other angles are not greater than 1, and the minimum value is -1, it is possible to determine whether the two vectors are pointing in roughly the same direction based on the cosine value of the angle between the two vectors, thereby obtaining the degree of similarity between each candidate security requirement and the subject or semantics of the requirement description in the embodiment of the present application.
  • the first similarity between the requirement description and each of the selected security requirements is determined.
  • the semantic representation of the selected security requirements and the requirement description can be obtained, so that the first similarity can be calculated through the text vector, which can improve the accuracy of the first similarity.
  • the above-mentioned operation of dividing the executable reference security data based on the STRIDE model may specifically include the following steps:
  • Step 601 Obtain semantic information of each piece of security data contained in the reference security data.
  • Step 602 For any piece of the security data, the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information.
  • the above-mentioned semantic information can represent the meaning expressed by each piece of security data.
  • the semantic information of each security data can be obtained through a preset text semantic extraction model or text semantic extraction algorithm, and the embodiments of the present application are not limited to this.
  • the reference security data is often a whole paragraph of text.
  • the embodiment of the present application can split the reference security data into multiple security data.
  • the reference security data can be pre-processed and converted into a specified format, wherein the above-mentioned specified format can be a TXT format, thereby facilitating subsequent calculations and analysis.
  • the STRIDE model is a model that can classify data according to the STRIDE method, and the STRIDE model can be pre-built. Specifically, the STRIDE model can determine the type of threat to which each piece of security data is targeted through the semantic information, determine which model dimension of threat it is used to solve, and divide it into corresponding model dimensions. Different model dimensions correspond to different threat types, thereby realizing the division of security data.
  • the above division of security data may also be performed by receiving input information from staff, and the above input information may represent the model dimension to which each piece of security data belongs.
  • the semantic information of each piece of security data contained in the reference security data is obtained; for any piece of the security data, the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information. In this way, by dividing the reference security data through the STRIDE model, security data that conforms to the STRIDE model dimension can be obtained, so as to facilitate the subsequent similarity matching with the demand description under different model dimensions and improve the matching accuracy.
  • the operation of obtaining the requirement description set may include the following steps:
  • Step 701 Obtain threat information of each process in the process to be processed.
  • Step 702 For any of the processes, determine a requirement description corresponding to the process according to the threat information.
  • Step 703 For any of the requirement descriptions, the semantic information of the requirement description is used as the input of the STRIDE model, and the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information.
  • the above-mentioned process to be processed refers to the business process for which the target security requirement set needs to be generated, and the business process can be the process designed for the software to be developed during the software design phase.
  • the above-mentioned threat information refers to the threats that may exist during the actual execution of each process, which may be external or internal, and will have destructive consequences on the system or software, and may cause downtime or sensitive information leakage, etc. Therefore, the embodiment of the present application can pre-identify the threat information existing in the process to be processed.
  • corresponding suggestion information can be generated for it, wherein the suggestion Information refers to adding operation steps to the process to solve the corresponding threat.
  • the embodiment of the present application can further use the above threat information and suggestion information as a demand description, or directly use the threat information or suggestion information as a demand description.
  • the embodiment of the present application is not limited to this. Specifically, the above threat information and demand description can be obtained through the threat modeling tool.
  • the STRIDE model is a model that can classify data according to the STRIDE method, and the STRIDE model can be pre-built. Specifically, since the semantic information can represent the meaning expressed by each requirement description, the STRIDE model can determine the type of threat that each requirement description needs to solve through the semantic information of each requirement description, determine which model dimension threat it needs to solve, and divide it into the corresponding model dimension. Different model dimensions correspond to different threat types, thereby realizing the division of the requirement description.
  • the threat information existing in each process in the process to be processed is obtained; for any of the processes, the requirement description corresponding to the process is determined according to the threat information; for any of the requirement descriptions, the semantic information of the requirement description is used as the input of the STRIDE model, and the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information.
  • the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information.
  • the model dimensions include impersonation, tampering, repudiation, information leakage, denial of service, and privilege escalation.
  • the above-mentioned impersonation refers to the attacker's attempt to obtain access rights by using false identity information
  • the above-mentioned tampering refers to the attacker's malicious modification of data without authorization, such as modifying communication data
  • the above-mentioned denial refers to the attacker's denial of performing a certain operation or business in a compliant or non-compliant manner
  • the above-mentioned information leakage refers to the accidental disclosure of private data, for example, users can view unauthorized data or content
  • the above-mentioned denial of service refers to the process of causing the system or software or application to be unavailable, for example, the attacker consumes all available resources of the system by sending a large number of requests to the server, resulting in the system being unavailable.
  • the above-mentioned privilege escalation refers to a user with limited privileges obtaining privileges for other operations, for example, the attacker takes over a process or account with higher privileges and trust.
  • the above-mentioned model dimensions include various threat types that may exist in system applications.
  • the embodiment of the present application can determine the target security requirement set corresponding to the requirement description from the perspective of various types of threats by dividing the requirement description and the reference security data into the above-mentioned model dimensions, thereby ensuring that the generated target security requirement set can meet the actual security requirements, so that the security functions developed by developers according to the target security requirement set can effectively avoid the threats of the above-mentioned different model dimensions.
  • FIG4 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • the software development life cycle (System Development Life Cycle, SDLC) is shown, which may include problem definition, feasibility analysis, overall description, system design, coding, debugging and testing, acceptance and operation, maintenance and upgrade to abandonment, among which the design stage is an important stage for the overall design of the software system based on the requirements analysis results.
  • SDLC System Development Life Cycle
  • completing the overall security solution design in the design stage in advance gives both developers and security personnel greater flexibility to eliminate security threats in advance and avoid passive defense such as patching afterwards. It also helps to reduce the cost of development and later maintenance.
  • Eliminate potential threats through security design and in the testing phase Conduct security testing and verification to form a design-implementation-verification closed loop. Most security threats can be discovered through threat modeling.
  • the embodiment of this application introduces a threat modeling process based on the STRIDE model during the development and design phase, using historically accumulated attack cases as a data set to identify potential security vulnerabilities and security threats in the system and determine the severity of each threat. Then, corresponding security requirements are generated to guide subsequent development and testing, so that potential problems can be discovered and resolved as early as possible to prevent later vulnerabilities from causing online problems.
  • FIG5 is a flowchart of another method for generating security requirements based on the STRIDE model provided in an embodiment of the present application. As shown in FIG5 , the method may include:
  • Step 211 Generate a basic threat list.
  • the above basic threat list refers to the above requirement description set, which can be classified according to impersonation, tampering, denial of service, information leakage, denial of service and privilege escalation.
  • Step 212 Acquire historical security requirement data as reference security data.
  • Step 213 Classify according to counterfeiting, tampering, repudiation, information leakage, denial of service and privilege escalation to obtain a reference security requirement set.
  • Step 214 Calculate the text vector of each reference security requirement.
  • doc2vec can be used for calculation.
  • Step 215 Calculate the text similarity between the reference security requirements using cosine similarity.
  • Step 216 Cluster the reference security requirements.
  • clustering can be performed using the k-means algorithm.
  • Step 217 Determine the similarity between the basic threat description and the clustered security requirements through cosine similarity.
  • Step 218 Output the security requirements that exceed the similarity threshold to obtain a target security requirement list.
  • the security requirement generation method based on the STRIDE model proposed in the embodiment of the present application can obtain the similarity between the requirement description and the security requirement to be selected under the same model dimension according to the model dimension, thereby improving the accuracy of the similarity calculation.
  • the target security requirement corresponding to the requirement description is selected through the similarity between the requirement description and the security requirement to be selected, and a target security requirement set is generated. This can meet the requirements in the requirement description set without the need for manual editing of security requirements.
  • Security requirements that meet the requirements can be selected based on the similarity, thereby improving the efficiency of generating the target security requirement set, and obtaining a relatively comprehensive list of security requirements through basic threat information.
  • FIG6 is a structural block diagram of a security requirement generation device 80 based on a STRIDE model provided in an embodiment of the present application. As shown in FIG6 , the device may include:
  • a requirement description acquisition module 801 is used to acquire a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model division;
  • a security data partitioning module 802 is used to partition executable reference security data based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions;
  • a first similarity acquisition module 803 is used to acquire, for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement;
  • the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
  • a selection module 804 is used to select a candidate security requirement corresponding to the requirement description as a target security requirement based on a first similarity between the requirement description and each candidate security requirement;
  • the target security requirement set generating module 805 is used to generate a target security requirement set based on the target security requirements corresponding to each of the requirement descriptions.
  • the device 80 further comprises:
  • a classification module for classifying, for any of the model dimensions, the security requirements in the reference security requirements set corresponding to the model dimension, to obtain security requirements of different categories under the model dimension; any category of security requirements includes a central requirement;
  • the selection module 804 is specifically used for:
  • the target central requirement is a central requirement in a category under the model dimension corresponding to the selected security requirement
  • a candidate security requirement corresponding to the requirement description is selected.
  • the classification module is specifically used to:
  • the selection module 804 is further configured to:
  • the candidate security requirement is determined as the candidate security requirement corresponding to the requirement description.
  • the first similarity acquisition module is specifically used to:
  • a first similarity between the requirement description and each of the candidate safety requirements is determined.
  • the security data partitioning module 802 is specifically used to:
  • the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information.
  • the requirement description acquisition module 801 is specifically used to:
  • the semantic information of the requirement description is used as the input of the STRIDE model, and the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information.
  • the model dimensions include impersonation, tampering, repudiation, information leakage, denial of service, and privilege escalation.
  • the embodiment of the present application obtains a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model; based on the STRIDE model, executable reference security data is divided to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions; for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement is obtained; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description; based on the first similarity between the requirement description and each candidate security requirement, a candidate security requirement corresponding to the requirement description is selected as a target security requirement; and a target security requirement set is generated based on the target security requirements corresponding to each of the requirement descriptions.
  • the first similarity between the requirement description and the candidate security requirement under the same model dimension can be obtained according to the model dimension, thereby improving the accuracy of the first similarity calculation.
  • the target security requirement corresponding to the requirement description is selected through the first similarity between the requirement description and the candidate security requirement, and a target security requirement set is generated.
  • the obtained target security requirement is consistent with the requirement description, and there is no need to manually edit the security requirement. Only the security requirement that meets the requirements can be selected according to the first similarity, thereby improving the efficiency of generating the target security requirement set.
  • an electronic device including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
  • Memory used to store computer programs
  • the processor is used to perform any of the above methods when executing the program stored in the memory.
  • a computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer performs any of the methods described in the above embodiments.
  • a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to perform any of the methods described in the above embodiments.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a server, data center, etc. that includes one or more available media integrated therein.
  • Data storage device may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present application relate to the technical field of computers, and provide a security requirement generation method and apparatus based on a STRIDE model, an electronic device and a medium. The method comprises: obtaining a requirement description set, wherein the requirement description set is obtained by dividing on the basis of a STRIDE model; on the basis of the STRIDE model, dividing executable reference security data to obtain a reference security requirement set; for any requirement description in the requirement description set, obtaining a first similarity between the requirement description and each security requirement to be selected; on the basis of the first similarity between the requirement description and each security requirement to be selected, selecting a security requirement to be selected corresponding to the requirement description as a target security requirement; and generating a target security requirement set on the basis of target security requirements corresponding to requirement descriptions. In this way, the security requirement does not need to be manually edited, and the security requirement meeting requirements is selected according to the first similarity, thereby improving the efficiency of generating the target security requirement set.

Description

基于STRIDE模型的安全需求生成方法、装置、电子设备及介质Security requirement generation method, device, electronic device and medium based on STRIDE model
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2023年2月13日提交中国专利局,申请号为202310106093.5,申请名称为“基于STRIDE模型的安全需求生成方法、装置、电子设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to a Chinese patent application filed with the China Patent Office on February 13, 2023, with application number 202310106093.5 and application name “Security Requirements Generation Method, Device, Electronic Device and Medium Based on STRIDE Model”, all contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及计算机技术领域,特别是涉及一种基于STRIDE模型的安全需求生成方法、装置、电子设备及介质。The present application relates to the field of computer technology, and in particular to a method, device, electronic device and medium for generating security requirements based on a STRIDE model.
背景技术Background Art
随着计算机技术的逐渐发展,各种系统或应用受到的威胁数量在逐渐增加,而为了提前消除安全威胁,通常是在系统或应用的开发阶段进行安全方案设计,相应地,需要基于安全需求进行安全方案设计。With the gradual development of computer technology, the number of threats to various systems or applications is gradually increasing. In order to eliminate security threats in advance, security solutions are usually designed during the development phase of the system or application. Accordingly, security solutions need to be designed based on security requirements.
现有技术中,往往是由相关工作人员按照工作经验进行人工编辑,得到安全需求,生成安全需求的效率较低。In the prior art, security requirements are often obtained by manual editing by relevant staff based on their work experience, and the efficiency of generating security requirements is low.
发明内容Summary of the invention
本申请实施例的目的在于提供一种基于STRIDE模型的安全需求生成方法、装置、电子设备及介质,以解决上述问题。具体技术方案如下:The purpose of the embodiments of the present application is to provide a method, device, electronic device and medium for generating security requirements based on the STRIDE model to solve the above problems. The specific technical solution is as follows:
在本申请实施的第一方面,首先提供了一种基于STRIDE模型的安全需求生成方法,该方法可以包括:In a first aspect of the implementation of the present application, a method for generating security requirements based on the STRIDE model is first provided, and the method may include:
获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;Obtaining a requirement description set, the requirement description set including requirement descriptions corresponding to each model dimension, the requirement description set being obtained based on the division of the STRIDE model;
基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求;Based on the STRIDE model, executable reference security data is divided to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions;
对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;For any requirement description in the requirement description set, obtaining a first similarity between the requirement description and each security requirement to be selected; the security requirement to be selected is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求;Based on a first similarity between the requirement description and each candidate security requirement, selecting a candidate security requirement corresponding to the requirement description as a target security requirement;
基于各所述需求描述对应的目标安全需求生成目标安全需求集。A target security requirement set is generated based on the target security requirements corresponding to each of the requirement descriptions.
在本申请实施的第二方面,提供了一种基于STRIDE模型的安全需求生成装置,该装置可以包括:In a second aspect of the implementation of the present application, a device for generating safety requirements based on a STRIDE model is provided, and the device may include:
需求描述获取模块,用于获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;A requirement description acquisition module is used to acquire a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the division of the STRIDE model;
安全数据划分模块,用于基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求; A security data partitioning module, used to partition executable reference security data based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions;
第一相似度获取模块,用于对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;A first similarity acquisition module is used to acquire, for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
选取模块,用于基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求;A selection module, configured to select, based on a first similarity between the requirement description and each of the candidate security requirements, a candidate security requirement corresponding to the requirement description as a target security requirement;
目标安全需求集生成模块,用于基于各所述需求描述对应的目标安全需求生成目标安全需求集。The target security requirement set generating module is used to generate a target security requirement set based on the target security requirements corresponding to each of the requirement descriptions.
本申请实施的第三方面,还提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;In a third aspect of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
存储器,用于存放计算机程序;Memory, used to store computer programs;
处理器,用于进行存储器上所存放的程序时,进行上述第一方面所述的方法。The processor is used to perform the method described in the first aspect when executing the program stored in the memory.
在本申请实施的第四方面,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机进行上述第一方面所述的方法。In a fourth aspect of the implementation of the present application, a computer-readable storage medium is further provided, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer performs the method described in the first aspect above.
在本申请实施的第五方面,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机进行上述第一方面任一所述的方法。In a fifth aspect of the implementation of the present application, there is also provided a computer program product comprising instructions, which, when executed on a computer, enables the computer to perform any of the methods described in the first aspect above.
本申请实施例通过获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求;对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求;基于各所述需求描述对应的目标安全需求生成目标安全需求集。这样,通过基于STRIDE模型划分的需求描述集和参照安全需求集,可以按照模型维度,获取同一模型维度下的需求描述和待选安全需求的第一相似度,提高第一相似度计算的准确性,同时,通过需求描述和待选安全需求的第一相似度选择与需求描述对应的目标安全需求,并生成目标安全需求集,所得到的目标安全需求与需求描述相一致,且无需人工编辑安全需求,根据第一相似度选择满足要求的安全需求即可,提高了生成目标安全需求集的效率。The embodiment of the present application obtains a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model; executable reference security data is divided based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions; for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement is obtained; the candidate security requirement is a security requirement whose model dimension corresponding to the reference security requirement set is consistent with the model dimension corresponding to the requirement description; based on the first similarity between the requirement description and each candidate security requirement, a candidate security requirement corresponding to the requirement description is selected as a target security requirement; and a target security requirement set is generated based on the target security requirements corresponding to each of the requirement descriptions. In this way, by dividing the requirement description set and the reference security requirement set based on the STRIDE model, the first similarity between the requirement description and the candidate security requirement under the same model dimension can be obtained according to the model dimension, thereby improving the accuracy of the first similarity calculation. At the same time, the target security requirement corresponding to the requirement description is selected through the first similarity between the requirement description and the candidate security requirement, and a target security requirement set is generated. The obtained target security requirement is consistent with the requirement description, and there is no need to manually edit the security requirement. Only the security requirement that meets the requirements can be selected according to the first similarity, thereby improving the efficiency of generating the target security requirement set.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
图1是本申请实施例提供的一种基于STRIDE模型的安全需求生成方法的步骤流程图;FIG1 is a flowchart of a method for generating security requirements based on a STRIDE model provided in an embodiment of the present application;
图2是本申请实施例提供的一种聚类操作示意图;FIG2 is a schematic diagram of a clustering operation provided in an embodiment of the present application;
图3是本申请实施例提供的一种文本向量计算的示意图; FIG3 is a schematic diagram of a text vector calculation provided by an embodiment of the present application;
图4是本申请实施例提供的一种场景示意图;FIG4 is a schematic diagram of a scenario provided by an embodiment of the present application;
图5是本申请实施例提供的另一种基于STRIDE模型的安全需求生成方法的步骤流程图;FIG5 is a flowchart of another method for generating security requirements based on the STRIDE model provided in an embodiment of the present application;
图6是本申请实施例提供的一种基于STRIDE模型的安全需求生成装置的结构框图。FIG6 is a structural block diagram of a security requirement generation device based on a STRIDE model provided in an embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
图1是本申请实施例提供的一种基于STRIDE模型的安全需求生成方法的步骤流程图,如图1所示,该方法可以包括如下步骤:FIG. 1 is a flowchart of a method for generating security requirements based on a STRIDE model provided in an embodiment of the present application. As shown in FIG. 1 , the method may include the following steps:
步骤101、获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到。Step 101: Obtain a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model division.
其中,上述需求描述集指的是包含需求描述的集合,可以是列表形式的,上述需求描述指的是针对在软件开发的设计阶段所设计的业务流程,可能会存在的攻击信息以及针对该攻击信息需要执行的防护操作,也就是,需求描述可以包含威胁描述以及建议描述,通常为文本形式,且各威胁描述与各建议描述通常是一一对应的。其中,上述业务流程可以是为万维网系统(World Wide Web,WEB)设计的,也可以是为主机类的软件设计的,本申请实施例对软件的类型不作限制。The above-mentioned requirement description set refers to a set containing requirement descriptions, which may be in the form of a list. The above-mentioned requirement description refers to the business process designed in the design phase of software development, the possible attack information and the protection operations that need to be performed for the attack information, that is, the requirement description may include a threat description and a suggestion description, usually in text form, and each threat description and each suggestion description usually correspond one to one. The above-mentioned business process may be designed for the World Wide Web system (WEB) or for host-type software. The embodiment of the present application does not limit the type of software.
其中,上述STRIDE模型是一种威胁建模,其可以将威胁划分为仿冒(Spoofing)、篡改(Tampering)、抵赖(Repudiation)、信息泄漏(Information Disclosure)、拒绝服务(Denial of Service)和权限提升(Elevation of Privilege),6个模型维度,相应地,本申请实施例可以将上述需求描述按照STRIDE模型的维度进行分类,得到对应不同维度的需求描述。在一些实施例中,本申请实施例中可以按照各需求描述所在的模型维度,进一步将不同维度的需求描述划分为不同的子集,从而上述需求描述集可以包含不同模型维度的子集。Among them, the above-mentioned STRIDE model is a threat modeling, which can divide threats into spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege, six model dimensions. Accordingly, the embodiment of the present application can classify the above-mentioned requirement description according to the dimensions of the STRIDE model to obtain requirement descriptions corresponding to different dimensions. In some embodiments, the embodiment of the present application can further divide the requirement descriptions of different dimensions into different subsets according to the model dimensions where each requirement description is located, so that the above-mentioned requirement description set can include subsets of different model dimensions.
具体的,本申请实施例可以通过威胁建模工具(threat modeling tool)获取上述需求描述集,其内核为STRIDE建模方法,具体的,可以将所设计的业务流程输入至上述威胁建模工具中,威胁建模工具可以识别判断各流程可能存在的威胁,并根据威胁生成相应的建议,从而可以根据所生成的各威胁以及建议得到需求描述集。Specifically, the embodiment of the present application can obtain the above-mentioned requirement description set through a threat modeling tool (threat modeling tool), the core of which is the STRIDE modeling method. Specifically, the designed business process can be input into the above-mentioned threat modeling tool. The threat modeling tool can identify and determine the possible threats in each process, and generate corresponding suggestions based on the threats, so that the requirement description set can be obtained according to the generated threats and suggestions.
步骤102、基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求。Step 102: Based on the STRIDE model, executable reference security data is divided to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions.
其中,上述可执行的参照安全数据指的是确定可以为软件开发提供参考的安全需求数据,其可以是历史的软件开发项目的安全需求,也可以是从互联网上直接获取的可参考的安全需求,其通常是在其他软件开发过程中,可以为开发人员提供参考的安全需求,因此上述参照安全数据是确定可执行的,其相比于上述需求描述中的建议描述,通常更为详细,可以为开发人员提供较为准确且更细节的参考。其中,上述安全需求指的是为了保证所设计的软件或系统在各方面(例如,服务器及数据的安全、服务器和用户之间信息传输的安全以及应用客户端与环境的安全等)的安全,在设计阶段所提出的开发需求,开发人员会参照安全需求完成系统或软件的安全功能开发或设计。 Among them, the executable reference security data refers to the security requirement data that can be determined to provide reference for software development, which can be the security requirements of historical software development projects, or the reference security requirements directly obtained from the Internet. They are usually security requirements that can provide reference for developers in other software development processes. Therefore, the reference security data is executable. Compared with the recommended description in the above requirement description, it is usually more detailed and can provide developers with a more accurate and detailed reference. Among them, the above security requirements refer to the development requirements proposed in the design stage in order to ensure the security of the designed software or system in all aspects (for example, the security of servers and data, the security of information transmission between servers and users, and the security of application clients and environments, etc.). Developers will refer to the security requirements to complete the security function development or design of the system or software.
其中,上述参照安全数据通常包含大量安全需求数据,且通常是在不同方面提供参考的安全需求数据,可以根据不同的参照安全数据所起到的作用确定各参照安全数据所在的模型维度。具体的,上述参照安全数据也为文本形式,本申请实施例可以通过各参照安全数据的语义描述确定其所在的模型维度,或者,也可以通过接收工作人员针对不同参照安全数据的输入信息来得到各参照安全数据所在的模型维度,本申请实施例对此不作限制。Among them, the above-mentioned reference security data usually includes a large amount of security requirement data, and is usually security requirement data that provides reference in different aspects. The model dimension of each reference security data can be determined according to the role played by different reference security data. Specifically, the above-mentioned reference security data is also in text form. The embodiment of the present application can determine the model dimension of each reference security data through the semantic description of each reference security data, or it can also obtain the model dimension of each reference security data by receiving the input information of the staff for different reference security data. The embodiment of the present application does not limit this.
在一些实施例中,本申请实施例中可以按照各参照安全数据的模型维度,进一步将不同维度的参照安全数据划分为不同的子集,从而上述参照安全需求集可以包含各模型维度对应的安全需求子集。In some embodiments, in the embodiments of the present application, reference security data of different dimensions can be further divided into different subsets according to the model dimensions of each reference security data, so that the above-mentioned reference security requirement set can include the security requirement subsets corresponding to each model dimension.
步骤103、对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求。Step 103: For any requirement description in the requirement description set, obtain a first similarity between the requirement description and each candidate security requirement; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description.
其中,上述第一相似度可以是需求描述的语义与各待选安全需求的语义之间的相似度,可以表征需求描述与各待选安全需求之间的匹配程度,相似度越高,匹配程度越高,相应地,待选安全需求可以避免该需求描述中的威胁的概率越高,待选安全需求作为该需求描述对应的安全需求的效果越好。Among them, the above-mentioned first similarity can be the similarity between the semantics of the requirement description and the semantics of each candidate security requirement, which can characterize the degree of matching between the requirement description and each candidate security requirement. The higher the similarity, the higher the degree of matching. Accordingly, the higher the probability that the candidate security requirement can avoid the threat in the requirement description, and the better the effect of the candidate security requirement as the security requirement corresponding to the requirement description.
具体的,上述第一相似度可以是需求描述与待选安全需求之间的余弦相似度,当然也可以是采用其他相似度算法来计算,本申请实施例对此不作限制。Specifically, the first similarity may be the cosine similarity between the requirement description and the selected security requirement. Of course, it may also be calculated using other similarity algorithms, which is not limited in this embodiment of the present application.
具体的,本申请实施例可以将上述参照安全需求集中,与上述需求描述对应的模型维度相同的安全需求作为待选安全需求,而由于模型维度可以表征需求描述与安全需求所针对的威胁维度,从而可以在同一威胁维度下计算两者的第一相似度,提高相似度计算的准确性。Specifically, the embodiments of the present application may set the above-mentioned reference security requirements and take the security requirements with the same model dimension corresponding to the above-mentioned requirement description as candidate security requirements. Since the model dimension can characterize the threat dimension targeted by the requirement description and the security requirement, the first similarity between the two can be calculated under the same threat dimension, thereby improving the accuracy of the similarity calculation.
步骤104、基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求。Step 104 : Based on the first similarity between the requirement description and each candidate security requirement, select the candidate security requirement corresponding to the requirement description as the target security requirement.
步骤105、基于各所述需求描述对应的目标安全需求生成目标安全需求集。Step 105: Generate a target security requirement set based on the target security requirements corresponding to each of the requirement descriptions.
具体的,本申请实施例可以从上述各待选安全需求中,选取与需求描述的第一相似度最高的作为目标安全需求,或者,也可以设置选取阈值,将第一相似度大于上述选取阈值的待选安全需求作为上述目标安全需求,可以按照实际情况自行设置,本申请实施例对此不作限制。Specifically, the embodiments of the present application can select the security requirement with the highest first similarity to the requirement description from the above-mentioned candidate security requirements as the target security requirement, or can also set a selection threshold and use the candidate security requirement with a first similarity greater than the above-mentioned selection threshold as the above-mentioned target security requirement. It can be set according to the actual situation, and the embodiments of the present application do not limit this.
进一步地,通过步骤104得到各需求描述对应的目标安全需求后,可以将不同需求描述对应的目标安全需求合并至同一集合中,得到上述目标安全需求集,从而完成安全需求生成。目标安全需求集即为包括所生成的安全需求的集合。Furthermore, after obtaining the target security requirements corresponding to each requirement description in step 104, the target security requirements corresponding to different requirement descriptions can be merged into the same set to obtain the above-mentioned target security requirement set, thereby completing the security requirement generation. The target security requirement set is a set including the generated security requirements.
综上所述,本申请实施例通过获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求;对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;基于所述需 求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求;基于各所述需求描述对应的目标安全需求生成目标安全需求集。这样,通过基于STRIDE模型划分的需求描述集和参照安全需求集,可以按照模型维度,获取同一模型维度下的需求描述和待选安全需求的第一相似度,提高第一相似度计算的准确性,同时,通过需求描述和待选安全需求的第一相似度选择与需求描述对应的目标安全需求,并生成目标安全需求集,所得到的目标安全需求与需求描述相一致,且无需人工编辑安全需求,根据第一相似度选择满足要求的安全需求即可,提高了生成目标安全需求集的效率。In summary, the embodiment of the present application obtains a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model division; executable reference security data is divided based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions; for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement is obtained; the candidate security requirement is a security requirement whose model dimension corresponding to the reference security requirement set is consistent with the model dimension corresponding to the requirement description; based on the requirement Calculate the first similarity between the description and each candidate security requirement, select the candidate security requirement corresponding to the requirement description as the target security requirement; generate a target security requirement set based on the target security requirements corresponding to each requirement description. In this way, through the requirement description set and the reference security requirement set divided based on the STRIDE model, the first similarity between the requirement description and the candidate security requirement under the same model dimension can be obtained according to the model dimension, thereby improving the accuracy of the first similarity calculation. At the same time, the target security requirement corresponding to the requirement description is selected through the first similarity between the requirement description and the candidate security requirement, and a target security requirement set is generated. The obtained target security requirement is consistent with the requirement description, and there is no need to manually edit the security requirement. The security requirement that meets the requirements can be selected according to the first similarity, thereby improving the efficiency of generating the target security requirement set.
在一些实施例中,本申请实施例具体可以包括下述步骤:In some embodiments, the embodiments of the present application may specifically include the following steps:
步骤201、对于任一所述模型维度,对所述参照安全需求集中与所述模型维度对应的安全需求进行分类,得到所述模型维度下不同类别的安全需求;任一类别的安全需求包含中心需求。Step 201: For any of the model dimensions, classify the security requirements in the reference security requirement set corresponding to the model dimension to obtain different categories of security requirements under the model dimension; any category of security requirements includes central requirements.
其中,对于任一模型维度的安全需求,其可能会对应于软件的不同的功能模块,因而上述分类可以是按照各安全需求对应的功能模块进行分类,将对应于同一功能模块的安全需求分类至同一类别中,当然,也可以按照实际需求设置其他的分类规则,本申请实施例对此不作限制。Among them, the security requirements of any model dimension may correspond to different functional modules of the software. Therefore, the above classification can be classified according to the functional modules corresponding to each security requirement, and the security requirements corresponding to the same functional module can be classified into the same category. Of course, other classification rules can also be set according to actual needs, and the embodiments of the present application are not limited to this.
进一步地,在得到不同类别的安全需求后,可以从各类别的安全需求中选取中心需求,其中,可以在同一类别下,计算任一安全需求与其他安全需求的相似度,将与其他安全需求的相似度最大的安全需求作为中心需求,具体的,可以通过K均值聚类算法(k-means clustering algorithm,K-means)实现上述分类以及确定各类别的中心需求。可以理解的,通过上述方式得到的各类别的中心需求与其他安全需求的均比较接近,因而该中心需求是该类别中比较具有代表性的安全需求。Furthermore, after obtaining security requirements of different categories, a central requirement can be selected from the security requirements of each category, wherein the similarity between any security requirement and other security requirements can be calculated under the same category, and the security requirement with the greatest similarity to other security requirements can be used as the central requirement. Specifically, the above classification and determination of the central requirements of each category can be achieved through the K-means clustering algorithm (k-means clustering algorithm, K-means). It can be understood that the central requirements of each category obtained in the above manner are relatively close to other security requirements, so the central requirement is a more representative security requirement in the category.
上述基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求的操作,本申请实施例具体可以包括下述步骤:The operation of selecting the candidate security requirement corresponding to the requirement description based on the first similarity between the requirement description and each candidate security requirement may specifically include the following steps:
步骤202、获取所述需求描述与各目标中心需求之间的第二相似度,作为各所述类别的相似度阈值;所述目标中心需求是所述待选安全需求对应的模型维度下的类别中的中心需求。Step 202: Obtain a second similarity between the requirement description and each target central requirement as a similarity threshold of each category; the target central requirement is a central requirement in a category under the model dimension corresponding to the selected security requirement.
步骤203、基于所述需求描述与各待选安全需求之间的第一相似度以及各所述类别的相似度阈值,选取与所述需求描述对应的待选安全需求。Step 203: Based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category, select a candidate security requirement corresponding to the requirement description.
进一步地,本申请实施例可以在同一模型维度下,获取需求描述与各类别的中心需求的第二相似度,由于各类别的中心需求是各类别中比较具有代表性的安全需求,因而可以将各中心需求的第二相似度作为该模型维度下各类别的相似度阈值,用于对其他安全需求进行筛选。其中,上述第二相似度也可以是需求描述的文本与中心需求的文本之间的余弦相似度,当然也可以是通过其他相似度算法计算,本申请实施例对此不作限制。Furthermore, the embodiment of the present application can obtain the second similarity between the requirement description and the central requirement of each category under the same model dimension. Since the central requirement of each category is a more representative security requirement in each category, the second similarity of each central requirement can be used as the similarity threshold of each category under the model dimension to screen other security requirements. Among them, the above-mentioned second similarity can also be the cosine similarity between the text of the requirement description and the text of the central requirement, and of course it can also be calculated by other similarity algorithms, which is not limited by the embodiment of the present application.
具体的,在同一模型维度下,可以将各待选安全需求对应的相似度阈值作为选取条件,将第一相似度大于相似度阈值的待选安全需求,作为与需求描述对应的待选安全需求,可以理解的,在存在待选安全需求与需求描述的第一相似度不大于对应的相似度阈值时,表明该待选安全需求与当前软件或系统的实际需求并不匹配,因而可以将其不作 为与需求描述对应的待选安全需求,相应地,在存在待选安全需求与需求描述的第一相似度大于对应的相似度阈值时,表明该待选安全需求与当前软件或系统的实际需求相匹配,因而可以将其作为与需求描述对应的待选安全需求。Specifically, under the same model dimension, the similarity threshold corresponding to each candidate security requirement can be used as a selection condition, and the candidate security requirement whose first similarity is greater than the similarity threshold is used as the candidate security requirement corresponding to the requirement description. It can be understood that when the first similarity between the candidate security requirement and the requirement description is not greater than the corresponding similarity threshold, it indicates that the candidate security requirement does not match the actual requirement of the current software or system, and thus it can be excluded. It is a candidate security requirement corresponding to the requirement description. Accordingly, when the first similarity between the candidate security requirement and the requirement description is greater than the corresponding similarity threshold, it indicates that the candidate security requirement matches the actual requirement of the current software or system, and thus it can be used as the candidate security requirement corresponding to the requirement description.
本申请实施例中,通过对于任一所述模型维度,对所述参照安全需求集中与所述模型维度对应的安全需求进行分类,得到所述模型维度下不同类别的安全需求;任一类别的安全需求包含中心需求;获取所述需求描述与各目标中心需求之间的第二相似度,作为各所述类别的相似度阈值;所述目标中心需求是所述待选安全需求对应的模型维度下的类别中的中心需求;基于所述需求描述与各待选安全需求之间的第一相似度以及各所述类别的相似度阈值,选取与所述需求描述对应的待选安全需求。这样,对每一模型维度下的参照安全需求进行分类,并在每个类别中确定中心需求,可以对同一模型维度中的参照安全需求进行聚类,便于后续的计算,同时,通过将需求描述与各中心需求的相似度作为各类别的相似度阈值,并通过相似度阈值对各待选安全需求进行筛选,可以进一步提高待选安全需求与需求描述之间的匹配性,提高生成目标安全需求集的准确性。In an embodiment of the present application, by classifying the security requirements corresponding to the model dimension in the reference security requirements set for any of the model dimensions, different categories of security requirements under the model dimension are obtained; any category of security requirements includes central requirements; the second similarity between the requirement description and each target central requirement is obtained as the similarity threshold of each category; the target central requirement is the central requirement in the category under the model dimension corresponding to the candidate security requirement; based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category, the candidate security requirement corresponding to the requirement description is selected. In this way, the reference security requirements under each model dimension are classified, and the central requirement is determined in each category, and the reference security requirements in the same model dimension can be clustered to facilitate subsequent calculations. At the same time, by using the similarity between the requirement description and each central requirement as the similarity threshold of each category, and screening each candidate security requirement by the similarity threshold, the matching between the candidate security requirement and the requirement description can be further improved, and the accuracy of generating the target security requirement set can be improved.
在一些实施例中,图2是本申请实施例提供的一种聚类操作示意图,如图2所示,所述对所述参照安全需求集中与所述模型维度对应的安全需求进行分类,得到所述模型维度下不同类别的安全需求的操作,本申请实施例具体可以包括下述步骤:In some embodiments, FIG. 2 is a schematic diagram of a clustering operation provided in an embodiment of the present application. As shown in FIG. 2, the operation of classifying the security requirements corresponding to the model dimension in the reference security requirement set to obtain different categories of security requirements under the model dimension may specifically include the following steps:
步骤301、从所述参照安全需求集中与所述模型维度对应的安全需求中选取多个初始中心需求,作为待选中心需求;一个待选中心需求对应表征一个所述类别。Step 301: Select multiple initial central requirements from the security requirements corresponding to the model dimension in the reference security requirement set as candidate central requirements; one candidate central requirement corresponds to one of the categories.
其中,上述初始中心需求可以是在同一模型维度下的安全需求中随机选取的,具体的,可以将同一模型维度下的安全需求随机分为K组,在每一组中随机选取一个初始中心需求,从而得到K个初始中心需求,相应地,可以得到K个类别。其中,上述K值可以按照实际需求自行设置,本申请实施例对此不作限制。The above initial central requirements can be randomly selected from the security requirements under the same model dimension. Specifically, the security requirements under the same model dimension can be randomly divided into K groups, and an initial central requirement is randomly selected from each group, thereby obtaining K initial central requirements, and accordingly, K categories can be obtained. The above K value can be set according to actual needs, and the embodiment of the present application does not limit this.
步骤302、对于所述参照安全需求集中与所述模型维度对应的安全需求中的任一安全需求,获取所述安全需求与各所述待选中心需求之间的第三相似度。Step 302: For any security requirement in the reference security requirement set corresponding to the model dimension, obtain a third similarity between the security requirement and each of the candidate center requirements.
步骤303、将所述安全需求划分至对应的第三相似度最大的待选中心需求所表征的类别。Step 303: Classify the security requirements into the categories represented by the corresponding candidate center requirements with the largest third similarity.
进一步地,通过获取同一模型维度下的其他安全需求与各待选中心需求之间的第三相似度,可以得到各安全需求与各待选中心需求之间的接近距离,相似度越大,表明两者越接近,从而可以将各安全需求分别分配到与其第三相似度最大的待选中心需求的类别中,实现聚类,得到每一模型维度下不同类别的安全需求以及该类别安全需求的中心需求。其中,上述第三相似度也可以是两者文本之间的余弦相似度,当然也可以通过其他相似度算法进行计算,本申请实施例对此不作限制。Furthermore, by obtaining the third similarity between other security requirements and each candidate central requirement under the same model dimension, the proximity between each security requirement and each candidate central requirement can be obtained. The greater the similarity, the closer the two are. Thus, each security requirement can be assigned to the category of the candidate central requirement with the largest third similarity, and clustering can be achieved to obtain security requirements of different categories under each model dimension and the central requirement of the security requirements of this category. Among them, the above third similarity can also be the cosine similarity between the two texts, and of course it can also be calculated by other similarity algorithms, which is not limited in the embodiments of the present application.
步骤304、基于各类别中包含的安全需求,重新选取多个中心需求作为所述待选中心需求,并基于各所述待选中心需求重新执行所述获取所述安全需求与各所述待选中心需求之间的第三相似度的操作,直至达到预设的终止条件,将当前的各所述待选中心需求作为目标中心需求,并将当前的分类结果作为最终分类结果。Step 304: Based on the security requirements contained in each category, reselect multiple center requirements as the candidate center requirements, and re-execute the operation of obtaining the third similarity between the security requirements and each of the candidate center requirements based on the candidate center requirements until the preset termination condition is reached, and use the current candidate center requirements as the target center requirements, and use the current classification result as the final classification result.
进一步地,在将同一模型维度下的各安全需求均分配到各待选中心需求所表征的类别后,可以从当前的各个类别所包含的安全需求中,重新选取各类别的中心需求,作为 新的待选中心需求。其中,上述各类别中包含的安全需求包括各类别的中心需求以及各类别中的除中心需求之外的其他安全需求。Furthermore, after all security requirements under the same model dimension are assigned to the categories represented by the candidate central requirements, the central requirements of each category can be reselected from the security requirements contained in the current categories as New candidate center requirements. The security requirements included in the above categories include the center requirements of each category and other security requirements in each category except the center requirements.
具体的,上述重新选取多个中心需求的操作可以是根据当前类别中所包含的安全需求,重新计算任一安全需求与类别中其他安全需求的相似度,进一步得到新的不同类别的待选中心需求,具体的,在得到任一安全需求与类别中其他安全需求的相似度后,可以进一步得到该安全需求与其他安全需求的相似度均值,即,将该安全需求与其他安全需求的相似度之和,除以,其他安全需求的数量,得到该安全需求的相似度均值,相应地,在该类别中的各安全需求通过上述操作均可以得到对应的相似度均值,可以将相似度均值最小的安全需求作为新的待选中心需求。Specifically, the above-mentioned operation of reselecting multiple central requirements can be to recalculate the similarity between any security requirement and other security requirements in the category based on the security requirements included in the current category, and further obtain new candidate central requirements of different categories. Specifically, after obtaining the similarity between any security requirement and other security requirements in the category, the mean similarity between the security requirement and the other security requirements can be further obtained, that is, the sum of the similarities between the security requirement and the other security requirements is divided by the number of other security requirements to obtain the mean similarity of the security requirement. Accordingly, each security requirement in the category can obtain the corresponding mean similarity through the above-mentioned operation, and the security requirement with the smallest mean similarity can be used as the new candidate central requirement.
进一步地,可以再一次执行获取各待选中心需求与上述参照安全需求集中与各待选中心需求在同一模型维度下的其他安全需求的第三相似度,并将其他安全需求划分至对应的第三相似度最大的待选中心需求的类别中。Furthermore, the third similarity between each candidate center requirement and other security requirements in the reference security requirement set under the same model dimension as each candidate center requirement can be obtained again, and other security requirements can be classified into the corresponding category of the candidate center requirement with the largest third similarity.
其中,上述预设的终止条件可以是重新选取的待选中心需求与原待选中心需求相一致,或者,选取待选中心需求的次数达到预设次数阈值,本申请实施例对此不作限制。在达到预设的终止条件的情况下,表明当前的分类结果已经满足要求,从而可以将当前的分类结果作为最终分类结果,将当前的待选中心需求作为目标中心需求,相应地,将各目标中心需求所表征的类别所包含的安全需求作为该类别的安全需求。Among them, the above-mentioned preset termination condition can be that the re-selected candidate center demand is consistent with the original candidate center demand, or the number of times the candidate center demand is selected reaches a preset number threshold, and the embodiment of the present application does not limit this. When the preset termination condition is reached, it indicates that the current classification result has met the requirements, so that the current classification result can be used as the final classification result, and the current candidate center demand is used as the target center demand. Correspondingly, the security requirements contained in the category represented by each target center demand are used as the security requirements of the category.
本申请实施例中,通过从所述参照安全需求集中与所述模型维度对应的安全需求中选取多个初始中心需求,作为待选中心需求;一个待选中心需求对应表征一个所述类别;对于所述参照安全需求集中与所述模型维度对应的安全需求中的任一安全需求,获取所述安全需求与各所述待选中心需求之间的第三相似度;将所述安全需求划分至对应的第三相似度最大的待选中心需求所表征的类别;基于各类别中包含的安全需求,重新选取多个中心需求作为所述待选中心需求,并基于各所述待选中心需求重新执行所述获取所述安全需求与各所述待选中心需求之间的第三相似度的操作,直至达到预设的终止条件,将当前的各所述待选中心需求作为目标中心需求,并将当前的分类结果作为最终分类结果。这样,通过计算第三相似度可以对同一模型维度下的安全需求进行分类,将较为接近的安全需求划分至同一类别,实现聚类,从而便于在同一模型维度及同一类别下对需求描述和安全需求进行匹配,进一步提高匹配的精确性。In the embodiment of the present application, multiple initial central requirements are selected from the security requirements corresponding to the model dimension in the reference security requirement set as the central requirements to be selected; one central requirement to be selected corresponds to one category; for any security requirement in the security requirements corresponding to the model dimension in the reference security requirement set, the third similarity between the security requirement and each central requirement to be selected is obtained; the security requirement is divided into the category represented by the central requirement to be selected with the largest corresponding third similarity; based on the security requirements contained in each category, multiple central requirements are re-selected as the central requirements to be selected, and the operation of obtaining the third similarity between the security requirement and each central requirement to be selected is re-executed based on each central requirement to be selected, until the preset termination condition is reached, the current central requirements to be selected are used as the target central requirements, and the current classification result is used as the final classification result. In this way, by calculating the third similarity, the security requirements under the same model dimension can be classified, and the relatively close security requirements can be classified into the same category to achieve clustering, so as to facilitate the matching of the requirement description and the security requirement under the same model dimension and the same category, and further improve the accuracy of the matching.
在一些实施例中,上述基于所述需求描述与各待选安全需求之间的第一相似度以及各所述类别的相似度阈值,选取与所述需求描述对应的待选安全需求的操作,本申请实施例具体可以包括下述步骤:In some embodiments, the operation of selecting the candidate security requirement corresponding to the requirement description based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category may specifically include the following steps:
步骤401、对于任一所述待选安全需求,从各所述类别的相似度阈值中获取所述待选安全需求所属的类别相似度阈值,作为所述待选安全需求对应的目标相似度阈值。Step 401: For any of the security requirements to be selected, a similarity threshold of the category to which the security requirement to be selected belongs is obtained from the similarity thresholds of the categories as a target similarity threshold corresponding to the security requirement to be selected.
步骤402、在所述待选安全需求与所述需求描述之间的第一相似度不低于所述待选安全需求对应的目标相似度阈值的情况下,将所述待选安全需求确定为与所述需求描述对应的待选安全需求。Step 402: If the first similarity between the candidate security requirement and the requirement description is not lower than a target similarity threshold corresponding to the candidate security requirement, determine the candidate security requirement as the candidate security requirement corresponding to the requirement description.
其中,通过前述步骤可以得到不同类别对应的多个相似度阈值,从而本申请实施例中可以根据待选安全需求所在的类别,选取该类别的相似度阈值作为该待选安全需求的 目标相似度阈值,从而可以得到各待选安全需求分别对应的目标相似度阈值。Among them, through the above steps, multiple similarity thresholds corresponding to different categories can be obtained, so in the embodiment of the present application, according to the category of the security requirement to be selected, the similarity threshold of the category can be selected as the similarity threshold of the security requirement to be selected. The target similarity threshold is obtained, so that the target similarity threshold corresponding to each candidate security requirement can be obtained.
进一步地,可以将各待选安全需求与需求描述之间的第一相似度,与各待选安全需求的目标相似度阈值分别进行比对,将第一相似度不低于对应的目标相似度阈值的待选安全需求,确定为与需求描述对应的待选安全需求。Furthermore, the first similarity between each candidate security requirement and the requirement description may be compared with the target similarity threshold of each candidate security requirement, and the candidate security requirement whose first similarity is not lower than the corresponding target similarity threshold may be determined as the candidate security requirement corresponding to the requirement description.
本申请实施例中,通过对于任一所述待选安全需求,从各所述类别的相似度阈值中获取所述待选安全需求所属的类别相似度阈值,作为所述待选安全需求对应的目标相似度阈值;在所述待选安全需求与所述需求描述之间的第一相似度不低于所述待选安全需求对应的目标相似度阈值的情况下,将所述待选安全需求确定为与所述需求描述对应的待选安全需求。这样,通过选取第一相似度阈值不低于目标相似度阈值的待选安全需求,可以提高所选取的待选安全需求与需求描述的匹配度,同时,通过从各类别的相似度阈值中获取待选安全需求所属的类别的相似度阈值作为目标相似度阈值,可以在同一模型维度的同一类别下对待选安全需求进行筛选,使得待选安全需求的筛选更加细化,进一步提高所选择的待选安全需求的准确性。In an embodiment of the present application, for any of the security requirements to be selected, the similarity threshold of the category to which the security requirement to be selected belongs is obtained from the similarity thresholds of each category as the target similarity threshold corresponding to the security requirement to be selected; when the first similarity between the security requirement to be selected and the requirement description is not lower than the target similarity threshold corresponding to the security requirement to be selected, the security requirement to be selected is determined as the security requirement to be selected corresponding to the requirement description. In this way, by selecting a security requirement to be selected whose first similarity threshold is not lower than the target similarity threshold, the matching degree between the selected security requirement to be selected and the requirement description can be improved. At the same time, by obtaining the similarity threshold of the category to which the security requirement to be selected belongs from the similarity thresholds of each category as the target similarity threshold, the security requirements to be selected can be screened under the same category of the same model dimension, so that the screening of the security requirements to be selected is more refined, and the accuracy of the selected security requirements to be selected is further improved.
在一些实施例中,上述获取所述需求描述与各待选安全需求之间的第一相似度的操作,本申请实施例具体可以包括下述步骤:In some embodiments, the operation of obtaining the first similarity between the requirement description and each candidate security requirement may include the following steps:
步骤501、获取各所述待选安全需求对应的第一文本向量以及所述需求描述对应的第二文本向量。Step 501: Obtain a first text vector corresponding to each of the to-be-selected security requirements and a second text vector corresponding to the requirement description.
步骤502、基于所述第二文本向量以及各所述待选安全需求对应的所述第一文本向量,确定所述需求描述与各待选安全需求之间的第一相似度。Step 502: Determine a first similarity between the requirement description and each of the security requirements to be selected based on the second text vector and the first text vector corresponding to each of the security requirements to be selected.
其中,上述文本向量是可以表征文本语义或主题的向量,从而本申请实施例通过分别获取各待选安全需求的第一文本向量以及需求描述对应的第二文本向量,再计算两者之间的相似度。The above-mentioned text vector is a vector that can represent the semantics or theme of the text. Therefore, the embodiment of the present application obtains the first text vector of each candidate security requirement and the second text vector corresponding to the requirement description respectively, and then calculates the similarity between the two.
具体的,本申请实施例中可以通过文本向量算法(例如,doc2vec)来计算上述第一文本向量和第二文本向量。图3是本申请实施例提供的一种文本向量计算的示意图,如图3所示,可以将各待选安全需求与需求描述的文本分别输入至分词器中,得到各文本的分词(Information-Dispersal Scheme,ids),再将分词作为输入,通过向量映射函数(nn.Embedding)得到文本向量。Specifically, in the embodiment of the present application, the first text vector and the second text vector can be calculated by a text vector algorithm (for example, doc2vec). FIG3 is a schematic diagram of a text vector calculation provided by an embodiment of the present application. As shown in FIG3, the texts of each selected security requirement and the requirement description can be input into the word segmenter to obtain the word segmentation (Information-Dispersal Scheme, ids) of each text, and then the word segmentation is used as input to obtain the text vector through the vector mapping function (nn.Embedding).
进一步地,可以通过计算第一文本向量和第二文本向量的余弦相似度来得到上述第一相似度。具体的,余弦相似度可以通过测量两个向量的夹角的余弦值来度量两者的相似性,其中,由于0度角的余弦值是1,其他角度的余弦值都不大于1,且最小值为-1,因而可以根据两个向量之间的角度的余弦值确定两个向量是否大致指向相同的方向,从而在本申请实施例中可以得出各待选安全需求与需求描述的主题或语义方面的相似程度。Furthermore, the first similarity can be obtained by calculating the cosine similarity between the first text vector and the second text vector. Specifically, the cosine similarity can measure the similarity between the two vectors by measuring the cosine value of the angle between the two vectors, wherein, since the cosine value of the 0-degree angle is 1, the cosine values of other angles are not greater than 1, and the minimum value is -1, it is possible to determine whether the two vectors are pointing in roughly the same direction based on the cosine value of the angle between the two vectors, thereby obtaining the degree of similarity between each candidate security requirement and the subject or semantics of the requirement description in the embodiment of the present application.
本申请实施例中,通过获取各所述待选安全需求对应的第一文本向量以及所述需求描述对应的第二文本向量;基于所述第二文本向量以及各所述待选安全需求对应的所述第一文本向量,确定所述需求描述与各待选安全需求之间的第一相似度。这样,通过先获取各待选安全需求与需求描述的文本向量,可以得到待选安全需求与需求描述的语义表征,从而通过文本向量来计算第一相似度,可以提高第一相似度的准确性。 In the embodiment of the present application, by obtaining the first text vector corresponding to each of the selected security requirements and the second text vector corresponding to the requirement description; based on the second text vector and the first text vector corresponding to each of the selected security requirements, the first similarity between the requirement description and each of the selected security requirements is determined. In this way, by first obtaining the text vectors of each of the selected security requirements and the requirement description, the semantic representation of the selected security requirements and the requirement description can be obtained, so that the first similarity can be calculated through the text vector, which can improve the accuracy of the first similarity.
在一些实施例中,上述基于所述STRIDE模型对可执行的参照安全数据进行划分的操作,本申请实施例具体可以包括下述步骤:In some embodiments, the above-mentioned operation of dividing the executable reference security data based on the STRIDE model may specifically include the following steps:
步骤601、获取所述参照安全数据中包含的各条安全数据的语义信息。Step 601: Obtain semantic information of each piece of security data contained in the reference security data.
步骤602、对于任一条所述安全数据,将所述安全数据的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述安全数据划分至对应的模型维度。Step 602: For any piece of the security data, the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information.
其中,上述语义信息可以表征各条安全数据所表达的含义,具体可以通过预设的文本语义提取模型或文本语义提取算法来获取各安全数据的语义信息,本申请实施例对此不作限制。Among them, the above-mentioned semantic information can represent the meaning expressed by each piece of security data. Specifically, the semantic information of each security data can be obtained through a preset text semantic extraction model or text semantic extraction algorithm, and the embodiments of the present application are not limited to this.
具体的,参照安全数据往往为整段的文本,本申请实施例可以对参照安全数据进行拆分,拆分为多条安全数据,进一步地,在参照安全数据的格式非指定格式的情况下,还可以对参照安全数据进行预处理,将其转换为指定格式,其中,上述指定格式可以为TXT格式,从而便于后续的计算和解析。Specifically, the reference security data is often a whole paragraph of text. The embodiment of the present application can split the reference security data into multiple security data. Furthermore, when the format of the reference security data is not a specified format, the reference security data can be pre-processed and converted into a specified format, wherein the above-mentioned specified format can be a TXT format, thereby facilitating subsequent calculations and analysis.
进一步地,上述STRIDE模型指的是可以按照STRIDE方法对数据进行分类的模型,上述STRIDE模型可以是预先构建的。具体的,上述STRIDE模型可以通过上述语义信息,确定各条安全数据所针对的威胁的类型,确定其用于解决哪一种模型维度的威胁,并将其划分至对应的模型维度,不同的模型维度对应不同的威胁类型,从而实现对安全数据的划分。Furthermore, the STRIDE model is a model that can classify data according to the STRIDE method, and the STRIDE model can be pre-built. Specifically, the STRIDE model can determine the type of threat to which each piece of security data is targeted through the semantic information, determine which model dimension of threat it is used to solve, and divide it into corresponding model dimensions. Different model dimensions correspond to different threat types, thereby realizing the division of security data.
在一些实施例中,上述对安全数据的划分也可以通过接收工作人员的输入信息进行,上述输入信息可以表征各条安全数据所属的模型维度。In some embodiments, the above division of security data may also be performed by receiving input information from staff, and the above input information may represent the model dimension to which each piece of security data belongs.
本申请实施例中,通过获取所述参照安全数据中包含的各条安全数据的语义信息;对于任一条所述安全数据,将所述安全数据的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述安全数据划分至对应的模型维度。这样,通过STRIDE模型对参照安全数据进行划分,可以得到符合STRIDE模型维度的安全数据,从而便于后续在不同模型维度下与需求描述进行相似度匹配,提高匹配的准确性。In the embodiment of the present application, the semantic information of each piece of security data contained in the reference security data is obtained; for any piece of the security data, the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information. In this way, by dividing the reference security data through the STRIDE model, security data that conforms to the STRIDE model dimension can be obtained, so as to facilitate the subsequent similarity matching with the demand description under different model dimensions and improve the matching accuracy.
在一些实施例中,上述获取需求描述集的操作,本申请实施例具体可以包括下述步骤:In some embodiments, the operation of obtaining the requirement description set may include the following steps:
步骤701、获取待处理流程中各流程所存在的威胁信息。Step 701: Obtain threat information of each process in the process to be processed.
步骤702、对于任一所述流程,根据所述威胁信息确定所述流程对应的需求描述。Step 702: For any of the processes, determine a requirement description corresponding to the process according to the threat information.
步骤703、对于任一条所述需求描述,将所述需求描述的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述需求描述划分至对应的模型维度。Step 703: For any of the requirement descriptions, the semantic information of the requirement description is used as the input of the STRIDE model, and the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information.
针对上述步骤701~703,其中,上述待处理流程指的是需要为其生成目标安全需求集的业务流程,业务流程可以是在软件设计阶段为需要开发的软件所设计的流程。相应地,上述威胁信息指的是在各流程的实际执行过程中可能存在的威胁,可能是外部的,也可能是内部的,会对系统或软件产生破坏性的后果,可能导致宕机或敏感信息泄露等,因而本申请实施例可以对待处理流程中所存在的威胁信息进行预先识别。Regarding the above steps 701 to 703, the above-mentioned process to be processed refers to the business process for which the target security requirement set needs to be generated, and the business process can be the process designed for the software to be developed during the software design phase. Correspondingly, the above-mentioned threat information refers to the threats that may exist during the actual execution of each process, which may be external or internal, and will have destructive consequences on the system or software, and may cause downtime or sensitive information leakage, etc. Therefore, the embodiment of the present application can pre-identify the threat information existing in the process to be processed.
进一步地,在存在威胁信息的情况下,可以为其生成相应的建议信息,其中,建议 信息指的是通过为流程增加操作步骤以解决对应的威胁,本申请实施例可以进一步将上述威胁信息以及建议信息作为需求描述,或者,也可以直接将威胁信息或建议信息作为需求描述,本申请实施例对此不作限制。具体的,上述威胁信息以及需求描述均可以通过threat modeling tool得到。Furthermore, in the case of threat information, corresponding suggestion information can be generated for it, wherein the suggestion Information refers to adding operation steps to the process to solve the corresponding threat. The embodiment of the present application can further use the above threat information and suggestion information as a demand description, or directly use the threat information or suggestion information as a demand description. The embodiment of the present application is not limited to this. Specifically, the above threat information and demand description can be obtained through the threat modeling tool.
进一步地,上述STRIDE模型指的是可以按照STRIDE方法对数据进行分类的模型,上述STRIDE模型可以是预先构建的。具体的,由于语义信息可以表征各需求描述所表达的含义,从而上述STRIDE模型可以通过各个需求描述的语义信息,确定各条需求描述所需解决的威胁的类型,确定其所需解决哪一种模型维度的威胁,并将其划分至对应的模型维度,不同的模型维度对应不同的威胁类型,从而实现对需求描述的划分。Furthermore, the STRIDE model is a model that can classify data according to the STRIDE method, and the STRIDE model can be pre-built. Specifically, since the semantic information can represent the meaning expressed by each requirement description, the STRIDE model can determine the type of threat that each requirement description needs to solve through the semantic information of each requirement description, determine which model dimension threat it needs to solve, and divide it into the corresponding model dimension. Different model dimensions correspond to different threat types, thereby realizing the division of the requirement description.
本申请实施例中,通过获取待处理流程中各流程所存在的威胁信息;对于任一所述流程,根据所述威胁信息确定所述流程对应的需求描述;对于任一条所述需求描述,将所述需求描述的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述需求描述划分至对应的模型维度。这样,通过获取待处理流程中的威胁信息以及需求描述,可以按照待处理流程的实际的需求,为其生成对应的目标安全需求集,同时,通过STRIDE模型对需求描述进行划分,可以得到符合STRIDE模型维度的需求描述,从而便于后续在不同模型维度下与参照安全数据进行相似度匹配,提高匹配的准确性。In the embodiment of the present application, the threat information existing in each process in the process to be processed is obtained; for any of the processes, the requirement description corresponding to the process is determined according to the threat information; for any of the requirement descriptions, the semantic information of the requirement description is used as the input of the STRIDE model, and the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information. In this way, by obtaining the threat information and requirement description in the process to be processed, a corresponding target security requirement set can be generated for it according to the actual requirements of the process to be processed. At the same time, by dividing the requirement description through the STRIDE model, a requirement description that conforms to the STRIDE model dimension can be obtained, so as to facilitate the subsequent similarity matching with the reference security data under different model dimensions and improve the accuracy of the matching.
在一些实施例中,上述模型维度包括仿冒、篡改、抵赖、信息泄露、拒绝服务以及权限提升。In some embodiments, the model dimensions include impersonation, tampering, repudiation, information leakage, denial of service, and privilege escalation.
其中,上述仿冒指的是攻击方通过使用虚假身份信息来尝试获取访问权限,上述篡改指的是攻击方在未经授权的情况下恶意修改数据,例如修改通信数据,上述抵赖指的是攻击方以合规或不合规的方式否认其执行了某项操作或业务,上述信息泄露指的是私密数据的意外公开,例如,用户可以查阅未授权的数据或内容,上述拒绝服务指的是导致系统或软件、应用不可用的过程,例如,攻击方通过向服务器发送大量请求来消耗系统的所有可用资源,导致的系统不可用。上述权限提升指的是拥有有限权限的用户取得了其他操作的权限,例如,攻击方接管具有较高权限且受信任的进程或账户。Among them, the above-mentioned impersonation refers to the attacker's attempt to obtain access rights by using false identity information, the above-mentioned tampering refers to the attacker's malicious modification of data without authorization, such as modifying communication data, the above-mentioned denial refers to the attacker's denial of performing a certain operation or business in a compliant or non-compliant manner, the above-mentioned information leakage refers to the accidental disclosure of private data, for example, users can view unauthorized data or content, and the above-mentioned denial of service refers to the process of causing the system or software or application to be unavailable, for example, the attacker consumes all available resources of the system by sending a large number of requests to the server, resulting in the system being unavailable. The above-mentioned privilege escalation refers to a user with limited privileges obtaining privileges for other operations, for example, the attacker takes over a process or account with higher privileges and trust.
可以理解的,上述模型维度包含了系统应用中可能存在的各个威胁类型,本申请实施例通过将需求描述以及参照安全数据划分为上述模型维度,可以从各个类型的威胁的角度出发,确定与需求描述相对应的目标安全需求集,从而保证所生成的目标安全需求集可以满足实际的安全需求,从而使得开发人员按照该目标安全需求集所开发的安全功能,可以有效避免上述不同模型维度的威胁。It can be understood that the above-mentioned model dimensions include various threat types that may exist in system applications. The embodiment of the present application can determine the target security requirement set corresponding to the requirement description from the perspective of various types of threats by dividing the requirement description and the reference security data into the above-mentioned model dimensions, thereby ensuring that the generated target security requirement set can meet the actual security requirements, so that the security functions developed by developers according to the target security requirement set can effectively avoid the threats of the above-mentioned different model dimensions.
图4是本申请实施例提供的一种场景示意图,如图4所示,其中示出了软件开发的生命周期(System Development Life Cycle,SDLC),可以包含问题定义、可行性分析、总体描述、系统设计、编码、调试和测试、验收与运行、维护升级到废弃等阶段,其中,设计阶段是对需求分析结果进行软件系统整体设计的重要阶段,相比在系统完成开发后再考虑安全需求,提前在设计阶段就完成整体安全方案设计,不管对开发人员还是安全人员,都有更大的弹性空间提前消除安全威胁,避免类似事后打补丁式地被动防御,同时也有助于降低开发和后期维护的成本。通过安全设计消除潜在的威胁,并在测试环节 进行安全测试验证,形成一个设计-实现-验证闭环。而绝大部分安全威胁,可以通过威胁建模来发现。FIG4 is a schematic diagram of a scenario provided by an embodiment of the present application. As shown in FIG4 , the software development life cycle (System Development Life Cycle, SDLC) is shown, which may include problem definition, feasibility analysis, overall description, system design, coding, debugging and testing, acceptance and operation, maintenance and upgrade to abandonment, among which the design stage is an important stage for the overall design of the software system based on the requirements analysis results. Compared with considering security requirements after the system is developed, completing the overall security solution design in the design stage in advance gives both developers and security personnel greater flexibility to eliminate security threats in advance and avoid passive defense such as patching afterwards. It also helps to reduce the cost of development and later maintenance. Eliminate potential threats through security design and in the testing phase Conduct security testing and verification to form a design-implementation-verification closed loop. Most security threats can be discovered through threat modeling.
本申请实施例为了防止威胁对系统产生严重影响,在开发设计阶段引入了基于STRIDE模型的威胁建模流程,使用历史积累的攻击案例作为数据集,识别出系统潜在的安全漏洞和安全威胁,确定每种威胁的严重性。然后生成对应的安全需求指导后续的开发和测试,这样可以尽早发现和解决潜在的问题,防止后期漏洞出现引起线上问题。In order to prevent threats from having a serious impact on the system, the embodiment of this application introduces a threat modeling process based on the STRIDE model during the development and design phase, using historically accumulated attack cases as a data set to identify potential security vulnerabilities and security threats in the system and determine the severity of each threat. Then, corresponding security requirements are generated to guide subsequent development and testing, so that potential problems can be discovered and resolved as early as possible to prevent later vulnerabilities from causing online problems.
图5是本申请实施例提供的另一种基于STRIDE模型的安全需求生成方法的步骤流程图,如图5所示,可以包括:FIG5 is a flowchart of another method for generating security requirements based on the STRIDE model provided in an embodiment of the present application. As shown in FIG5 , the method may include:
步骤211、生成基础威胁列表。Step 211: Generate a basic threat list.
其中,上述基础威胁列表指的是上述需求描述集,其中可以按照仿冒、篡改、抵赖、信息泄露、拒绝服务以及权限提升进行分类。The above basic threat list refers to the above requirement description set, which can be classified according to impersonation, tampering, denial of service, information leakage, denial of service and privilege escalation.
步骤212、获取历史安全需求数据作为参照安全数据。Step 212: Acquire historical security requirement data as reference security data.
步骤213、按照仿冒、篡改、抵赖、信息泄露、拒绝服务以及权限提升进行分类,得到参照安全需求集。Step 213: Classify according to counterfeiting, tampering, repudiation, information leakage, denial of service and privilege escalation to obtain a reference security requirement set.
步骤214、计算各参照安全需求的文本向量。Step 214: Calculate the text vector of each reference security requirement.
其中,具体可以使用doc2vec计算。Specifically, doc2vec can be used for calculation.
步骤215、利用余弦相似度计算各参照安全需求之间的文本相似性。Step 215: Calculate the text similarity between the reference security requirements using cosine similarity.
步骤216、对参照安全需求进行聚类。Step 216: Cluster the reference security requirements.
具体可以通过k-means算法进行聚类。Specifically, clustering can be performed using the k-means algorithm.
步骤217、通过余弦相似度判断基础威胁描述与聚类后的安全需求的相似性。Step 217: Determine the similarity between the basic threat description and the clustered security requirements through cosine similarity.
步骤218、将超出相似度阈值的安全需求进行输出,得到目标安全需求列表。Step 218: Output the security requirements that exceed the similarity threshold to obtain a target security requirement list.
可以看出,本申请实施例提出的基于STRIDE模型的安全需求生成方法相比现有的人工编辑的方式,可以按照模型维度,在同一模型维度下获取需求描述和待选安全需求的相似度,提高相似度计算的准确性,同时,通过需求描述和待选安全需求的相似度选择与需求描述对应的目标安全需求,并生成目标安全需求集,可以在无需人工编辑安全需求的同时,满足需求描述集中的需求,根据相似度选择满足要求的安全需求即可,提高了生成目标安全需求集的效率,通过基础的威胁信息得到了比较全面的安全需求列表。It can be seen that the security requirement generation method based on the STRIDE model proposed in the embodiment of the present application can obtain the similarity between the requirement description and the security requirement to be selected under the same model dimension according to the model dimension, thereby improving the accuracy of the similarity calculation. At the same time, the target security requirement corresponding to the requirement description is selected through the similarity between the requirement description and the security requirement to be selected, and a target security requirement set is generated. This can meet the requirements in the requirement description set without the need for manual editing of security requirements. Security requirements that meet the requirements can be selected based on the similarity, thereby improving the efficiency of generating the target security requirement set, and obtaining a relatively comprehensive list of security requirements through basic threat information.
图6是本申请实施例提供的一种基于STRIDE模型的安全需求生成装置80的结构框图,如图6所示,该装置可以包括:FIG6 is a structural block diagram of a security requirement generation device 80 based on a STRIDE model provided in an embodiment of the present application. As shown in FIG6 , the device may include:
需求描述获取模块801,用于获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;A requirement description acquisition module 801 is used to acquire a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model division;
安全数据划分模块802,用于基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求;A security data partitioning module 802 is used to partition executable reference security data based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions;
第一相似度获取模块803,用于对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;A first similarity acquisition module 803 is used to acquire, for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
选取模块804,用于基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求; A selection module 804 is used to select a candidate security requirement corresponding to the requirement description as a target security requirement based on a first similarity between the requirement description and each candidate security requirement;
目标安全需求集生成模块805,用于基于各所述需求描述对应的目标安全需求生成目标安全需求集。The target security requirement set generating module 805 is used to generate a target security requirement set based on the target security requirements corresponding to each of the requirement descriptions.
在一些实施例中,所述装置80还包括:In some embodiments, the device 80 further comprises:
分类模块,用于对于任一所述模型维度,对所述参照安全需求集中与所述模型维度对应的安全需求进行分类,得到所述模型维度下不同类别的安全需求;任一类别的安全需求包含中心需求;A classification module, for classifying, for any of the model dimensions, the security requirements in the reference security requirements set corresponding to the model dimension, to obtain security requirements of different categories under the model dimension; any category of security requirements includes a central requirement;
所述选取模块804,具体用于:The selection module 804 is specifically used for:
获取所述需求描述与各目标中心需求之间的第二相似度,作为各所述类别的相似度阈值;所述目标中心需求是所述待选安全需求对应的模型维度下的类别中的中心需求;Obtaining a second similarity between the requirement description and each target central requirement as a similarity threshold of each category; the target central requirement is a central requirement in a category under the model dimension corresponding to the selected security requirement;
基于所述需求描述与各待选安全需求之间的第一相似度以及各所述类别的相似度阈值,选取与所述需求描述对应的待选安全需求。Based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category, a candidate security requirement corresponding to the requirement description is selected.
在一些实施例中,所述分类模块,具体用于:In some embodiments, the classification module is specifically used to:
从所述参照安全需求集中与所述模型维度对应的安全需求中选取多个初始中心需求,作为待选中心需求;一个待选中心需求对应表征一个所述类别;Selecting a plurality of initial central requirements from the security requirements corresponding to the model dimension in the reference security requirement set as candidate central requirements; one candidate central requirement correspondingly represents one of the categories;
对于所述参照安全需求集中与所述模型维度对应的安全需求中的任一安全需求,获取所述安全需求与各所述待选中心需求之间的第三相似度;For any security requirement in the reference security requirement set corresponding to the model dimension, obtaining a third similarity between the security requirement and each of the candidate center requirements;
将所述安全需求划分至对应的第三相似度最大的待选中心需求所表征的类别;Classifying the security requirements into categories represented by the corresponding candidate center requirements with the largest third similarity;
基于各类别中包含的安全需求,重新选取多个中心需求作为所述待选中心需求,并基于各所述待选中心需求重新执行所述获取所述安全需求与各所述待选中心需求之间的第三相似度的操作,直至达到预设的终止条件,将当前的各所述待选中心需求作为目标中心需求,并将当前的分类结果作为最终分类结果。Based on the security requirements contained in each category, multiple center requirements are reselected as the candidate center requirements, and based on each of the candidate center requirements, the operation of obtaining the third similarity between the security requirements and each of the candidate center requirements is re-executed until the preset termination condition is reached, and the current candidate center requirements are used as the target center requirements, and the current classification result is used as the final classification result.
在一些实施例中,所述选取模块804,具体还用于:In some embodiments, the selection module 804 is further configured to:
对于任一所述待选安全需求,从各所述类别的相似度阈值中获取所述待选安全需求所属的类别相似度阈值,作为所述待选安全需求对应的目标相似度阈值;For any of the security requirements to be selected, obtaining a similarity threshold of the category to which the security requirement to be selected belongs from the similarity thresholds of the categories as a target similarity threshold corresponding to the security requirement to be selected;
在所述待选安全需求与所述需求描述之间的第一相似度不低于所述待选安全需求对应的目标相似度阈值的情况下,将所述待选安全需求确定为与所述需求描述对应的待选安全需求。In a case where the first similarity between the candidate security requirement and the requirement description is not lower than a target similarity threshold corresponding to the candidate security requirement, the candidate security requirement is determined as the candidate security requirement corresponding to the requirement description.
在一些实施例中,所述第一相似度获取模块,具体用于:In some embodiments, the first similarity acquisition module is specifically used to:
获取各所述待选安全需求对应的第一文本向量以及所述需求描述对应的第二文本向量;Obtaining a first text vector corresponding to each of the to-be-selected security requirements and a second text vector corresponding to the requirement description;
基于所述第二文本向量以及各所述待选安全需求对应的所述第一文本向量,确定所述需求描述与各待选安全需求之间的第一相似度。Based on the second text vector and the first text vector corresponding to each of the candidate safety requirements, a first similarity between the requirement description and each of the candidate safety requirements is determined.
在一些实施例中,所述安全数据划分模块802,具体用于:In some embodiments, the security data partitioning module 802 is specifically used to:
获取所述参照安全数据中包含的各条安全数据的语义信息;Acquire semantic information of each piece of security data contained in the reference security data;
对于任一条所述安全数据,将所述安全数据的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述安全数据划分至对应的模型维度。For any piece of the security data, the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information.
在一些实施例中,所述需求描述获取模块801,具体用于:In some embodiments, the requirement description acquisition module 801 is specifically used to:
获取待处理流程中各流程所存在的威胁信息; Obtain threat information of each process in the process to be processed;
对于任一所述流程,根据所述威胁信息确定所述流程对应的需求描述;For any of the processes, determining a requirement description corresponding to the process according to the threat information;
对于任一条所述需求描述,将所述需求描述的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述需求描述划分至对应的模型维度.For any of the requirement descriptions, the semantic information of the requirement description is used as the input of the STRIDE model, and the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information.
在一些实施例中,所述模型维度包括仿冒、篡改、抵赖、信息泄露、拒绝服务以及权限提升。In some embodiments, the model dimensions include impersonation, tampering, repudiation, information leakage, denial of service, and privilege escalation.
综上所述,本申请实施例通过获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求;对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求;基于各所述需求描述对应的目标安全需求生成目标安全需求集。这样,通过基于STRIDE模型划分的需求描述集和参照安全需求集,可以按照模型维度,获取同一模型维度下的需求描述和待选安全需求的第一相似度,提高第一相似度计算的准确性,同时,通过需求描述和待选安全需求的第一相似度选择与需求描述对应的目标安全需求,并生成目标安全需求集,所得到的目标安全需求与需求描述相一致,且无需人工编辑安全需求,根据第一相似度选择满足要求的安全需求即可,提高了生成目标安全需求集的效率。In summary, the embodiment of the present application obtains a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the STRIDE model; based on the STRIDE model, executable reference security data is divided to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions; for any requirement description in the requirement description set, a first similarity between the requirement description and each candidate security requirement is obtained; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description; based on the first similarity between the requirement description and each candidate security requirement, a candidate security requirement corresponding to the requirement description is selected as a target security requirement; and a target security requirement set is generated based on the target security requirements corresponding to each of the requirement descriptions. In this way, by dividing the requirement description set and the reference security requirement set based on the STRIDE model, the first similarity between the requirement description and the candidate security requirement under the same model dimension can be obtained according to the model dimension, thereby improving the accuracy of the first similarity calculation. At the same time, the target security requirement corresponding to the requirement description is selected through the first similarity between the requirement description and the candidate security requirement, and a target security requirement set is generated. The obtained target security requirement is consistent with the requirement description, and there is no need to manually edit the security requirement. Only the security requirement that meets the requirements can be selected according to the first similarity, thereby improving the efficiency of generating the target security requirement set.
在本申请提供的又一实施例中,还提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;In another embodiment provided by the present application, an electronic device is provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
存储器,用于存放计算机程序;Memory, used to store computer programs;
处理器,用于进行存储器上所存放的程序时,进行上述任一所述的方法。The processor is used to perform any of the above methods when executing the program stored in the memory.
在本申请提供的又一实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机进行上述实施例中任一所述的方法。In another embodiment provided by the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer performs any of the methods described in the above embodiments.
在本申请提供的又一实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机进行上述实施例中任一所述的方法。In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to perform any of the methods described in the above embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和进行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等 数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a server, data center, etc. that includes one or more available media integrated therein. Data storage device: The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).
需要说明的是,本申请实施例中获取各种数据相关过程,都是在遵照所在地国家相应的数据保护法规政策的前提下,并获得由相应装置所有者给予授权的情况下进行的。It should be noted that the various data-related processes in the embodiments of the present application are all carried out in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制时,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。 The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (15)

  1. 一种基于STRIDE模型的安全需求生成方法,其特征在于,所述方法包括:A method for generating security requirements based on a STRIDE model, characterized in that the method comprises:
    获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;Obtaining a requirement description set, the requirement description set including requirement descriptions corresponding to each model dimension, the requirement description set being obtained based on the division of the STRIDE model;
    基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求;Based on the STRIDE model, executable reference security data is divided to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions;
    对于所述需求描述集中的任一需求描述,获取所述需求描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;For any requirement description in the requirement description set, obtaining a first similarity between the requirement description and each candidate security requirement; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
    基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求;Based on a first similarity between the requirement description and each candidate security requirement, selecting a candidate security requirement corresponding to the requirement description as a target security requirement;
    基于各所述需求描述对应的目标安全需求生成目标安全需求集。A target security requirement set is generated based on the target security requirements corresponding to each of the requirement descriptions.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, characterized in that the method further comprises:
    对于任一所述模型维度,对所述参照安全需求集中与所述模型维度对应的安全需求进行分类,得到所述模型维度下不同类别的安全需求;任一类别的安全需求包含中心需求;For any of the model dimensions, classify the security requirements in the reference security requirements set corresponding to the model dimension to obtain different categories of security requirements under the model dimension; any category of security requirements includes a central requirement;
    所述基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,包括:The selecting, based on the first similarity between the requirement description and each of the candidate security requirements, the candidate security requirement corresponding to the requirement description includes:
    获取所述需求描述与各目标中心需求之间的第二相似度,作为各所述类别的相似度阈值;所述目标中心需求是所述待选安全需求对应的模型维度下的类别中的中心需求;Obtaining a second similarity between the requirement description and each target central requirement as a similarity threshold of each category; the target central requirement is a central requirement in a category under the model dimension corresponding to the selected security requirement;
    基于所述需求描述与各待选安全需求之间的第一相似度以及各所述类别的相似度阈值,选取与所述需求描述对应的待选安全需求。Based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category, a candidate security requirement corresponding to the requirement description is selected.
  3. 根据权利要求2所述的方法,其特征在于,所述对所述参照安全需求集中与所述模型维度对应的安全需求进行分类,得到所述模型维度下不同类别的安全需求,包括:The method according to claim 2 is characterized in that the step of classifying the security requirements corresponding to the model dimension in the reference security requirement set to obtain different categories of security requirements under the model dimension comprises:
    从所述参照安全需求集中与所述模型维度对应的安全需求中选取多个初始中心需求,作为待选中心需求;一个待选中心需求对应表征一个所述类别;Selecting a plurality of initial central requirements from the security requirements corresponding to the model dimension in the reference security requirement set as candidate central requirements; one candidate central requirement correspondingly represents one of the categories;
    对于所述参照安全需求集中与所述模型维度对应的安全需求中的任一安全需求,获取所述安全需求与各所述待选中心需求之间的第三相似度;For any security requirement in the reference security requirement set corresponding to the model dimension, obtaining a third similarity between the security requirement and each of the candidate center requirements;
    将所述安全需求划分至对应的第三相似度最大的待选中心需求所表征的类别;Classifying the security requirements into categories represented by the corresponding candidate center requirements with the largest third similarity;
    基于各类别中包含的安全需求,重新选取多个中心需求作为所述待选中心需求,并基于各所述待选中心需求重新执行所述获取所述安全需求与各所述待选中心需求之间的第三相似度的操作,直至达到预设的终止条件,将当前的各所述待选中心需求作为目标 中心需求,并将当前的分类结果作为最终分类结果。Based on the security requirements contained in each category, multiple center requirements are reselected as the candidate center requirements, and the operation of obtaining the third similarity between the security requirements and each candidate center requirement is re-executed based on each candidate center requirement until a preset termination condition is reached, and the current candidate center requirements are used as the target Center needs, and take the current classification result as the final classification result.
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述需求描述与各待选安全需求之间的第一相似度以及各所述类别的相似度阈值,选取与所述需求描述对应的待选安全需求,包括:The method according to claim 3 is characterized in that the selecting the candidate security requirement corresponding to the requirement description based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category comprises:
    对于任一所述待选安全需求,从各所述类别的相似度阈值中获取所述待选安全需求所属的类别相似度阈值,作为所述待选安全需求对应的目标相似度阈值;For any of the security requirements to be selected, obtaining a similarity threshold of the category to which the security requirement to be selected belongs from the similarity thresholds of the categories as a target similarity threshold corresponding to the security requirement to be selected;
    在所述待选安全需求与所述需求描述之间的第一相似度不低于所述待选安全需求对应的目标相似度阈值的情况下,将所述待选安全需求确定为与所述需求描述对应的待选安全需求。In a case where the first similarity between the candidate security requirement and the requirement description is not lower than a target similarity threshold corresponding to the candidate security requirement, the candidate security requirement is determined as the candidate security requirement corresponding to the requirement description.
  5. 根据权利要求1所述的方法,其特征在于,所述获取所述需求描述与各待选安全需求之间的第一相似度,包括:The method according to claim 1, characterized in that the obtaining of the first similarity between the requirement description and each candidate security requirement comprises:
    获取各所述待选安全需求对应的第一文本向量以及所述需求描述对应的第二文本向量;Obtaining a first text vector corresponding to each of the to-be-selected security requirements and a second text vector corresponding to the requirement description;
    基于所述第二文本向量以及各所述待选安全需求对应的所述第一文本向量,确定所述需求描述与各待选安全需求之间的第一相似度。Based on the second text vector and the first text vector corresponding to each of the candidate safety requirements, a first similarity between the requirement description and each of the candidate safety requirements is determined.
  6. 根据权利要求1所述的方法,其特征在于,所述基于所述STRIDE模型对可执行的参照安全数据进行划分,包括:The method according to claim 1, characterized in that the partitioning of executable reference safety data based on the STRIDE model comprises:
    获取所述参照安全数据中包含的各条安全数据的语义信息;Acquire semantic information of each piece of security data contained in the reference security data;
    对于任一条所述安全数据,将所述安全数据的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述安全数据划分至对应的模型维度。For any piece of the security data, the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information.
  7. 根据权利要求1所述的方法,其特征在于,所述获取需求描述集,包括:The method according to claim 1, characterized in that the obtaining of the requirement description set comprises:
    获取待处理流程中各流程所存在的威胁信息;Obtain threat information of each process in the process to be processed;
    对于任一所述流程,根据所述威胁信息确定所述流程对应的需求描述;For any of the processes, determining a requirement description corresponding to the process according to the threat information;
    对于任一条所述需求描述,将所述需求描述的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述需求描述划分至对应的模型维度。For any of the requirement descriptions, the semantic information of the requirement description is used as the input of the STRIDE model, and the STRIDE model divides the requirement description into corresponding model dimensions according to the semantic information.
  8. 一种基于STRIDE模型的安全需求生成装置,其特征在于,所述装置包括:A safety requirement generation device based on the STRIDE model, characterized in that the device comprises:
    需求描述获取模块,用于获取需求描述集,所述需求描述集包括与各模型维度对应的需求描述,所述需求描述集基于所述STRIDE模型划分得到;A requirement description acquisition module is used to acquire a requirement description set, wherein the requirement description set includes requirement descriptions corresponding to each model dimension, and the requirement description set is obtained based on the division of the STRIDE model;
    安全数据划分模块,用于基于所述STRIDE模型对可执行的参照安全数据进行划分,得到参照安全需求集;所述参照安全需求集包括与各所述模型维度对应的安全需求;A security data partitioning module, used to partition executable reference security data based on the STRIDE model to obtain a reference security requirement set; the reference security requirement set includes security requirements corresponding to each of the model dimensions;
    第一相似度获取模块,用于对于所述需求描述集中的任一需求描述,获取所述需求 描述与各待选安全需求之间的第一相似度;所述待选安全需求是所述参照安全需求集中对应的模型维度与所述需求描述对应的模型维度相一致的安全需求;The first similarity acquisition module is used to obtain the requirement for any requirement description in the requirement description set. a first similarity between the description and each candidate security requirement; the candidate security requirement is a security requirement whose corresponding model dimension in the reference security requirement set is consistent with the model dimension corresponding to the requirement description;
    选取模块,用于基于所述需求描述与各待选安全需求之间的第一相似度,选取与所述需求描述对应的待选安全需求,作为目标安全需求;A selection module, configured to select, based on a first similarity between the requirement description and each of the candidate security requirements, a candidate security requirement corresponding to the requirement description as a target security requirement;
    目标安全需求集生成模块,用于基于各所述需求描述对应的目标安全需求生成目标安全需求集。The target security requirement set generating module is used to generate a target security requirement set based on the target security requirements corresponding to each of the requirement descriptions.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, characterized in that the device further comprises:
    分类模块,用于对于任一所述模型维度,对所述参照安全需求集中与所述模型维度对应的安全需求进行分类,得到所述模型维度下不同类别的安全需求;任一类别的安全需求包含中心需求;A classification module, for classifying, for any of the model dimensions, the security requirements in the reference security requirements set corresponding to the model dimension, to obtain security requirements of different categories under the model dimension; any category of security requirements includes a central requirement;
    所述选取模块,具体用于:The selection module is specifically used for:
    获取所述需求描述与各目标中心需求之间的第二相似度,作为各所述类别的相似度阈值;所述目标中心需求是所述待选安全需求对应的模型维度下的类别中的中心需求;Obtaining a second similarity between the requirement description and each target central requirement as a similarity threshold of each category; the target central requirement is a central requirement in a category under the model dimension corresponding to the selected security requirement;
    基于所述需求描述与各待选安全需求之间的第一相似度以及各所述类别的相似度阈值,选取与所述需求描述对应的待选安全需求。Based on the first similarity between the requirement description and each candidate security requirement and the similarity threshold of each category, a candidate security requirement corresponding to the requirement description is selected.
  10. 根据权利要求9所述的装置,其特征在于,所述分类模块,具体用于:The device according to claim 9, characterized in that the classification module is specifically used to:
    从所述参照安全需求集中与所述模型维度对应的安全需求中选取多个初始中心需求,作为待选中心需求;一个待选中心需求对应表征一个所述类别;Selecting a plurality of initial central requirements from the security requirements corresponding to the model dimension in the reference security requirement set as candidate central requirements; one candidate central requirement correspondingly represents one of the categories;
    对于所述参照安全需求集中与所述模型维度对应的安全需求中的任一安全需求,获取所述安全需求与各所述待选中心需求之间的第三相似度;For any security requirement in the reference security requirement set corresponding to the model dimension, obtaining a third similarity between the security requirement and each of the candidate center requirements;
    将所述安全需求划分至对应的第三相似度最大的待选中心需求所表征的类别;Classifying the security requirements into categories represented by the corresponding candidate center requirements with the largest third similarity;
    基于各类别中包含的安全需求,重新选取多个中心需求作为所述待选中心需求,并基于各所述待选中心需求重新执行所述获取所述安全需求与各所述待选中心需求之间的第三相似度的操作,直至达到预设的终止条件,将当前的各所述待选中心需求作为目标中心需求,并将当前的分类结果作为最终分类结果。Based on the security requirements contained in each category, multiple center requirements are reselected as the candidate center requirements, and based on each of the candidate center requirements, the operation of obtaining the third similarity between the security requirements and each of the candidate center requirements is re-executed until the preset termination condition is reached, and the current candidate center requirements are used as the target center requirements, and the current classification result is used as the final classification result.
  11. 根据权利要求10所述的装置,其特征在于,所述选取模块,具体还用于:The device according to claim 10, characterized in that the selection module is further used to:
    对于任一所述待选安全需求,从各所述类别的相似度阈值中获取所述待选安全需求所属的类别相似度阈值,作为所述待选安全需求对应的目标相似度阈值;For any of the security requirements to be selected, obtaining a similarity threshold of the category to which the security requirement to be selected belongs from the similarity thresholds of the categories as a target similarity threshold corresponding to the security requirement to be selected;
    在所述待选安全需求与所述需求描述之间的第一相似度不低于所述待选安全需求对应的目标相似度阈值的情况下,将所述待选安全需求确定为与所述需求描述对应的待选安全需求。 In a case where the first similarity between the candidate security requirement and the requirement description is not lower than a target similarity threshold corresponding to the candidate security requirement, the candidate security requirement is determined as the candidate security requirement corresponding to the requirement description.
  12. 根据权利要求8所述的装置,其特征在于,所述第一相似度获取模块,具体用于:The device according to claim 8, characterized in that the first similarity acquisition module is specifically used to:
    获取各所述待选安全需求对应的第一文本向量以及所述需求描述对应的第二文本向量;Obtaining a first text vector corresponding to each of the to-be-selected security requirements and a second text vector corresponding to the requirement description;
    基于所述第二文本向量以及各所述待选安全需求对应的所述第一文本向量,确定所述需求描述与各待选安全需求之间的第一相似度。Based on the second text vector and the first text vector corresponding to each of the candidate safety requirements, a first similarity between the requirement description and each of the candidate safety requirements is determined.
  13. 根据权利要求8所述的装置,其特征在于,所述安全数据划分模块,具体用于:The device according to claim 8, characterized in that the security data partitioning module is specifically used to:
    获取所述参照安全数据中包含的各条安全数据的语义信息;Acquire semantic information of each piece of security data contained in the reference security data;
    对于任一条所述安全数据,将所述安全数据的语义信息作为所述STRIDE模型的输入,由所述STRIDE模型根据所述语义信息将所述安全数据划分至对应的模型维度。For any piece of the security data, the semantic information of the security data is used as the input of the STRIDE model, and the STRIDE model divides the security data into corresponding model dimensions according to the semantic information.
  14. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;An electronic device, characterized in that it comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
    存储器,用于存放计算机程序;Memory, used to store computer programs;
    处理器,用于进行存储器上所存放的程序时,实现权利要求1-7任一所述的方法。A processor, for implementing any of the methods of claims 1-7 when executing a program stored in a memory.
  15. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器进行时实现如权利要求1-7中任一所述的方法。 A computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
PCT/CN2023/140017 2023-02-13 2023-12-19 Security requirement generation method and apparatus based on stride model, electronic device and medium WO2024169388A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310106093.5 2023-02-13
CN202310106093.5A CN115809466B (en) 2023-02-13 2023-02-13 Security requirement generation method and device based on STRIDE model, electronic equipment and medium

Publications (1)

Publication Number Publication Date
WO2024169388A1 true WO2024169388A1 (en) 2024-08-22

Family

ID=85487859

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/140017 WO2024169388A1 (en) 2023-02-13 2023-12-19 Security requirement generation method and apparatus based on stride model, electronic device and medium

Country Status (2)

Country Link
CN (1) CN115809466B (en)
WO (1) WO2024169388A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115809466B (en) * 2023-02-13 2023-04-07 天翼云科技有限公司 Security requirement generation method and device based on STRIDE model, electronic equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070199050A1 (en) * 2006-02-14 2007-08-23 Microsoft Corporation Web application security frame
CN109683854A (en) * 2018-12-21 2019-04-26 北京国舜科技股份有限公司 A kind of software security requirement analysis method and system
CN110457009A (en) * 2019-07-06 2019-11-15 天津大学 Implementation method of software security requirement recommendation model based on data analysis
US11128653B1 (en) * 2018-12-13 2021-09-21 Amazon Technologies, Inc. Automatically generating a machine-readable threat model using a template associated with an application or service
CN115809466A (en) * 2023-02-13 2023-03-17 天翼云科技有限公司 Security requirement generation method and device based on STRIDE model, electronic equipment and medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101452469B (en) * 2008-12-24 2011-03-23 天津大学 Software safety defect library system based on attack mode and management method thereof
US9571510B1 (en) * 2014-10-21 2017-02-14 Symantec Corporation Systems and methods for identifying security threat sources responsible for security events
CN109388377A (en) * 2018-10-08 2019-02-26 广西民族大学 A kind of software security requirement acquisition method based on Formal Modeling

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070199050A1 (en) * 2006-02-14 2007-08-23 Microsoft Corporation Web application security frame
US11128653B1 (en) * 2018-12-13 2021-09-21 Amazon Technologies, Inc. Automatically generating a machine-readable threat model using a template associated with an application or service
CN109683854A (en) * 2018-12-21 2019-04-26 北京国舜科技股份有限公司 A kind of software security requirement analysis method and system
CN110457009A (en) * 2019-07-06 2019-11-15 天津大学 Implementation method of software security requirement recommendation model based on data analysis
CN115809466A (en) * 2023-02-13 2023-03-17 天翼云科技有限公司 Security requirement generation method and device based on STRIDE model, electronic equipment and medium

Also Published As

Publication number Publication date
CN115809466A (en) 2023-03-17
CN115809466B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US20220358242A1 (en) Data security hub
US11184380B2 (en) Security weakness and infiltration detection and repair in obfuscated website content
CN116506217B (en) Analysis method, system, storage medium and terminal for security risk of service data stream
US11956272B2 (en) Identifying legitimate websites to remove false positives from domain discovery analysis
CN110855648B (en) Early warning control method and device for network attack
CN108090351A (en) For handling the method and apparatus of request message
CN112367338A (en) Malicious request detection method and device
CN112559526A (en) Data table export method and device, computer equipment and storage medium
WO2024169388A1 (en) Security requirement generation method and apparatus based on stride model, electronic device and medium
KR102318496B1 (en) Method and blockchain nodes for detecting abusing based on blockchain networks
US9998495B2 (en) Apparatus and method for verifying detection rule
US20240095289A1 (en) Data enrichment systems and methods for abbreviated domain name classification
CN117910010A (en) Distributed secure storage method and system
WO2023072002A1 (en) Security detection method and apparatus for open source component package
US11907658B2 (en) User-agent anomaly detection using sentence embedding
Moreaux et al. Blockchain assisted near-duplicated content detection
Al-Ghuraybi et al. AMCB: enhancing the authentication process with blockchain integrated with PUF and machine learning
EP4485241A1 (en) Method and apparatus for verifying applications
CN115022002B (en) Verification mode determining method and device, storage medium and electronic equipment
US20250097227A1 (en) Assignment of resource criticality scores to cloud resources based on cloud resource class
CN119622697A (en) Terminal device verification method, device, electronic device and storage medium
CN119397607A (en) Data leakage prevention method and device, computer equipment and storage medium
CN115130103A (en) Risk processing method and device, electronic equipment and storage medium
CN119557921A (en) Infringement data management method and system
CN118503939A (en) Data security management method and system based on dynamic fingerprint technology of access terminal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23922504

Country of ref document: EP

Kind code of ref document: A1