STRIDE Threat Modeling for Beginners - In 20 Minutes

Netsec Explained
23 Oct 202321:49

Summary

TLDRThis engaging video from NetC Explained dives into the often overlooked but crucial aspect of cybersecurity: threat modeling. The host demystifies the concept, making it accessible and intriguing, especially for those new to the field. Viewers learn to create Data Flow Diagrams, identify trust boundaries, and evaluate the strengths and weaknesses of an application, using a simplified stride framework. Real-world examples, like a railway reservation system and a college library website, illustrate the process. The video emphasizes collaboration across teams and the proactive integration of security measures in the development lifecycle, promising not just theoretical knowledge but practical tools to enhance application security and potentially save significant resources.

Takeaways

  • πŸ” Threat modeling is a crucial, yet often overlooked part of security that involves understanding the details of an application to identify and address potential threats.
  • πŸš€ Understanding threat modeling can significantly reduce time, headaches, and financial costs for consultants and clients alike.
  • πŸ“ˆ The basics of threat modeling involve creating a Data Flow Diagram (DFD), labeling trust boundaries, and identifying the strengths and weaknesses of an application.
  • πŸ› οΈ The OWASP threat modeling process is recommended for further detailed guidance beyond the basics.
  • πŸ“Š DFDs are used in threat modeling to visualize data flow within systems, varying in detail from level 0 (least detailed) to level 5 (most detailed).
  • πŸ” Trust boundaries in DFDs help identify where trust levels change within the system, crucial for spotting potential security vulnerabilities.
  • πŸ—’οΈ Utilizing frameworks like STRIDE within threat modeling helps systematically identify and address various types of security threats.
  • 🀝 Threat modeling should be a collaborative and ongoing process involving multiple stakeholders to ensure comprehensive security coverage.
  • πŸ•’ The time required for threat modeling can vary, but it is an essential investment for securing applications effectively.
  • πŸŽ“ Proper threat modeling can empower developers, improve application security, and should ideally be conducted before writing any code or making significant changes.

Q & A

  • What is threat modeling and why is it important?

    -Threat modeling is a process used to identify and assess potential threats to a system, including the strengths and weaknesses of the application. It is important because it helps in understanding the application at a detailed level, identifying and mitigating potential vulnerabilities, and enhancing the security of the system.

  • What are the three basic steps of threat modeling mentioned in the video?

    -The three basic steps of threat modeling mentioned are creating a Data Flow Diagram (DFD), labeling the trust boundaries, and identifying the strengths and weaknesses of the application.

  • What is a Data Flow Diagram (DFD) and its purpose in threat modeling?

    -A Data Flow Diagram (DFD) is a graphical representation of the flow of data through a system. It shows how data is processed by the system's components. In threat modeling, DFDs help in understanding how the system works and in identifying potential security vulnerabilities.

  • What are trust boundaries in the context of threat modeling?

    -Trust boundaries in threat modeling represent the points in the data flow where the level of trust changes, such as between unauthenticated and authenticated users or between regular users and administrators. Identifying trust boundaries helps in understanding where to apply security controls to prevent unauthorized access.

  • Can you explain the STRIDE methodology used for identifying threats?

    -STRIDE is a methodology used to identify threats based on six categories: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privileges. It helps in systematically assessing and addressing the potential vulnerabilities in each area.

  • Why is it recommended to perform threat modeling early in the software development lifecycle?

    -Performing threat modeling early in the software development lifecycle, ideally before any code is written, allows for the identification and mitigation of potential security issues in the planning phase. This approach helps in building security into the application from the start rather than trying to address vulnerabilities after development.

  • What is the importance of collaboration in threat modeling?

    -Collaboration is crucial in threat modeling because it involves working with developers, architects, and other stakeholders to understand the system's architecture and potential threats. This collaborative process ensures a comprehensive view of the application's security posture and promotes shared responsibility for security.

  • How does the video suggest handling the completion of a threat model?

    -The video suggests handling the completion of a threat model through a series of meetings: an initial meeting to understand the application and identify threats, a second meeting to confirm findings and correct any inaccuracies, and a final meeting after drafting the threat model to ensure everyone agrees and understands the identified threats and mitigations.

  • What are the benefits of using existing application architecture diagrams in threat modeling?

    -Using existing application architecture diagrams in threat modeling can simplify the process by providing a base to overlay the threat model. It helps in easier identification of components, data flows, and trust boundaries, making the creation of DFDs more efficient and accurate.

  • Why might a threat model need to be updated, and how often should this be done?

    -A threat model might need to be updated due to changes in the application's architecture, introduction of new features, or emerging threats. It should be revisited and updated regularly, especially before major changes in the application, to ensure it accurately reflects the current state of the system and its security needs.

