SlideShare a Scribd company logo
Threat Modeling: Applied on a Publish-
Subscribe Architectural Style
Dr. Dharma Ganesan, Ph.D.,
dharmalingam.ganesan11@gmail.com
1
Disclaimer
The views expressed in the slides are my own
and not of my employer
2
Context of the Slides
• I was a Lecturer for “Secure Software Testing
and Construction” course (Fall 2015)
–at University of Maryland, College Park
• Threat modeling was introduced to graduate
students of this course
–Hands-on approach to modeling and security
3
Agenda
• Threat Modeling – Introduction
–First 30 slides are from a threat modeling book
–Got permission from the author of the book
•https://threatmodelingbook.com/
• Applying it on a simplified real-world system
–Publish-Subscribe architectural style
–Software Enterprise Bus
• Conclusion
4
Wouldn’t it be better to find
security issues before we write a
line of code?
So how can we do that?
5
Ways to Find Security Issues
• Static analysis of code
• Fuzzing or other dynamic testing
• Pen test/red team
• Wait for bug reports after release
• These issues are detected later in the process
6
Ways to Find Security Issues (2)
• Threat modeling!
– Think about security issues early
– Understand our requirements better
– Don’t write security bugs into the code
7
So…how do we threat model?
8
How to Threat Model (Summary)
• What are we building?
• What can go wrong?
• What are we going to do about it?
9
What Are We Building?
• Create a model of the
software/system/technology
• A model abstracts away the details so you can
look at the whole
– Diagraming is a key approach
– Mathematical models rare in commercial environs
• Software models for threat modeling usually
focus on data flows and boundaries
• DFDs, “swim lanes,” state machines can all
help (next slides)
10
DFD (Data Flow Diagram)
• Developed in the early 70s, and still useful
– Simple: easy to learn, sketch
– Threats often follow data
• Abstracts programs into:
– Processes: your code
– Data stores: files, databases, shared memory
– Data flows: connect processes to other elements
– External entities: everything but your code & data.
Includes people & cloud software
– Trust boundaries now made explicit 11
Data Flow Diagram (Example)
12
Swim Lane Diagrams
• Show two or more entities
communicating, each “in a lane”
• Useful for network
communication
• Lanes have implicit boundaries
between them
13
State Machines
• Helpful for considering what changes
security state
– For example, unauthenticated to
authenticated
– User to root/admin
• Rarely shows boundaries
14
How to Threat Model (Summary)
• What are we building?
• What can go wrong?
• What are we going to do about it?
15
What Can Go Wrong?
• Fun to brainstorm
• Mnemonics, trees or libraries of threats can all
help structure thinking
• Structure helps get you towards completeness
and predictability
• STRIDE is a mnemonic
– Spoofing, Tampering, Repudiation, Information
Disclosure, Denial of Service, Elevation of Privilege
– Easy, right?
16
Spoofing
By Lego Envy, http://www.eurobricks.com/forum/index.php?showtopic=64532
17
Tampering
http://pinlac.com/LegoDSTractorBeam.html
18
RepudiationRepudiation
By Seb H http://www.flickr.com/photos/88048956@N04/8531040850/ 19
Information DisclosureInformation Disclosure
20
Denial of Service
Model by Nathan Sawaya
http://brickartist.com/gallery/han-solo-in-carbonite/
21
Elevation of Privilege
http://www.flickr.com/photos/prodiffusion/
22
STRIDE
Threat Property
Violated
Definition Example
Spoofing Authentication Impersonating
something or someone
else.
Pretending to be any of Bill Gates, Paypal.com
or ntdll.dll
Tampering Integrity Modifying data or code Modifying a DLL on disk or DVD, or a packet as it
traverses the network
Repudiation Non-repudiation Claiming to have not
performed an action.
“I didn’t send that email,” “I didn’t modify that
file,” “I certainly didn’t visit that web site, dear!”
Information
Disclosure
Confidentiality Exposing information
to someone not
authorized to see it
Allowing someone to read the Windows source
code; publishing a list of customers to a web
site.
Denial of Service Availability Deny or degrade
service to users
Crashing Windows or a web site, sending a
packet and absorbing seconds of CPU time, or
routing packets into a black hole.
Elevation of Privilege Authorization Gain capabilities
without proper
authorization
Allowing a remote internet user to run
commands is the classic example, but going
from a limited user to admin is also EoP.
23
Using STRIDE
• Consider how each STRIDE threat could
impact each part of the model
– “How could a clever attacker spoof this part of the
system?...tamper with?… etc.”
• Easier with aids
– Elevation of Privilege game
– Attack trees (see Threat Modeling: Designing for Security, Appendix B)
– Experience
24
What Can Go Wrong?
• Track issues as we find them
– “attacker could pretend to be a client & connect”
• Track assumptions
– “I think that connection is always over SSL”
• Both lists are inputs to “what are we going to
do about it”
25
How to Threat Model (Summary)
• What are we building?
• What can go wrong?
• What are we going to do about it?
26
What Are You Going to Do About It?
• For each threat:
– Fix it!
– Mitigate with standard or custom approaches
– Accept it?
– Transfer the risk?
• For each assumption:
– Check it
– Wrong assumptions lead to reconsider what goes
wrong
27
Fix It!
• The best way to fix a security bug is to remove
functionality
– For example, if SSL doesn’t have a “heartbeat”
message, the “heartbleed bug” couldn’t exist
– You can only take this so far
– Oftentimes end up making risk tradeoffs
• Mitigate the risk in various ways (next slide)
28
Mitigate
• Add/use technology to prevent attacks
• For example, prevent tampering:
– Network: Digital signatures, cryptographic integrity
tools, crypto tunnels such as SSH or IPsec
• Developers, sysadmins have different toolkits for
mitigating problems
• Standard approaches available which have been
tested & worked through
• Sometimes you need a custom approach
29
Some Technical Ways to Address
Threat Mitigation Technology Developer Example Sysadmin Example
Spoofing Authentication Digital signatures, Active
directory, LDAP
Passwords, crypto
tunnels
Tampering Integrity, permissions Digital signatures ACLs/permissions,
crypto tunnels
Repudiation Fraud prevention,
logging, signatures
Customer history risk
management
Logging
Information
disclosure
Permissions,
encryption
Permissions (local), PGP,
SSL
Crypto tunnels
Denial of service Availability Elastic cloud design Load balancers, more
capacity
Elevation of
privilege
Authorization, isolation Roles, privileges, input
validation for purpose,
(fuzzing*)
Sandboxes, firewalls
* Fuzzing/fault injection is not a mitigation, but a great testing technique
See chapter 8, Threat Modeling for more
30
Agenda
• Threat Modeling – Introduction
• Applying it on a simplified real-world system
• Conclusions
31
Can we identify threats of this
sample architecture?
32
The system we analzed is quite similar to this architectural style
Threat modeling of a bus
• A software bus for component/application
communication
• Ideal for developing distributed systems
• Publish-subscribe architectural style
–Components publish messages
–The bus routes the messages to subscribers
based on the message subject/topic
•Let us enumerate STRIDE for this architecture
33
Input artifacts to our review
• Software architecture
• API documentation
• Test cases
• Source code
34
S - Spoofing (sample threats)
• We reviewed the initial design and APIs
• It turned out that is no method for verifying the authenticity of
the bus, another system could impersonate the bus, responding to
calls as if it were the bus.
• This could be mitigated by using a system of authentication (e.g.
public key cryptography) between the applications and the bus.
35
S - Spoofing (sample)
•An unauthorized application could impersonate
another application by publishing messages which
would normally be published only by a particular
application.
•An attacker could unsubscribe legitimate
applications from the bus.
•These issues could be mitigated by using
authentication and authorization controls
36
T - Tampering (sample)
• Because the messages are not encrypted,
messages can be intercepted and modified.
• For example, while a legitimate application tries
to subscribe to a particular topic the message is
intercepted and the subscriber is subscribed to a
different topic.
• This could be mitigated by encrypting messages
between the applications and the bus.
37
R - Repudiation (sample)
• There does not appear to be any method to
enforce non-repudiation in the system.
• For example, there does not appear to be any
logging of published messages, or tracking of who
originally sent messages
• It would be possible for someone to create a fake
message and say that it was a published message
received from the bus.
38
R - Repudiation (sample)
• An application could also claim that it
published a message when in fact it did not
do so.
• Alternatively (or in addition), messages could
be digitally signed and timestamped so as to
guarantee the sender and recipient of the
data, and the time of the occurrence.
39
I - Information Disclosure (sample)
• The APIs show no evidence of encryption of data-
in-transit
• Because messages are not encrypted, it is possible
to eavesdrop on the messages sent between the
bus and the applications.
• This could be mitigated through encryption.
40
I - Information Disclosure (sample)
•An application could subscribe to the topic “.*” (a
regular expression for “everything”), thereby
matching all messages destined for all applications.
•This would be a way for an evil application to view
all messages without even knowing the available
topics.
•Since XML is the messaging format, xml entity
injection could be used to steal files
41
I - Information Disclosure (sample)
•This could be mitigated by adding some
restrictions to wildcard usage of message subjects
•Or by limiting the set of message subjects to a pre-
defined set rather than allowing regular
expressions.
42
D - Denial of Service (sample)
• An application could prevent other applications
from accessing the bus by impersonating the bus
and sending disconnect messages to other
applications.
• Similarly, an application could send unsubscribe
messages to prevent the other applications from
receiving data.
43
D - Denial of Service (sample)
•Because messages are in XML, the system may be
vulnerable XML bombs which may crash the bus
–This could be mitigated by carefully ensuring
proper parsing of inputs to the bus.
•An application can make too many connections to
the bus.
–This could be mitigated by limiting the # of
connections
44
E - Elevation of Privilege (sample)
• It may be possible to craft a particular XML input
which would be incorrectly parsed
– For example, XML injection to run remote code
• Large messages may trigger buffer overflows and
remote code execution
– This could be mitigated by introducing
appropriate compiler flags
• (e.g. DEP prevention, stack canaries, etc)
– Of course, length check in the source code, too
45
Deriving security requirements using
threat modeling - (sample)
• Based on the threats described above, below are
recommended high-level security requirements for
the software bus:
1) All traffic between the bus and the applications
must be encrypted using strong encryption.
2) There must be mutual authentication between the
bus and each application.
46
Deriving security requirements using
threat modeling - (sample)
3) Messages transmitted between the bus and the
applications should be digitally signed and
timestamped in order to prevent repudiation and
spoofing.
4) The bus should contain a whitelist of applications
which are allowed to subscribe to particular
applications. This will prevent information disclosure
by ensuring that messages are only seen by the
proper applications.
47
Conclusion
• Threat Modeling using STRIDE helps in
identifying security requirements
• STRIDE facilitates systematic enumeration of
threats based on software architecture
• For every architectural style, the list of
threats and mitigation strategies can be
reused!
48
Conclusion ...
• An organization could build a library of threats for
each architectural style
• The identified threats become security bugs to
address
• 4 questions to remember
–What are you building?
– What can go wrong?
– What are you going to do about it
– Checking your work
•Reference: https://threatmodelingbook.com
49
Acknowledgment
• Mr. Caudill Nathan (Cyber Security Graduate)
–For working out the details using STRIDE
• Mr. Adam Shostack
https://threatmodelingbook.com/
50

