WEBVTT

00:00.600 --> 00:03.000
So, hi everybody, my name is Matt Domko.

00:04.120 --> 00:07.080
I don't know who that was, but they're my new best friend.

00:07.440 --> 00:13.280
So, you are at Data on Demand, the challenges of building a privacy-focused AI device.

00:13.520 --> 00:26.580
And in reality, what I want to talk about is I am a consumer and also a supporter of the AI magical things.

00:27.220 --> 00:35.300
And if I have the one that I work on at work, or if I have one from somebody else, they're just certain things that I really want to make sure that they happen.

00:35.340 --> 00:38.360
And that's kind of the goal of this thing.

00:38.860 --> 00:40.420
So, I do have a job.

00:40.420 --> 00:42.200
They pay me to do stuff.

00:42.760 --> 00:50.180
These are my thoughts, things in my brain that I wrote down in order to make a device safer.

00:50.560 --> 00:55.100
But this is not the thoughts and ideas of my company.

00:56.740 --> 00:58.660
A company I work at.

00:58.840 --> 01:03.440
So, I'm into 3D printing, laser cutting, cosplay, mostly steampunk stuff.

01:03.840 --> 01:09.800
If you ever want to nerd out about any of that, or just security education in general, I'm super, super into it.

01:10.100 --> 01:14.760
I'm also the director of fun at Tynes, if anybody's familiar with Tynes.

01:14.780 --> 01:19.020
It's an unofficial title and they don't pay me, but I'm the director of fun.

01:20.460 --> 01:22.580
Here's the agenda we'll work through.

01:23.760 --> 01:25.440
So, the problem.

01:25.440 --> 01:26.940
There's all these things.

01:26.940 --> 01:31.260
And it's funny, when I was creating these slides, it was like, okay, what are the AI devices that exist?

01:31.260 --> 01:32.520
And there were like three.

01:32.540 --> 01:38.040
And then all of a sudden, we had two new ones appear that are the exact same, but different with the same name.

01:38.040 --> 01:38.680
I don't know.

01:38.680 --> 01:44.380
Anyway, the point is, is I want a hardware device that makes AI easy for just the general consumer.

01:44.440 --> 01:49.640
But I want to respect their privacy because it's the right thing to do.

01:50.160 --> 02:12.520
And so, it's kind of a challenge when you think about the difference between working in the consumer space, where it's like anyone in my family who's not into technology might actually purchase one of these versus the team that I work with at an organization and they already have an understanding of how they treat their data and where it's going.

02:12.960 --> 02:24.680
So, before we get into the pipelines that we should be using to protect that data, I want to start off talking about some basic request workflows.

02:24.960 --> 02:31.740
So, when I think about doing something with any kind of AI, it's really four different types of requests.

02:31.740 --> 02:35.380
And it's basically two with little differences.

02:35.500 --> 02:37.500
So, the first one is just a general knowledge request.

02:37.500 --> 02:39.340
I don't need to know anything about you.

02:39.340 --> 02:42.680
I can just make this request.

02:42.700 --> 02:45.460
The second one is a contextual knowledge request.

02:45.460 --> 02:50.060
So, I need to know some things about you, but I don't need any super sensitive data.

02:50.600 --> 02:51.940
Generic actions requests.

02:51.940 --> 02:55.220
So, if I want to do something for you, but it could be anybody.

02:55.220 --> 02:56.460
It could be done for Matt.

02:56.460 --> 02:57.760
It could be done for Steve.

02:57.760 --> 02:59.120
It could be done for Jay.

02:59.120 --> 03:00.560
I think that's who that was now.

03:02.060 --> 03:03.020
That's what we would do.

03:03.020 --> 03:10.340
But if I wanted to do something on behalf of you, on your Spotify account, on your Grubhub account, whatever it is, I need to be authenticated.

03:10.440 --> 03:14.340
And so, that's that fourth type that I like to think about.

03:16.020 --> 03:21.480
So, if we look at the general knowledge request, it's fairly simple.

03:21.480 --> 03:24.120
So, I have my AI walkie-talkie.

03:24.120 --> 03:28.500
I push the button and I say whatever it is I'm going to say.

03:29.120 --> 03:31.100
What's the weather out today?

03:32.120 --> 03:35.800
It's going to go up through the internet into my cloud provider.

03:35.840 --> 03:39.900
There's a routing and storage and replay engine that sort of glues everything together.

03:39.900 --> 03:49.300
But at its core, we're really just doing speech to text, text to speech, and some LLM calls to figure out what the right answer is.

03:49.320 --> 03:53.720
So, that's a knowledge request.

03:54.000 --> 03:59.600
When we're doing those types of requests, right, what kind of data are we thinking about?

03:59.800 --> 04:04.960
Well, if my request is tell me a fact about cats, super easy.

04:05.000 --> 04:09.300
If I say I've got a weird rash, should I see a doctor?

04:09.340 --> 04:13.360
A little bit more sensitive than tell me a fact about cats.

04:13.360 --> 04:17.460
And so, when I think about protecting this data, it's really three different kinds.

04:17.460 --> 04:23.660
I've got audio data, that recording of my voice that needs to get converted into speech to text.

04:23.820 --> 04:28.580
I've got the transcript data, which is the result of that speech to text call.

04:28.580 --> 04:37.400
And then I've got my response data, which is where I took that text, ran it through an LLM, and had the LLM give me an answer.

04:39.040 --> 04:45.140
When we think about generic action requests, it's very, very similar to what we just saw.

04:45.140 --> 04:47.820
The only difference is now we insert an actuator.

04:47.820 --> 04:52.980
So, an actuator is just a thing that can perform a task when you provide an input.