Outlines

00:00

πŸ“ What is threat modeling and why it matters

The first paragraph introduces threat modeling, explaining it is an often overlooked part of security that involves understanding an application in detail to identify threats. It can save time, make clients happy, and help find bugs. The speaker promises to teach the basics of threat modeling in three parts: creating a data flow diagram, labeling trust boundaries, and identifying strengths/weaknesses.

05:03

πŸ“ˆ Creating data flow diagrams (DFDs)

The second paragraph explains data flow diagrams, which map data flows in a system. It shows DFDs at levels 0 (high-level), 1 (adds some detail), and 2 (very detailed). Level 1 is best for basic threat modeling since it balances understandability and detail. DFDs overlay well with existing architecture diagrams.

10:03

πŸ›‘οΈ Labeling trust boundaries

The third paragraph introduces trust boundaries, which indicate changing trust levels, like between user and application backend. It shows examples of labeling trust boundaries on sample DFDs based on privilege levels and access controls, following the principle of least privilege.

15:04

πŸ’ͺ Identifying strengths and weaknesses

The fourth paragraph explains using the STRIDE framework to list security strengths and weaknesses at each trust boundary. It shows an example spreadsheet breaking down protections and vulnerabilities for spoof, tamper, repudiation, information disclosure, denial of service, elevation of privilege.

20:05

πŸ€” Answering common questions

The fifth paragraph answers common questions about threat modeling: when to do it (planning phase), working with teams (collaborative meetings), and time required (2-3 weeks to start). It emphasizes threat modeling is an ongoing process centered on security conversations.

Mindmap

Keywords

πŸ’‘threat modeling

Threat modeling is the process of analyzing an application or system to identify potential security threats. In the video, it is presented as an important but often overlooked part of the security process. Threat modeling involves creating data flow diagrams, identifying trust boundaries, and calling out strengths/weaknesses using a framework like STRIDE. It helps developers build more secure software by considering threats early in the design process.

πŸ’‘data flow diagram (DFD)

A data flow diagram (DFD) visually maps out the architecture and data flows in an application or system. DFDs are created at different levels of detail (0-5) during threat modeling to understand the basic pieces of the system and how data moves between them. The video shows examples of DFDs at levels 0, 1, and 2.

πŸ’‘trust boundary

A trust boundary represents a separation between areas of different trust levels in a system, like between public users and authenticated users. Identifying trust boundaries is an important step in threat modeling. It helps to isolate components and highlight areas to focus additional security controls.

πŸ’‘STRIDE

STRIDE is a threat modeling framework used to categorize different types of threats: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. In the video, STRIDE is used to list strengths/weaknesses at different trust boundaries.

πŸ’‘vulnerability

A vulnerability is a weakness in a system that can be exploited by threats. As part of threat modeling, hypothetical vulnerabilities are included in the example (like no 2FA or cleartext credentials) to demonstrate identifying weaknesses that could turn into threats.

πŸ’‘mitigation

A mitigation is a safeguard put in place to reduce the risk or potential impact of threats exploiting vulnerabilities. Strong mitigations are listed as strengths during the threat modeling process (like TLS certificates, authorization controls etc.).

πŸ’‘OWASP

OWASP (Open Web Application Security Project) is an organization focused on web app security. The video references the OWASP threat modeling methodology as a source for additional details on performing more advanced threat modeling.

πŸ’‘principle of least privilege

The principle of least privilege is an important concept in information security. It means limiting access rights for users, accounts, and processes to only those needed to perform their tasks. This principle is mentioned in the video when discussing separation between application components.

πŸ’‘risk

