Security Testing: How Security Testing Is Different Types of Security Attacks Threat Modelling
Security Testing: How Security Testing Is Different Types of Security Attacks Threat Modelling
Security Testing: How Security Testing Is Different Types of Security Attacks Threat Modelling
¾ Analogy:
– A fault may remain latent, or may be surfaced as a failure when the
code is executed
– A vulnerability may remain latent, or may be exploited by an attacker,
enabling an attack
Based on: Graff, Mark G. and van Wyk, Kenneth R., Secure Coding: Principles and Practices, O’Reilly, 2003.
Beware of Side Effects
Unreachable code?
Look at code
coverage.
Thompson, Herbert, Why Security Testing is Hard, IEEE Security and Privacy, July/Aug 2003, pp. 83-86.
Four general classes of security attacks
¾ Dependencies
– Application may inherit vulnerabilities from components its
dependant upon
– Libraries that contain security service may fail (so application must
respond securely – defense in depth!)
¾ Unanticipated user input
– Reserved words, escape characters, long strings, boundary values
¾ Expose design vulnerabilities
– Esp. Ports open, insecure default values, test instrumentation
interwoven with implementation code [that can explicitly bypass
security for ease of testing]
¾ Expose implementation vulnerabilities
– Developers only understand their piece, may expose data
I. Alexander, "Misuse Cases: Use Cases with Hostile Intent," IEEE Software, vol. 20, no. 1, pp. 58-66, January/February
2003.
Threat modeling
¾ Security-based analysis that helps people determine the
highest level risks posed to the product and how threats
manifest themselves
¾ Decompose the application (data flow diagram, DFD) to
investigate the components, or assets or threat targets,
of the application and how data flows between them.
– Treat targets are: every data source, process, data flow, and interactor
¾ Using STRIDE, identify threats for each treat target.
These serve as the roots for the threat trees; there is one
tree per threat goal.
– Threats should have at least one test case in the test plan [realistically,
the higher-risk threats]
¾ Build one or more threat trees for each threat target, as
appropriate (risk-based choice).
¾ Using DREAD (or some other threat ranking method,
determine the security risk for each threat tree.
Howard, M. and Leblanc, D. Writing Secure Code, Microsoft Press, 2003.
Data Flow Diagram (DFD): Symbols
A process. Transforms or manipulates data.
http://www.microsoft.com/whdc/driver/security/threatmodel.mspx
Data Flow Diagram (DFD): Sample
(modified)
http://www.microsoft.com/whdc/driver/security/threatmodel.mspx
Simple rules for DFD entities:
¾ A process must have at least one data flow entering
and one data flow exiting.
¾ All data flows start or stop at a process.
¾ Data stores cannot connect together, they must pass
through a process.
¾ Process names are verbs and nouns or verb phrases
(e.g. Process stock symbol, evaluate exam grade)
¾ Data flow names are nouns or noun phrases (e.g. Stock
price, Exam score)
¾ Interactor names are nouns (e.g. Stock broker)
¾ Data store names are nouns (e.g. Realtime stock data,
Exam result data)
The ultimate
threat; the goal of
the attacker.
Conditions
and/or steps to
carry out the
attack.
http://msdn.microsoft.com/security/securecode/threatmodeling
Microsoft Security Risk
Management: DREAD
http://msdn.microsoft.com/security/securecode/threatmodeling
Consider your project
¾ Draw a DFD diagram.
¾ Draw 2-3 attack trees, maybe based upon your scenario
(misuse case).
¾ Create test cases for those attack trees.
¾ Resource:
http://www.microsoft.com/whdc/driver/security/threatmodel.mspx
References
¾ Graff, Mark G. and van Wyk, Kenneth R., Secure
Coding: Principles and Practices, O’Reilly, 2003.
¾ Howard, M. and LeBlanc, D., Writing Secure Code,
Microsoft Press, 2003.
¾ Thompson, H., Why Security Testing is Hard, IEEE
Security and Privacy, July/Aug 2003, pp. 83-86.
¾ Whittaker, J., How to Break Software Security,
Addison Wesley, 2004.