04:53.400 --> 04:58.820
And so, this is the thing that calls the Google Weather API for you.

05:01.350 --> 05:11.230
As far as the types of data that we need and that we need to protect, we've still got our audio, transcript, and response data, but we also have some contextual data, right?

05:11.230 --> 05:14.630
Things like your location, things like your interests.

05:14.630 --> 05:31.970
If I ask my AI walkie-talkie for five restaurants in the area that are good, ideally, if I absolutely do not like cheeseburgers, it would not give me the greatest cheeseburger restaurant in the neighborhood because it knows.

05:31.970 --> 05:36.630
And so, that contextual data is also something super sensitive that we want to protect.

05:37.570 --> 05:41.810
And the last piece is the authenticated action request.

05:41.830 --> 05:43.890
Exact same flow as everything else.

05:43.890 --> 05:48.870
The only difference is now we have to store some sort of credential somewhere, right?

05:48.870 --> 05:57.190
I can't order you food from your Uber Eats account unless I have a way to tell Uber, hey, Matt wants food from Uber.

05:57.790 --> 05:59.330
So, whenever I think about that...

06:02.110 --> 06:03.730
More examples.

06:03.790 --> 06:06.450
Call me an Uber, order me some tacos.

06:06.450 --> 06:07.970
Did Jimmy do his homework?

06:09.490 --> 06:12.510
Same data as before, but we have additional context.

06:12.510 --> 06:15.570
We have the identity of the person that's asking for it.

06:15.570 --> 06:19.130
We have additional context about who this Jimmy person is, right?

06:19.130 --> 06:22.210
Some, like, familial connection.

06:22.470 --> 06:25.050
And then authentication information.

06:28.740 --> 06:35.140
So, this is, like, the sticky point that I feel like always...

06:35.140 --> 06:36.820
It's always a really fun discussion.

06:37.420 --> 06:43.080
And so, yeah, I don't want to just make authentication information something tiny on the slide.

06:43.080 --> 06:44.780
I want to actually talk about it.

06:45.100 --> 06:49.700
So, if I think about how can I authenticate a customer?

06:50.160 --> 06:52.680
Well, or as a customer, sorry.

06:53.280 --> 06:55.800
I can do one of three things, really.

06:55.800 --> 06:58.880
I can save their username and password in a database.

06:58.880 --> 07:02.460
And then anytime I need to do something as them, I just log in as them.

07:03.180 --> 07:04.860
That's cool, right?

07:05.160 --> 07:06.300
Probably not.

07:06.640 --> 07:09.340
I can have them log in and I can store their cookies.

07:09.340 --> 07:12.640
So, at least I can't create a new session.

07:12.640 --> 07:14.900
I can only use that same session again.

07:15.320 --> 07:18.600
And then the last option is I can just use OAuth.

07:19.800 --> 07:26.220
The problem is as security professionals, it's really easy to just say go be a grown up and use OAuth.

07:26.320 --> 07:34.340
But whenever you're working with a business that has to make money, you actually have to think about these things and consider some of the tradeoffs.

07:34.340 --> 07:36.480
So, we're going to talk about some of the tradeoffs.

07:36.480 --> 07:40.000
So, if I just store the username and password, it's great.

07:40.000 --> 07:42.620
We can log in whenever we want.

07:43.040 --> 07:45.860
Sorry, yeah, wherever we want, whenever we want.

07:45.980 --> 07:52.980
I don't actually have to store any session information because if I get logged out, I'll just log back in because I know their username and password.

07:54.360 --> 07:59.460
Downside, I have their username and password and someone can steal it.

08:00.680 --> 08:03.900
Bonus, we can log in whenever we want.

08:04.440 --> 08:05.840
I covered that part already.

08:06.480 --> 08:13.920
And then the downside to that is in order to actually revoke our access, a customer has to change their password.

08:15.020 --> 08:20.640
Again, another bonus, we can do anything that the customer can do because we have their username and password.

08:20.800 --> 08:26.120
But the downside, we can do anything the customer can do, including change their password.

08:26.540 --> 08:32.920
So, if we're thinking about tradeoffs, this one doesn't feel like the right thing to do.

08:33.440 --> 08:37.140
So, the next thing we have, right, session cookies.

08:37.340 --> 08:39.280
So, lots of pros here.

08:39.280 --> 08:41.080
Sessions expire regularly.

08:41.280 --> 08:45.280
The downside for the engineering team is sessions expire regularly.

08:45.660 --> 08:49.380
I can have access to almost everything that a user can do.

08:49.380 --> 08:58.800
If you've ever tried to go in and add someone to a repository in GitHub, like, you can create a repository, just I'm logged in.

08:58.800 --> 09:02.220
But in order to add a person to that repository, you have to step up.

09:02.220 --> 09:03.560
You have to type in your password again.

09:03.560 --> 09:05.300
You have to do an MFA push.

09:05.800 --> 09:14.740
And so, this is really great because if the provider supports it, we can actually scope down what it is that we're able to do.

09:14.960 --> 09:18.640
But the downside is the provider actually has to support that.

09:18.640 --> 09:24.520
So, while GitHub might have that requirement, the McDonald's mobile app maybe doesn't.

09:24.520 --> 09:38.940
Um, another nice thing on the engineering side is typically MFA requirements, bot protection, all of that happens at sign-in and before you actually get your session token for the site.

09:40.260 --> 09:46.140
The downside is that it also doesn't usually generate a new login event.

09:46.140 --> 09:53.140
So, if you're like me, and every time you get a message from Google that says, hey, you just logged in from somewhere new, was that you?

09:53.140 --> 09:54.880
And you get like super paranoid.

09:55.320 --> 10:00.580
You're not going to get those because most providers just say, oh, you've got a session token that already works.