Risk refers to the likelihood and impact associated with a threat successfully exploiting a vulnerability. While not explicitly covered, threat modeling ultimately enables better risk assessment by revealing priorities for security efforts.

πŸ’‘secure development lifecycle

The secure development lifecycle incorporates security practices like threat modeling into the software development process. The video recommends threat modeling early, during planning and design phases, before issues multiply.

Highlights

Threat modeling often goes overlooked but can save time, make clients happy, and identify bugs.

Threat modeling involves creating data flow diagrams, labeling trust boundaries, and identifying strengths and weaknesses.

Data flow diagrams visually map how data flows through an application at different levels of detail.

Trust boundaries indicate where trust levels change, like between unauthenticated and authenticated users.

Use the STRIDE framework to list security strengths and weaknesses at each trust boundary.

The user side focuses on spoofing, repudiation, information disclosure and denial of service.

The application side focuses on tampering, repudiation, information disclosure and escalation of privileges.

Ideally threat modeling is done in the planning phase before any code is written.

Threat modeling is a collaborative, ongoing process involving multiple meetings with stakeholders.

The real value in threat modeling is pushing security responsibility onto developers.

Creating a basic threat model doesn't take long, but getting stakeholder buy-in and info can take weeks.

Finished example threat models help demonstrate structure and validate assumptions.

Use threat models to build security into applications instead of tacking it on later.

Let developers feel empowered by threat modeling instead of treating it as an audit.

Try the exercise yourself to identify additional strengths, weaknesses, assumptions.

Transcripts

play00:00

if I could save a company a million

play00:02

dollar a year on their security budget

play00:04

this is how I would do it what's going

play00:06

on everybody Welcome to netc explained

play00:09

and in this video we're going to be

play00:10

talking about a piece of the security

play00:12

puzzle that often goes way overlooked

play00:15

and that is threat modeling now if the

play00:18

first thing you thought when you heard

play00:19

threat modeling was H that sounds boring

play00:23

it's really not in fact it's really

play00:25

exciting to learn the ins and outs of an

play00:28

application in that level of detail

play00:30

to be honest this is something that I

play00:31

wish I knew when I was first starting

play00:33

out my career in Consulting and bug

play00:35

hunting this would have saved me a lot

play00:37

of time and it would have made my

play00:39

clients happy too but if you're not

play00:41

convinced I have a finished threat model

play00:43

in the description below of an AI

play00:45

application very similar to chat GPT

play00:47

this will give you an idea of what one

play00:49

of these threat models can look like and

play00:51

how they can help you in identifying and

play00:53

determining new bugs in an application

play00:55

now if you want to learn how to make one

play00:56

yourself to save time headache and money

play00:59

then and that's what we're going to get

play01:00

into today I'm excited so let's get

play01:04

started now for this video we're only

play01:06

going to go over the basics of threat

play01:08

modeling and we're going to do that in

play01:09

three parts we're going to create a DFD

play01:12

or a data flow diagram we're going to

play01:14

label the trust boundaries and then

play01:16

we're going to identify the strengths

play01:17

and weaknesses of the application right

play01:19

we're going to call out the threats

play01:21

there's obviously more we can do after

play01:22

that but this will get you started to

play01:24

take things further I highly recommend

play01:26

the oos threat modeling process for more

play01:29

detail it's a really solid guide and I

play01:32

highly recommend you check it out after

play01:33

this video I also want to point out that

play01:35

for this video I'll mainly be focusing

play01:37

on applications but this exact same

play01:39

process works for any other system such

play01:42

as networking or Cloud step one data

play01:45

flow diagrams dfds can come into

play01:48

different levels of detail so we'll

play01:50

starting at zero going down to one two

play01:52

all the way down to five getting more

play01:54

and more detailed as you go further so

play01:57

let's take a look Okay so here's an

play02:00

example of a level zero DFD this is for

play02:02

a railway reservation system so we see

play02:05

that we have a passenger who can submit

play02:08

a reservation or cancel a reservation

play02:10

and then receive travel information from

play02:12

the railway reservation itself and then

play02:14

we also have admin which has kind of a

play02:16

back Channel access to uh reserve and

play02:19

cancel information as well as uh upload

play02:21

and download train info and gather

play02:24