More Related Content

PPTX
Misp(malware information sharing platform)
PPTX
Application Threat Modeling
PPTX
WannaCry ransomware outbreak - what you need to know
PPTX
ip security
PDF
Threat Modeling Everything
PPTX
Cyber Threat Modeling
PDF
Secure Design: Threat Modeling
PDF
Zero Trust Model
Misp(malware information sharing platform)
Application Threat Modeling
WannaCry ransomware outbreak - what you need to know
ip security
Threat Modeling Everything
Cyber Threat Modeling
Secure Design: Threat Modeling
Zero Trust Model

What's hot (20)

PPT
Cryptography and network security
PDF
How to become a Cybersecurity Engineer? | Cybersecurity Salary | Cybersecurit...
PPT
Digital Certificate
PPTX
Cyber Threat Hunting with Phirelight
PPTX
Security Training: #3 Threat Modelling - Practices and Tools
PDF
Knowledge for the masses: Storytelling with ATT&CK
PPTX
7 Steps to Threat Modeling
PDF
Next Generation Memory Forensics
PDF
Secure Code Review 101
PDF
Cyber Threat Intelligence
PDF
Building the Security Operations and SIEM Use CAse
PDF
Wired and Wireless Network Forensics
PPTX
ARP Spoofing.pptx
PDF
2020 FRSecure CISSP Mentor Program - Class 5
PPTX
Understanding cyber resilience
PDF
Defence in Depth Architectural Decisions
PPTX
Distributed denial-of-service (DDoS) attack || Seminar Report @ gestyy.com/...
PDF
Security operations center-SOC Presentation-مرکز عملیات امنیت
PPSX
2 Security Architecture+Design
PPTX
Image encryption using aes key expansion
Cryptography and network security
How to become a Cybersecurity Engineer? | Cybersecurity Salary | Cybersecurit...
Digital Certificate
Cyber Threat Hunting with Phirelight
Security Training: #3 Threat Modelling - Practices and Tools
Knowledge for the masses: Storytelling with ATT&CK
7 Steps to Threat Modeling
Next Generation Memory Forensics
Secure Code Review 101
Cyber Threat Intelligence
Building the Security Operations and SIEM Use CAse
Wired and Wireless Network Forensics
ARP Spoofing.pptx
2020 FRSecure CISSP Mentor Program - Class 5
Understanding cyber resilience
Defence in Depth Architectural Decisions
Distributed denial-of-service (DDoS) attack || Seminar Report @ gestyy.com/...
Security operations center-SOC Presentation-مرکز عملیات امنیت
2 Security Architecture+Design
Image encryption using aes key expansion
Ad

