WEBVTT

00:00.000 --> 00:02.660
If you were here yesterday, then you might already know me.

00:02.660 --> 00:11.140
I do application security at Sage, and in my spare time, which is a lot of it, no, I'm one of the three leaders for the London OS chapter.

00:11.600 --> 00:21.180
Spiros is a security engineer and architect, and he is actually the nerd that coined the name of this game in the presentation, and then didn't bother to show up and show off.

00:22.420 --> 00:26.280
Right, so let's start with some threat modeling basics.

00:26.820 --> 00:31.000
Just a quick show of hands, how many people know what threat modeling is?

00:31.300 --> 00:34.140
Perfect, yeah, real AppSec village, nice.

00:35.320 --> 00:43.920
All right, 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.

00:43.960 --> 00:58.240
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.

00:58.580 --> 01:02.820
So it's also the answer to something called security by design.

01:02.820 --> 01:12.220
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.

01:13.080 --> 01:14.760
And we can do that.

01:14.760 --> 01:33.660
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.

01:33.660 --> 01:35.520
And that's the definition of a threat model.

01:36.120 --> 01:37.640
There are lots of definitions.

01:37.640 --> 01:38.940
This is the one I picked.

01:40.140 --> 01:47.940
Right, so threat modeling in an ideal situation is done in that part of the SDLC, so in the planning phase.

01:47.940 --> 01:50.220
In real life, it's not always like that.

01:50.220 --> 01:54.220
You can do threat modeling at any point of the SDLC and hope for the best.

01:54.740 --> 02:01.860
It examines the design of system operations and how the data flows across system boundaries.

02:01.860 --> 02:09.580
And it identifies all the points where the attackers, hackers could exploit and how they could do so.

02:09.900 --> 02:13.500
And lastly, it designs solutions to keep our data and applications safe.

02:15.060 --> 02:19.120
So you've probably seen this in countless other security talks.

02:19.120 --> 02:24.520
There's a difference between finding issues in the beginning of the flow versus at the end.

02:24.740 --> 02:33.840
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.

02:34.200 --> 02:37.340
So when we do threat modeling, we try to get the full picture of a system.

02:37.340 --> 02:42.760
This is a slightly weird picture, but I found it in a 2019 training and I really liked it.

02:42.940 --> 02:48.100
It always helps if we have different perspectives and experiences around the table.

02:48.360 --> 02:59.820
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.

02:59.820 --> 03:09.520
And security is usually there to facilitate the whole exercise, learn, so that we can then support development efforts afterwards.

03:11.780 --> 03:20.100
OK, 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.

03:20.100 --> 03:22.140
Attack, vulnerability and risk.

03:22.140 --> 03:24.900
The attack is what we're trying to protect against.

03:25.160 --> 03:28.580
The vulnerability is a weakness in our protection defenses.

03:29.300 --> 03:36.020
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.

03:38.420 --> 03:47.180
Now, moving on to how exactly we do threat modeling, we can use one way is to use these four questions as a framework.

03:47.180 --> 03:48.700
What are we working on?

03:48.700 --> 03:50.120
What could go wrong?

03:50.120 --> 03:52.320
What are we hoping to do about it?

03:53.000 --> 03:55.140
And did we do a good enough job?

03:56.000 --> 04:04.880
And then we combine those questions with some quite simplistic components in the data flow diagram.

04:04.880 --> 04:07.060
So you probably already know what DFDs are.

04:07.180 --> 04:12.080
They are simplistic, but they do cover most of the concepts in a system.

04:12.700 --> 04:17.440
So entities, processes, data stores and data flows, and most importantly, trust boundaries.

04:19.020 --> 04:21.240
We can come up with something that looks like this.

04:21.240 --> 04:22.020
Don't get scared.

04:22.020 --> 04:24.740
That's a real life corporate threat model.

04:24.740 --> 04:30.760
It's quite ugly, but it does include everything that you need in a threat model.

04:30.760 --> 04:32.460
You have your assets clearly identified.

04:32.460 --> 04:34.580
So the what are we working on?

04:35.020 --> 04:40.880
You have your use cases, the user workflows and what people need to achieve if they use your system or your app.

04:40.880 --> 04:42.200
You have data flows.

04:42.200 --> 04:46.580
So how exactly is data going through past trust boundaries?

