56
Threat Modeling: Lessons from Star Wars Adam Shostack [email protected]

Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack [email protected]. Agenda –What is threat modeling?

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Threat Modeling:Lessons from

Star Wars

Adam [email protected]

Page 2: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Agenda

–What is threat modeling?

–A simple approach to threat modeling

–Top 10 lessons

Page 3: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What is threat modeling?

Page 4: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

A SIMPLE APPROACH TO

THREAT MODELING

Page 5: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

4 Questions

• What are you working on?

• What can go wrong?

• What are you going to do about it?

• Did you do an acceptable job at 1-3?

Page 6: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Web AppCustomer

DB

Our AppOur App

Content creation

What are you working on?

Page 7: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What are you working on?

• nmap

• tcpdump

• lsof

• strace/dtrace

• All help you create a model of the system being pentested

• Either with or without a copy of their threat model

Page 8: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What Are You Working On?

Page 9: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What are you working on?Data Flow Diagram example

Page 10: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What are you deploying? Network example

Page 11: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What Can Go Wrong?Remember STRIDE

Page 12: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Spoofing

By Lego Envy, http://www.eurobricks.com/forum/index.php?showtopic=64532

Page 13: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Tampering

http://pinlac.com/LegoDSTractorBeam.html

Page 14: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

RepudiationRepudiation

By Seb H http://www.flickr.com/photos/88048956@N04/8531040850/

Page 15: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Information Disclosure

Page 16: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Photo by Simon Liu http://www.flickr.com/photos/si-mocs/6999508124/

Information Disclosure(and impact)

Page 17: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Denial of Service

Model by Nathan Sawayahttp://brickartist.com/gallery/han-solo-in-carbonite/

Page 18: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Elevation of Privilege

http://www.flickr.com/photos/prodiffusion/

Page 19: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What Can Go Wrong?Remember STRIDE

Page 20: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What can go wrong? Kill Chains

• Harvesting email addresses, conference

information, etc.Reconnaissance

• Coupling exploit with backdoor into

deliverable payloadWeaponization

• Delivering weaponized bundle to the victim

via email, web, USB, etc.Delivery

• Exploiting a vulnerability to execute code

on victim’s systemExploitation

• Installing malware on the assetInstallation

• Command channel for remote

manipulation of victimCommand & Control (C2)

• With “Hands on Keyboard” access,

intruders accomplish their original goalActions on Objectives From/see also Sean Malone,

Extended Cyber Kill Chain, BlackHat 2016

Page 21: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

4 Questions

1. What are you working on?

2. What can go wrong?

3.3.3.3. What are you going to do about it?What are you going to do about it?What are you going to do about it?What are you going to do about it?

4.4.4.4. Did you do an acceptable job at 1Did you do an acceptable job at 1Did you do an acceptable job at 1Did you do an acceptable job at 1----3?3?3?3?

Page 22: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What Are You Going To Do About It? (sw eng edition)Threat Property Mitigation approach

Spoofing Authentication • Passwords, multi-factor authN

• Digital signatures

Tampering Integrity • Permissions/ACLs

• Digital signatures

Repudiation Non-Repudiation • Secure logging and auditing

• Digital Signatures

Information Disclosure Confidentiality • Encryption

• Permissions/ACLS

Denial of Service Availability • Permissions/ACLs

• Filtering

• Quotas

Elevation of privilege Authorization • Permissions/ACLs

• Input validation

Page 23: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What Are You Going To Do About It? – pentest edition

Threat Property Testing approach

Spoofing Authentication • THC Hydra

• SSLSpoof

Tampering Integrity • Burp

• emacs

Repudiation Non-Repudiation • (Unclear if this applies in a CTF)

Information Disclosure Confidentiality • Tcpdump/Wireshark

• Google

Denial of Service Availability • HULK

• PyLoris

Elevation of privilege Authorization • Metasploit

• Fuzzers

Page 24: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What Are You Going To Do? OWASP EditionOWASP Top 10 STRIDE Look when Threat

Modeling?

Injection Tampering Yes

Broken Auth/Session management Spoofing (initial, ongoing) Yes

XSS Tampering/EoP Maybe