Viewers also liked (11)

PDF
Exploiting Cryptographic Misuse - An Example
PPTX
Linux binary analysis and exploitation
PPTX
Explaining my Phd Thesis to layman
PPTX
Model-based Testing of a Software Bus - Applied on Core Flight Executive
PPTX
Load-time Hacking using LD_PRELOAD
PDF
Carbon Finance
PDF
Reverse Engineering of Software Architecture
PDF
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
PDF
Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study
PDF
Automated Test Case Generation and Execution from Models
PDF
Ethical hacking & Information Security
Exploiting Cryptographic Misuse - An Example
Linux binary analysis and exploitation
Explaining my Phd Thesis to layman
Model-based Testing of a Software Bus - Applied on Core Flight Executive
Load-time Hacking using LD_PRELOAD
Carbon Finance
Reverse Engineering of Software Architecture
How to Release Rock-solid RESTful APIs and Ice the Testing BackBlob
Model-based Testing using Microsoft’s Spec Explorer Tool: A Case Study
Automated Test Case Generation and Execution from Models
Ethical hacking & Information Security
Ad

Similar to Threat Modeling: Applied on a Publish-Subscribe Architectural Style (20)

PPTX
Architecting for Security Resilience
PPTX
Threat Modeling - Locking the Door to Vulnerabilities
PPTX
Threat Modeling-modélisation_de_menaces.pptx
DOCX
Residency ResearchISOL 536 Security Architecture and Design.docx
PDF
Threat Modeling workshop by Robert Hurlbut
PPTX
Threat Modeling In 2021
PPTX
Secure Design: Threat Modeling
DOCX
ISOL 536Security Architecture and DesignThreat Modeling.docx
PDF
Threat Modeling to Reduce Software Security Risk
PPTX
Threat modelling(system + enterprise)
PPTX
The security mindset securing social media integrations and social learning...
PDF
Session2-Application Threat Modeling
PPTX
Application Security Architecture and Threat Modelling
PDF
Application Threat Modeling
PDF
Application Threat Modeling In Risk Management
PPTX
Threat Modeling And Analysis
PPTX
Lecture-10 about language of community.pptx
PPTX
Understanding Application Threat Modelling & Architecture
Architecting for Security Resilience
Threat Modeling - Locking the Door to Vulnerabilities
Threat Modeling-modélisation_de_menaces.pptx
Residency ResearchISOL 536 Security Architecture and Design.docx
Threat Modeling workshop by Robert Hurlbut
Threat Modeling In 2021
Secure Design: Threat Modeling
ISOL 536Security Architecture and DesignThreat Modeling.docx
Threat Modeling to Reduce Software Security Risk
Threat modelling(system + enterprise)
The security mindset securing social media integrations and social learning...
Session2-Application Threat Modeling
Application Security Architecture and Threat Modelling
Application Threat Modeling
Application Threat Modeling In Risk Management
Threat Modeling And Analysis
Lecture-10 about language of community.pptx
Understanding Application Threat Modelling & Architecture

