Threat modelling¶
Threat modelling is best integrated into the design phase of an SDLC before any code is written. Threat modelling is a structured process of identifying potential security threats and prioritising techniques to mitigate attacks so that data or assets that have been classified as valuable or of higher risk during risk assessment, such as confidential data, are protected. When performed early, it brings a great advantage; potential issues can be found early and solved, saving fixing costs down the line.
There are several tools and methodologies to do threat modelling.
If you would like to have a DFD/threat diagram designer, you can use the Microsoft threat modellingtool, OWASP Threat Dragon, or Mozilla SeaSponge.
If you have a small team and would like to do threat modelling via a card game team activity, the Microsoft EOP card game and OWASP Cornucopia are recommended.
And you can add using threat libraries such as CAPEC, ATT&CK, and CWE, which can support threat identification during threat modelling.
Methods¶
There are several methods to perform threat modelling. Not all the methods have the same purpose; focus varies from risk, to privacy concerns, to customer. The methods can be combined to understand potential threats better. STRIDE, DREAD, and PASTA fit together really well. Don’t let the process or tools limit learning and innovation.
STRIDE¶
STRIDE stands for Spoofing, Tampering, Repudiation, Information Disclosure, Denial Of Service, and Elevation/Escalation of Privilege. STRIDE is a widely used threat model developed by Microsoft which evaluates the system’s design in a more detailed view. STRIDE can be used to identify threats, including the property violated by the threat and definition. The system’s data flow diagram is to be developed in this model, and each node is applied with the STRIDE model. Identifying security threats is a manual process that tools are not supported and should be carried out during the risk assessment. Using data flow diagrams and integrating STRIDE, the system entities, attack surfaces, like known boundaries and attacker events become more identifiable. STRIDE is built upon the CIA triad principle (Confidentiality, Integrity & Availability). Security professionals using STRIDE are looking to answer “What could go wrong with this system?”
STRIDE threat |
|
---|---|
Spoofing |
Spoofing is an act of impersonation of a user by a malicious actor |
Tampering |
The modification of information by an unauthorised user. It violates |
Repudiation |
Not taking responsibility for events where the actions are not |
Information Disclosure |
Information Disclosure is an act of violation of confidentiality of the |
Denial of Service |
Denial of Service occurs when an authorised user cannot access |
Elevation/Escalation of Privilege |
Escalating privileges to gain unauthorised access is a classic |
DREAD¶
The abbreviation DREAD stands for five questions about each potential: Damage Potential, Reproducibility, Exploitability, Affected Users and Discoverability. DREAD is also a methodology created by Microsoft which can be an add-on to the STRIDE model. It’s a model that ranks threats by assigning identified threats according to their severity and priority. In other words, it creates a rating system that is scored based on risk probability. Without STRIDE, the DREAD model also can be used in assessing, analysing and finding the risk probability by threat rating.
DREAD potential |
|
---|---|
Damage |
Damage refers to the possible damage a threat could cause to the existing |
Reproducibility |
Measures the complexity of the attack. So how easily a hacker can replicate |
Exploitability |
Refers to the attack’s sophistication or how easy it would be to launch the |
Affected Users |
Describes the number of users affected by the successful exploitation of a |
Discoverability |
The process of discovering the vulnerable points in the system. For example, |
PASTA¶
PASTA is short for Process for Attack Simulation and Threat Analysis; it is a risk-centric threat modelling framework. PASTA’s focus is to align technical requirements with business objectives. PASTA involves the threat modelling process from analysing threats to finding ways to mitigate them, but on a more strategic level and from an attacker’s perspective. It identifies the threat, enumerates them, and then assigns them a score. This helps organisations find suitable countermeasures to be deployed to mitigate security threats.
PASTA Stage |
|
---|---|
Define Objectives |
The first stage focuses on noting the structure and defining objectives. |
Define Technical Scope |
This is where architectural diagrams are defined, both logical and |
Decomposition & |
Each asset will have a defined trust boundary that encompasses all |
Threat Analysis |
This refers to the extracted information obtained from threat |
Vulnerabilities & |
it analyses the vulnerabilities of web application security controls. |
Attack/Exploit Enumeration & |
In this stage, we map out the possible threat landscape and the entire |
Risk Impact Analysis |
Based on the collective data from the previous stages, the scoped |
Example threat matrices¶
Often, the objective of threat modelling is to discuss the most relevant and high-priority security risks with mitigations. If it is a very large project, and most of the modules serve similar functions, it may be beneficial to perform the threat modelling with high-risk parts or the one which can mostly represent the business functions.
Name |
Tools |
---|---|
Device |
Developer Workstation: Mac/Win/Linux/Cloud-based |
Git Repository Service |
GitHub, GitLab, Bitbucket, Beanstalk, GitHub, GitLab, SourceForge |
CI |
CI/CD Services like CircleCI, Cloud Build, Codebuild, GitHub Actions, |
CD |
CI/CD Services like CircleCI, Cloud Build, Codebuild, GitHub Actions, |
Secret Management |
Secret Management Services like AWS Secret Manager, |
Production environment |
Cloud Services (AWS, Azure, GCP) and other resources like |
Recommended modules for threat modelling and code reviewing:
Modules with security controls such as authentication, authorisation, session management, encryption, data validation, error handling, or logging, administration, and database handlers.
Legacy modules with vulnerable CVE.
Modules that may externally interact with unknown users or third-party APIs.
Modules that handle sensitive information.