10:00.580 --> 10:02.000
So, we're just going to use that.

10:02.540 --> 10:04.480
So, that's not great.

10:06.420 --> 10:12.980
A good thing, users can actually manually expire those sessions for themselves, which is great, right?

10:12.980 --> 10:16.080
Because if I go to Gmail and I say, where am I logged in?

10:16.080 --> 10:18.580
And it says, I'm logged into AWS.

10:18.580 --> 10:20.140
I'm not logged into AWS.

10:20.140 --> 10:21.300
I'm going to click log out.

10:22.280 --> 10:23.100
So, that's great.

10:23.100 --> 10:28.660
It requires the provider to actually create that opportunity for their customer.

10:29.800 --> 10:35.700
And then the other nice thing about this is it can be used on almost any website, right?

10:35.720 --> 10:45.800
When we get to the OAuth piece, the biggest limitation is if you look at all of the websites on the internet, how many of them actually support OAuth?

10:45.840 --> 10:52.580
If we're in the B2B world and we're focusing just on, oh, I want Datadog.

10:52.580 --> 10:54.600
I want GitLab.

10:54.600 --> 10:57.640
I want all of these commercial enterprises.

10:57.640 --> 11:03.800
Absolutely, there's OAuth because it's a thing that we've been hounding vendors about for the last, I don't know, 20 years.

11:03.800 --> 11:05.880
But there's a benefit there.

11:05.880 --> 11:08.560
And that is, if they do it, they get our business.

11:08.560 --> 11:19.480
Whereas, if you're a local mechanic shop and you just want people to book spots online with you, you're not incentivized to invest in OAuth.

11:19.480 --> 11:24.560
How do we support the general consumer with a technology that doesn't exist everywhere?

11:25.100 --> 11:34.340
The other thing that I think makes OAuth tricky in situations like this is you have to configure it for each site.

11:35.000 --> 11:47.660
If there are 100 million sites on the internet and I hire a 10X engineer who can knock out one integration every six hours, okay, so that's 600 million?

11:47.660 --> 11:49.140
Did I say 100 million sites?

11:49.140 --> 11:50.020
I don't know.

11:50.380 --> 11:55.100
But the point is, it's a very, very long time to actually be able to reach the entire internet.

11:56.640 --> 11:58.380
So we've done our pros and cons.

11:58.380 --> 11:59.540
Let's put them on a graph.

11:59.840 --> 12:02.820
That graph saying low effort to high effort.

12:02.820 --> 12:05.620
Obviously, the business likes it whenever we do things low effort.

12:06.420 --> 12:08.240
Not secure to more secure.

12:08.240 --> 12:11.520
Obviously, as professionals, we like to be over there on the far right-hand side.

12:11.520 --> 12:13.760
So we look at this graph and we say, you know what?

12:13.760 --> 12:16.020
There's just so much risk with username and password.

12:16.020 --> 12:17.000
That's out.

12:17.000 --> 12:20.620
And then we go to our CTO and we say, hey, I want to do OAuth to the world.

12:20.620 --> 12:23.160
We're going to call get token every time we need this.

12:23.340 --> 12:28.780
And I tell them it's going to take a thousand years to get all of the sites that they want to cover done.

12:28.780 --> 12:30.160
And I get told, no, you know what?

12:30.160 --> 12:31.220
That's probably not.

12:31.220 --> 12:33.200
And even as a practitioner, right?

12:33.200 --> 12:41.680
I realized that if I try to make the world's most secure company, that's just us not making money with all the computers turned off.

12:41.680 --> 12:43.960
And I like having a place to work.

12:43.960 --> 12:45.920
I like building cool things for consumers.

12:45.920 --> 12:52.120
And so working with cookies for now is kind of like the way that I see us going.

12:53.880 --> 12:57.180
So let's talk about that user context.

12:57.520 --> 12:59.700
That authentication information.

13:00.140 --> 13:03.140
So there's sort of like the naive way, right?

13:03.140 --> 13:05.580
Where you can just do it, make it work.

13:05.580 --> 13:06.900
It's going to work great.

13:06.900 --> 13:09.360
And then there's more of a more secure way.

13:09.360 --> 13:11.200
So first let's talk about the naive way.

13:11.560 --> 13:15.780
So the first thing that I'll do is recognize, oh, the user wants to store a cookie.

13:15.780 --> 13:17.380
I'll create context.

13:17.540 --> 13:21.700
The intention controller is going to recognize that and say, oh, they want to store a cookie.

13:21.700 --> 13:22.280
Cool.

13:22.460 --> 13:25.100
It's going to create a context container.

13:25.180 --> 13:31.460
That container exists purely to allow the user to store those cookies.

13:31.700 --> 13:34.260
So some companies do it in a web browser.

13:34.260 --> 13:37.920
Some companies do it with a Chrome extension.

13:39.220 --> 13:40.840
Lots of different ways that you could do it.

13:40.840 --> 13:44.000
But the point is, we're going to collect that context.

13:44.000 --> 13:45.760
We're going to write it into a database.

13:45.780 --> 13:51.280
Whenever it comes time to use that cookie, again, it all fits on one slide.

13:51.300 --> 13:53.860
I recognize I want to use this context.

13:53.960 --> 13:55.860
I say, oh, this is Matt's user account.

13:55.860 --> 14:01.960
I'm going to go ahead and go into the database, grab Matt's cookie, and then stuff it into an actuator.

14:01.960 --> 14:05.160
That actuator now has a login session for me.

14:05.380 --> 14:08.260
And it can order the thing that I asked for.

14:08.620 --> 14:12.100
It goes off into the third party space and does the thing it's supposed to do.

14:12.100 --> 14:13.740
What's the problem with this?