More from Dharmalingam Ganesan (20)

PDF
.NET Deserialization Attacks
PDF
Reverse Architecting using Relation Algebra.pdf
PDF
How to exploit rand()?
PDF
Cyclic Attacks on the RSA Trapdoor Function
PDF
An Analysis of RSA Public Exponent e
PDF
An Analysis of Secure Remote Password (SRP)
PDF
Thank-a-Gram
PDF
Active Attacks on DH Key Exchange
PDF
Can I write to a read only file ?
PPTX
How do computers exchange secrets using Math?
PDF
On the Secrecy of RSA Private Keys
PDF
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
PDF
Analysis of Short RSA Secret Exponent d
PDF
Dependency Analysis of RSA Private Variables
PDF
Analysis of Shared RSA Modulus
PDF
RSA Game using an Oracle
PDF
RSA Two Person Game
PDF
RSA without Integrity Checks
PPTX
RSA without Padding
PDF
Solutions to online rsa factoring challenges
.NET Deserialization Attacks
Reverse Architecting using Relation Algebra.pdf
How to exploit rand()?
Cyclic Attacks on the RSA Trapdoor Function
An Analysis of RSA Public Exponent e
An Analysis of Secure Remote Password (SRP)
Thank-a-Gram
Active Attacks on DH Key Exchange
Can I write to a read only file ?
How do computers exchange secrets using Math?
On the Secrecy of RSA Private Keys
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Analysis of Short RSA Secret Exponent d
Dependency Analysis of RSA Private Variables
Analysis of Shared RSA Modulus
RSA Game using an Oracle
RSA Two Person Game
RSA without Integrity Checks
RSA without Padding
Solutions to online rsa factoring challenges