passenger information so think of data

play02:26

flow diagram level zero as a back of the

play02:29

napkin kind of thing right it's a very

play02:31

quick sketch that you draw out in about

play02:33

2 minutes so not a lot of detail but

play02:36

they're still very useful in

play02:38

understanding parts of the application

play02:40

okay the next one is a level one data

play02:42

flow diagram notice how this goes into a

play02:44

little bit more detail right so we

play02:46

separate the railway reservation system

play02:48

into the reservation process and the

play02:50

inquiry process the passenger still has

play02:53

access to both processes uh but we see

play02:55

how the reservation process handles

play02:57

reservations through the reservation

play02:59

storage then we see how inquiries handle

play03:01

things through uploads and downloads it

play03:03

also connects to a ticket generation

play03:05

process and allows you to generate

play03:08

reports to the

play03:09

admin level one is the one that I use

play03:12

most often uh this is goes into enough

play03:15

detail to understand a little bit of the

play03:16

underlying bits of the system but not

play03:18

too much detail where it over

play03:20

complicates the process what's also

play03:22

really nice is that a lot of application

play03:24

developers will already have

play03:26

architecture diagram that you can kind

play03:27

of read off of so you can overlay your

play03:30

threat model with our architecture

play03:31

diagrams and it makes things a lot

play03:33

easier when you're creating a threat

play03:35

model and having those

play03:36

conversations the last one I want you to

play03:38

take a look at is a level two data flow

play03:40

diagram notice how this goes into way

play03:43

more detail so we have the reservation

play03:45

process query process Railway department

play03:48

and inquiry process over here that's

play03:50

being used for passengers as well as for

play03:53

reporting and

play03:54

reservations we're communicating back to

play03:57

a searching process and then that talks

play04:00

to a waiting process a confirmation

play04:02

process a cancellation process and then

play04:04

the ticket generation and it goes all

play04:06

the way out to generate the ticket for

play04:08

the client so this is a lot more detail

play04:12

almost a little too much for what we

play04:13

need to create a basic threat model but

play04:16

this just kind of gives you an idea of

play04:18

what a level two data flow diagram looks

play04:20

like now that we have a map of our

play04:22

application data flow we need to

play04:24

identify the trust boundaries I have

play04:26

here up on the screen uh an example of a

play04:28

data flow with trust boundaries that are

play04:30

being labeled trust boundaries are

play04:32

places in the DFD where trust levels

play04:34

change so think unauthenticated user to

play04:37

authenticated user or regular user to a

play04:39

power user to admin to internal engineer

play04:43

you get the idea I have a couple data

play04:45

flow diagrams for us to take a look at

play04:47

and label the trust boundaries so you

play04:48

can see what that process looks like

play04:50

okay here's an example data flow diagram

play04:53

this is a level one data flow diagram

play04:55

I'm using draw IO I find it to be very

play04:58

helpful when creating these things for

play04:59

clients because it's easier for me to

play05:02

finish up the report create the data

play05:04

flow diagram and then pass that off to

play05:06

the development team so they can further

play05:07

their

play05:08

practices so we have a couple things

play05:10

labeled here right we have our actor

play05:12

which is usually in a small rectangle

play05:14

and that's going to be our user in this

play05:15

case we have data flows going to

play05:18

multiple processes and those processes

play05:21

uh communicate to either the user or

play05:24

backend systems and then you see this

play05:26

multi Circle over here on the right uh

play05:29

which is is a multi-process so this is

play05:31

something that we use to kind of

play05:32

abstract a bunch of different things

play05:34

happening all at the same time uh access

play05:36

to our database is going to be our data

play05:38

store as or asset Library uh so this is

play05:41

going to be the app database and it's

play05:43

with two lines one on top and one on

play05:45

bottom so this is somewhat standard of

play05:48

data flow diagrams so if you look online

play05:50

on how to create a data flow diagram

play05:52

you're going to see a lot of these

play05:53

symbols finally we have our trust

play05:55

boundary which is represented by a

play05:57

dotted line that we saw earlier so in

play06:00

this case we have a user that can

play06:02

connect to an application backend and

play06:04

modify a report they also receive static

play06:06

files from what looks like to be a web