14:14.900 --> 14:16.720
What makes you nervous?

14:19.260 --> 14:20.200
Stolen cookies.

14:20.200 --> 14:21.100
I heard that in the front.

14:21.100 --> 14:21.740
Awesome.

14:21.740 --> 14:22.500
Yeah, exactly.

14:22.500 --> 14:30.740
I don't want to be the guy that has a database just full of cookies that other people can just come in and take from me.

14:30.740 --> 14:33.200
That would be really, really bad.

14:33.200 --> 14:37.060
So let's think about a way that we could do this a little bit more securely.

14:37.480 --> 14:41.260
So, again, I'll recognize I want to create some context.

14:41.260 --> 14:42.680
I want to store that cookie.

14:42.680 --> 14:47.040
The intention controller is going to recognize that, very similar to before.

14:47.060 --> 14:51.380
It's going to create that web browser so that the customer can log in.

14:51.380 --> 14:54.720
But then notice we have a vault service down below.

14:54.720 --> 15:08.840
And so once that cookie's collected, instead of just stuffing it into a vault and then returning it to the database, what we're actually going to do is we're going to stuff it into the vault, but we're also going to add the identity of the customer it belongs to.

15:08.840 --> 15:14.720
So when we get to the next slide, you'll see that we should actually say, hey, yes, I want this cookie.

15:14.720 --> 15:17.420
Also, Matt said I could have it two minutes ago.

15:17.420 --> 15:26.040
And so by having a short-lived JWT that the user provides to you, your life just gets a lot better.

15:26.040 --> 15:31.680
I can sleep a lot better at night knowing that I'm not storing cookies for 100,000 people.

15:31.680 --> 15:41.060
I'm storing encrypted blobs, and you would have to actually have a request from the user in order to go get that cookie.

15:42.900 --> 15:48.800
So when we get to using the context securely, I kind of already covered this, but we'll walk through it again.

15:48.880 --> 15:52.260
We recognize the user wants to take an authenticated action.

15:52.260 --> 15:56.220
We get the object ID and not the actual object from the database.

15:56.520 --> 16:05.040
We send that object ID and the user's JWT to our vault, or sorry, to our context actuator.

16:05.040 --> 16:11.420
The context actuator now is the thing that reaches out to the vault and gets that cookie.

16:11.420 --> 16:21.740
And so this one tiny space in our network is the only place that with a request from the customer, you can actually go get their cookie.

16:23.020 --> 16:27.500
Once the actuator performs the action, we tear it down.

16:27.500 --> 16:28.600
We never use it again.

16:28.600 --> 16:30.320
It was just that one thing.

16:30.320 --> 16:37.780
So the risk of someone coming in and stealing a token off of the actuator gets a lot smaller, right?

16:37.780 --> 16:47.240
Essentially, we're looking at build system compromises that allow you to get in versus earlier it was just, can someone access my database?

16:49.300 --> 16:53.980
So it was a lot as far as securing the customer context.

16:54.200 --> 16:57.520
So some do's and don'ts to sort of take away.

16:57.740 --> 16:59.820
Don't collect context that'll make you a target.

17:01.000 --> 17:13.300
If you are only storing cookies for DoorDash, Spotify, and Uber, not a lot of people are going to come after you, right?

17:13.420 --> 17:19.540
Why do I want this cookie that is likely going to get caught?

17:19.540 --> 17:23.220
There's much better things for me to spend my time on as an attacker.

17:23.280 --> 17:35.140
So if we ever get to a world where somebody wants to use their AI walkie talkie to spend money, I don't want to store that financial instrument because that makes me a target.

17:35.640 --> 17:43.480
And so allowing vendors, service providers to actually own that piece is super, super important to me.

17:43.620 --> 17:52.540
The second piece is don't reuse context or, yeah, context containers or actuators across users.

17:52.540 --> 17:57.700
So anytime I'm taking something sensitive from the customer, it should be a one-off thing.

17:57.700 --> 17:59.740
And then when it's done, it should go away.

17:59.740 --> 18:11.380
And then I don't ever have to worry about, oh, well, I accidentally ordered $1,000 worth of tacos on Jay's Uber Eats account instead of on Matt's.

18:11.380 --> 18:17.140
And now Jay has a ton of tacos to share with who?

18:17.140 --> 18:18.380
I don't know.

18:18.380 --> 18:20.380
So not doing those.

18:20.380 --> 18:26.800
And then the other don't, big don't, is don't trust that context as being true, right?

18:27.880 --> 18:34.560
It's really easy for our engineers and developers to think, oh, yeah, no, this is a cookie that the customer gave us to order for them.

18:34.560 --> 18:35.640
So that's good, right?

18:35.640 --> 18:36.940
No , the answer is no.

18:36.940 --> 18:42.040
This is data that came from the internet, and we should just treat it like all the other data that came from the internet.

18:42.560 --> 18:44.000
A couple of do's.

18:44.420 --> 18:51.100
Allow less vault access to only that one thing that actually needs to go get it.

18:51.100 --> 19:02.960
This way, if you do have any issues with people trying or having the ability to connect to your vault service, they can't actually do anything, right?

19:02.960 --> 19:08.410
Because you have to be running in that one specific container in order to access those tokens.

19:09.100 --> 19:14.500
And then the last piece, which is kind of my favorite, is correlation IDs.

19:14.500 --> 19:24.480
Anytime I need to ask for a cookie from the vault, I should be able to match that up to a request that came from a physical device.

19:24.800 --> 19:33.980
And if I can't, that means that somebody that I work with is going to have a bad day, or I'm going to have a bad day because somebody else is creating those requests.