Recently uploaded (20)

PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
history of c programming in notes for students .pptx
PDF
Nekopoi APK 2025 free lastest update
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Transform Your Business with a Software ERP System
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
System and Network Administration Chapter 2
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
top salesforce developer skills in 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
history of c programming in notes for students .pptx
Nekopoi APK 2025 free lastest update
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms II-SECS-1021-03
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Transform Your Business with a Software ERP System
Operating system designcfffgfgggggggvggggggggg
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
System and Network Administration Chapter 2
How Creative Agencies Leverage Project Management Software.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Illustrator 28.6 Crack My Vision of Vector Design
top salesforce developer skills in 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
How to Choose the Right IT Partner for Your Business in Malaysia
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf

Threat Modeling: Applied on a Publish-Subscribe Architectural Style

  • 1. Threat Modeling: Applied on a Publish- Subscribe Architectural Style Dr. Dharma Ganesan, Ph.D., dharmalingam.ganesan11@gmail.com 1
  • 2. Disclaimer The views expressed in the slides are my own and not of my employer 2
  • 3. Context of the Slides • I was a Lecturer for “Secure Software Testing and Construction” course (Fall 2015) –at University of Maryland, College Park • Threat modeling was introduced to graduate students of this course –Hands-on approach to modeling and security 3
  • 4. Agenda • Threat Modeling – Introduction –First 30 slides are from a threat modeling book –Got permission from the author of the book •https://threatmodelingbook.com/ • Applying it on a simplified real-world system –Publish-Subscribe architectural style –Software Enterprise Bus • Conclusion 4
  • 5. Wouldn’t it be better to find security issues before we write a line of code? So how can we do that? 5
  • 6. Ways to Find Security Issues • Static analysis of code • Fuzzing or other dynamic testing • Pen test/red team • Wait for bug reports after release • These issues are detected later in the process 6
  • 7. Ways to Find Security Issues (2) • Threat modeling! – Think about security issues early – Understand our requirements better – Don’t write security bugs into the code 7
  • 8. So…how do we threat model? 8
  • 9. How to Threat Model (Summary) • What are we building? • What can go wrong? • What are we going to do about it? 9
  • 10. What Are We Building? • Create a model of the software/system/technology • A model abstracts away the details so you can look at the whole – Diagraming is a key approach – Mathematical models rare in commercial environs • Software models for threat modeling usually focus on data flows and boundaries • DFDs, “swim lanes,” state machines can all help (next slides) 10
  • 11. DFD (Data Flow Diagram) • Developed in the early 70s, and still useful – Simple: easy to learn, sketch – Threats often follow data • Abstracts programs into: – Processes: your code – Data stores: files, databases, shared memory – Data flows: connect processes to other elements – External entities: everything but your code & data. Includes people & cloud software – Trust boundaries now made explicit 11
  • 12. Data Flow Diagram (Example) 12
  • 13. Swim Lane Diagrams • Show two or more entities communicating, each “in a lane” • Useful for network communication • Lanes have implicit boundaries between them 13
  • 14. State Machines • Helpful for considering what changes security state – For example, unauthenticated to authenticated – User to root/admin • Rarely shows boundaries 14
  • 15. How to Threat Model (Summary) • What are we building? • What can go wrong? • What are we going to do about it? 15
  • 16. What Can Go Wrong? • Fun to brainstorm • Mnemonics, trees or libraries of threats can all help structure thinking • Structure helps get you towards completeness and predictability • STRIDE is a mnemonic – Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege – Easy, right? 16
  • 17. Spoofing By Lego Envy, http://www.eurobricks.com/forum/index.php?showtopic=64532 17
  • 19. RepudiationRepudiation By Seb H http://www.flickr.com/photos/88048956@N04/8531040850/ 19
  • 21. Denial of Service Model by Nathan Sawaya http://brickartist.com/gallery/han-solo-in-carbonite/ 21
  • 23. STRIDE Threat Property Violated Definition Example Spoofing Authentication Impersonating something or someone else. Pretending to be any of Bill Gates, Paypal.com or ntdll.dll Tampering Integrity Modifying data or code Modifying a DLL on disk or DVD, or a packet as it traverses the network Repudiation Non-repudiation Claiming to have not performed an action. “I didn’t send that email,” “I didn’t modify that file,” “I certainly didn’t visit that web site, dear!” Information Disclosure Confidentiality Exposing information to someone not authorized to see it Allowing someone to read the Windows source code; publishing a list of customers to a web site. Denial of Service Availability Deny or degrade service to users Crashing Windows or a web site, sending a packet and absorbing seconds of CPU time, or routing packets into a black hole. Elevation of Privilege Authorization Gain capabilities without proper authorization Allowing a remote internet user to run commands is the classic example, but going from a limited user to admin is also EoP. 23
  • 24. Using STRIDE • Consider how each STRIDE threat could impact each part of the model – “How could a clever attacker spoof this part of the system?...tamper with?… etc.” • Easier with aids – Elevation of Privilege game – Attack trees (see Threat Modeling: Designing for Security, Appendix B) – Experience 24
  • 25. What Can Go Wrong? • Track issues as we find them – “attacker could pretend to be a client & connect” • Track assumptions – “I think that connection is always over SSL” • Both lists are inputs to “what are we going to do about it” 25
  • 26. How to Threat Model (Summary) • What are we building? • What can go wrong? • What are we going to do about it? 26
  • 27. What Are You Going to Do About It? • For each threat: – Fix it! – Mitigate with standard or custom approaches – Accept it? – Transfer the risk? • For each assumption: – Check it – Wrong assumptions lead to reconsider what goes wrong 27
  • 28. Fix It! • The best way to fix a security bug is to remove functionality – For example, if SSL doesn’t have a “heartbeat” message, the “heartbleed bug” couldn’t exist – You can only take this so far – Oftentimes end up making risk tradeoffs • Mitigate the risk in various ways (next slide) 28
  • 29. Mitigate • Add/use technology to prevent attacks • For example, prevent tampering: – Network: Digital signatures, cryptographic integrity tools, crypto tunnels such as SSH or IPsec • Developers, sysadmins have different toolkits for mitigating problems • Standard approaches available which have been tested & worked through • Sometimes you need a custom approach 29
  • 30. Some Technical Ways to Address Threat Mitigation Technology Developer Example Sysadmin Example Spoofing Authentication Digital signatures, Active directory, LDAP Passwords, crypto tunnels Tampering Integrity, permissions Digital signatures ACLs/permissions, crypto tunnels Repudiation Fraud prevention, logging, signatures Customer history risk management Logging Information disclosure Permissions, encryption Permissions (local), PGP, SSL Crypto tunnels Denial of service Availability Elastic cloud design Load balancers, more capacity Elevation of privilege Authorization, isolation Roles, privileges, input validation for purpose, (fuzzing*) Sandboxes, firewalls * Fuzzing/fault injection is not a mitigation, but a great testing technique See chapter 8, Threat Modeling for more 30
  • 31. Agenda • Threat Modeling – Introduction • Applying it on a simplified real-world system • Conclusions 31
  • 32. Can we identify threats of this sample architecture? 32 The system we analzed is quite similar to this architectural style
  • 33. Threat modeling of a bus • A software bus for component/application communication • Ideal for developing distributed systems • Publish-subscribe architectural style –Components publish messages –The bus routes the messages to subscribers based on the message subject/topic •Let us enumerate STRIDE for this architecture 33
  • 34. Input artifacts to our review • Software architecture • API documentation • Test cases • Source code 34
  • 35. S - Spoofing (sample threats) • We reviewed the initial design and APIs • It turned out that is no method for verifying the authenticity of the bus, another system could impersonate the bus, responding to calls as if it were the bus. • This could be mitigated by using a system of authentication (e.g. public key cryptography) between the applications and the bus. 35
  • 36. S - Spoofing (sample) •An unauthorized application could impersonate another application by publishing messages which would normally be published only by a particular application. •An attacker could unsubscribe legitimate applications from the bus. •These issues could be mitigated by using authentication and authorization controls 36
  • 37. T - Tampering (sample) • Because the messages are not encrypted, messages can be intercepted and modified. • For example, while a legitimate application tries to subscribe to a particular topic the message is intercepted and the subscriber is subscribed to a different topic. • This could be mitigated by encrypting messages between the applications and the bus. 37
  • 38. R - Repudiation (sample) • There does not appear to be any method to enforce non-repudiation in the system. • For example, there does not appear to be any logging of published messages, or tracking of who originally sent messages • It would be possible for someone to create a fake message and say that it was a published message received from the bus. 38
  • 39. R - Repudiation (sample) • An application could also claim that it published a message when in fact it did not do so. • Alternatively (or in addition), messages could be digitally signed and timestamped so as to guarantee the sender and recipient of the data, and the time of the occurrence. 39
  • 40. I - Information Disclosure (sample) • The APIs show no evidence of encryption of data- in-transit • Because messages are not encrypted, it is possible to eavesdrop on the messages sent between the bus and the applications. • This could be mitigated through encryption. 40
  • 41. I - Information Disclosure (sample) •An application could subscribe to the topic “.*” (a regular expression for “everything”), thereby matching all messages destined for all applications. •This would be a way for an evil application to view all messages without even knowing the available topics. •Since XML is the messaging format, xml entity injection could be used to steal files 41
  • 42. I - Information Disclosure (sample) •This could be mitigated by adding some restrictions to wildcard usage of message subjects •Or by limiting the set of message subjects to a pre- defined set rather than allowing regular expressions. 42
  • 43. D - Denial of Service (sample) • An application could prevent other applications from accessing the bus by impersonating the bus and sending disconnect messages to other applications. • Similarly, an application could send unsubscribe messages to prevent the other applications from receiving data. 43
  • 44. D - Denial of Service (sample) •Because messages are in XML, the system may be vulnerable XML bombs which may crash the bus –This could be mitigated by carefully ensuring proper parsing of inputs to the bus. •An application can make too many connections to the bus. –This could be mitigated by limiting the # of connections 44
  • 45. E - Elevation of Privilege (sample) • It may be possible to craft a particular XML input which would be incorrectly parsed – For example, XML injection to run remote code • Large messages may trigger buffer overflows and remote code execution – This could be mitigated by introducing appropriate compiler flags • (e.g. DEP prevention, stack canaries, etc) – Of course, length check in the source code, too 45
  • 46. Deriving security requirements using threat modeling - (sample) • Based on the threats described above, below are recommended high-level security requirements for the software bus: 1) All traffic between the bus and the applications must be encrypted using strong encryption. 2) There must be mutual authentication between the bus and each application. 46
  • 47. Deriving security requirements using threat modeling - (sample) 3) Messages transmitted between the bus and the applications should be digitally signed and timestamped in order to prevent repudiation and spoofing. 4) The bus should contain a whitelist of applications which are allowed to subscribe to particular applications. This will prevent information disclosure by ensuring that messages are only seen by the proper applications. 47
  • 48. Conclusion • Threat Modeling using STRIDE helps in identifying security requirements • STRIDE facilitates systematic enumeration of threats based on software architecture • For every architectural style, the list of threats and mitigation strategies can be reused! 48
  • 49. Conclusion ... • An organization could build a library of threats for each architectural style • The identified threats become security bugs to address • 4 questions to remember –What are you building? – What can go wrong? – What are you going to do about it – Checking your work •Reference: https://threatmodelingbook.com 49
  • 50. Acknowledgment • Mr. Caudill Nathan (Cyber Security Graduate) –For working out the details using STRIDE • Mr. Adam Shostack https://threatmodelingbook.com/ 50