play06:09

application that application backend

play06:11

then also connects to a backend data

play06:14

store so this is going to be an

play06:15

application database for storing and

play06:17

modification and then it has access to

play06:19

some other backend processes that either

play06:21

May tie back into the user or it may tie

play06:23

into some other function being performed

play06:25

on the back

play06:26

end so in this case what we want to do

play06:28

is we want to look for uh change in

play06:31

trust levels right so for example if we

play06:34

go from an unauthenticated user to an

play06:36

authenticated user or maybe we want to

play06:39

keep the user separate from the process

play06:42

in the application backend itself that's

play06:45

usually where you'll find the First

play06:46

Trust boundary we want to separate the

play06:48

user from the application we don't want

play06:49

to give them full access to that

play06:51

application so let's go ahead and add a

play06:54

trust boundary

play06:57

to this spot between the user and the

play07:00

application

play07:01

backend now there's still a couple more

play07:03

that we need to set up if you look

play07:05

closely you can see that the application

play07:07

backend talks to a back-end database now

play07:10

we want to be very careful because

play07:11

things like SQL injection can happen or

play07:14

data corruption so we want to limit the

play07:16

access that the application has to the

play07:18

back-end database right we're not going

play07:20

to run it with admin credentials or

play07:21

anything like that we want to follow the

play07:23

principle of least privilege so we're

play07:25

going to put another trust boundary

play07:27

there in the application database

play07:32

oops there we

play07:34

go and then finally our application

play07:36

backend can communicate to some other

play07:38

processes on the back end as well um

play07:41

usually this is done through apis but we

play07:43

want to continue to follow principle of

play07:45

least privileged so especially since

play07:47

this application backend has the slim

play07:50

but possibility of being compromised by

play07:52

a user we want to create a separate

play07:54

barrier between the application itself

play07:56

that the user can interface with and the

play07:58

further services that are down

play07:59

Downstream so we're going to create one

play08:01

last trust boundary between the

play08:02

application process and the backend

play08:05

Services I'll just go ahead and rotate

play08:08

that so it looks a little

play08:13

nicer awesome this is our completed data

play08:16

flow diagram for this level one

play08:19

DFD I have one more data flow diagram

play08:22

for us to take a look at and this is

play08:23

going to be the level two data flow

play08:25

diagram so here we can see this looks

play08:27

like a college library website and even

play08:30

though it's a level two we still have a

play08:31

couple abstracted multi-processes going

play08:33

on and I did that to keep things a

play08:35

little simple so it all fit on one

play08:36

screen so here we have the users that

play08:39

can send requests and receive responses

play08:41

from the library website itself and then

play08:43

likewise we have Librarians which can

play08:45

receive requests and receive responses

play08:48

we have web pages that are in disk now

play08:50

this can either be static files or

play08:52

dynamic files such as PHP go python Java

play08:56

you name it uh that's communicating with

play08:58

the library website

play08:59

and then of course we have a back-end

play09:01

database which is part of the College

play09:02

library database and the database

play09:04

files so when we're looking at this we

play09:07

want to make sure that we do have a

play09:09

separation between the users and the

play09:11

application users should not have full R

play09:13

of the application and usually they'll

play09:15

have at least somewhat limited access to

play09:17

the application even once they log in

play09:19

right they're not all going to be

play09:20

considered admin or an internal engineer

play09:23

likewise the Librarians even though they

play09:25

might have more access than a regular

play09:27

user in order to do different things

play09:30

they're still going to have limited

play09:31

access because they're also not admin or

play09:33

internal engineer so the First Trust

play09:35

boundary we're going to put is actually

play09:37

going to be between the library in uh

play09:39

the Librarians and the users and the

play09:41

library's website

play09:43

itself so let's go ahead and add

play09:47

that and rotate this a

play09:52

bit

play09:55

oops and let's

play09:58

expand

play10:00

so that we create a separate uh

play10:02

separation between the users the

play10:04

Librarians and then the college website

play10:07

itself cool so we see that because we

play10:10

have this separation the web pages on

play10:12

disk are separate from the users but

play10:14

what about the library website and the

play10:16

database just like the last data flow

play10:18

diagram we want to have a separation

play10:20