19:34.260 --> 19:49.520
And so I think that's a thing that we sort of owe to our customers when we build devices like this , is a way to tell them not only are we doing our best to protect your authentication information from random people on the internet, but we also recognize your data is important to you.

19:49.520 --> 19:52.880
We are not you, so we shouldn't have access to it either.

19:52.880 --> 20:05.140
And so by introducing those correlation IDs, you can do really cool things like requiring that correlation ID to exist before the request gets routed into the vault.

20:05.140 --> 20:11.980
Or you can just set up automated alerting so that you know if it ever happens, you at least know about it.

20:11.980 --> 20:15.620
So do's and don'ts for context.

20:16.260 --> 20:19.420
So the next piece, securing customer conversations.

20:19.840 --> 20:23.780
This one was really, really fun to think about.

20:24.620 --> 20:30.020
So if I take out my AI walkie-talkie and I say, what's my favorite color?

20:30.260 --> 20:33.600
There's a couple of types of data that happen there, right?

20:33.600 --> 20:37.920
We still have our same speech-to-text request and response.

20:37.920 --> 20:43.340
We still have the LLM request and response and the text-to-speech back as well.

20:43.340 --> 20:47.860
So essentially, I have audio data and I have text data that I need to worry about.

20:49.220 --> 20:55.400
As far as what type of binary data, it might be an audio recording, but it also might be a picture, right?

20:55.400 --> 20:59.440
Maybe your magic AI walkie-talkie takes magic photos.

20:59.440 --> 21:04.200
And when it takes the photo, it converts it into some cool 8-bit format.

21:05.380 --> 21:12.680
I probably don't want random people on the internet or even the company that makes that AI walkie-talkie to have access to those pictures, right?

21:12.680 --> 21:14.460
Because I'm a general consumer.

21:14.460 --> 21:16.360
Why do people need access to that?

21:17.800 --> 21:22.140
Same thing goes with all of the text-to-speech that we just talked about, right?

21:22.140 --> 21:24.080
We have a transcript of what the user said.

21:24.100 --> 21:26.280
We have an answer to their question.

21:26.520 --> 21:29.660
And we have what we want the device to echo back.

21:29.980 --> 21:31.700
So how do we store that?

21:31.700 --> 21:36.620
A really, really easy way is I have my magic AI gadget.

21:36.940 --> 21:46.640
It sends a request to that super awesome router that will take everything that I wrote and then just store it in a database.

21:46.640 --> 21:49.320
If it's binary data, it'll just store it in S3.

21:50.140 --> 21:53.120
In the database, I just put a pointer to S3.

21:53.120 --> 21:53.780
Life's great.

21:53.780 --> 21:55.400
This is super easy, right?

21:55.500 --> 22:00.120
Again, we're storing sensitive things about people in a database.

22:00.120 --> 22:05.520
I don't want to be, like, going to sleep at night knowing that that happens.

22:05.520 --> 22:10.120
So what do we do to make life a little bit safer?

22:10.820 --> 22:23.880
So instead of just receiving that data from the magical device and then writing it all down, again, we'll do the same thing with our Vault engine.

22:23.880 --> 22:35.780
And so whenever we receive the data, we'll actually reach out to the Vault engine and say, can I have... kind of got two really cool options here.

22:35.780 --> 22:45.420
So you could have the service send that data to the Vault engine, have it encrypt it, and then return back to you the ciphertext.

22:45.420 --> 22:47.060
And now you can just write that.

22:47.060 --> 22:52.940
Now in the future, you just have to take that ciphertext and say, Vault engine, can you give me this data in plain text, please?

22:52.940 --> 22:57.320
The other option that you have is you can request the customer's storage key.

22:57.320 --> 22:59.760
And you can say, please give me the key for Matt Damko.

22:59.760 --> 23:01.560
I have a bunch of stuff I want to write.

23:01.600 --> 23:07.520
In both cases, I'm not storing things that I have access to.

23:07.520 --> 23:14.780
I'm storing things that I only have access to for that two-minute window whenever Matt Damko pushes the button.

23:20.140 --> 23:23.760
So I've got some do's and don'ts for securing those conversations.

23:24.880 --> 23:28.500
So please don't use built-in types for these things.

23:28.720 --> 23:34.840
My worst day ever is whenever someone says, oh, yeah, no, we're just sending this JSON.

23:34.880 --> 23:36.200
And there's just like a string there.

23:36.200 --> 23:36.720
And I look at it.

23:36.720 --> 23:37.360
I'm like, oh, OK, cool.

23:37.360 --> 23:37.920
It's just a string.

23:37.920 --> 23:38.700
No big deal.

23:38.700 --> 23:46.520
And that string is actually like six hours of me watching Gilmore Girls because I started a meeting transcription during it.

23:46.640 --> 23:51.600
So rather than taking these things and just going with the defaults, let's create a custom object.

23:51.600 --> 23:57.880
Use a strongly typed language that allows you to say, OK, this is actually a type of sensitive data.

23:57.880 --> 24:08.540
And the only way that it's allowed to be logged is either through that vault controller interaction or through a secure logger.

24:09.300 --> 24:10.160
So, yeah, don't...

24:10.160 --> 24:12.020
Please, one second.

24:14.220 --> 24:17.040
So the other thing that definitely...

24:18.140 --> 24:21.480
In the business-to-business space, it happens.

24:21.480 --> 24:24.140
It's not great, but it could be worse, right?

24:24.160 --> 24:32.140
Essentially, if I need to do analytics on data and I have the data in a place, well, let me just go grab that data and do analytics.

24:32.480 --> 24:38.480
It's one thing to do it whenever it's how many times did my employees click on a phishing link.

24:38.480 --> 24:46.160
It's another thing altogether for it to be a recording of me and my kid talking about something.

