02 Threat Modeling
02 Threat Modeling
02 Threat Modeling
Dan Sellers
.Net Developer Specialist
Microsoft Canada
Key Concepts
A Threat Model describes a system’s
threat profile.
A threat is not a vulnerability.
The point of a threat model is more than
just finding vulnerabilities.
A system is anything that exposes
functionality to an end user, and can
describe anything from a single feature to
a web application and its supporting
infrastructure.
Copyright Microsoft Corp. 2004
Threat Modeling Process
Collect Model the Determine
Background System Threats
Information
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats /
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
Threat Modeling Process
Collect Model the Determine
Background System Threats
Information
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats /
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
6
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams/Process
Models
Internal Security
Notes
8
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams/Process
Models
Internal Security
Notes
12
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
16
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats /
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
20
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats /
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
24
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats /
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
28
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams/Process
Models
Internal Security
Notes
30
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats /
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
34
Identify Assets
Assets are those things, both concrete
and abstract, that could be targets of an
attack by an adversary.
Because of the widely varied functionality
of systems, protected resources can also
be widely varied. For example, a
concrete example might be corporate
data stored in a database. A more
abstract example might be network
coherency in a peer to peer application.
Assets should be nouns.
Copyright Microsoft Corp. 2004
Tool: Assets Table
Assets
ID Name Description Trust Level
1 Speed-dial list The speed dial list contains the names and (1) Administrator
numbers of often-used contacts. (2) Long-distance user
(3) Local call user
2 Caller ID Provides information about the incoming (1) Administrator
caller. (2) Long-distance user
(3) Local call user
3 Access to the PSTN The Phone 1.0 indirectly protects access to (1) Administrator
the PSTN. (2) Long-distance user
(3) Local call user
4 Long-distance calls The Phone 1.0 has optional lock-out for long (1) Administrator
distance calling so that only authorized users (2) Long-distance user
can make long distance calls.
5 Phone configuration The administrative configuration for the (1) Administrator
Phone 1.0
6 Messages Messages left by callers when the Phone 1.0 (1) Administrator
has the answering machine feature enabled. (2) Long-distance user
(3) Local call user
…
Assets: Relevance
Who uses the information? The Threat Modeling team
uses the information when identifying threats. When analyzing
security-critical processing, points where an asset is referenced
should be scrutinized. The assets are, in essence, the targets of
threats to the system. That is, a threat is what an attacker might
try to do to or with an asset that would result in a violation of the
systems expected security bounds.
How is the information collected? Many assets are
identified when discussing system functionality, use scenarios,
and other background information. Questions to ask are: Does
the system have access to any resources that an external entity
would not normally have access to? What aspects of the
system are critical to proper functionality?
How is it used in the rest of the Threat Model?
Assets are used during threat identification to identify an
adversary’s goals. Assuming that an adversary picks a
protected resource as a target, what might he try to do to it?
Threat Modeling Process
Collect Model the Determine
Background System Threats
Information
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams/Process
Models
Internal Security
Notes
38
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
43
A Process
Transforms or manipulates
data.
Level 0
Multiple Processes
Transforms or manipulates
data.
A Data Store
A location that stores
temporary or permanent
data
Boundary
A machine, physical,
address space or trust Level 1 Level 2
boundary.
Interactor
Input to the system.
1 Fabrikam
Local User PSTN
Visual display Phone 1.0 Telephone
output conversation
Ringer
Admin
menus /data
Telephone
conversation
Tool: Data Flow Diagram
Administrative privilege User dials 9 after
boundary answering machine
picks up Interface enabled
User via 1.1 Enable privilege boundary
PSTN password
User enters entering
digit in
Menus, password
mode
data entering mode
Password enter
enable
Selections,
data
Digit
Wait for
next digit
Admin enable
1.4 Enable
admin Password ring
mode buffer (stores
8 digits)
1.3 Check if
buffer
Successful
matches
8-digit password
completion password
Data Flow Diagrams:
Relevance
Who uses the information? DFDs can be used by security
testers to get a better understanding of the system’s functionality and
implementation. The visual representation of the data flows allows the
tester to create attack hypotheses.
How is the information collected? The designers and
implementers of the system provide this information. It is often partially
completed before any threat modeling meetings. During the meetings,
however, they are usually expanded and more diagrams are created as
the team analyzes the system.
How is it used in the rest of the Threat Model? The
DFDs are used during threat identification as a way to direct threat
hypotheses. They allow the threat modeling team to better understand
the functionality exposed by the system, and what an attacker’s goals
might be.
Threat Modeling Process
Collect Model the Determine
Background System Threats
Information
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats /
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
50
Determine Threats
Enumerating threats creates a threat profile for
a system, describing all of the potential attacks
that should be mitigated against.
Threats with valid attack paths are
vulnerabilities.
The security of a system can be expressed in
terms of threats with appropriate mitigation vs.
total threats, taking into account the severity of
the threats with insufficient mitigation
(vulnerabilities).
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams/Process
Models
Internal Security
Notes
52
Enumerate Threats
Identifying threats, as the critical point in creating a
usable threat model, is appropriately the most difficult
step in the process.
The Threat Modeling team must take the information
produced up to this point and create attack hypotheses.
Enumerate Threats
It is important not to confuse threats with
vulnerabilities. A threat is simply what an
adversary might try to do to a protected
resource in the system. A vulnerability is
a specific way that a threat is exploitable
based on an unmitigated attack path.
Threats become more specific as the
process model becomes more specific.
Enumerate Threats
A key aspect to enumerating threats is understanding
specifications (and whether or not they are adhered to).
Protocol specifications, file format specifications, etc.
can define the adversary’s sandbox. While they are
often constrained by specifications, they can often
create spec-valid data that causes corruption or other
errors.
As specifications become more complex, the corner
cases that allow for spec-valid but malicious data
increase.
Note that if the system includes a parser for a given
specification, then the adversary will also try spec-
invalid data to attack the parser itself.
Enumerate Threats
Threats can apply a verb to an asset
(adversary does something to an asset):
Adversary captures [password data] using a sniffer.
Or, they can result in an asset:
Adversary supplies a path name that exceeds
MAX_PATH, causing a buffer overflow that may
result in the [ability to execute native code].
In either case, threats are verbs.
Using STRIDE
STRIDE is used to classify the effect of threats.
Spoofing. Spoofing allows an adversary to pose as another
user, component, or other system that has an identity in the
system being modeled.
Tampering. Tampering is the modification of data within the
system to achieve a malicious goal.
Repudiation. Repudiation is the ability of an adversary to
deny performing some malicious activity because the
system does not have sufficient evidence to prove
otherwise.
Information Disclosure. Information Disclosure is the
exposure of protected data to a user that is not otherwise
allowed access to that data.
Denial of Service. Denial of Service is when an adversary
can prevent legitimate users from using the normal
functionality of the system.
Elevation of Privilege. Elevation of Privilege is when and
* Some information taken from Writing Secure Code, 2 Edition
nd
adversary
Copyright Microsoft Corp. 2004
assumes a Trust Level with different privileges
Tool: Threats Table
Threats
Threat
ID 1
Name Adversary gains access to the remote administration interface resulting in access
to the phone configuration.
Description The Phone 1.0 has a remote administration interface that allows an authorized
user to configure it via the PSTN. The interface is disabled by default, but can be
enabled using the local keypad.
STRIDE Classification Tampering
Information Disclosure
Denial of Service
Elevation of Privilege
Mitigated? No
Known Mitigation If the remote administration interface is enabled, the end user should change the
default password.
Investigation Notes (none)
Threat
ID 2
Description The speed dial list has sensitive information (names and telephone numbers).
Mitigated? No
Known Mitigation
Related Use Scenarios:
(2) If the Phone 1.0 is installed in a location where…
Description Access to long distance can be restricted. Often it is not desirable for arbitrary
users to make long distance calls.
Each element in
TID 6.0 the DFD is
susceptible to
one or more
TID
SR 5.0 threat types
TID 7.0
1.0 STRI
DE
TID 8.0
10.0
STRI
SR DE
2.0. TID
11.0 9.0
TID
4.0
STRI
3.0DE
Use Scenarios
Entry Points
Implementation
Assumptions
Trust Levels
Analyze Threats/
Determine
External Security
Vulnerabilities
Notes
Data Flow
Diagrams /Process
Models
Internal Security
Notes
63
Formulate Attacks
Using threat trees
Threat trees start with what an attacker might try to
do to or with a protected resource (threat), and create
a tree of conditions that must be met in order obtain
access to that protected resource.
Each condition can be translated to a test that can be
performed programmatically or confirmed via code or
design review. Conditions may or may not have
mitigation, but do have DREAD ratings.
Access to one protected resource can facilitate
access to others. Chaining threat trees can create
more complex attacks (“attack chaining”).
1.3.1 1.3.2
1.1.1 1.1.2 1.2.1 1.2.2
Password is in Compromise
Sniff network ‘Phishing’ attack Password is weak Brute force attack
cleartext database
1.3.2.1 1.3.2.2
SQL injection Access database
Application
Defenses
Programming
Best Practice
attack directly
Infrastructure
Defenses
Close ports 1.3.2.2.1
1.3.2.2.2
Weak db account
Enforce strong
Copyright Microsoft Corp. 2004 to Internet Port open passwords
password(s)
69
Using DREAD
DREAD is a method of characterizing the risk
associated with a vulnerability. It is an acronym for
the following categories, and is calculated as an
average of values assigned to each of:
Damage Potential. Damage Potential ranks the extent of the
damage that occurs if a vulnerability is exploited.
Reproducibility. Reproducibility ranks how often an attempt
at exploiting a vulnerability works.
Exploitability. Exploitability assigns a number to the effort
required to exploit the vulnerability, and also considers
preconditions (such as whether the user must be
authenticated).
Affected Users. Affected Users is a numeric value
characterizing the ratio of installed instances of the system
that would be affected if an exploit became widely
available.
Discoverability. Discoverability is the likelihood that, if the
vulnerability were to go unpatched, it would be found by
external security researchers, hackers, etc.
* Some information taken from Writing Secure Code, 2 Edition
nd
Applying Risk
•Damage potential
Threat
•Affected Users
-or-
•Damage
Condition Condition
•Reproducibility
Condition Condition •Exploitability
•Discoverability
-or-
•Chance
Condition Condition Condition
Conclusion
Additional Resources
http://www.microsoft.com/downloads/details.aspx?FamilyID
=62830f95-0e61-4f87-88a6-e7c663444ac1&displaylang=en
Questions?
Definitions
Definitions
System: Anything that exposes functionality to
an end user. It can describe anything from a
single feature to a web application and its
supporting infrastructure.
Entry Point: A location where an external entity
interfaces with the component and component
processing begins. Examples include any
accessible API, or a socket endpoint.
Definitions
Asset: Those things, both concrete and
abstract, that could be targets of an attack by
an adversary.
Trust Level: A classification for an external
entity that interfaces to a component or
supplies it with data. It describes the
characteristics of that entity that are relevant to
security processing, such as credentials and
assumptions.
Definitions
Threat Path: A data or processing flow that
starts at an Entry Point. Threat Paths diagram
the critical processing that an external entity
can cause to execute. Threat Paths also
contain security-specific information, such as
process and trust boundaries.
Threat: What a malicious external entity bound
to a specific Access Category might try to do to
attack the processing along a threat path. A
Threat does not constitute a Vulnerability
Definitions
Effect Classification: Categorization of
the result of an adversary realizing a
Threat. Example: STRIDE
Vulnerability: A weakness in a system
that can be exploited by an external
entity. A Vulnerability exists when there
is a Threat that goes unmitigated.
Definitions
Attack Path: In a threat tree, an attack
path is a path from a leaf condition to the
root threat, inclusive of any anded
conditions.
Threat Profile: An enumeration of all
potential threats to a system, regardless
of whether that system is vulnerable to
them.
This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.
© 2001 Microsoft Corporation. All rights reserved.