between the web application that users

play10:22

are directly interacting with and then

play10:24

any other Downstream system just like

play10:26

this database but we don't need a put

play10:29

any other boundary between the database

play10:31

and the database files right maybe this

play10:33

is a distributed database or uh maybe

play10:36

this is just an abstraction showing that

play10:38

the database has access to some other

play10:40

files on the back end right this could

play10:42

be an S3 bucket or some sort of local

play10:43

file storage or even just a separate

play10:45

database entirely so let's go ahead and

play10:48

add another data uh another trust

play10:52

boundary between the College library

play10:55

website and the College library

play10:58

database

play10:59

and that's it there's only two trust

play11:01

boundaries here uh these are the only

play11:03

places where trust levels are going to

play11:04

change within the application at least

play11:06

that we're showing right now uh you'll

play11:08

notice that the multiprocess little

play11:10

Loops here uh these are here because

play11:13

they're also part of that same trust

play11:15

level if they were parts of different

play11:16

trust levels we would want to separate

play11:18

that out and then highlight the trust

play11:19

boundaries in there as well again most

play11:22

of the time I use level one data flow

play11:24

diagrams level two data flow diagrams

play11:26

can go into a lot more detail but they

play11:27

also become a lot more

play11:30

complicated awesome the last thing we're

play11:32

going to do here is pick a framework to

play11:34

list out our strengths and

play11:35

weaknesses for this exercise I'm going

play11:37

to use stride but if you're an internal

play11:39

team I also really like the idea behind

play11:42

pasta as well so you may want to look

play11:44

into that stride stands for spoofing

play11:47

tampering repudiation basically a fancy

play11:50

word for logging that way I can't say

play11:52

that I didn't do something information

play11:55

disclosure denial of service and

play11:57

elevation of privileges

play11:59

what you want to do here is look at each

play12:01

of your trust boundaries and then write

play12:02

down the strengths and weaknesses for

play12:04

each category you're going to do this

play12:05

for both sides of the trust boundary

play12:07

just to make sure you get proper

play12:08

coverage your strengths in this case are

play12:10

really your mitigations so for spoofing

play12:13

as an example we're going to use a

play12:15

username and password to log into the

play12:16

application so I can't pretend to be

play12:18

somebody else but depending on the

play12:20

application maybe we need a little bit

play12:22

more right maybe we need multiactor

play12:24

authentication so that's something that

play12:25

we're going to want to write down as

play12:27

well or we can use SS TLS to prevent

play12:30

tampering or information disclosure for

play12:32

anything that's in transit across that

play12:34

trust

play12:35

boundary so let's take a look here's the

play12:38

DFD that we're going to look at we have

play12:39

three trust boundaries so we're going to

play12:41

want to set up three sections in our

play12:42

spreadsheet so this is our example

play12:45

spreadsheet I usually use this when I'm

play12:47

going through my trust boundaries in

play12:48

order to identify this stride

play12:51

methodology so we have three trust

play12:53

boundaries trust boundary 01 which is

play12:55

going from the user to the application

play12:57

backend trust boundary 02 two which is

play12:59

going from the application backend to

play13:00

the application database and then trust

play13:03

boundary 3 which is going from the

play13:05

application backend to the other

play13:07

services that we

play13:09

identified so I'm going to keep things

play13:10

simple and we're only going to fill out

play13:12

trust boundary one in this video uh for

play13:15

a complete list of what this looks like

play13:17

again take a look at the finished threat

play13:18

model at the link in the description

play13:21

something I want to point out is that

play13:22

not all of the stride categories always

play13:24

make sense when you're looking at

play13:25

different aspects of the application so

play13:28

you'll notice here in trust boundary R1

play13:29

I have a couple gray boxes and the

play13:31

reason why I have these gray boxes is

play13:32

because if we're the user we don't need

play13:35

to worry about tampering data that we

play13:36

enter into the application but the

play13:39

application itself needs to worry about

play13:40

information that we tampered into it

play13:43

same thing with information disclosure

play13:45

denial of service and escalation of

play13:47

privileges so the user doesn't really

play13:49

need to worry about these things so we

play13:51

gray these out to keep things a little

play13:53

