start	end	text
600	3000	So, hi everybody, my name is Matt Domko.
4120	7080	I don't know who that was, but they're my new best friend.
7440	13280	So, you are at Data on Demand, the challenges of building a privacy-focused AI device.
13520	23600	And in reality, what I want to talk about is I am a consumer and also a supporter of
24120	26580	the AI magical things.
27220	31840	And if I have the one that I work on at work, or if I have one from somebody else,
31840	35300	they're just certain things that I really want to make sure that they happen.
35340	38360	And that's kind of the goal of this thing.
38860	42200	So, I do have a job. They pay me to do stuff.
42760	50180	These are my thoughts, things in my brain that I wrote down in order to make a device safer.
50560	55100	But this is not the thoughts and ideas of my company.
56740	58660	A company I work at.
58840	63440	So, I'm into 3D printing, laser cutting, cosplay, mostly steampunk stuff.
63840	67880	If you ever want to nerd out about any of that, or just security education in general,
67880	69800	I'm super, super into it.
70100	74760	I'm also the director of fun at Tynes, if anybody's familiar with Tynes.
74780	79020	It's an unofficial title and they don't pay me, but I'm the director of fun.
80460	82580	Here's the agenda we'll work through.
83760	85440	So, the problem.
85440	86940	There's all these things.
86940	88960	And it's funny, when I was creating these slides,
88960	91260	it was like, okay, what are the AI devices that exist?
91260	92520	And there were like three.
92540	96320	And then all of a sudden, we had two new ones appear that are the exact same,
96320	98040	but different with the same name.
98040	98680	I don't know.
98680	104380	Anyway, the point is, is I want a hardware device that makes AI easy for just the general consumer.
104440	109640	But I want to respect their privacy because it's the right thing to do.
110160	113540	And so, it's kind of a challenge when you think about
113540	116900	the difference between working in the consumer space,
116900	121720	where it's like anyone in my family who's not into technology might actually
121720	127040	purchase one of these versus the team that I work with at an organization
127040	132520	and they already have an understanding of how they treat their data and where it's going.
132960	140740	So, before we get into the pipelines that we should be using to protect that data,
140740	144680	I want to start off talking about some basic request workflows.
144960	149140	So, when I think about doing something with any kind of AI,
149140	151740	it's really four different types of requests.
151740	155380	And it's basically two with little differences.
155500	157500	So, the first one is just a general knowledge request.
157500	159340	I don't need to know anything about you.
159340	162680	I can just make this request.
162700	165460	The second one is a contextual knowledge request.
165460	170060	So, I need to know some things about you, but I don't need any super sensitive data.
170600	171940	Generic actions requests.
171940	175220	So, if I want to do something for you, but it could be anybody.
175220	177760	It could be done for Matt. It could be done for Steve.
177760	180560	It could be done for Jay. I think that's who that was now.
182060	183020	That's what we would do.
183020	185500	But if I wanted to do something on behalf of you,
185500	188200	on your Spotify account, on your Grubhub account,
188200	190340	whatever it is, I need to be authenticated.
190440	194340	And so, that's that fourth type that I like to think about.
196020	199320	So, if we look at the general knowledge request,
199320	201480	it's fairly simple.
201480	204120	So, I have my AI walkie-talkie.
204120	208500	I push the button and I say whatever it is I'm going to say.
209120	211100	What's the weather out today?
212120	215800	It's going to go up through the internet into my cloud provider.
215840	219900	There's a routing and storage and replay engine that sort of glues everything together.
219900	224980	But at its core, we're really just doing speech to text, text to speech,
224980	229300	and some LLM calls to figure out what the right answer is.
229320	233720	So, that's a knowledge request.
234000	239600	When we're doing those types of requests, right, what kind of data are we thinking about?
239800	244960	Well, if my request is tell me a fact about cats, super easy.
245000	249300	If I say I've got a weird rash, should I see a doctor?
249340	253360	A little bit more sensitive than tell me a fact about cats.
253360	257460	And so, when I think about protecting this data, it's really three different kinds.
257460	263660	I've got audio data, that recording of my voice that needs to get converted into speech to text.
263820	268580	I've got the transcript data, which is the result of that speech to text call.
268580	273420	And then I've got my response data, which is where I took that text,
273420	277400	ran it through an LLM, and had the LLM give me an answer.
279040	285140	When we think about generic action requests, it's very, very similar to what we just saw.
285140	287820	The only difference is now we insert an actuator.
287820	292980	So, an actuator is just a thing that can perform a task when you provide an input.
293400	298820	And so, this is the thing that calls the Google Weather API for you.
301350	305790	As far as the types of data that we need and that we need to protect,
305790	311230	we've still got our audio, transcript, and response data, but we also have some contextual data, right?
311230	314630	Things like your location, things like your interests.
314630	323230	If I ask my AI walkie-talkie for five restaurants in the area that are good,
323230	327450	ideally, if I absolutely do not like cheeseburgers,
327450	331970	it would not give me the greatest cheeseburger restaurant in the neighborhood because it knows.
331970	336630	And so, that contextual data is also something super sensitive that we want to protect.
337570	341810	And the last piece is the authenticated action request.
341830	343890	Exact same flow as everything else.
343890	348870	The only difference is now we have to store some sort of credential somewhere, right?
348870	354590	I can't order you food from your Uber Eats account unless I have a way to tell Uber,
354590	357190	hey, Matt wants food from Uber.
357790	359330	So, whenever I think about that...
362110	363730	More examples.
363790	367970	Call me an Uber, order me some tacos. Did Jimmy do his homework?
369490	372510	Same data as before, but we have additional context.
372510	375570	We have the identity of the person that's asking for it.
375570	379130	We have additional context about who this Jimmy person is, right?
379130	382210	Some, like, familial connection.
382470	385050	And then authentication information.
388740	395140	So, this is, like, the sticky point that I feel like always...
395140	396820	It's always a really fun discussion.
397420	401860	And so, yeah, I don't want to just make authentication information something tiny
401860	403080	on the slide.
403080	404780	I want to actually talk about it.
405100	409700	So, if I think about how can I authenticate a customer?
410160	412680	Well, or as a customer, sorry.
413280	415800	I can do one of three things, really.
415800	418880	I can save their username and password in a database.
418880	422460	And then anytime I need to do something as them, I just log in as them.
423180	424860	That's cool, right?
425160	426300	Probably not.
426640	429340	I can have them log in and I can store their cookies.
429340	432640	So, at least I can't create a new session.
432640	434900	I can only use that same session again.
435320	438600	And then the last option is I can just use OAuth.
439800	444980	The problem is as security professionals, it's really easy to just say go be a grown
444980	446220	up and use OAuth.
446320	450760	But whenever you're working with a business that has to make money, you actually have
450760	454340	to think about these things and consider some of the tradeoffs.
454340	456480	So, we're going to talk about some of the tradeoffs.
456480	460000	So, if I just store the username and password, it's great.
460000	462620	We can log in whenever we want.
463040	465860	Sorry, yeah, wherever we want, whenever we want.
465980	470560	I don't actually have to store any session information because if I get logged out, I'll
470560	472980	just log back in because I know their username and password.
474360	479460	Downside, I have their username and password and someone can steal it.
480680	483900	Bonus, we can log in whenever we want.
484440	485840	I covered that part already.
486480	491560	And then the downside to that is in order to actually revoke our access, a customer
491560	493920	has to change their password.
495020	499260	Again, another bonus, we can do anything that the customer can do because we have their
499260	500640	username and password.
500800	506120	But the downside, we can do anything the customer can do, including change their password.
506540	512920	So, if we're thinking about tradeoffs, this one doesn't feel like the right thing to do.
513440	517140	So, the next thing we have, right, session cookies.
517340	519280	So, lots of pros here.
519280	521080	Sessions expire regularly.
521280	525280	The downside for the engineering team is sessions expire regularly.
525660	529380	I can have access to almost everything that a user can do.
529380	536200	If you've ever tried to go in and add someone to a repository in GitHub, like, you can create
536360	538800	a repository, just I'm logged in.
538800	542220	But in order to add a person to that repository, you have to step up.
542220	543560	You have to type in your password again.
543560	545300	You have to do an MFA push.
545800	552240	And so, this is really great because if the provider supports it, we can actually scope
552240	554740	down what it is that we're able to do.
554960	558640	But the downside is the provider actually has to support that.
558640	564520	So, while GitHub might have that requirement, the McDonald's mobile app maybe doesn't.
564520	572860	Um, another nice thing on the engineering side is typically MFA requirements, bot protection,
572860	578240	all of that happens at sign-in and before you actually get your session token for the
578240	578940	site.
580260	586140	The downside is that it also doesn't usually generate a new login event.
586140	590440	So, if you're like me, and every time you get a message from Google that says, hey,
590440	593140	you just logged in from somewhere new, was that you?
593140	594880	And you get like super paranoid.
595320	599540	You're not going to get those because most providers just say, oh, you've got a session
599540	600580	token that already works.
600580	602000	So, we're just going to use that.
602540	604480	So, that's not great.
606420	612100	A good thing, users can actually manually expire those sessions for themselves, which
612100	612980	is great, right?
612980	616080	Because if I go to Gmail and I say, where am I logged in?
616080	618580	And it says, I'm logged into AWS.
618580	620140	I'm not logged into AWS.
620140	621300	I'm going to click log out.
622280	623100	So, that's great.
623100	628660	It requires the provider to actually create that opportunity for their customer.
629800	635700	And then the other nice thing about this is it can be used on almost any website, right?
635720	642720	When we get to the OAuth piece, the biggest limitation is if you look at all of the websites
642720	645800	on the internet, how many of them actually support OAuth?
645840	652580	If we're in the B2B world and we're focusing just on, oh, I want Datadog.
652580	654600	I want GitLab.
654600	657640	I want all of these commercial enterprises.
657640	661200	Absolutely, there's OAuth because it's a thing that we've been hounding vendors about for
661200	663800	the last, I don't know, 20 years.
663800	665880	But there's a benefit there.
665880	668560	And that is, if they do it, they get our business.
668560	674900	Whereas, if you're a local mechanic shop and you just want people to book spots online
674900	679480	with you, you're not incentivized to invest in OAuth.
679480	684560	How do we support the general consumer with a technology that doesn't exist everywhere?
685100	692080	The other thing that I think makes OAuth tricky in situations like this is you have to configure
692080	694340	it for each site.
695000	701420	If there are 100 million sites on the internet and I hire a 10X engineer who can knock out
701420	707660	one integration every six hours, okay, so that's 600 million?
707660	709140	Did I say 100 million sites?
709140	710020	I don't know.
710380	715100	But the point is, it's a very, very long time to actually be able to reach the entire internet.
716640	718380	So we've done our pros and cons.
718380	719540	Let's put them on a graph.
719840	722820	That graph saying low effort to high effort.
722820	725620	Obviously, the business likes it whenever we do things low effort.
726420	728240	Not secure to more secure.
728240	731520	Obviously, as professionals, we like to be over there on the far right-hand side.
731520	733760	So we look at this graph and we say, you know what?
733760	736020	There's just so much risk with username and password.
736020	737000	That's out.
737000	740620	And then we go to our CTO and we say, hey, I want to do OAuth to the world.
740620	743160	We're going to call get token every time we need this.
743340	747860	And I tell them it's going to take a thousand years to get all of the sites that they want
747860	748780	to cover done.
748780	750160	And I get told, no, you know what?
750160	751220	That's probably not.
751220	753200	And even as a practitioner, right?
753200	759840	I realized that if I try to make the world's most secure company, that's just us not making
759840	761680	money with all the computers turned off.
761680	763960	And I like having a place to work.
763960	765920	I like building cool things for consumers.
765920	772120	And so working with cookies for now is kind of like the way that I see us going.
773880	777180	So let's talk about that user context.
777520	779700	That authentication information.
780140	783140	So there's sort of like the naive way, right?
783140	785580	Where you can just do it, make it work.
785580	786900	It's going to work great.
786900	789360	And then there's more of a more secure way.
789360	791200	So first let's talk about the naive way.
791560	795780	So the first thing that I'll do is recognize, oh, the user wants to store a cookie.
795780	797380	I'll create context.
797540	801700	The intention controller is going to recognize that and say, oh, they want to store a cookie.
801700	802280	Cool.
802460	805100	It's going to create a context container.
805180	811460	That container exists purely to allow the user to store those cookies.
811700	814260	So some companies do it in a web browser.
814260	817920	Some companies do it with a Chrome extension.
819220	820840	Lots of different ways that you could do it.
820840	824000	But the point is, we're going to collect that context.
824000	825760	We're going to write it into a database.
825780	831280	Whenever it comes time to use that cookie, again, it all fits on one slide.
831300	833860	I recognize I want to use this context.
833960	835860	I say, oh, this is Matt's user account.
835860	841120	I'm going to go ahead and go into the database, grab Matt's cookie, and then stuff it into an
841120	841960	actuator.
841960	845160	That actuator now has a login session for me.
845380	848260	And it can order the thing that I asked for.
848620	852100	It goes off into the third party space and does the thing it's supposed to do.
852100	853740	What's the problem with this?
854900	856720	What makes you nervous?
859260	860200	Stolen cookies.
860200	861100	I heard that in the front.
861100	861740	Awesome.
861740	862500	Yeah, exactly.
862500	868980	I don't want to be the guy that has a database just full of cookies that other people can
868980	870740	just come in and take from me.
870740	873200	That would be really, really bad.
873200	877060	So let's think about a way that we could do this a little bit more securely.
877480	881260	So, again, I'll recognize I want to create some context.
881260	882680	I want to store that cookie.
882680	887040	The intention controller is going to recognize that, very similar to before.
887060	891380	It's going to create that web browser so that the customer can log in.
891380	894720	But then notice we have a vault service down below.
894720	900180	And so once that cookie's collected, instead of just stuffing it into a vault and then
900180	904380	returning it to the database, what we're actually going to do is we're going to stuff it into
904380	908840	the vault, but we're also going to add the identity of the customer it belongs to.
908840	913760	So when we get to the next slide, you'll see that we should actually say, hey, yes, I want
913760	914720	this cookie.
914720	917420	Also, Matt said I could have it two minutes ago.
917420	925500	And so by having a short-lived JWT that the user provides to you, your life just gets a
925500	926120	lot better.
926120	932060	I can sleep a lot better at night knowing that I'm not storing cookies for 100,000 people.
932060	938740	I'm storing encrypted blobs, and you would have to actually have a request from the
938740	941060	user in order to go get that cookie.
942900	947580	So when we get to using the context securely, I kind of already covered this, but we'll
947580	948800	walk through it again.
948880	952260	We recognize the user wants to take an authenticated action.
952260	956220	We get the object ID and not the actual object from the database.
956520	965040	We send that object ID and the user's JWT to our vault, or sorry, to our context actuator.
965040	971420	The context actuator now is the thing that reaches out to the vault and gets that cookie.
971420	979000	And so this one tiny space in our network is the only place that with a request from
979000	981740	the customer, you can actually go get their cookie.
983020	987500	Once the actuator performs the action, we tear it down.
987500	988600	We never use it again.
988600	990320	It was just that one thing.
990320	997600	So the risk of someone coming in and stealing a token off of the actuator gets a lot smaller,
997600	997780	right?
997780	1003840	Essentially, we're looking at build system compromises that allow you to get in versus
1003840	1007240	earlier it was just, can someone access my database?
1009300	1013980	So it was a lot as far as securing the customer context.
1014200	1017520	So some do's and don'ts to sort of take away.
1017740	1019820	Don't collect context that'll make you a target.
1021000	1031620	If you are only storing cookies for DoorDash, Spotify, and Uber, not a lot of people are
1031620	1033300	going to come after you, right?
1033420	1039540	Why do I want this cookie that is likely going to get caught?
1039540	1043220	There's much better things for me to spend my time on as an attacker.
1043280	1049100	So if we ever get to a world where somebody wants to use their AI walkie talkie to spend
1049100	1055140	money, I don't want to store that financial instrument because that makes me a target.
1055640	1062260	And so allowing vendors, service providers to actually own that piece is super, super
1062260	1063480	important to me.
1063620	1071640	The second piece is don't reuse context or, yeah, context containers or actuators across
1071640	1072540	users.
1072540	1077120	So anytime I'm taking something sensitive from the customer, it should be a one-off
1077120	1077700	thing.
1077700	1079740	And then when it's done, it should go away.
1079740	1085320	And then I don't ever have to worry about, oh, well, I accidentally ordered $1,000 worth
1085320	1091380	of tacos on Jay's Uber Eats account instead of on Matt's.
1091380	1097140	And now Jay has a ton of tacos to share with who?
1097140	1098380	I don't know.
1098380	1100380	So not doing those.
1100380	1106800	And then the other don't, big don't, is don't trust that context as being true, right?
1107880	1112380	It's really easy for our engineers and developers to think, oh, yeah, no, this is a
1112380	1114680	cookie that the customer gave us to order for them.
1114680	1115860	So that's good, right?
1115860	1117200	No, the answer is no.
1117200	1120600	This is data that came from the internet, and we should just treat it like all the other
1120600	1122900	data that came from the internet.
1122900	1124820	A couple of do's.
1124820	1131100	Allow less vault access to only that one thing that actually needs to go get it.
1131100	1139600	This way, if you do have any issues with people trying or having the ability to connect to
1139600	1142960	your vault service, they can't actually do anything, right?
1142960	1147820	Because you have to be running in that one specific container in order to access those
1147820	1148410	tokens.
1149100	1154500	And then the last piece, which is kind of my favorite, is correlation IDs.
1154500	1162640	Anytime I need to ask for a cookie from the vault, I should be able to match that up to a
1162640	1164860	request that came from a physical device.
1164860	1170500	And if I can't, that means that somebody that I work with is going to have a bad day, or
1170500	1174600	I'm going to have a bad day because somebody else is creating those requests.
1174600	1179100	And so I think that's a thing that we sort of owe to our customers when we build devices
1179100	1183120	like this, is a way to tell them not only are we doing our best to protect your authentication
1183120	1188620	information from random people on the internet, but we also recognize your data is important
1188620	1189520	to you.
1189520	1192880	We are not you, so we shouldn't have access to it either.
1192880	1200320	And so by introducing those correlation IDs, you can do really cool things like requiring
1200320	1205140	that correlation ID to exist before the request gets routed into the vault.
1205140	1210860	Or you can just set up automated alerting so that you know if it ever happens, you at
1210860	1211980	least know about it.
1211980	1215620	So do's and don'ts for context.
1216260	1219420	So the next piece, securing customer conversations.
1219840	1223780	This one was really, really fun to think about.
1224620	1230020	So if I take out my AI walkie-talkie and I say, what's my favorite color?
1230260	1233600	There's a couple of types of data that happen there, right?
1233600	1237920	We still have our same speech-to-text request and response.
1237920	1243340	We still have the LLM request and response and the text-to-speech back as well.
1243340	1247860	So essentially, I have audio data and I have text data that I need to worry about.
1249220	1254220	As far as what type of binary data, it might be an audio recording, but it also might be
1254320	1255400	a picture, right?
1255400	1259440	Maybe your magic AI walkie-talkie takes magic photos.
1259440	1264200	And when it takes the photo, it converts it into some cool 8-bit format.
1265380	1270100	I probably don't want random people on the internet or even the company that makes that
1270100	1272680	AI walkie-talkie to have access to those pictures, right?
1272680	1274460	Because I'm a general consumer.
1274460	1276360	Why do people need access to that?
1277800	1282140	Same thing goes with all of the text-to-speech that we just talked about, right?
1282140	1284080	We have a transcript of what the user said.
1284100	1286280	We have an answer to their question.
1286520	1289660	And we have what we want the device to echo back.
1289980	1291700	So how do we store that?
1291700	1296620	A really, really easy way is I have my magic AI gadget.
1296940	1304760	It sends a request to that super awesome router that will take everything that I wrote and then
1304760	1306640	just store it in a database.
1306640	1309320	If it's binary data, it'll just store it in S3.
1310140	1313120	In the database, I just put a pointer to S3.
1313120	1313780	Life's great.
1313780	1315400	This is super easy, right?
1315500	1320120	Again, we're storing sensitive things about people in a database.
1320120	1325520	I don't want to be, like, going to sleep at night knowing that that happens.
1325520	1330120	So what do we do to make life a little bit safer?
1330820	1339060	So instead of just receiving that data from the magical device and then writing it all down,
1339060	1343880	again, we'll do the same thing with our Vault engine.
1343880	1351500	And so whenever we receive the data, we'll actually reach out to the Vault engine and say,
1351500	1355780	can I have... kind of got two really cool options here.
1355780	1362280	So you could have the service send that data to the Vault engine, have it encrypt it,
1362280	1365420	and then return back to you the ciphertext.
1365420	1367060	And now you can just write that.
1367060	1370280	Now in the future, you just have to take that ciphertext and say,
1370280	1372940	Vault engine, can you give me this data in plain text, please?
1372940	1377320	The other option that you have is you can request the customer's storage key.
1377320	1379760	And you can say, please give me the key for Matt Damko.
1379760	1381560	I have a bunch of stuff I want to write.
1381600	1387520	In both cases, I'm not storing things that I have access to.
1387520	1391280	I'm storing things that I only have access to for that two-minute window
1391280	1394780	whenever Matt Damko pushes the button.
1400140	1403760	So I've got some do's and don'ts for securing those conversations.
1404880	1408500	So please don't use built-in types for these things.
1408720	1413180	My worst day ever is whenever someone says,
1413180	1414840	oh, yeah, no, we're just sending this JSON.
1414880	1416200	And there's just like a string there.
1416200	1416720	And I look at it.
1416720	1417360	I'm like, oh, OK, cool.
1417360	1417920	It's just a string.
1417920	1418700	No big deal.
1418700	1423800	And that string is actually like six hours of me watching Gilmore Girls
1423800	1426520	because I started a meeting transcription during it.
1426640	1429660	So rather than taking these things and just going with the defaults,
1429660	1431600	let's create a custom object.
1431600	1434860	Use a strongly typed language that allows you to say,
1434860	1437880	OK, this is actually a type of sensitive data.
1437880	1440820	And the only way that it's allowed to be logged is either through
1440820	1448540	that vault controller interaction or through a secure logger.
1449300	1450160	So, yeah, don't...
1450160	1452020	Please, one second.
1454220	1457040	So the other thing that definitely...
1458140	1461480	In the business-to-business space, it happens.
1461480	1464140	It's not great, but it could be worse, right?
1464160	1469720	Essentially, if I need to do analytics on data and I have the data in a place,
1469720	1472140	well, let me just go grab that data and do analytics.
1472480	1475220	It's one thing to do it whenever it's how many times
1475800	1478480	did my employees click on a phishing link.
1478480	1484140	It's another thing altogether for it to be a recording of me and my kid
1484620	1486160	talking about something.
1488020	1490160	So don't let it happen, right?
1490160	1495980	Don't share data between production and anything else.
1495980	1499560	If you're not using that data to provide a direct value to the user,
1499560	1501720	you're essentially stealing their data right now.
1501720	1503120	And I'm not a fan.
1504240	1510380	And then the last one, don't allow new log types without a privacy and security review.
1510380	1516440	And so this is a thing that I've sort of started harping on a lot more at work,
1516440	1521880	which is like, if you want to do something new, and it has to do with customer data,
1521880	1527200	we owe it to our customers to spend 15 minutes drawing out what we're going to do,
1527200	1529100	identifying the data that we're going to write down,
1529100	1533480	and talking about whether or not that is a good thing to do with our customers' data.
1534680	1537780	So yeah, don't do that.
1538920	1541660	Do move encryption to client-side where possible.
1541660	1546100	So the way that it is in this diagram that I just showed you,
1547580	1554260	is as the service provider, you can just grab a JWT and go get the data.
1554440	1559120	Wouldn't it be great if the only person that had your data was like you in your web browser,
1559120	1560780	when you get to go view your pictures?
1560780	1563500	That would be great. That's a technology that exists.
1564280	1567340	It's not a technology that exists, as far as I'm aware,
1567340	1570420	that works really well with AI use cases,
1570420	1574760	where we want to get your permission to use your data to make things better.
1575400	1583120	And so that's a tough road to climb, but I think that it's a goal to move towards.
1584260	1586300	Require a short-lived JWT.
1586600	1589800	This is really, really easy to do.
1590060	1592260	When your user wants to do something,
1592260	1595120	make them send you a token that says that they want to do it,
1595120	1596600	and have that expire quickly.
1596960	1601340	If you look into the different types of vault providers that exist,
1601340	1604740	I know of at least one that does that.
1604740	1607980	You can give them a JWT, and they will only give you the data back
1607980	1612380	if that JWT is signed by the customer, the person who owns the data.
1612760	1615480	I sleep a lot better at night knowing that I have that.
1616320	1620120	And then the last piece, if you've ever worked at an AI company,
1620120	1624280	you probably have a chat room where it's just AI news,
1624280	1628260	and people are excited about new models and new things that are coming out,
1628260	1633040	and Anthropic has this, AWS has this, OpenAI has this,
1633040	1634720	and they want to try it out.
1634720	1640020	The problem is, unless you have a commercial agreement with them,
1640160	1644100	a lot of times, you're just sort of giving them free reign
1644100	1647180	to do whatever they want with your customer data.
1647280	1652800	And so one of the things that I've worked really hard on at the last few jobs
1652800	1657400	has been making sure that we actually make those thoughtful decisions.
1657400	1661500	We say, okay, this type of data, maybe we're okay with that company
1661500	1663280	using it for whatever they want.
1663280	1666420	But this other type of data, super, super important to us,
1666420	1671560	and we're not going to allow it to go to those levels of LLMs.
1671840	1674440	Essentially, pay more to protect our customers.
1674540	1675560	I think it's worth it.
1677180	1681580	So the last one is privacy-focused logging.
1682200	1687020	So if you're an engineer, and you're coming up with logs for this new service you built,
1687020	1688800	this is probably how you're going to do your logs.
1688800	1690320	You're just going to take everything that you know,
1690320	1692640	and you're like, I might need this someday, ship it to Datadog.
1693280	1696160	And then one of your SRE managers is going to be like,
1696160	1698820	hey, so your Datadog bill's kind of high, can you cut it back?
1698820	1700460	You're like, no, I need all of this.
1700460	1704100	I need every single piece of data that comes in, or I can't do my job.
1704660	1707020	Okay, that's a way.
1707180	1709380	But again, we're talking about consumers.
1709380	1713160	We're not talking about business-to-business operations.
1713220	1717640	And so if I'm a consumer, and I have to worry about
1719000	1722820	every single thing being stored on my behalf, I start to get nervous.
1722820	1730000	And so what I like to do in these cases is require a custom logging handler.
1730200	1733460	Engineers are already creating these to make their lives easier.
1733460	1735920	All you have to do as the security person is say,
1735920	1739160	hey, so right now it looks like you're taking everything,
1739160	1741500	you're formatting it, and then you're shipping it out.
1741500	1745060	What I would love for you to do is instead explicitly declare
1745060	1747920	these are the fields that we're going to log.
1747920	1752300	And by forcing them to explicitly declare the fields that they're going to log,
1752300	1757680	you don't have to worry about, oh, I just updated the code to log this extra field.
1757780	1762180	Also, it's everyone's birthday and social security number.
1762180	1763380	That's okay, right?
1763400	1766600	You don't have to worry about that because the logger won't allow it.
1766600	1769200	And now instead of monitoring your entire code base
1769200	1774160	for a change that might log something in a wrong way,
1774160	1777980	you only have to monitor that base privacy logger.
1778080	1780140	So it's definitely worth investment.
1780140	1787840	And this code is from ChatGPT, write me a privacy-focused log handler in Python.
1788280	1791020	It might work. I don't know.
1791180	1794580	But the point is, it's not super difficult,
1794580	1797040	and your engineers are likely already doing it anyway.
1800060	1804220	So some highlights on privacy-focused logging.
1804540	1810040	Prefer metrics over, like, actual counts and group by statements
1810040	1812280	whenever you're thinking about things.
1812280	1817380	You don't need to log every single request in order to know how many requests happened, right?
1817380	1822300	And so if you don't need to store the data, don't.
1822720	1825800	A thing that I've been big about for a very long time
1825800	1831660	has been the fact that business metrics and that type of work
1831660	1834040	needs to be a feature request of the product.
1834040	1838280	This is not something where, oh, I've got a really strong program manager.
1838280	1841160	They're going to go into Datadog and create these dashboards
1841160	1844280	that are going to tell them what our most popular feature is.
1844280	1846400	It's a very, very easy shortcut.
1846400	1850100	But it's also a very, very easy, easy way to lose control
1850100	1853480	of the way that you're managing the privacy of your customer data.
1853900	1855700	And so rather than getting into that,
1855700	1861200	when we do a product design doc, right,
1861200	1864080	let's explicitly call out, I need these metrics.
1864260	1866560	And now it's part of the product.
1866560	1868120	You don't have to go look through logs
1868120	1871800	because you've already decided I'm going to use counters instead.
1871960	1875140	Engineering logs for engineering things.
1875340	1878820	We talked about using custom logging classes.
1879620	1882380	Anonymize where possible, pseudo-anonymize everywhere else.
1882740	1888600	So I might need to know which user I'm dealing with
1888600	1890720	whenever I'm solving an engineering challenge.
1890720	1894460	I don't need to know that user's email.
1894460	1897260	I don't need to know that user's address.
1897260	1898880	I don't need to know any of those things.
1898880	1904400	I just need to be able to say, user 123 of 1000.
1904480	1906960	And so this is where, when we do logging,
1906960	1910540	rather than logging all of the information we have about that customer,
1910540	1914660	let's just log a pseudo-anonymized user ID.
1914660	1916300	It doesn't provide access to anything,
1916300	1918220	but it lets us sort of work through the streams
1918700	1920940	and track down when bugs happen.
1922320	1926840	Set an extremely short time limit for your engineering logs.
1926840	1931040	If you need something for longer than a week, two weeks,
1931040	1932880	that should probably live somewhere else.
1932880	1934840	Probably doesn't need to be in Datadog.
1934840	1936960	Your CFO is going to thank you.
1937320	1938720	And so are your customers,
1938720	1941160	because you're not storing their personal data somewhere
1941160	1942600	that you don't need to.
1944000	1946100	Enforce just-in-time logging.
1946100	1950120	So I think one of the coolest and scariest things
1950120	1953420	about joining an engineering team at Facebook
1953420	1955920	is like the first two days when they're like,
1955920	1959500	oh yeah, and by the way, if you look at anyone that you work with's data,
1959500	1960720	we're going to fire you.
1960720	1962680	And I'm just like, I don't even want to accidentally do that.
1962680	1965020	You're paying me really well. I get free pizza.
1965020	1967000	Like, why would I mess that up?
1967020	1970540	And the way that they enforce that is,
1970540	1974180	if you need access to something and you don't have it by default,
1974180	1976040	you just go find the table and say,
1976040	1978140	I would like access to this.
1978320	1979560	I need it for this long.
1979560	1982140	And this is my business purpose behind it.
1982280	1987400	And as long as it's not like your ex-partner's page,
1987400	1990840	it'll just grant you access and log it.
1991020	1995900	And I feel like it's way better to have that than,
1995900	1999840	oh yeah, just everybody in engineering has access to everything all the time.
1999840	2003780	So that just-in-time access gives us, again, a little bit more safety
2003780	2008420	and a little bit better of a way to recognize when something's going off the rails.
2009560	2013460	All of the do's and don'ts that we talked about in the other two
2013460	2016920	sort of apply to privacy-focused logging as well.
2017740	2021940	All right, the last one, privacy-focused analytics.
2022400	2026960	So if I've got a feature that's out there, it's doing great things,
2026960	2028140	but I want to make it faster,
2028140	2031200	but I don't understand what requests are happening.
2031200	2034140	And so I need to actually see these requests
2034140	2037680	in order to make the product work better.
2037680	2041980	Well, 18-year-old Matt Domko goes into the routing engine
2041980	2046880	and he just adds a new branch of code for 2A that says,
2046880	2049720	yeah, so anytime somebody makes a request,
2049720	2051920	I want you to go do the thing that you always do,
2051920	2055380	but also log a copy of it to my analytics storage.
2055780	2060020	And then once that table is super full or that bucket has all the data I need,
2060020	2063340	I can go in and do some sort of analytics process on it.
2063900	2068020	The problem with that is in order to solve whatever challenge I'm facing,
2068020	2071940	again, I probably don't need to know the customer's name.
2071940	2075060	I don't need to know all of the things that they did.
2075060	2079380	I probably just need to know what's the length of their request
2079380	2083220	and what time was it when they made the request.
2083220	2087640	Well, whatever the thing is that I need, it's probably not everything.
2088780	2092660	So the way that I've thought about handling this,
2093920	2098980	we have our new analytics logger.
2098980	2103160	And again, we still insert it into 2A,
2103160	2106920	but instead of having it directly write data outside
2106920	2110960	of my little nice fancy production bubble where data never leaves,
2110960	2113380	I read it to a privacy filtering account.
2113380	2115460	And so that privacy filtering account,
2115460	2118800	whenever it receives new data, it reaches in and it says,
2118800	2125920	I'm expecting that Matt needs to know the locations of every failed Uber request.
2126080	2129820	And so what that privacy filtering Lambda will do
2129820	2135480	is it will just extract the location and the time that it happened.
2135980	2140220	Because I don't need to know anything else about that conversation
2140220	2143500	or what's going on except for that one single line.
2143500	2147620	So why would I allow myself to copy the entire thing out?
2147620	2151280	So I create this process where in order to get data out of production,
2151280	2153260	I ensure that it's anonymized.
2153260	2155860	I ensure that I only have the data that I need.
2155860	2159620	Once that data has been cleaned, we've ran it through something like
2160520	2164340	Amazon Macie to check for PII and things like that.
2164340	2170440	Then we'll go ahead and copy it from the privacy account into the analytics account.
2170820	2172740	Analytics is already expensive.
2172920	2176500	And so like this additional process that we're introducing
2176500	2181200	in order to protect our customers is totally worth it.
2184980	2191800	And so we've got a summary of the things that have made my life easier
2191800	2195340	in protecting customers' privacy.
2195440	2201160	The first thing, simple data classification guide.
2201320	2204180	Anyone that was ever in the military, they've got like those colors.
2204180	2206540	And when you see colors, you're like, oh, this is sensitive.
2206540	2208800	I shouldn't do anything wrong with this.
2208800	2209880	This is green.
2209880	2212680	I think I can do whatever I want with this, but let me check.
2213740	2216780	Having some sort of simple guide where your engineers know
2217780	2222440	if data is labeled as red, that means it can't leave prod.
2222440	2226680	If data is labeled as yellow, it means it can go from prod
2226680	2230700	into the privacy account, into an analytics account.
2230700	2233440	If data is labeled as green, it's on the website.
2233440	2234580	So who cares?
2234580	2238320	But coming up with those shortcuts for your engineers
2238320	2240180	is going to make your life a lot easier.
2241880	2243940	Build that culture of design reviews.
2244020	2245060	Show up to them.
2245140	2249080	I know that our engineers build a lot of really cool stuff all the time.
2249800	2252260	And that means I'm going to be at more meetings.
2252260	2253540	But again, it's worth it.
2253540	2255080	You're learning more about the product.
2255200	2257500	You have a chance to actually step in and say,
2257500	2260640	well, what is this data and why do you actually need to store it
2260640	2262980	or move it or read it?
2263620	2265280	So build that culture.
2265280	2266700	Show up to those things.
2267600	2269080	Service control policies.
2269080	2273680	So these exist, I know, in AWS and Azure.
2273680	2275660	Does GCP have something like this where you can say
2275660	2277700	you're not allowed to break this rule no matter what?
2277700	2278940	I don't care who you are.
2279980	2281040	Yeah, okay.
2281760	2283220	So set that up.
2283220	2287200	If you have a production account where all of your day-to-day data exists,
2287200	2289020	make it so you can't mess it up.
2289020	2290740	No data is allowed to leave production
2290740	2294500	except for to go to this singular privacy account.
2295580	2297380	It works fairly well and it keeps you out of trouble
2297380	2301580	when you're traveling or at a conference talking about privacy.
2303460	2305880	The two-step filtering process that we talked about,
2305880	2308940	I feel like that's the only way that we can truly ensure
2308940	2312840	we're not accidentally moving data somewhere we shouldn't.
2313140	2316520	And so think about how to implement something like that.
2316820	2319520	There's tons of services and all the different cloud providers
2319520	2323520	that will parse your data and tell you yes or no,
2323520	2328740	this has sensitive data in it.
2329320	2334500	I just learned about S3 bucket filtering?
2334720	2336280	I don't remember the exact name.
2336280	2342280	But anyway, you can create a new S3 access point.
2342280	2343200	We'll go with that.
2343200	2347360	You can create a new S3 access point and say through this access point,
2347360	2350340	you can only read filtered data,
2350340	2353140	which kind of takes your hands away from having to do anything
2353140	2358860	as long as you only let your developers read through that singular access point.
2361340	2363580	Oh, yes, almost done.
2363840	2367800	So a couple of guidelines that I've set with the teams
2367800	2369900	that I've worked with in the past.
2370040	2374900	This is the one that you screenshot and send to everyone.
2375260	2377340	And it's really just four questions.
2377360	2379760	Are you logging a new type of data?
2380260	2381420	We should talk.
2381520	2383520	Are you moving data outside of broad?
2383520	2384660	We should talk.
2385140	2387500	Are you connecting to broad databases?
2387660	2388880	We should talk.
2388880	2391480	Are you bringing in a new tool or vendor?
2391500	2392740	We should talk.
2393600	2398280	I think those are fairly easy to do in practice.
2398620	2402140	And it's worth the extra time that we have to invest.
2404600	2405840	That's it.
2406720	2408180	What time is it?
2408180	2409120	4.42?
2409440	2412780	I have time for questions if anybody has any.
2412780	2417120	If not, I'm going to get off the stage and chug a bunch of water.
2418620	2420800	Oh, contact page.
2420800	2425120	So, hashtag cyber on the Twitter.
2426220	2433220	And if you're worried about your Rabbit R1, security at rabbit.tech.
2437240	2441620	I don't... that guy right there.
2441620	2442740	Cool.
2442740	2444340	Well, thank you, everybody.
2444340	2445420	Have a great con.