24:48.020 --> 24:50.160
So don't let it happen, right?

24:50.160 --> 24:55.980
Don't share data between production and anything else.

24:55.980 --> 25:01.720
If you're not using that data to provide a direct value to the user, you're essentially stealing their data right now.

25:01.720 --> 25:03.120
And I'm not a fan.

25:04.240 --> 25:10.380
And then the last one, don't allow new log types without a privacy and security review.

25:10.380 --> 25:29.100
And so this is a thing that I've sort of started harping on a lot more at work, which is like, if you want to do something new, and it has to do with customer data, we owe it to our customers to spend 15 minutes drawing out what we're going to do, identifying the data that we're going to write down,

25:29.100 --> 25:33.480
and talking about whether or not that is a good thing to do with our customers' data.

25:34.680 --> 25:37.780
So yeah, don't do that.

25:38.920 --> 25:41.660
Do move encryption to client-side where possible.

25:41.660 --> 25:54.260
So the way that it is in this diagram that I just showed you, is as the service provider, you can just grab a JWT and go get the data.

25:54.440 --> 26:00.780
Wouldn't it be great if the only person that had your data was like you in your web browser, when you get to go view your pictures?

26:00.780 --> 26:01.560
That would be great.

26:01.560 --> 26:03.500
That's a technology that exists.

26:04.280 --> 26:14.760
It's not a technology that exists, as far as I'm aware, that works really well with AI use cases, where we want to get your permission to use your data to make things better.

26:15.400 --> 26:23.120
And so that's a tough road to climb, but I think that it's a goal to move towards.

26:24.260 --> 26:26.300
Require a short-lived JWT.

26:26.600 --> 26:29.800
This is really, really easy to do.

26:30.060 --> 26:36.600
When your user wants to do something, make them send you a token that says that they want to do it, and have that expire quickly.

26:36.960 --> 26:44.740
If you look into the different types of vault providers that exist, I know of at least one that does that.

26:44.740 --> 26:52.380
You can give them a JWT, and they will only give you the data back if that JWT is signed by the customer, the person who owns the data.

26:52.760 --> 26:55.480
I sleep a lot better at night knowing that I have that.

26:56.320 --> 27:14.720
And then the last piece, if you've ever worked at an AI company, you probably have a chat room where it's just AI news, and people are excited about new models and new things that are coming out, and Anthropic has this, AWS has this, OpenAI has this, and they want to try it out.

27:14.720 --> 27:27.180
The problem is, unless you have a commercial agreement with them, a lot of times, you're just sort of giving them free reign to do whatever they want with your customer data.

27:27.280 --> 27:37.400
And so one of the things that I've worked really hard on at the last few jobs has been making sure that we actually make those thoughtful decisions.

27:37.400 --> 27:43.280
We say, okay, this type of data, maybe we're okay with that company using it for whatever they want.

27:43.280 --> 27:51.560
But this other type of data, super, super important to us, and we're not going to allow it to go to those levels of LLMs.

27:51.840 --> 27:54.440
Essentially, pay more to protect our customers.

27:54.540 --> 27:55.560
I think it's worth it.

27:57.180 --> 28:01.580
So the last one is privacy-focused logging.

28:02.200 --> 28:08.800
So if you're an engineer, and you're coming up with logs for this new service you built, this is probably how you're going to do your logs.

28:08.800 --> 28:12.640
You're just going to take everything that you know, and you're like, I might need this someday, ship it to Datadog.

28:13.280 --> 28:18.820
And then one of your SRE managers is going to be like, hey, so your Datadog bill's kind of high, can you cut it back?

28:18.820 --> 28:20.460
You're like, no, I need all of this.

28:20.460 --> 28:24.100
I need every single piece of data that comes in, or I can't do my job.

28:24.660 --> 28:27.020
Okay, that's a way.

28:27.180 --> 28:29.380
But again, we're talking about consumers.

28:29.380 --> 28:33.160
We're not talking about business-to-business operations.

28:33.220 --> 28:42.820
And so if I'm a consumer, and I have to worry about every single thing being stored on my behalf, I start to get nervous.

28:42.820 --> 28:50.000
And so what I like to do in these cases is require a custom logging handler.

28:50.200 --> 28:53.460
Engineers are already creating these to make their lives easier.

28:53.460 --> 29:01.500
All you have to do as the security person is say, hey, so right now it looks like you're taking everything, you're formatting it, and then you're shipping it out.

29:01.500 --> 29:07.920
What I would love for you to do is instead explicitly declare these are the fields that we're going to log.

29:07.920 --> 29:17.680
And by forcing them to explicitly declare the fields that they're going to log, you don't have to worry about, oh, I just updated the code to log this extra field.

29:17.780 --> 29:22.180
Also, it's everyone's birthday and social security number.

29:22.180 --> 29:23.380
That's okay, right?

29:23.400 --> 29:26.600
You don't have to worry about that because the logger won't allow it.

29:26.600 --> 29:37.980
And now instead of monitoring your entire code base for a change that might log something in a wrong way, you only have to monitor that base privacy logger.

29:38.080 --> 29:40.140
So it's definitely worth investment.

29:40.140 --> 29:47.840
And this code is from ChatGPT, write me a privacy-focused log handler in Python.

29:48.280 --> 29:49.580
It might work.

29:49.580 --> 29:51.020
I don't know.

29:51.180 --> 29:57.040
But the point is, it's not super difficult, and your engineers are likely already doing it anyway.

30:00.060 --> 30:04.220
So some highlights on privacy-focused logging.

30:04.540 --> 30:12.280
Prefer metrics over, like, actual counts and group by statements whenever you're thinking about things.