simple now as I mentioned earlier we're

play13:55

going to have something as a strength in

play13:57

our application right so we're running

play13:58

with the assumption that there's an

play14:00

authentication like a login flow so a

play14:01

username and

play14:04

password so I'm going to list that in as

play14:07

one of the strengths but maybe this is

play14:09

an application that requires a little

play14:10

bit more security so let's call out no

play14:13

two-factor authentication as one of our

play14:15

first vulnerabilities or first weakness

play14:17

in the

play14:23

application so this is going to be

play14:24

labeled as

play14:26

vol01 for repudiation let's say there's

play14:28

no logging Trail or Telemetry coming

play14:30

from the user uh so this is something

play14:32

that we'll want to call out as uh

play14:36

limitation right so no audit Trail and

play14:40

this is going to be our vul

play14:44

O2 we're just going to make

play14:46

things look nice I'll just keep

play14:49

everything

play14:50

lowercase bump that up so we're done

play14:53

with the user side now let's look at the

play14:54

application side so how do we prevent

play14:59

oh I just realized I misspelled

play15:01

strengths that's

play15:04

funny that's silly all right all

play15:09

fixed so on the application side how do

play15:13

we make sure that the application isn't

play15:15

being spoofed back to the user so if

play15:18

this was a regular HTTP site we wouldn't

play15:21

be able to tell um somebody could spoof

play15:23

the DNS or there could be some bit

play15:24

flipping or they could even just visit

play15:26

the wrong website maybe they change a

play15:28

letter on accident but in this case

play15:30

we're going to use a TLS certificate to

play15:33

prevent spoofing the application to the

play15:34

user so this is going to stop uh Hackers

play15:37

from doing something like a man- inthe

play15:38

middle attack so this is going to be our

play15:42

TLS

play15:44

certificate now what about tampering

play15:46

what do we have in place to prevent the

play15:48

user from tampering with different

play15:50

aspects of the application now if you

play15:53

know about crossy scripting and input

play15:55

injection you're probably already

play15:56

familiar with input filtering out output

play15:58

en coding but let's run with the

play16:00

assumption that this application doesn't

play16:01

have either of those so we're going to

play16:03

put

play16:05

no business validation input and this is

play16:09

going to be our

play16:10

vul

play16:14

vol03 I'll just fix that so it looks

play16:16

nice and neat so that's going to be our

play16:17

vul 03 uh what

play16:20

about uh repudiation let's say for

play16:23

instance the application doesn't have

play16:25

any logging on itself or at least we

play16:26

don't have proper logging on the

play16:28

application other than the fact that

play16:30

somebody's accessing the app uh so this

play16:33

will be no

play16:35

logging user actions and this is going

play16:38

to be

play16:41

v04 uh let's take a look at information

play16:43

disclosure let's say that the app was

play16:45

really poorly made and so we have uh

play16:48

clear text

play16:54

credentials and this is going to be

play16:55

volum

play16:57

05

play17:00

and then as far as denial of service

play17:02

let's say that we do have a strength and

play17:03

we have uh backup ISP and a WF in

play17:12

place and then as far as escalation of

play17:14

privileges let's say that we have a

play17:16

strong authorization control pattern

play17:18

that we put at every aspect of the

play17:24

application if I can

play17:27

spell

play17:30

awesome so when we're done this is what

play17:33

it's going to look like for each of

play17:35

these and we can continue through trust

play17:37

boundary 2 and Trust boundary 3 but I'll

play17:39

leave that as an exercise for you to see

play17:41

if there's any other strengths or

play17:43

weaknesses that you can come up with on

play17:45

your own if you do this exercise let me

play17:47

know in the comments below and see what

play17:49

you come up with how many

play17:50

vulnerabilities did you identify what

play17:52

kind of assumptions did you make it's a

play17:54

lot of fun doing this kind of

play17:56

exercise perfect and that's threat

play17:58

modeling in a nutshell once you finish

play18:01

everything that we did in this video I

play18:02

really want you to go back to the oos

play18:04

threat modeling process and list out the

play18:08

threats and identify mitigations for

play18:10

each one as I said earlier there's

play18:12

obviously a lot more that you can do

play18:13

with this and I encourage you to

