start	end	text
0	2660	If you were here yesterday, then you might already know me.
2660	4440	I do application security at Sage,
4440	7480	and in my spare time, which is a lot of it,
7480	11140	no, I'm one of the three leaders for the London OS chapter.
11600	13720	Spiros is a security engineer and architect,
13720	16920	and he is actually the nerd that coined the name of this game
16920	18220	in the presentation,
18220	21180	and then didn't bother to show up and show off.
22420	26280	Right, so let's start with some threat modeling basics.
26820	28580	Just a quick show of hands,
28580	31000	how many people know what threat modeling is?
31300	34140	Perfect, yeah, real AppSec village, nice.
35320	39500	All right, so this might be something that you already know,
39500	42440	but I'll still go through a bit of an introduction
42440	43920	for those who don't know.
43960	46360	It's sometimes called diagram hacking,
46360	49320	and it's like blue sky thinking of what could go wrong
49320	52400	in an application, but you actually have to try
52400	54180	to have your feet firmly on the ground
54180	58240	and think of the context of your application as well.
58580	60760	So it's also the answer to something
60760	62820	called security by design.
62820	65180	So that's like the fancy, boring way of saying
65180	68860	that security should be embedded in a product from its inception
68860	72220	rather than an add-on at the end of the development.
73080	74760	And we can do that.
74760	77960	We can achieve this by understanding user culture,
77960	80300	goals, and workflows,
80980	84360	by understanding organizational and technical capabilities
84360	86140	of a product and a team,
86140	89280	as well as adversary capabilities and dispositions,
89780	91440	and then putting all of this together
91440	93660	in a solution called a threat model.
93660	95520	And that's the definition of a threat model.
96120	98940	There are lots of definitions. This is the one I picked.
100140	103260	Right, so threat modeling in an ideal situation
103260	107940	is done in that part of the SDLC, so in the planning phase.
107940	110220	In real life, it's not always like that.
110220	112760	You can do threat modeling at any point of the SDLC
112760	114220	and hope for the best.
114740	118360	It examines the design of system operations
118840	121860	and how the data flows across system boundaries.
121860	126120	And it identifies all the points where the attackers,
126940	129580	hackers could exploit and how they could do so.
129900	133500	And lastly, it designs solutions to keep our data and applications safe.
135060	139120	So you've probably seen this in countless other security talks.
139120	141960	There's a difference between finding issues
141960	144520	in the beginning of the flow versus at the end.
144740	148280	So we don't end up in production with something looking like this,
148280	150300	where you either don't have any security controls
150300	153840	or controls that aren't applicable to your context.
154200	155300	So when we do threat modeling,
155300	157340	we try to get the full picture of a system.
157340	158700	This is a slightly weird picture,
158700	162760	but I found it in a 2019 training and I really liked it.
162940	165200	It always helps if we have different perspectives
165720	168100	and experiences around the table.
168360	171480	So keep in mind, this is an exercise for developers,
171480	174240	architects, QA, business leads,
174240	176620	anyone that can bring a different perspective,
177080	179820	as much as it is for security people.
179820	183380	And security is usually there to facilitate the whole exercise,
183380	189520	learn, so that we can then support development efforts afterwards.
191780	195420	OK, I'd like to take a couple of seconds to go through some terms
195420	198100	that are usually used interchangeably,
198100	200100	but they do not mean the same thing.
200100	202140	Attack, vulnerability and risk.
202140	204900	The attack is what we're trying to protect against.
205160	208580	The vulnerability is a weakness in our protection defenses.
209300	212420	And then when we put these two together with our assets
212420	213900	or the things we're trying to protect,
213900	216020	then we get the exposure or the risk.
218420	222520	Now, moving on to how exactly we do threat modeling,
222520	227180	we can use one way is to use these four questions as a framework.
227180	228700	What are we working on?
228700	230120	What could go wrong?
230120	232320	What are we hoping to do about it?
233000	235140	And did we do a good enough job?
236000	237480	And then we combine those questions
237980	244880	with some quite simplistic components in the data flow diagram.
244880	247060	So you probably already know what DFDs are.
247180	252080	They are simplistic, but they do cover most of the concepts in a system.
252700	255520	So entities, processes, data stores and data flows,
255520	257440	and most importantly, trust boundaries.
259020	261240	We can come up with something that looks like this.
261240	264740	Don't get scared. That's a real life corporate threat model.
264740	270760	It's quite ugly, but it does include everything that you need in a threat model.
270760	272460	You have your assets clearly identified.
272460	274580	So the what are we working on?
275020	277200	You have your use cases, the user workflows
277200	280880	and what people need to achieve if they use your system or your app.
280880	282200	You have data flows.
282200	286580	So how exactly is data going through past trust boundaries?
287040	289680	And then on top of all of these, you can come up with threats.
289680	290720	So what could go wrong?
291740	295340	There are also various ways and approaches of doing threat modeling.
295340	298720	And I'm saying that because in our team, for example,
298720	301300	there's 20 of us, 20 AppSec engineers.
301300	303880	We each have a different way of doing threat modeling.
303880	306740	Sometimes quite annoying, but it works.
307080	310900	So we have lots of acronyms in this space.
310900	314960	STRIDES, which stands for spoofing, tampering, repudiation,
314960	319780	information disclosure, denial of service, elevation of privilege.
319800	321740	You have PASTA, not food,
321740	325200	but the process for attack simulation and threat analysis.
325680	331260	Linden, which is for identifying and mitigating privacy threats.
331800	334680	And then when it comes to tools, you have games.
335160	337740	Threat modeling is code, which looks at Terraform
337740	341160	and Threat Dragon, which is another OS project.
342960	344340	Something interesting here.
344340	348460	Yeah, the two games out now, maybe you guys know of more,
348460	350560	are Elevation of Privilege and Cornucopia.
350560	354080	And later we're going to talk about Cornucopia a little bit more.
355480	357580	Right. So insights.
357740	362220	By the way, this is generated by GPT, obviously,
362220	364440	because, yeah, lots of generated images.
365660	369040	Hence, it doesn't want to spell exploits for some reason.
369040	371420	I tried. Right.
371420	373220	So some of the lessons learned.
373220	375360	People have very little time.
375360	378360	It's usually quite difficult to convince teams
378360	380960	to allow you to do threat modeling.
381520	384920	So you have to be efficient with the little time you're given.
384920	389660	Stick to the points and enable teams to do threat modeling without you there
389660	392920	so that you're not a bottleneck.
392960	396040	And have the confidence that they've done it properly.
396740	399280	Don't assume familiarity with terms.
399280	405620	As we all know, different acronyms mean different things to development versus security.
406600	411140	Don't point and ask where vulnerabilities are on a data flow.
411140	415300	I did that and the results was crickets and confused faces.
415920	421000	Try to get the conversation flowing between the same people in the same team,
421000	425840	because you'll see that they are not all on the same page with what's being built.
425840	428400	So usually architects have a picture in their minds
428400	432260	and then the developers who write the code know what they're building
432260	435500	and it's not exactly what architects envisioned.
437280	440140	Don't assume everything needs to be mitigated.
440180	444300	So make it clear to the team that you're not there to quadruple their workload
444300	448000	because they will get scared and they will stop listening to you.
448000	449500	Context is very important.
450320	453900	And lastly, threat modeling is a time-consuming process, as we said.
453900	456960	There are literally too many ways to do it.
456960	458900	It can easily get out of hand.
458900	463240	And if you try to look at a big diagram in one go, you'll get lost.
463240	468280	So start small and keep in mind that a threat model is a living document.
468280	473920	It should be updated the same rate as you update your application with major changes.
475440	478020	Now, a little bit about Cornucopia.
479200	482200	It is an OS project, yet another one.
482200	484520	Those are the leaders and the team.
484520	488880	It was built in 2012 and it currently has two decks,
488880	492740	but a lot of expansions are planned for different industries,
492740	494700	for AI security, for example.
494700	498220	It helps because it's language and platform agnostic
498220	503180	and it kind of gets developers to think of identifying
503180	505480	and developing security user stories.
507540	511060	So these are the suits of the web application version.
512200	516760	They're focused around normal stuff like authentication, authorization,
516760	519140	data security and cryptography, session management
519140	522760	and an overall threat category called Cornucopia.
523840	527840	And then the game itself has a couple of pros and cons.
527900	532600	Pros, you are allowing developers to play a card game on work hours.
532600	534460	So that's cool. They will like it.
534460	536740	And it's very easy to pick up for them.
538120	541540	Cons, oddly enough, security people struggle to pick it up
541540	544320	because we sometimes go into a threat modeling session
545100	550280	having already thought of some threats for an application.
550280	553520	So we could overlook important exploits.
554320	557200	And then some people struggle trying to explain
557200	558940	what the difference is between cards
559560	561800	or give an example for their own application
561800	564780	and come up with the actual risk for a card.
566500	569360	That's where engineers and exploits comes in.
569880	572580	Spiros really likes Dungeons and Dragons.
572580	574220	He really wanted to call it this.
574900	579100	The idea behind this game is to make it like a mini game
579100	581900	based on Cornucopia to train the trainers.
581900	583460	Trainers can be whoever.
583460	586860	Other security people, developers, architects,
586860	589120	anyone that wants to go back to their teams
589120	592080	and introduce the mindset of threat modeling.
592440	596820	To make sure the engineering teams are self-sufficient
596820	599340	and they don't just depend on security being there.
601680	604420	Please admire some more AI generated art.
604540	609380	Do not count swords, teeth or anything like that or letters.
611200	614620	Right, so what is engineers and exploits?
614620	616060	It's the mini game can help
616060	618580	because it's giving you some sample diagrams.
618580	620380	It can be as complex or as simplistic
620380	622420	as the game master wants it to be.
622720	625160	And it helps because you're not jumping straight
625160	628820	into a threat modeling exercise for your actual production app.
629360	632200	You're doing something as a game to understand the concept.
633040	635980	And it has a few rules. There's a game master.
636460	638960	Preferably, this is the more experienced threat modeler
638960	643140	to take on the role of a very annoying, very confident dev.
643900	646900	There are four to seven players around the table,
646900	648880	each with around seven cards.
648880	650940	They all impersonate security consultants
650940	654460	and they are there on a mission to find what could go wrong
654460	657520	and convince the game master to open Jira tickets
657840	661260	and fix those issues before the app goes into production.
662820	667360	Yeah, good luck with that. Each round is roughly 20 minutes.
667780	671700	The person with most threats wins and you can steal points.
671700	675980	This is very fair. Right, so as a game master,
675980	678880	you want to keep a positive attitude and atmosphere
678880	683200	and get people to actually think about what could go wrong
683200	684620	and give examples.
684620	687940	You are, as I said, the role of a very confident dev.
687940	690300	You're not thick. You just don't really know security.
691460	694200	When you give points, you have to be very precious with your points.
694200	697620	If a player points at a web server and says,
697620	700020	oh, cross-site scripting, that's not a threat.
700280	703900	If a player just reads the card or asks a question,
703900	704940	that's not a point.
706440	708860	And then these are the players.
709020	714000	I don't know if you guys noticed your AppSec organizers,
714000	717140	AppSec village organizers today, but one of them is in this image.
719020	722220	I just asked the AI to generate this and it came up with errors.
722220	724480	So I don't know. It must have known.
724620	727420	So as a player, you're there to learn and have fun,
727420	730960	but get competitive and play your cards smartly.
731380	733700	And that brings me to tomorrow's session.
733700	736280	So if you do want to come back, play the game
736700	740980	and win the cornucopia card decks, be here between those times.
740980	743700	And yeah, enjoy it.
743700	744600	Questions?
754790	755970	No questions.
756530	757270	Yes.
772910	777670	Is it necessary to add a story to the game or is it just like an exercise?
783220	784780	Yes, yes, exactly.
784780	786380	Yeah. So story points.
789470	793110	Yeah, that's that's an even better that's like an expansion of the game for that.
793110	796750	That's even better to get people to be even more competitive.
798070	798870	Thanks.
799070	801270	All right. Thank you very much.