30:12.280 --> 30:17.380
You don't need to log every single request in order to know how many requests happened, right?

30:17.380 --> 30:22.300
And so if you don't need to store the data, don't.

30:22.720 --> 30:34.040
A thing that I've been big about for a very long time has been the fact that business metrics and that type of work needs to be a feature request of the product.

30:34.040 --> 30:38.280
This is not something where, oh, I've got a really strong program manager.

30:38.280 --> 30:44.280
They're going to go into Datadog and create these dashboards that are going to tell them what our most popular feature is.

30:44.280 --> 30:46.400
It's a very, very easy shortcut.

30:46.400 --> 30:53.480
But it's also a very, very easy, easy way to lose control of the way that you're managing the privacy of your customer data.

30:53.900 --> 31:04.080
And so rather than getting into that, when we do a product design doc, right, let's explicitly call out, I need these metrics.

31:04.260 --> 31:06.560
And now it's part of the product.

31:06.560 --> 31:11.800
You don't have to go look through logs because you've already decided I'm going to use counters instead.

31:11.960 --> 31:15.140
Engineering logs for engineering things.

31:15.340 --> 31:18.820
We talked about using custom logging classes.

31:19.620 --> 31:22.380
Anonymize where possible, pseudo-anonymize everywhere else.

31:22.740 --> 31:30.720
So I might need to know which user I'm dealing with whenever I'm solving an engineering challenge.

31:30.720 --> 31:34.460
I don't need to know that user's email.

31:34.460 --> 31:37.260
I don't need to know that user's address.

31:37.260 --> 31:38.880
I don't need to know any of those things.

31:38.880 --> 31:44.400
I just need to be able to say, user 123 of 1000.

31:44.480 --> 31:54.660
And so this is where, when we do logging, rather than logging all of the information we have about that customer, let's just log a pseudo-anonymized user ID.

31:54.660 --> 32:00.940
It doesn't provide access to anything, but it lets us sort of work through the streams and track down when bugs happen.

32:02.320 --> 32:06.840
Set an extremely short time limit for your engineering logs.

32:06.840 --> 32:12.880
If you need something for longer than a week, two weeks, that should probably live somewhere else.

32:12.880 --> 32:14.840
Probably doesn't need to be in Datadog.

32:14.840 --> 32:16.960
Your CFO is going to thank you.

32:17.320 --> 32:22.600
And so are your customers, because you're not storing their personal data somewhere that you don't need to.

32:24.000 --> 32:26.100
Enforce just-in-time logging.

32:26.100 --> 32:40.720
So I think one of the coolest and scariest things about joining an engineering team at Facebook is like the first two days when they're like, oh yeah, and by the way, if you look at anyone that you work with's data, we're going to fire you.

32:40.720 --> 32:42.680
And I'm just like, I don't even want to accidentally do that.

32:42.680 --> 32:43.860
You're paying me really well.

32:43.860 --> 32:45.020
I get free pizza.

32:45.020 --> 32:47.000
Like, why would I mess that up?

32:47.020 --> 32:58.140
And the way that they enforce that is, if you need access to something and you don't have it by default, you just go find the table and say, I would like access to this.

32:58.320 --> 32:59.560
I need it for this long.

32:59.560 --> 33:02.140
And this is my business purpose behind it.

33:02.280 --> 33:10.840
And as long as it's not like your ex-partner's page, it'll just grant you access and log it.

33:11.020 --> 33:19.840
And I feel like it's way better to have that than, oh yeah, just everybody in engineering has access to everything all the time.

33:19.840 --> 33:28.420
So that just-in-time access gives us, again, a little bit more safety and a little bit better of a way to recognize when something's going off the rails.

33:29.560 --> 33:36.920
All of the do's and don'ts that we talked about in the other two sort of apply to privacy-focused logging as well.

33:37.740 --> 33:41.940
All right, the last one, privacy-focused analytics.

33:42.400 --> 33:51.200
So if I've got a feature that's out there, it's doing great things, but I want to make it faster, but I don't understand what requests are happening.

33:51.200 --> 33:57.680
And so I need to actually see these requests in order to make the product work better.

33:57.680 --> 34:15.380
Well, 18-year-old Matt Domko goes into the routing engine and he just adds a new branch of code for 2A that says, yeah, so anytime somebody makes a request, I want you to go do the thing that you always do, but also log a copy of it to my analytics storage.

34:15.780 --> 34:23.340
And then once that table is super full or that bucket has all the data I need, I can go in and do some sort of analytics process on it.

34:23.900 --> 34:31.940
The problem with that is in order to solve whatever challenge I'm facing, again, I probably don't need to know the customer's name.

34:31.940 --> 34:35.060
I don't need to know all of the things that they did.

34:35.060 --> 34:43.220
I probably just need to know what's the length of their request and what time was it when they made the request.

34:43.220 --> 34:47.640
Well, whatever the thing is that I need, it's probably not everything.

34:48.780 --> 34:58.980
So the way that I've thought about handling this, we have our new analytics logger.

34:58.980 --> 35:13.380
And again, we still insert it into 2A, but instead of having it directly write data outside of my little nice fancy production bubble where data never leaves, I read it to a privacy filtering account.

35:13.380 --> 35:25.920
And so that privacy filtering account, whenever it receives new data, it reaches in and it says, I'm expecting that Matt needs to know the locations of every failed Uber request.

35:26.080 --> 35:35.480
And so what that privacy filtering Lambda will do is it will just extract the location and the time that it happened.

35:35.980 --> 35:43.500
Because I don't need to know anything else about that conversation or what's going on except for that one single line.

35:43.500 --> 35:47.620
So why would I allow myself to copy the entire thing out?