04:47.040 --> 04:49.680
And then on top of all of these, you can come up with threats.

04:49.680 --> 04:50.720
So what could go wrong?

04:51.740 --> 04:55.340
There are also various ways and approaches of doing threat modeling.

04:55.340 --> 05:01.300
And I'm saying that because in our team, for example, there's 20 of us, 20 AppSec engineers.

05:01.300 --> 05:03.880
We each have a different way of doing threat modeling.

05:03.880 --> 05:06.740
Sometimes quite annoying, but it works.

05:07.080 --> 05:10.900
So we have lots of acronyms in this space.

05:10.900 --> 05:19.780
STRIDES, which stands for spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege.

05:19.800 --> 05:25.200
You have PASTA, not food, but the process for attack simulation and threat analysis.

05:25.680 --> 05:31.260
Linden, which is for identifying and mitigating privacy threats.

05:31.800 --> 05:34.680
And then when it comes to tools, you have games.

05:35.160 --> 05:41.160
Threat modeling is code, which looks at Terraform and Threat Dragon, which is another OS project.

05:42.960 --> 05:44.340
Something interesting here.

05:44.340 --> 05:50.560
Yeah, the two games out now, maybe you guys know of more, are Elevation of Privilege and Cornucopia.

05:50.560 --> 05:54.080
And later we're going to talk about Cornucopia a little bit more.

05:55.480 --> 05:56.180
Right.

05:56.180 --> 05:57.580
So insights.

05:57.740 --> 06:04.440
By the way, this is generated by GPT, obviously, because, yeah, lots of generated images.

06:05.660 --> 06:09.040
Hence, it doesn't want to spell exploits for some reason.

06:09.040 --> 06:10.460
I tried.

06:10.820 --> 06:11.420
Right.

06:11.420 --> 06:13.220
So some of the lessons learned.

06:13.220 --> 06:15.360
People have very little time.

06:15.360 --> 06:20.960
It's usually quite difficult to convince teams to allow you to do threat modeling.

06:21.520 --> 06:24.920
So you have to be efficient with the little time you're given.

06:24.920 --> 06:32.920
Stick to the points and enable teams to do threat modeling without you there so that you're not a bottleneck.

06:32.960 --> 06:36.040
And have the confidence that they've done it properly.

06:36.740 --> 06:39.280
Don't assume familiarity with terms.

06:39.280 --> 06:45.620
As we all know, different acronyms mean different things to development versus security.

06:46.600 --> 06:51.140
Don't point and ask where vulnerabilities are on a data flow.

06:51.140 --> 06:55.300
I did that and the results was crickets and confused faces.

06:55.920 --> 07:05.840
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.

07:05.840 --> 07:15.500
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.

07:17.280 --> 07:20.140
Don't assume everything needs to be mitigated.

07:20.180 --> 07:28.000
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.

07:28.000 --> 07:29.500
Context is very important.

07:30.320 --> 07:33.900
And lastly, threat modeling is a time-consuming process, as we said.

07:33.900 --> 07:36.960
There are literally too many ways to do it.

07:36.960 --> 07:38.900
It can easily get out of hand.

07:38.900 --> 07:43.240
And if you try to look at a big diagram in one go, you'll get lost.

07:43.240 --> 07:48.280
So start small and keep in mind that a threat model is a living document.

07:48.280 --> 07:53.920
It should be updated the same rate as you update your application with major changes.

07:55.440 --> 07:58.020
Now, a little bit about Cornucopia.

07:59.200 --> 08:02.200
It is an OS project, yet another one.

08:02.200 --> 08:04.520
Those are the leaders and the team.

08:04.520 --> 08:14.700
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.

08:14.700 --> 08:25.480
It helps because it's language and platform agnostic and it kind of gets developers to think of identifying and developing security user stories.

08:27.540 --> 08:31.060
So these are the suits of the web application version.

08:32.200 --> 08:42.760
They're focused around normal stuff like authentication, authorization, data security and cryptography, session management and an overall threat category called Cornucopia.

08:43.840 --> 08:47.840
And then the game itself has a couple of pros and cons.

08:47.900 --> 08:52.600
Pros, you are allowing developers to play a card game on work hours.

08:52.600 --> 08:53.420
So that's cool.