Insecure Direct Object Refs EoP Yes

Security Misconfiguration ? Probably not

Sensitive data exposure Info Disclosure Maybe

Missing Function Level Access control EoP Probably not

CSRF Spoofing Probably not

Known Vulnerabilities No good map No

Redirects & Forwards ? Maybe

Page 25: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What are you going to do? CCM Edition

Page 26: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

What are you going to do? Portfolio Management

• See my RSA talk

“Security Leadership

Lessons From

The Dark Side”

Link: adam.shostack.org

Acme Data

Center

Iden. fy

(8%)

Protect

(39%)

Detect

(45%)

Respond

(8%)

Recover

(0)

Devices

(34%) 3 14 12 5

Apps

(22%) 2 5 15

Data

(3%) 3

Network

(30%) 15 15

People

(11%) 3 5 3

Page 27: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Top Ten Lessons

Page 28: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?
Page 29: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #1: “Search your feelings!”

• “Think Like An Attacker”

• Serious work is helped by structureFix

Trap

Page 30: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #2: “You’re Never Done Threat Modeling”

Model

Identify Threats

Mitigate

Validate

Model

Identify Threats

Mitigate

Validate

Page 31: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #3: “The Way To Threat Model Is…”

• Too much focus on specifics of how

– Use this framework (STRIDE)

– With this diagram type

• Focus on helping people find good threats

• Focus on different skills, systems

– Developers, operations, security, etc

Fix

Trap

Page 32: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Model

Identify Threats

Mitigate

Validate

Model

Identify Threats

Address Threats

Validate

Privacy

Trap #3: Monolithic ProcessesTrap Fix

Page 33: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Security mavens Experts in other areas

Trap #3: “The Way To Threat Model Is…”

Page 34: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #4: Threat Modeling as One Skill

• “I should learn to threat model”

• Think of techniques & repertoire

• Technique: DFDs, STRIDE, Attack trees

• Repertoire:

– Tools: SSLSpoof, Firesheep

– Books: Mitnick, Cuckoo's Egg

• All used to analogize & reason about new systems

Trap

Fix

Page 35: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #5: “Threat Modeling is Easy”

• Thinking your first threat model will be easy

• Metaphor: musical instrument…

• Understand that learning depends on easy tunes

• Accept not everyone wants to be a virtuoso

Trap

Fix

Page 36: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

We’ve got to give them more time!

Page 37: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #6: Threat Modeling is for Specialists

• Thinking TM is for specialists

• Make it like version control:

– Every developer, most sysadmins know some

– Some orgs have full time people managing trees

• This is a stretch goal for threat modeling

Trap

Fix

Page 38: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #7: The Wrong Focus

• Start from your assets

• Start by thinking about your attackers

• Threat modeling should focus on finding threats

• Remember trap #3: “The Way to threat model is”

• Starting from assets or attackers work for some people

Trap

Fix

Page 39: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #8: Not Having a Rebel Alliance

• Cost & feasibility of fixes changes along the supply chain

– Some threats are “easy” for a supplier to fix (OS behavior)

– Some threats are “easy” for a developer to fix (add logging)

– Some threats are “easy” for operations to fix (look at the logs)

• Think about an alliance along your supply chain

• Rebellions are built on

– Security Operations Guide

– Non-requirements

Trap

Fix hopethreat modeling

Page 40: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Requirements

Threats Mitigations

Requirements drive threats

Threats drive requirements

No mitigation? Simplify requirements

Threats need mitigation

Mitigations can be bypassed

Trap #9: Laser-Like Focus on Threats

Interplay of attacks, mitigations and requirements

Page 41: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?
Page 42: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Trap #10: Threat Modeling at the Wrong Time“Sir, we’ve analyzed their attack pattern, and there is a danger”

“Sir, we’ve analyzed their attack pattern, and there is a danger”

Page 43: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Summary

• Anyone can threat model, and everyone should…soon!

• The skills, techniques and repertoire can all be learned

• There are many traps

• Threat modeling is the way to

– Drive security through your product, service or system

– (Or demonstrate that it didn’t happen)

– Engage with leadership about security

Page 44: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Summary

• Anyone can threat model, and everyone should…soon!