35:47.620 --> 35:53.260
So I create this process where in order to get data out of production, I ensure that it's anonymized.

35:53.260 --> 35:55.860
I ensure that I only have the data that I need.

35:55.860 --> 36:04.340
Once that data has been cleaned, we've ran it through something like Amazon Macie to check for PII and things like that.

36:04.340 --> 36:10.440
Then we'll go ahead and copy it from the privacy account into the analytics account.

36:10.820 --> 36:12.740
Analytics is already expensive.

36:12.920 --> 36:21.200
And so like this additional process that we're introducing in order to protect our customers is totally worth it.

36:24.980 --> 36:35.340
And so we've got a summary of the things that have made my life easier in protecting customers' privacy.

36:35.440 --> 36:41.160
The first thing, simple data classification guide.

36:41.320 --> 36:44.180
Anyone that was ever in the military, they've got like those colors.

36:44.180 --> 36:46.540
And when you see colors, you're like, oh, this is sensitive.

36:46.540 --> 36:48.800
I shouldn't do anything wrong with this.

36:48.800 --> 36:49.880
This is green.

36:49.880 --> 36:52.680
I think I can do whatever I want with this, but let me check.

36:53.740 --> 37:02.440
Having some sort of simple guide where your engineers know if data is labeled as red, that means it can't leave prod.

37:02.440 --> 37:10.700
If data is labeled as yellow, it means it can go from prod into the privacy account, into an analytics account.

37:10.700 --> 37:13.440
If data is labeled as green, it's on the website.

37:13.440 --> 37:14.580
So who cares?

37:14.580 --> 37:20.180
But coming up with those shortcuts for your engineers is going to make your life a lot easier.

37:21.880 --> 37:23.940
Build that culture of design reviews.

37:24.020 --> 37:25.060
Show up to them.

37:25.140 --> 37:29.080
I know that our engineers build a lot of really cool stuff all the time.

37:29.800 --> 37:32.260
And that means I'm going to be at more meetings.

37:32.260 --> 37:33.540
But again, it's worth it.

37:33.540 --> 37:35.080
You're learning more about the product.

37:35.200 --> 37:42.980
You have a chance to actually step in and say, well, what is this data and why do you actually need to store it or move it or read it?

37:43.620 --> 37:45.280
So build that culture.

37:45.280 --> 37:46.700
Show up to those things.

37:47.600 --> 37:49.080
Service control policies.

37:49.080 --> 37:53.680
So these exist, I know, in AWS and Azure.

37:53.680 --> 37:57.700
Does GCP have something like this where you can say you're not allowed to break this rule no matter what?

37:57.700 --> 37:58.940
I don't care who you are.

37:59.980 --> 38:01.040
Yeah, okay.

38:01.760 --> 38:03.220
So set that up.

38:03.220 --> 38:09.020
If you have a production account where all of your day-to-day data exists, make it so you can't mess it up.

38:09.020 --> 38:14.500
No data is allowed to leave production except for to go to this singular privacy account.

38:15.580 --> 38:21.580
It works fairly well and it keeps you out of trouble when you're traveling or at a conference talking about privacy.

38:23.460 --> 38:32.840
The two-step filtering process that we talked about, I feel like that's the only way that we can truly ensure we're not accidentally moving data somewhere we shouldn't.

38:33.140 --> 38:36.520
And so think about how to implement something like that.

38:36.820 --> 38:48.740
There's tons of services and all the different cloud providers that will parse your data and tell you yes or no, this has sensitive data in it.

38:49.320 --> 38:54.500
I just learned about S3 bucket filtering?

38:54.720 --> 38:56.280
I don't remember the exact name.

38:56.280 --> 39:02.280
But anyway, you can create a new S3 access point.

39:02.280 --> 39:03.200
We'll go with that.

39:03.200 --> 39:18.860
You can create a new S3 access point and say through this access point, you can only read filtered data, which kind of takes your hands away from having to do anything as long as you only let your developers read through that singular access point.

39:21.340 --> 39:23.580
Oh, yes, almost done.

39:23.840 --> 39:29.900
So a couple of guidelines that I've set with the teams that I've worked with in the past.

39:30.040 --> 39:34.900
This is the one that you screenshot and send to everyone.

39:35.260 --> 39:37.340
And it's really just four questions.

39:37.360 --> 39:39.760
Are you logging a new type of data?

39:40.260 --> 39:41.420
We should talk.

39:41.520 --> 39:43.520
Are you moving data outside of broad?

39:43.520 --> 39:44.660
We should talk.

39:45.140 --> 39:47.500
Are you connecting to broad databases?

39:47.660 --> 39:48.880
We should talk.

39:48.880 --> 39:51.480
Are you bringing in a new tool or vendor?

39:51.500 --> 39:52.740
We should talk.

39:53.600 --> 39:58.280
I think those are fairly easy to do in practice.

39:58.620 --> 40:02.140
And it's worth the extra time that we have to invest.

40:04.600 --> 40:05.840
That's it.

40:06.720 --> 40:08.180
What time is it?

40:08.180 --> 40:09.120
4.42?

40:09.440 --> 40:12.780
I have time for questions if anybody has any.

40:12.780 --> 40:17.120
If not, I'm going to get off the stage and chug a bunch of water.

40:18.620 --> 40:20.800
Oh, contact page.

40:20.800 --> 40:25.120
So , hashtag cyber on the Twitter.

40:26.220 --> 40:33.220
And if you're worried about your Rabbit R1, security at rabbit.tech.

40:37.240 --> 40:41.620
I don't... that guy right there.

40:41.620 --> 40:42.740
Cool.

40:42.740 --> 40:44.340
Well, thank you, everybody.

40:44.340 --> 40:45.420
Have a great con.

