start	end	text
8380	10760	Let's start with some Threat Modeling basics.
11300	15400	Just a quick show of hands, how many people know what Threat Modeling is?
15880	16680	Perfect!
16760	18640	Yeah, real AppSec village, nice.
19980	28400	Alright, so this might be something that you already know, but I'll still go through a bit of an introduction for those who don't know.
28460	43160	It's sometimes called diagram hacking, and it's like blue sky thinking of what could go wrong in an application, but you actually have to try to have your feet firmly on the ground and think of the context of your application as well.
43280	56660	So, it's also the answer to something called security by design, so that's like the fancy, boring way of saying that security should be embedded in a product from its inception, rather than an add-on at the end of the development.
57800	78160	And we can do that, we can achieve this, by understanding user culture, goals, and workflows, by understanding organizational and technical capabilities of a product and a team, as well as adversary capabilities and dispositions, and then putting all of this together in a solution called a Threat Model,
78160	80160	and that's the definition of a Threat Model.
80740	83600	There are lots of definitions, this is the one I picked.
84700	92520	Right, so, Threat Modeling in an ideal situation is done in that part of the SDLC, so in the planning phase.
92520	94860	In real life, it's not always like that.
94860	98820	You can do Threat Modeling at any point of the SDLC and hope for the best.
99140	114360	It examines the design of system operations and how the data flows across system boundaries, and it identifies all the points where the attackers, hackers could exploit, and how they could do so.
114360	118240	And lastly, it designs solutions to keep our data and applications safe.
119520	123640	So, you've probably seen this in countless other security talks.
123800	138440	There's a difference between finding issues in the beginning of the flow versus at the end, so we don't end up in production with something looking like this, where you either don't have any security controls or controls that aren't applicable to your context.
138800	141960	So, when we do Threat Modeling, we try to get the full picture of a system.
141960	147420	This is a slightly weird picture, but I found it in a 2019 training, and I really liked it.
147600	152780	It always helps if we have different perspectives and experiences around the table.
153040	164440	So, keep in mind this is an exercise for developers, architects, QA, business leads, anyone that can bring a different perspective, as much as it is for security people.
164440	174200	And security is usually there to facilitate the whole exercise, learn, so that we can then support development efforts afterwards.
176520	177300	Okay.
177300	184660	I'd like to take a couple of seconds to go through some terms that are usually used interchangeably, but they do not mean the same thing.
184900	186780	Attack, vulnerability, and risk.
186780	189500	The attack is what we're trying to protect against.
189840	193160	The vulnerability is a weakness in our protection defenses.
194060	200980	And then, when we put these two together with our assets, or the things we're trying to protect, then we get the exposure, or the risk.
203100	207200	Now, moving on to how exactly we do threat modeling.
207860	211860	One way is to use these four questions as a framework.
211860	213580	What are we working on?
213580	214860	What could go wrong?
214860	217120	What are we hoping to do about it?
217580	219960	And did we do a good enough job?
220640	225120	And then we combine those questions with some quite simplistic components.
227820	231780	In the data flow diagram, so you probably already know what DFDs are.
232040	236780	They are simplistic, but they do cover most of the concepts in a system.
237560	242240	So, entities, processes, data stores, and data flows, and most importantly, trust boundaries.
243760	245940	We can come up with something that looks like this.
245940	246700	Don't get scared.
246700	249440	That's a real-life corporate threat model.
249440	250440	It's quite ugly.
252460	255100	But it does include everything that you need in a threat model.
255100	257320	You have your assets clearly identified.
257320	259200	So, what are we working on?
259780	265700	You have your use cases, the user workflows, and what people need to achieve if they use your system or your app.
265700	267160	You have data flows.
267260	271440	So, how exactly is data going through past trust boundaries?
271780	274240	And then on top of all of these, you can come up with threats.
274240	275380	So, what could go wrong?
276580	280080	There are also various ways and approaches of doing threat modeling.
280080	285860	And I'm saying that because in our team, for example, there's 20 of us, 20 AppSec engineers.
285860	288700	We each have a different way of doing threat modeling.
288700	291640	Sometimes quite annoying, but it works.
291820	295700	So, we have lots of acronyms in this space.
295700	304580	STRIVE, which stands for Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege.
304620	309820	You have PASTA, not food, but the process for Attack Simulation and Threat Analysis.
310580	316360	Linden, which is for Identifying and Mitigating Privacy Threats.
316360	326160	And then when it comes to tools, you have games, Threat Modeling is Code, which looks at Terraform, and Threat Dragon, which is another OS project.
327680	329500	Something interesting here, yeah.
329500	335300	The two games out now, maybe you guys know of more, are Elevation of Privilege and Cornucopia.
335300	338560	And later we're going to talk about Cornucopia a little bit more.
339740	340940	Right.
341000	342420	So, insights.
342640	347180	By the way, this is generated by GPT, obviously.
347180	349360	Because, yeah, lots of generated images.
350380	353960	Hence, it doesn't want to spell exploits for some reason.
353980	355220	I tried.
355840	356200	Right.
356200	358080	So, some of the lessons learned.
358080	360180	People have very little time.
360180	365860	It's usually quite difficult to convince teams to allow you to do Threat Modeling.
365860	369780	So, you have to be efficient with the little time you're given.
369780	377800	Stick to the points and enable teams to do Threat Modeling without you there, so that you're not a bottleneck.
377800	380920	And have the confidence that they've done it properly.
381640	385240	Don't assume familiarity with terms, as we all know.
385240	390740	Different acronyms mean different things to development versus security.
391460	396000	Don't point and ask where vulnerabilities are on a data flow.
396060	400380	I did that, and the result was crickets and confused faces.
400940	410740	Try to get the conversation flowing between the same people in the same team, because you'll see that they are not all on the same page with what's being built.
410880	420360	So, usually architects have a picture in their minds, and then the developers who write the code know what they're building, and it's not exactly what architects envisioned.
422160	425000	Don't assume everything needs to be mitigated.
425140	432840	So, make it clear to the team that you're not there to quadruple their workload, because they will get scared, and they will stop listening to you.
432900	434360	Context is very important.
435440	438940	And lastly, Threat Modeling is a time-consuming process, as we said.
438940	441820	There are literally too many ways to do it.
441840	448120	It can easily get out of hand, and if you try to look at a big diagram in one go, you'll get lost.
448120	453160	So, start small, and keep in mind that a threat model is a living document.
453160	458920	It should be updated the same rate as you update your application with major changes.
460300	463000	Now, a little bit about Cornucopia.
464120	467240	It is an OS project, yet another one.
467360	469740	Those are the leaders and the team.
469820	479600	It was built in 2012, and it currently has two decks, but a lot of expansions are planned for different industries, for AI security, for example.
479600	490800	It helps because it's language and platform agnostic, and it kind of gets developers to think of identifying and developing security user stories.
492000	496680	So, these are the suits of the web application version.
496840	508000	They're focused around normal stuff, like authentication, authorization, data security and cryptography, session management, and an overall threat category called Cornucopia.
508540	512840	And then, the game itself has a couple of pros and cons.
512920	518400	Pros, you are allowing developers to play a card game on work hours, so that's cool.
518400	519460	They will like it.
519460	521660	And it's very easy to pick up for them.
523100	535260	Cons, oddly enough, security people struggle to pick it up, because we sometimes go into a threat modeling session having already thought of some threats for an application.
535260	538780	So, we could overlook important exploits.
539360	550020	And then, some people struggle trying to explain what the difference is between cards, or give an example for their own application and come up with the actual risk for a card.
551660	554220	That's where Engineers and Exploits comes in.
554220	557560	So, Spiros really likes Dungeons and Dragons.
557560	559500	He really wanted to call it this.
559980	566900	The idea behind this game is to make it like a mini-game based on Cornucopia, to train the trainers.
566900	568480	Trainers can be whoever.
568480	577100	Other security people, developers, architects, anyone that wants to go back to their teams and introduce the mindset of threat modeling.
577520	584840	To make sure that engineering teams are self-sufficient and they don't just depend on security being there.
586700	589540	Please admire some more AI-generated art.
589580	594440	Do not count swords, teeth, or anything like that, or letters.
596300	599660	Right, so, what is Engineers and Exploits?
599660	600720	It's the mini-game.
600720	603680	It can help because it's giving you some sample diagrams.
603680	607620	It can be as complex or as simplistic as the game master wants it to be.
607820	614300	And it helps because you're not jumping straight into a threat modeling exercise for your actual production app.
614640	617240	You're doing something as a game to understand the concept.
618240	619740	And it has a few rules.
619740	621120	There's a game master.
621500	628000	Preferably this is the more experienced threat modeler to take on the role of a very annoying, very confident dev.
628960	631960	There are four to seven players around the table.
631960	634100	Each with around seven cards.
634100	646320	They all impersonate security consultants and they are there on a mission to find what could go wrong and convince the game master to open Jira tickets and fix those issues before the app goes into production.
648000	649820	Yeah, good luck with that.
649860	652460	Each round is roughly 20 minutes.
652740	656820	The person with most threats wins and you can steal points.
656840	658040	This is very fair.
659520	669620	Right, so as a game master, you want to keep a positive attitude and atmosphere and get people to actually think about what could go wrong and give examples.
669860	673080	You are, as I said, the role of a very confident dev.
673080	673820	You're not thick.
673820	675460	You just don't really know security.
676580	679280	When you give points, you have to be very precious with your points.
679280	685200	If a player points at a web server and says, oh, cross-site scripting, that's not a threat.
685400	690140	If a player just reads the card or asks a question, that's not a point.
691560	694060	And then, these are the players.
694200	702080	I don't know if you guys noticed your AppSec village organizers today, but one of them is in this image.
703980	708220	I just asked the AI to generate this and it came up with errors, so I don't know.
708220	709680	It must have known.
709820	716140	So, as a player, you're there to learn and have fun, but get competitive and play your cards smartly.
716680	718900	And that brings me to tomorrow's session.
718900	728300	So, if you do want to come back, play the game and win the cornucopia card decks, be here between those times and, yeah, enjoy it.