08:53.420 --> 08:54.460
They will like it.

08:54.460 --> 08:56.740
And it's very easy to pick up for them.

08:58.120 --> 09:10.280
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.

09:10.280 --> 09:13.520
So we could overlook important exploits.

09:14.320 --> 09:24.780
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.

09:26.500 --> 09:29.360
That's where engineers and exploits comes in.

09:29.880 --> 09:32.580
Spiros really likes Dungeons and Dragons.

09:32.580 --> 09:34.220
He really wanted to call it this.

09:34.900 --> 09:41.900
The idea behind this game is to make it like a mini game based on Cornucopia to train the trainers.

09:41.900 --> 09:43.460
Trainers can be whoever.

09:43.460 --> 09:52.080
Other security people, developers, architects, anyone that wants to go back to their teams and introduce the mindset of threat modeling.

09:52.440 --> 09:59.340
To make sure the engineering teams are self-sufficient and they don't just depend on security being there.

10:01.680 --> 10:04.420
Please admire some more AI generated art.

10:04.540 --> 10:09.380
Do not count swords, teeth or anything like that or letters.

10:11.200 --> 10:14.620
Right, so what is engineers and exploits?

10:14.620 --> 10:18.580
It's the mini game can help because it's giving you some sample diagrams.

10:18.580 --> 10:22.420
It can be as complex or as simplistic as the game master wants it to be.

10:22.720 --> 10:28.820
And it helps because you're not jumping straight into a threat modeling exercise for your actual production app.

10:29.360 --> 10:32.200
You're doing something as a game to understand the concept.

10:33.040 --> 10:34.680
And it has a few rules.

10:34.680 --> 10:35.980
There's a game master.

10:36.460 --> 10:43.140
Preferably, this is the more experienced threat modeler to take on the role of a very annoying, very confident dev.

10:43.900 --> 10:48.880
There are four to seven players around the table, each with around seven cards.

10:48.880 --> 11:01.260
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.

11:02.820 --> 11:04.740
Yeah, good luck with that.

11:04.740 --> 11:07.360
Each round is roughly 20 minutes.

11:07.780 --> 11:11.700
The person with most threats wins and you can steal points.

11:11.700 --> 11:13.040
This is very fair.

11:14.000 --> 11:24.620
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.

11:24.620 --> 11:27.940
You are, as I said, the role of a very confident dev.

11:27.940 --> 11:28.700
You're not thick.

11:28.700 --> 11:30.300
You just don't really know security.

11:31.460 --> 11:34.200
When you give points, you have to be very precious with your points.

11:34.200 --> 11:40.020
If a player points at a web server and says, oh, cross-site scripting, that's not a threat.

11:40.280 --> 11:44.940
If a player just reads the card or asks a question, that's not a point.

11:46.440 --> 11:48.860
And then these are the players.

11:49.020 --> 11:57.140
I don't know if you guys noticed your AppSec organizers, AppSec village organizers today, but one of them is in this image.

11:59.020 --> 12:02.220
I just asked the AI to generate this and it came up with errors.

12:02.220 --> 12:03.060
So I don't know.

12:03.060 --> 12:04.480
It must have known.

12:04.620 --> 12:10.960
So as a player, you're there to learn and have fun, but get competitive and play your cards smartly.

12:11.380 --> 12:13.700
And that brings me to tomorrow's session.

12:13.700 --> 12:20.980
So if you do want to come back, play the game and win the cornucopia card decks, be here between those times.

12:20.980 --> 12:23.700
And yeah, enjoy it.

12:23.700 --> 12:24.600
Questions?

12:34.790 --> 12:35.970
No questions.

12:36.530 --> 12:37.270
Yes.

12:52.910 --> 12:57.670
Is it necessary to add a story to the game or is it just like an exercise?

13:03.220 --> 13:04.780
Yes, yes, exactly.

13:04.780 --> 13:05.040
Yeah.

13:05.040 --> 13:06.380
So story points.

13:09.470 --> 13:13.110
Yeah, that's that's an even better that's like an expansion of the game for that.

13:13.110 --> 13:16.750
That's even better to get people to be even more competitive.

13:18.070 --> 13:18.870
Thanks.

13:19.070 --> 13:19.870
All right.

13:19.870 --> 13:21.270
Thank you very much.