• The skills, techniques and repertoire can all be learned

• There are many traps

• Threat modeling is the way to

– Drive security through your product, service or system

– Engage with leadership about security

Page 45: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

— George BoxGeorge BoxGeorge BoxGeorge Box

“All models are wrong, some “All models are wrong, some “All models are wrong, some “All models are wrong, some models are useful”models are useful”models are useful”models are useful”

Page 46: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Call to Action

• Remember the 4 questions

• Be proactive

– Find security issues early

– Fix them before they’re exploited

• Go threat model something!

• Drive threat modeling for your org

Page 47: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Questions?

Learning more:

• Threatmodelingbook.com site & book

• adam.shostack.org/blog/category/threat-modeling/

Page 48: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Questions?

Learning more:

• Threatmodelingbook.com site & book

• adam.shostack.org/blog/category/threat-modeling/

• Adam helps lots of organizations — get in touch!

[email protected] / +1 917-391-2168

Page 49: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Questions?

Resources:

• adam.shostack.org/blog/category/threat-modeling/

• This talk, linked from Threatmodelingbook.com resources page: https://youtu.be/-2zvfevLnp4

• The book!

Email: [email protected]

Page 50: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Thank you!

• Star Wars: Episodes IV-VI

• Great Creative Commons Lego brick art:– Lego Envy, http://www.eurobricks.com/forum/index.php?showtopic=64532

– http://pinlac.com/LegoDSTractorBeam.html

– Seb H http://www.flickr.com/photos/88048956@N04/8531040850/

– Simon Liu http://www.flickr.com/photos/si-mocs/6999508124/

– Kaitan Tylerguy http://www.flickr.com/photos/kaitan/3326772088/

– Nathan Sawaya, http://brickartist.com/gallery/han-solo-in-carbonite/

– http://www.flickr.com/photos/prodiffusion/

Page 51: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

BACKUP

Page 52: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Resources: Additional Books

• The Checklist Manifesto, Atul Gawande

• Thinking Fast & Slow, Daniel Kahneman

• The Cukoo’s Egg, Cliff Stoll

• Ghost in the Wires, Kevin Mitnick

• Understanding Privacy, Dan Solove

• Privacy in Context, Helen Nissenbaum

Page 53: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Threat Modeling: Designing For Security

Part I: Getting StartedPart I: Getting StartedPart I: Getting StartedPart I: Getting Started1. Dive in and threat model2. Strategies for threat modeling

Part II: Finding ThreatsPart II: Finding ThreatsPart II: Finding ThreatsPart II: Finding Threats3. STRIDE4. Attack Trees5. Attack Libraries6. Privacy Tools

Part III: Managing and Addressing Threats Part III: Managing and Addressing Threats Part III: Managing and Addressing Threats Part III: Managing and Addressing Threats 7: Processing and managing threats8. Defensive Building Blocks9. Tradeoffs when addressing threats10. Validating threats are addressed11. Threat modeling tools

Part IV: Threat modeling in technologies and tricky Part IV: Threat modeling in technologies and tricky Part IV: Threat modeling in technologies and tricky Part IV: Threat modeling in technologies and tricky areasareasareasareas

12. Requirements cookbook13. Web and cloud threats14. Accounts and Identity15. Human Factors and Usability16. Threats to cryptosystems

Part IV: Taking it to the next levelPart IV: Taking it to the next levelPart IV: Taking it to the next levelPart IV: Taking it to the next level17. Bringing threat modeling to your organization18. experimental approaches19 Architecting for success

AppendicesAppendicesAppendicesAppendices– Helpful tools, Threat trees, Attacker Lists, Elevation of Privilege (the cards), Case

studies

Page 54: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?
Page 55: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

Process

Data Store

SSSS T R I DT R I DT R I DT R I D EEEE

� �

� �����

� ��

� ��

ELEMENT

?

Data Flow

External Entity

Different Threats Affect Each Element Type

Page 56: Threat Modeling: Lessons from Star Wars Adam Shostack · 2017-06-26 · Threat Modeling: Lessons from Star Wars Adam Shostack adam@shostack.org. Agenda –What is threat modeling?

This isn’t the reputation you’re looking for…