play18:15

continue to play around and learn for a

play18:17

finished threat model take a look at the

play18:19

one that I have in the description below

play18:20

it shows you what a final report looks

play18:22

like including my assumptions strengths

play18:25

and weaknesses and mitigation approach

play18:28

now there's a couple common questions

play18:30

that I want to go over before I let you

play18:31

go the first question is when should you

play18:34

do threat modeling here's a diagram of

play18:37

the software development life cycle so

play18:41

when you should do threat modeling is

play18:42

ideally before any line of code is

play18:45

written so that's going to be in the

play18:46

planning phase now if this is an

play18:48

application that already exists and you

play18:50

want to do threat modeling on that then

play18:52

make sure that you do threat modeling

play18:53

before any major changes are done to the

play18:55

application once you get everybody on

play18:57

board with threat model then it's a lot

play18:59

easier to build the security into the

play19:01

application instead of tacking it onto

play19:03

the side at the end now the second

play19:06

question is how do you work with other

play19:08

teams it's important to keep in mind

play19:09

that threat modeling isn't a oneandone

play19:11

kind of thing right it's a collaborative

play19:13

and ongoing process so you're going to

play19:15

want to get other stakeholders on board

play19:18

the biggest value of a threat model

play19:20

isn't the report at the end it's going

play19:22

through the process and pushing that

play19:24

security responsibility onto your

play19:26

developers so that they can feel more

play19:28

empowered to do their best work now I

play19:31

would recommend three meetings at least

play19:34

so the first meeting is for you to work

play19:36

with the developers and The Architects

play19:37

to get an understanding of how the

play19:39

application works and any possible

play19:41

threats that you can come up with right

play19:43

out the gate from there you're going to

play19:45

want to create your first draft of the

play19:47

data flow diagram the test boundaries

play19:49

and the threats identified then you're

play19:52

going to have your second meeting and in

play19:53

your second meeting you're going to

play19:54

confirm with developer teams and the

play19:57

architects in order to make sure that

play19:58

everybody's on the same page usually in

play20:01

the second meeting you're going to

play20:02

notice that there are some things that

play20:03

you're missing or some assumptions that

play20:05

you made or maybe the developers didn't

play20:06

communicate certain things properly so

play20:08

they'll be able to correct you there now

play20:10

if everything goes well then you're

play20:12

going to have one more meeting and

play20:13

that's going to be after you draft your

play20:14

final version of the threat model which

play20:17

includes your data flow diagram and your

play20:20

threats uh I would also add in

play20:22

mitigations and prioritize risks as well

play20:25

which you'll see in the OAS threat

play20:26

modeling process so so this final

play20:28

meeting is really just to get a check

play20:30

off from everybody to make sure that

play20:32

we're all on the same page we've

play20:33

identified everything that we need to

play20:35

and we're good to go the last common

play20:37

question is how long does it take to

play20:39

make a threat model well the answer to

play20:42

this kind of depends on the application

play20:43

and the team and a lot of other factors

play20:45

so I can't give you a solid number I

play20:47

would recommend spending at least two to

play20:49

three weeks especially if you're not

play20:51

part of the org or if you're not part of

play20:53

the development team remember it takes a

play20:56

lot of time to get all of the St steh

play20:58

holders into their same room for a

play20:59

meeting so factor that into your

play21:02

timeline once you have all your

play21:04

information and everybody signed off the

play21:06

actual creation of the threat model

play21:08

doesn't take that long at all so to give

play21:11

you an example the AI threat model that

play21:13

I put together in the description that

play21:15

took me only a couple of days once I

play21:16

knew how I wanted to lay out the

play21:18

application and what common applications

play21:20

look like so there you have it a brief

play21:22

introduction to threat modeling systems

play21:25

I hope this video has convinced you of

play21:26

how helpful threat models can be and

play21:29

give you the confidence to start

play21:30

building them on your own well that's

play21:33

all I have for you guys today for more

play21:35

information check out the links in the

play21:36

description below if you like this video

play21:38

let me know by leaving a thumbs up it

play21:40

really helps with the YouTube algorithm

play21:42

and don't forget to subscribe to see

play21:44

more videos like this I'll see you next

play21:47

time