start	end	text
8670	13250	Who here is familiar with access control within web applications in some way or form?
13390	14050	About half of you.
14050	14450	That's cool.
14450	15950	Who knows what RBAC is?
16430	17150	ABAC?
17790	18510	ReBAC?
19070	19590	Cool.
20530	21910	Increasingly dropping numbers of hands.
21910	22950	That's kind of what I expected.
22950	25570	I think we've got about 10% people here who know ReBAC.
25570	29370	So we're going to dive in, and we're going to go a little bit deep dive into how ReBAC works.
29370	32250	Now normally, this is a 45 minute to one hour conversation.
32530	37030	So, excuse me if I skip over some bits, but please come and ask me questions afterwards.
37030	47790	But we're going to go a little bit deep on how the data actually gets stored, so that we as developers understand how ReBAC was going to help us, and how the relationship-based access control actually works, or may not work for you.
47790	49110	It's not always the right solution.
49530	50410	But who am I?
50550	54670	I'm a guy who develops slides that have really bad contrast on LED screens.
54830	58070	Also, I've been a software engineer for too many years.
58110	59630	I used to put the number up there.
59650	61750	It made me feel old, so now I just do a sentence.
61750	63050	You can do the maths in your head.
63050	66130	I love working with developer and open source communities.
66130	67950	I've been doing that for about 20 years.
68030	70730	I'm really passionate about security and privacy.
70810	73150	If you want to talk to me about any of those things, those are my jam.
73150	74350	Come talk to me afterwards.
74790	81130	I'm currently working as a developer advocate for a company called ArcJet, hence the branding across my chest here.
81130	84790	We're a middleware security solution for your web applications.
84810	89070	If you are writing any kind of web application at all, check out arcjet.com and just plug it in.
89070	89710	It's free.
89710	90250	Give it a try.
90250	91750	We'd love to hear what you think about it.
91750	97030	If you want to contact me, I've got the X logo on there, although I still like to call them Twitter.
97070	108190	I feel some ways about an organization whose community does not accept certain people's desire to change their identity, so I will not allow Twitter to change their identity either.
108190	110570	My Twitter handle is at BenDekarai.
110570	111810	My DMs are open.
111810	114150	Contact me, if you like.
114150	115470	It's not an instruction.
115670	116950	It's an offer.
117290	118130	Let's get into it.
118130	119330	Access Control 101.
119330	120790	Basics and understandings thereof.
120790	125470	First thing we're going to have a look at is the caricatures we're going to be looking at.
125510	127910	Whenever it comes to access control, the dog wants the bone.
128270	131890	We're going to look at ways that we can stop or allow the dog from accessing the bone.
131890	134690	First one is going to be using RBAC, role-based access control.
134810	139010	It's probably one of the simplest access control mechanisms, so we'll skip through this very quickly.
139010	140670	Basically, we have a number of roles.
140690	143270	You've got an admin, you've got a manager, employee, and a guest.
143350	145410	In our case, our dog, this is Shadow.
145750	147330	Shadow has a blue hat on.
147330	148770	Blue hats are employees.
148770	154750	And the door is locked to all, but the admins, managers, and employees, we don't want guest dogs getting to the bones.
154750	161970	Only employee, manager, and admin dogs, my analogies fall apart a little bit sometimes, are going to get access to the bones.
161970	165010	So because Shadow has access, the door opens.
165150	166130	Role-based access control.
166130	167010	Nice and simple.
167790	168510	Next one.
168830	170590	Attribute-based access control.
170590	176950	This is kind of like role-based, because you could say, well, a role is an attribute of a person, but attribute puts so many more layers on top of this.
176950	179310	So we've got four attributes here of the dog.
179310	180190	This is Min.
180190	182790	This is a white Siberian husky.
182790	184470	These are actual real dogs in my life.
184470	186390	I like to relay them into my talks.
186590	187850	There are four characteristics.
187850	189870	Service dog, good boy, loyal, and fierce.
189870	194370	I can tell you, while Shadow is a service dog, Min will never be a service dog.
194370	198810	If you've ever seen one of those dogs that just cannot control itself because it's always so bloody happy, that's Min.
198810	200830	So she will never ever be a service dog.
200830	204210	But she is usually a good boy or loyal.
204210	205390	She is not fierce.
205390	211410	We've decided in this case that we're going to make her a loyal dog, and the door will open if you are a good boy or a loyal dog.
211550	214590	Now, as an aside, I go on tangents occasionally.
214710	218430	You might be asking yourself, but why doesn't the service dog get a bone?
218430	219770	Because a service dog is good, right?
219770	221890	Service dogs deserve bones.
221990	223270	Does anybody agree with that?
223750	224590	Nobody agrees with that?
224590	225630	You all hate service dogs.
225630	226830	That's what I'm learning about you lot.
226830	227410	Jesus.
227670	228690	Rough crowd.
229270	230530	No, service dogs are working.
230530	231510	They don't get to eat.
231850	236370	But we're going to layer an attribute on top of this, because you could say, well, that's just a role, right?
236370	238790	The attribute here we're going to put in is time.
238790	240090	Who does have a dog?
241410	242190	Wrong audience.
242190	243290	Who has cats?
244070	246490	Okay, let's pretend your cat likes eating bones.
247390	249130	Or for those of you who have dogs.
249430	253650	Who lets their dog sleep in their bedroom with them at night?
253650	257810	Who would like the sound of a crunching bone at 3 a.m.?
257810	262890	No, I certainly don't like the sound of a crunching bone at 3 a.m., so if it's outside of 9 p.m.
262890	264610	to 9 a.m., no bone for you.
264670	266990	So, sadly, men get no bone.
268150	270470	But there are plenty of other things we can do attributes on.
270470	276630	We've got actual identity, physical location, network location, the time, the weather, whether or not you're authenticated to a system.
276630	281750	There are lots of things you can layer on top of this as an attribute of whether or not somebody should get access to a resource.
282810	289430	So, a bit more complexity, a bit more flexibility about how we can control our resources, which brings us on to relationship-based access control.
289430	293330	This changes the paradigm quite significantly as I lose my balance.
293790	297810	So, this dog doesn't actually have a name.
297810	299210	Who here had a dog?
299550	300610	What was your dog's name?
300610	300990	Liam.
301010	302130	This is Liam.
302130	302870	Thank you.
302870	304550	Liam is actually a dog.
304550	306190	Dali designed Liam.
306230	309830	I thought it came out a little bit like a cat, but that's what we're going with.
309830	312330	So, Liam has an owner.
312530	313810	You are the mad scientist.
313810	314570	Congratulations.
314970	316650	So, Liam's owner is a mad scientist.
316650	319230	The mad scientist is friends with a farmer.
319230	323710	The farmer has a whole lot of sheep, and for the vegetarians in the audience, I apologize, but sheep have bones.
326130	327070	Ten minutes?
328110	329250	Oh, I need to stay back.
329250	332370	This is not good for me because, A, I'm going to fall off the back of the stage.
332450	333230	Not too far.
333230	333590	Okay.
333590	334510	Just right here.
334510	335010	Okay.
335330	338070	The guy who likes to roam may no longer roam.
338150	338910	That's okay.
339530	343350	So, we have this chain of relationships, as you can see.
343350	350350	So, we can see here that Liam may or may not have access to the bone based on the rules that you can see.
350650	351850	Now I'm getting feedback.
351950	353930	Based on the rules you can see on the door there.
354910	356870	Sorry, let's just zoom in a little bit.
356870	358670	The rules you can see on the door there.
359130	363890	So, with relationship-based access control, we don't actually have a concept of users anymore.
363890	370770	We just have a concept of entities and relationships.
375470	376370	Entities and relationships.
376370	377910	I'll keep going unless they actually stop me.
377910	379890	Or unless too many people in the audience cringe.
380050	381050	It appears to be good again.
381050	382230	So, here we've got an action.
382230	384490	Can the action eat be completed on the bone?
385590	387930	Note that we're looking here at what can be done to the bone.
387930	391070	We're not looking at what Shadow or Liam can do.
391450	393010	We're looking at what can be done to the bone.
393010	394570	What actions can be taking place.
394850	401730	If it's the animal owner or the friend of the owner of an animal, or the pet of a friend of the owner of the animal, they can eat the bone.
402410	408330	Technically, I suppose you could argue, no, I probably wouldn't want the owner of the bone, the sheep, to be eating the bone.
408330	409650	That would be a little bit weird.
409970	415790	But you can see we just find here a set of relationships that allow us to decide whether or not the bone can be accessed by the dog.
416090	423050	And because through those green lines there, which are really terrible in this background, you can see that the flow does actually go all the way through.
423410	424370	Liam gets a bone.
424470	425550	Good for Liam.
425550	426770	So, the door opens.
427310	432990	Now, say one day the farmer and the mad scientist break friends.
433030	434490	They're no longer friends with each other.
434490	435830	Suddenly, that relationship is broken.
435830	437370	Now, nothing has changed about the bone.
437370	438970	And nothing has changed about Liam.
438970	440630	But the relationship is broken.
440630	443390	Therefore, the friend component of that rule there breaks.
443390	447530	So, the only rule that allowed Liam to get access to that bone is now broken.
447530	448550	And the door shuts.
449110	451630	So, that's what a relationship-based access control is about.
451630	455830	It's not so much about defining what somebody or some user can do.
455830	462930	It's about what actions can be performed on a resource based on a set of rules that relates lots of resources together.
463070	464090	Does that make sense?
464510	465230	Cool.
465970	471590	So, under the hood, who here is familiar with the Entity Attribute Value model of designing?
471610	484810	So, if you've ever done any kind of content management systems or anything like that where you've got an undefined, at the beginning of your project, you have an undefined number of entities, you want a way to be able to create new entities in your system without having to do a database deployment because they are nasty.
484830	486470	Especially when you have a lot of data.
486650	496550	So, the Entity Attribute Value model of data storage basically says you have a table that defines entities and you have another table that defines the attributes and values for that entity.
496590	499810	So, if you want to add another entity, it's just another row in a table.
499870	500710	Nice and simple.
501030	503050	Let's have a quick look at how that works.
503050	504690	So, we've got a user and an article.
504690	508190	So, we're going to be looking at a blog post system, for example.
508270	512290	So, we've got a user and an article, and on this right-hand side here, we've got a whole jumbled load of mess.
512290	514910	But you can see that we've got the Entity ID, the second column.
514910	520610	So, the first, second, and the last two rows in the attribute table belong to a user.
521210	528490	And because the second column has number twos in it, the third and fourth rows belong to an article.
528530	532630	So, you can see the user's username is Robin, and the user's password is Password.
532750	535150	Down there, we have username Morgan and password.
535990	539110	For some reason, they like using JSON Web Tokens for their passwords.
539110	540670	But that's their password.
541350	544910	And then, the middle two there, you can see that we've got an article, one article.
544910	546450	Instance ID of the article is one.
546450	550150	We've got a title of Rebec for the win, and content is CanHasFGA.
550610	552030	Fine grained access control.
552630	567670	So now, if we want to pull stuff out, we can use a fairly simple-ish join within an SQL table to say, well, pull all these things out, and I can pull out, for example, get me all of the articles that you have.
567690	569770	Give me the title and the content.
569770	575590	Or maybe, rather than getting information about one entity, you could say, give me a list of all the users, and just give me their usernames.
575670	586570	So this table setup basically allows you to get really varied views across the data you have without having to change your database schema, without having to know what that schema looks like to start with.
586650	590570	And you can store arbitrary data in there and pull it out in whichever way you want.
590770	593670	It's complicated and expensive to pull out.
593790	597770	And it's somewhat complicated to set up and use within...
597770	601750	more so than if you had, like, an article table and a user table and a comment table.
601970	615510	So if we wanted to add a comment, for example, we just add an extra row over there, and then we can add some extra columns here saying, okay, so we've now got this entity ID3, instance ID1, so this is comment number 1, the article ID is number 1, author is Sam,
615510	617590	comment was first, and here's the date, Sam.
617990	622990	So without making any database schema change, I've added a whole new entity to the system.
623870	630270	The only reason I tell you about EAV is because this is very similar to the way that Reback is managed under the hood.
630330	632130	So let's have a look at how that works.
632270	638250	We've got entities on the left-hand side, Robin is a user, Acme Co is an organization, and Reback for the win is an article.
639730	641550	And down here we have some relationships.
641750	651410	So we're now looking at just subject ID, and I apologize for the color scheme, we've got a relationship ID, which is just arbitrary for this table, we've got a subject entity ID and an object entity ID.
651410	653750	So how does a subject relate to an entity?
653750	658230	A subject is an entity, it's just the primary entity within a relationship.
658270	665170	So we're saying subject 1, the user, entity ID 3, the article, relationship type is owner.
665510	669150	Therefore we know that Robin is the owner of the Reback for the win article.
670550	676550	We can then add in that Robin, user 1, is a member of organization Acme Co.
677450	683510	And we can add in that Morgan, user 4, is a member of the organization Acme Co.
683510	684070	as well.
684270	688150	So we now know that both Robin and Morgan are members of Acme Co.
688150	693570	Now we have another one here where we say the organization is a viewer of the Reback article.
693610	695850	But organizations can't view things.
696430	700130	So we're able to extend that slightly and put an extra entity relation on there.
700130	702230	How do the entities relate to each other?
702310	704570	Through this member relation.
704910	712350	So if we dial that back, if we see here we've got member in the middle two rows here, we've got a relationship of members.
712350	721710	So what we now know is that members of organization 2 can view the Reback for the win article.
722150	729010	So now if I add another member into that organization, they automatically inherit that because the relationship exists already.
729570	730390	Does that make sense?
731070	732870	This is where it gets a little bit murky.
733170	734230	You don't need to know all of this.
734230	739210	I just want you to understand how the data sits in there so that when we start pulling it out, you can see what's going on.
740230	744470	So, the other thing we can do is define permissions on all of these.
744470	747250	So we've got the relationships, but what does that actually mean they can do?
747410	753230	So permission ID 1, again arbitrarily for the permissions table, relates to relationship ID 1.
753230	757410	So relationship ID 1 was Robin is the owner of the Reback article.
757850	761030	So we're saying here, well, one of the permissions is read.
762750	768130	Relationship ID 1 is also that Robin is the owner of the article.
768670	770090	Robin also has write access.
771010	778430	And then we have relationship ID 4, which is this inferred down here, members of organization 2.
778870	781970	Members of organization 2 have read permissions.
782990	787570	So even over here, we've got relationship types and entities like viewer is just a label.
787630	789390	It doesn't mean anything to the system.
789410	799410	But when you look at that, you see what that means is the permission for viewer for any member of organization 2 has read access on article 1.
800790	803490	So there's one extra table here compared to EAV.
803490	811650	But this allows us to define a multitude of relationships and permissions and how they relate to each other and to other entities.
812150	814590	And more importantly, they allow you to chain those entities.
814590	819290	Remember how we went from Liam to the mad scientist to the farmer to the sheep to the bone?
819430	820870	It's not just one-to-one.
820870	825690	You can define these huge big chains, and if any part of that chain gets broken, then the relationship breaks.
826870	829030	So querying the Reback model.
829030	830110	How does this work?
830330	833970	Let's say we come in here and we want to find out who can read.
834370	837190	We can see here that the read...
837190	838410	Sorry, who can write.
838410	840110	The permission ID there is 2.
841210	843150	So if we...
849080	851420	I think I've got the wrong one highlighted there.
851420	854400	I want to find out who can write to Reback article 2.
854840	857640	So first thing we do is we look at the...
857640	859500	and the highlighting isn't working so great here.
859500	862520	The object entity ID 3 there is the Reback article.
862520	866280	So we say, okay, within the relationships, let's find out everything we know about the article.
866460	874760	And we can see here that the fourth one there can be excluded straight away because the relationship ID number 4 is not in the permissions table.
875200	878880	However, relationship ID 1 is in that table.
878880	887700	That is related to the object identity 2, so we can pull out that the user Robin has write access to the article.
887880	890460	So you can look at things in other directions as well.
891080	895940	And then further to that, you could even say, okay, well, tell me everything about the article, rather than starting from permissions.
895940	897360	We look at article number 3.
897620	901800	We know that Robin is the owner of that article already.
902700	905660	And if we look at the viewer here, we can then...
905660	911840	and this is what I was talking about before, how member gets extrapolated to infer relationship status.
911840	918600	So we can see that the member here of organization 2 has access to the article.
918780	925160	And if we then fold those in, you see how before this one here was highlighted, what we're now doing is saying the subject is now the object.
925160	933080	So where the object is now entity ID 2, where also the relationship type is member, that's where this one basically gets folded out.
933140	935780	So that's probably one of the most complicated lookups.
935780	941520	It's really deep, diving straight into the depths of the Reback schema.
941560	952060	But essentially what we're doing there at that point is we're saying this permission or this relationship here doesn't make sense from a permission sense, because you don't give permissions to inanimate objects like organizations necessarily.
952060	953100	I mean, you do.
953100	955340	But that doesn't really help an end user.
955340	961520	How do we then unfold that and then extrapolate that to refer to the actual user entities?
962040	966380	And this is where it gets complicated, because Reback, as I said, doesn't have a concept of a user necessarily.
966420	972200	You could actually ask Reback what is the relationship between this organization and that network.
972500	973840	Neither of them really do anything.
973840	974780	They're system entities.
974780	975940	They're not user entities.
975940	977400	But they still have relationships.
977400	979740	So it's powerful but also complex.
982880	984200	Implementation details.
986180	992600	Let's have a think about how we might do something in code, which is probably the way most of us do for more complicated business logic like this.
992600	1008380	So if we want to allow editing an article, if a user is an admin or an editor, if an editor is allowed to edit this particular article, if the article is sensitive, then we also want to make sure that the person is on site, and we want to make sure that they're doing it during office hours.
1009340	1014140	Seems like a fairly robust kind of setup that you might have in a large organization.
1014620	1015540	So, if.
1015980	1018400	If the user is admin or if the user is editor.
1018700	1019280	Cool.
1019420	1023040	So we know what role the user has.
1023620	1028360	Also, if the user is an editor and the list of document editors contains the current user.
1028500	1030820	So we don't want any editor to be able to edit this.
1031180	1035260	Only if the list of editors for this particular article includes the current user.
1035560	1037240	So we can compound those two together.
1037920	1041740	Then also we want to say, well, if the document isn't sensitive, then we can carry on.
1041740	1046140	Otherwise, we're going to check to see if the user's location is on premises.
1046560	1050220	Or if the user's location is currently in office hours.
1050220	1055380	And I say the user's location because in a world like today, who knows when it's 9 to 5 for somebody.
1055460	1065720	So as long as it's within the location they're in, it's working hours, and they're on premises, or the document is not sensitive, and they meet the user requirements, they're going to get access to this document.
1066840	1069660	Imagine if you had to come back and change those rules three months later.
1071800	1078860	So, instead what we're going to do is we're going to define entities within our relationship-based access management tool of choice.
1079020	1080580	We're going to define a document.
1080760	1082500	The document has an owner and an editor.
1082500	1089040	The owner is a user, and the editor is a member of an organization with the member type editor.
1089240	1092180	So you can have different types of people within groups.
1092820	1096360	And then we're going to have a sensitive document, so that's the definition of a normal document.
1096420	1099080	The sensitive document is going to extend document.
1099720	1108340	It's also going to have an edit action on it that says, if it's within working hours, and it's a sensitive document, it's the document owner who's trying to do this action.
1108340	1112040	Because remember, we're defining actions on an entity and who's allowed to perform it.
1112240	1115180	So, can edit be done on a sensitive document?
1115180	1120120	Yes, you can, if you are the document owner, and you are the document owner and you're on-premises.
1121100	1123320	Or if you're an editor and you're on-premises.
1124020	1129500	So this gets tied into your relationship-based access model, schema, and permission systems.
1129640	1132980	So now your code can change from this to that.
1134480	1143220	And now your business logic isn't restricted or it doesn't include the permissions check, because there's no real reason for that to be there.
1143220	1149160	The permission for who should access an entity within your system should not be dependent on what's in the business logic.
1149160	1151360	There's a fast and firm rule for that.
1151380	1153080	This gives you two benefits.
1153080	1157520	One from a clean code, easy-to-read perspective, that is much easier to read.
1157520	1158880	You know exactly what's going to happen.
1158880	1160400	You don't have to think about it.
1160400	1172780	Also, from a permissions and access control management perspective, your security team can manage the rules and the schema separately from your development team and it puts the responsibility in the right place.
1174740	1176560	So, demo time.
1176800	1177620	This is the fun part.
1177900	1180400	The first part was all about DOGS.
1180400	1184960	Then we went to document access management, which is important, but boring.
1184960	1186360	So we're going to go back to DOGS.
1186800	1189540	I have tried a number of products.
1189540	1191660	There are all these products up on the screen here.
1191660	1192520	There are many more.
1192520	1195800	These are relationship-based access management tools.
1195840	1197300	Some of them are open source and free to use.
1197300	1198380	Some of them are paid for.
1198380	1200760	I'm going to be using Permify in this demo.
1202580	1206040	Am I going to annoy anybody by switching over to this on the AV team?
1206040	1208840	They didn't mic check me on this one, so I apologise in advance.
1208840	1210420	But I'm going to need both hands to type.
1211280	1213240	I'm just going to stop screen sharing.
1215220	1219700	Let's jump over here and we're going to have a first look at Postman.
1220440	1222200	Let's make this a bit bigger.
1223040	1224740	Can you all read that okay?
1224940	1225740	Excellent.
1226400	1228860	Let's have a look from the beginning.
1228860	1230600	We're going to create a tenant.
1230600	1242700	In fact, the first thing I'm going to do, because like all developers, I decided to test this before I started the talk, so I'm just going to restart Permify in the background, so we're starting from a bank slate.
1243160	1246940	Now over here, what we're going to do is we're going to create a new tenant.
1246940	1257300	So Permify allows you to have multiple tenants in your system, so you can sandbox or isolate certain areas of your organisation or even certain organisations within a larger system.
1258040	1263680	We're going to create a tenant over here called Dog & Bone.
1264240	1271300	If I hit send on that, we'll see down here that we get a positive response back, a 200, and we've got our tenant.
1271300	1273340	The next thing I'm going to do is create the schema.
1273440	1278400	Now this schema for some reason, Permify wants it in a single string.
1278820	1282380	So to make it easier, I have it over here.
1284540	1286500	This is very similar to what we saw in the slides.
1286500	1288360	Basically we've got a definition of a dog.
1288560	1290480	A dog has an owner, which is a person.
1290680	1291540	We've got a sheep.
1291540	1293640	A sheep has an owner that is also a person.
1293780	1296480	A sheep also has a bone, which is an entity type bone.
1296800	1297880	We've got a person.
1297960	1300280	A person can have a friend, would be another person.
1300280	1305940	A person can also have sheep and a person can have dogs, so we've got bi-directional rules here.
1305940	1308740	And then we've got a relationship between the bone.
1308740	1310640	The bone has an owner, and that's a sheep.
1310640	1311560	And then we've got a permission.
1311560	1314360	Can the owner's friend's dog eat?
1315180	1320120	And eat is true if that comes out as a relationship that exists.
1321900	1327520	So let's submit that through, and we should find that that has now worked.
1327520	1329820	If I now create some relationships...
1332180	1333600	Come on, get bigger.
1336100	1336980	Where's the handle?
1337560	1338480	It's always hiding.
1341880	1343940	I'll just scroll through this little by little.
1344200	1348140	So, actually, if I make this slightly smaller, is that still readable at the back?
1348860	1349740	Yep, okay.
1349840	1351260	So at least we can see a bit more at a time.
1351260	1354160	So we can see here we've got a relationship between a subject and an entity.
1354340	1358540	Remember I said a subject is also an entity, but it's just the primary entity in a relationship.
1358540	1359960	Is the microphone cutting out?
1359960	1360920	A little?
1361240	1364560	I'll go back to this one, because I don't need to type as much now.
1364560	1368700	So we can see that the subject, mad scientist, is the owner of Shadow the dog.
1368940	1373020	We can see here that Shadow the dog is also a dog belonging to the scientist.
1373400	1375980	And then we've got the farmer has Dolly the sheep.
1376220	1378040	The sheep belongs to the farmer.
1378220	1386020	We've got Dolly is a sheep to the femur, and the femur is a bone to the sheep.
1386020	1388500	So we've got these relationships built up now.
1388860	1401220	So if I come through and I ask what friends does the scientist have, because we haven't defined those relationships yet, if I execute that, we'll see down here that the result is nothing.
1401220	1403180	He has no friends.
1403180	1404680	He's a sad scientist.
1405100	1408140	As it happens, the farmer is also a sad farmer.
1408260	1411640	Although the farmer has sheep, so a little bit happier, probably.
1412160	1413680	I know, sheep are better than dogs?
1413680	1415180	I digress yet again.
1415260	1416840	So can shadow eat the bone?
1417000	1417800	What do we reckon?
1419460	1421720	No, so if I hit that, it comes through.
1421900	1422840	Result denied.
1423240	1431260	So it's a very low energy kind of reaction that I'm getting.
1431260	1433380	But it's also a very low energy kind of output.
1433400	1437020	So I thought, I've got these two requests here that I can make.
1437020	1440260	The first one calls data right.
1440700	1444460	What I'm going to do is I'm going to say, okay, the mad scientist is now friends with the farmer.
1444640	1446780	And then I've got another one here, break friends.
1446960	1448180	It's data delete.
1448180	1451600	And in here I'm defining the mad scientist is no longer a friend with the farmer.
1451640	1455040	So to make this a little more exciting, I decided to
1459530	1461870	show you all my sister's Facebook page.
1462790	1465210	And also, let's bring this back in over here.
1465830	1467410	I have a dog and a bone.
1467410	1471230	Let's just refresh this because it doesn't like having the lid shut on it.
1471870	1474670	And for some reason, I'm getting an image rendering error.
1474670	1475550	There we go.
1475710	1477070	What demos go perfectly.
1477070	1478670	So, doors closed.
1478670	1479830	Dog can't get a bone.
1479830	1487010	So what happens if the farmer makes friends with the scientist?
1487010	1487870	What do you think?
1492460	1493940	No, it didn't work.
1495400	1497060	Did I call the right one there?
1497380	1498780	Looks like you're offline.
1498800	1500560	Yeah, but I'm doing everything locally.
1500560	1500880	So,
1506900	1508480	did I call the wrong one?
1508680	1510100	Did I call break friends?
1510360	1512040	Let's double click on that one.
1515330	1516470	Darn it.
1516910	1528550	Well, I will show you that if we come over here and look at friends of mad scientist, we should now have, there we go, the friendship is now in here.
1528550	1533850	So now if our call can shadow eat the bone, it comes back as still denied.
1534030	1534590	Okay.
1534590	1536150	So, this is where the demo fails.
1536150	1538610	I'm more than happy to work out why the demo failed.
1538610	1544250	It was probably something to do with keeping my Wi-Fi off at Defcon and closing my laptop lid between testing demos.
1544450	1545930	But the theory is there.
1545930	1547950	The results should have come back immediately.
1547950	1550090	I had a little bit of a cheat in my app.
1550090	1551710	It was basically polling every second.
1551970	1557170	But there are plenty of ways of connecting to databases and getting a full-time stream of data back.
1557170	1565070	So you can get almost like a push notification or an immediate notification of permission changes if that's something you need in your environment.
1565070	1570610	Most of the time it's probably something you only need every time you make a request to make sure that requests should be honored.
1571770	1585970	But one of the things that I want to caution is that while this is complicated and exciting and perhaps when it comes to permission systems, dare I say a little bit sexy, I'm not sure, it's not always the right solution.
1585970	1591730	As I said, there's a lot more computation power required for doing things like checking whether or not a permission should be granted.
1591910	1594830	Role-based access control is always going to be your easiest.
1594930	1598270	That's always simply like, is this person an admin, yes or no?
1598610	1604910	In fact, in some situations, if you think of your home internet router, you don't even have permission systems like, are they logged in, yes or no?
1605030	1606550	That's technically the simplest.
1607030	1617810	So work out which level of permissions complexity or the way that your data is modeled and how you want to define whether or not access should be allowed.
1617950	1622690	Work out what level of complexity you can get to at a minimum while still meeting your requirements.
1622690	1627590	Because if you go for the full thing straight out, re-back all the way, baby, absolutely it's fun.
1627810	1632030	You will probably create a situation where your job is now indispensable.
1632050	1635230	You will not be fired because nobody knows what the hell you did.
1635310	1637190	But it's not always the right solution.
1637290	1638650	Pick the right one for you.
1638650	1647930	If you're currently going through a situation where you want to implement some kind of permission control, more than welcome to come up and talk to me afterwards and tell me a story.
1647930	1652110	I'll let you know if I've got any clue at all as to what you may or may not consider.
1652470	1659930	I'm certainly not going to tell you I know your system inside out and can tell you what the answer is, but I'm happy to have a chat and go through that with you.
1660150	1664610	But I would like to finish by just saying thank you.
1664870	1666550	If I can even fire my slides.
1670260	1672040	Let's just get that back up there.
1672140	1675040	So again, that's my contact details at the top there.
1675540	1679240	ArcJet are currently running a contest if you want to try our product out.
1679600	1681380	There's some prizes we're giving away as well.
1681380	1682580	Challenge.arcjet.com.
1682580	1683140	Give it a try.
1683140	1683800	Let us know.
1683800	1692260	We would really love to know from you how you find the product, how easy it is to use and what we can do to make it easier for you to make your website sit better.
1692700	1694460	But this talk was about permission systems.
1694460	1695380	Come talk to me.
1695420	1696120	Thank you for your time.
1696120	1697780	Have a great rest of your DEF CON.
1703820	1704860	DEF CON.
