AWS re:Invent 2022 - [NEW] Use policies to manage permissions w/Amazon Verified Permissions (SEC335)
AWS re:Invent 2022 - [NEW] Use policies to manage permissions w/Amazon Verified Permissions (SEC335)
Permissions in your application can be based on several factors, including principal’s roles and attributes, resource data, and other contextual information such as method of authentication. By using policy-based permissions, you can decouple authorization logic from your applications, gain better visibility and auditability into access rules, and manage permissions at scale. Join us in this session to learn how policy-based permissions can be applied to your applications using Amazon Verified Permissions, and discover how this fits into the end-to-end journey of application authentication, authorization, and fine-grained access control.
ABOUT AWS Amazon Web Services (AWS) hosts events, both online and in-person, bringing the cloud computing community together to connect, collaborate, and learn from AWS experts.
AWS is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.
#reInvent2022 #AWSreInvent2022 #AWSEvents
Content
0.36 -> - Hi, good afternoon everybody.
2.01 -> Thank you very much for coming.
3.87 -> Appreciate there are a lot
of good sessions out there.
6.09 -> So thank you for making
this one part of your day.
10.26 -> The topic is a new service
13.47 -> that we launched on Monday
15.9 -> in gated preview called
Amazon Verified Permissions.
19.5 -> And specifically how you use
Amazon Verified Permissions
22.98 -> to manage permissions
within your application.
26.07 -> My name's Julian Lovelock.
27.39 -> I'm the product manager.
29.22 -> And I'll be joined on stage
30.75 -> by my colleagues, Emina and Mahmoud.
32.97 -> And I'll let them introduce themselves
34.98 -> as they take the stage.
37.59 -> So how's the day or this
particular session breakdown?
41.52 -> I'm gonna do an introduction
to the product explaining
45.42 -> why we built it and a
little bit about high level.
49.2 -> What it does.
50.61 -> Mahmoud's gonna get into more depth,
52.98 -> talking about how you would
integrate your application
55.86 -> into this service.
57.99 -> And then Emina will be talking
59.79 -> about the Cedar policy language
62.13 -> which is the language
in which the policies
64.44 -> for this permission system are written.
69.54 -> Like any good solution,
it starts with a problem.
73.29 -> So what is the problem that
we were trying to solve?
79.35 -> In a word that problem is permissions.
82.95 -> Or more broadly.
84.57 -> How does an application
developer manage the permissions
88.23 -> within their application
and authorize user actions
92.01 -> based on those permissions?
94.8 -> So whatever application
you're trying to build
97.83 -> you have to have some element
of permissions management
100.35 -> within that application.
102.33 -> If you're building an
online banking application,
105.3 -> you have to think about how
do I determine which accounts,
108.78 -> different users are allowed to access
110.49 -> and what transactions they're allowed
111.75 -> to take on those accounts.
113.85 -> If I'm building a photo
sharing application
116.34 -> I have to think about who's
allowed access to which photos,
119.01 -> who can comment on them, who
can create albums, et cetera.
122.7 -> I'm building an HR system.
123.99 -> I have to think about who has access
126.06 -> to different employee records.
127.56 -> Who can access reviews.
128.73 -> Who can submit reviews.
129.75 -> Who can access payroll data.
132 -> It goes on.
132.833 -> So any application that
you're building, pretty much,
135.69 -> you need to think about how
you manage the permissions
138.03 -> within that application.
139.74 -> And how you authorize
user actions within it.
143.91 -> So we can define permissions broadly
147.18 -> as the set of rules that
describe what each user
150.75 -> in the application is permitted to do.
154.626 -> And we can express those
permissions as policies.
159 -> In the simplest sense, there
are two types of policies.
162.78 -> Those that commit you to do something
165.66 -> and those that forbid your
user from doing something.
170.76 -> We also see in general terms
two authorization models.
176.16 -> There is what we often refer to as RBAC
178.44 -> or role-based access control
181.2 -> which works well in a
hierarchical organization.
185.04 -> Where users are divided into
a group, into a hierarchy,
188.79 -> and we can assign roles
to different groups.
191.37 -> And those roles determine what users
193.35 -> in those groups are permitted to do.
194.82 -> And that, as you might imagine, works well
196.92 -> in a workforce environment
198.84 -> where employees are typically organized
200.79 -> into some sort of a hierarchy.
203.58 -> The challenge that we often
see with RBAC based models
206.82 -> is as you make those
permissions more granular
211.41 -> you get more and more roles.
214.14 -> And we have customers
who've explained to us
215.79 -> that they actually have
more roles than employees.
220.23 -> The other model is ABAC,
attribute based access control.
224.73 -> This works pretty well in a
consumer facing application,
228.57 -> whereas you might imagine your users
230.73 -> aren't divided into nice hierarchies.
234 -> And so you are defining the rules
236.1 -> in an ABAC based model
238.26 -> based on attributes of the
resource that you're protecting
242.37 -> or the identity that you
are enabling access to.
246.42 -> Or for I should say.
248.16 -> Challenge with ABAC models
250.05 -> is that they can become quite opaque.
253.23 -> Difficult to analyze 'cause these rules
255.45 -> can come out across as quite ad hoc.
261.84 -> So we've established that
permissions management
265.41 -> is a must have.
267.63 -> We can logically ask ourselves,
"Well how's it done today"?
271.5 -> So through the course of this session
274.14 -> you'll see various different
examples thrown at you.
277.35 -> My slides are gonna
throw an example at you
279.09 -> that's oriented around a
financial services application.
282.51 -> And they gotta protect access
283.98 -> to creating payees and actions like that.
287.7 -> So we imagine a user
289.68 -> of this online banking application needing
292.26 -> to create a payee.
293.88 -> And the application has to figure out
295.92 -> whether said user is permitted to do this.
299.43 -> And what we're gonna
see more often than not
302.37 -> is that logic actually embedded
304.86 -> into the code of the application.
308.1 -> You can see there my attempted code.
309.72 -> You can see why I became a product manager
311.55 -> rather than a developer
but you get the sense
314.07 -> which is that this code
315.93 -> is gonna have convoluted
logic written into it
318.42 -> that protects this particular transaction.
320.13 -> But it's gonna be part of the code.
321.3 -> So what's the issue with that?
324.93 -> Well the issue is that
326.31 -> in order to understand
328.98 -> what or who is allowed to
do what in this application
332.13 -> you effectively have to
be able to read the code.
335.85 -> Also, every time you
change the rules around
338.76 -> who is allowed to do what.
340.29 -> Maybe there's a change organizationally.
342.6 -> Maybe there's a new set of regulations.
344.88 -> Maybe there's an event that requires you
347.01 -> to re-look at the permissions
rules within your system.
350.25 -> These things all require you to go back
352.14 -> and change the code of your application.
355.83 -> Which, to put it frankly, is suboptimal.
359.4 -> And then the other thing
is audits are difficult.
362.28 -> It's not an unreasonable question
364.71 -> for an auditor to ask, "Okay,
who can create payees"?
369.42 -> And if answering that request
requires the respondents
373.5 -> to go look at the code
375.15 -> it's gonna be a very
lengthy and tedious audit.
381.84 -> So we can begin to understand
384.15 -> some of the characteristics
385.89 -> that we want a modular
permission system to have.
390.96 -> We want those permissions to be expressed
393.81 -> as relatively simple,
easy to read policies.
399.21 -> We wanna be able to support
role based access control
403.02 -> and attribute based access control.
406.68 -> And we want those policies to be auditable
409.38 -> and easy to understand.
411.81 -> If we look at it
412.643 -> from a non-functional
requirement perspective
416.58 -> we want very low latency
because we're gonna adhere
419.16 -> to zero trust policy strategy.
422.13 -> We're gonna have our
application check permissions
424.89 -> for each and every time anyone within
426.57 -> that application does anything.
428.46 -> So that better happen quickly.
430.89 -> It's gotta be highly available
432.06 -> because if the system stops working
434.22 -> then the users can't do
anything in the system.
437.691 -> And we want it to be easy to plug in
439.17 -> because if a developer can't plug
440.52 -> this service into their application
443.7 -> they're obviously not gonna use it.
448.08 -> So we've established we need
449.73 -> a permissions management system.
452.31 -> We know the kind of
characteristics it has to have.
455.94 -> Why can't we as a development
team just build it ourself
458.52 -> as part of our application development?
459.99 -> Why do we need to go to a third party
462.45 -> and take a service from
them to do this thing?
466.26 -> Well firstly, it's pretty
time consuming to build.
469.68 -> It gets complicated quickly as you start
471.9 -> to try and accommodate many
different types of policies.
476.1 -> And it's difficult to do right.
479.22 -> There's some fairly complex mathematics
481.83 -> that sit behind
requirements like being able
484.86 -> to analyze policies to
understand who can do what
488.28 -> or if one policy
contradicts another policy.
491.07 -> If you want to be able to do that
492.27 -> through some automated analysis tools
494.4 -> based on automated reasoning.
497.13 -> And Emina will talk a little bit more
498.63 -> about that in her session.
500.67 -> Or her section I should say.
503.13 -> It may not scale.
504.54 -> What you built to work well with 50 roles
508.59 -> may begin to struggle from
a performance perspective
511.77 -> when you have 50,000 roles.
514.83 -> And more often than not
governance takes a backseat.
520.41 -> The logic of a permissions
management system
523.8 -> that enables you to go and see
525.9 -> who actually created this policy,
527.61 -> when did they create this policy,
529.02 -> how come they were allowed
to create this policy,
531 -> does the policy changed?
532.83 -> All of that governance
layer is typically left out
535.68 -> in a self-build.
539.67 -> So this is where we'd like
541.83 -> to introduce Amazon Verified Permissions.
544.71 -> As an off the shelf permissions management
547.53 -> and authorization system
that meets these challenges.
552.45 -> Essentially what the system does
554.73 -> is to store permissions
expressed as policies
558.84 -> and provide a means for your application
561.78 -> to manage these permissions
563.97 -> and to authorize the users
of that application against
567.15 -> these permissions by
evaluating those policies.
573.3 -> I'm gonna run through
some high level use cases
576.09 -> and then I'm gonna hand over to Mahmoud.
577.8 -> And he's gonna get into
a bit more depth around
579.6 -> these use cases.
581.13 -> So we're gonna imagine our
financial services application.
584.94 -> And we're gonna want to
start to think about, okay,
587.16 -> as an application developer.
588.81 -> How do I create and maintain
policies in that application?
593.43 -> How does a user of that
application create permissions
596.7 -> on the fly?
597.57 -> Let's look at a use case for that.
599.88 -> How does the authorization process work?
602.76 -> And how do we go about auditing?
604.62 -> I'm gonna touch on these at a high level
606.18 -> and then as I said,
Mahmoud's gonna get into them
607.8 -> in a bit more detail.
611.94 -> So let's imagine our
application developer.
615.03 -> They're creating a financial
services application.
618.24 -> There may be a baseline policy
620.37 -> that applies across all
users of this application.
623.79 -> Such as allow the account
owner not only to have access
628.77 -> to the account and operate on the account,
631.05 -> but also to delegate
authority to a second user
635.94 -> in the event that the account
owner is not available.
638.58 -> So this would be what we might think of
640.53 -> as a baseline policy.
641.7 -> It's created by the application developer
644.61 -> as part, almost, as an extension
646.14 -> of the code of the application
648.39 -> at the outset and this policy is deployed
650.91 -> along with the application.
656.46 -> And you can see or maybe you can't see
659.28 -> but there's an example
here of such a policy.
662.91 -> And as I said, Emina's gonna get more
665.43 -> into the structure of the policy language
667.29 -> but it's basically broken down
668.85 -> into what we describe as a scope.
671.19 -> Which essentially caters to
the role-based access control
676.35 -> by defining a set of actions
678.48 -> that a group or an individual user
680.31 -> can take on a set of resources.
683.61 -> And then there's a set
of conditions underneath
685.95 -> which accommodates the attribute
based access control aspect
690.57 -> which puts qualifiers on those.
695.34 -> Now imagine our end user Jane, our CFO.
699.51 -> She's taken a well earned vacation.
701.52 -> So she needs to delegate
access while she's away
705.09 -> to be able to manage this account.
708.03 -> So this is an example
where an action by Jane
711.63 -> within the application is gonna result
713.58 -> in a policy being created in
the underlying policy store.
717.48 -> In this case a policy
that gives permission
720.75 -> to Jeff to manage the
account specific resource
725.01 -> during the period of Jane's vacation.
728.67 -> So that when our application
end user Jeff logs
731.49 -> onto the application
and, for example, tries
733.56 -> to create a payee on the account.
737.46 -> The application calls verified permissions
740.07 -> and says, "I've got this user Jeff.
742.8 -> He's trying to take
this action create payee
745.14 -> on this account, five one five...
746.91 -> Can't remember what account.
747.743 -> Use five five three dot dot dot.
749.67 -> Is this permitted or not"?
751.83 -> And the permissions management
system is gonna come back
754.59 -> with an allow or deny based on
756.39 -> an evaluation of the policies.
757.77 -> And this is all gonna happen
in a matter of milliseconds.
760.68 -> Jeff is gonna be blissfully unaware
762.93 -> that his permissions have been checked
764.58 -> and assuming he's allowed to do it
766.44 -> he's gonna carry on and create that payee.
772.05 -> And then our final persona
in this story is our auditor
776.43 -> who wants to have that view
across all of the different...
780.99 -> It's like the auditor's
the most popular one
782.43 -> to take photos of.
783.263 -> I wonder why that is.
784.17 -> Who basically wants to have that view
788.16 -> across all of the permissions
that have been created.
791.97 -> Who's basically benefited
from using these permissions?
796.23 -> And he's gonna be able to do that
798.81 -> based on a set of analysis tools
800.94 -> that we provide as part of the product
803.43 -> as well as services like CloudTrail
807.03 -> to which audit logs are gonna be written.
808.71 -> And he's gonna be able to use
the normal CloudTrail tools
811.86 -> to view those audit logs
and see what happened.
816.36 -> So at this point I'm gonna hand you over
818.19 -> to my colleague Mahmoud.
819.69 -> And he's going to be walking through
821.07 -> in a little bit more depth a
sample application for you.
826.95 -> - Thank you Julian.
828.96 -> Hi everyone, good afternoon once again
830.28 -> and thanks for being here.
831.75 -> My name is Mahmoud Matouk.
832.833 -> I am a solutions architect
with AWS Identity.
835.59 -> And in this section of the session
837.15 -> we'll be looking at how to get started
839.1 -> with Amazon Verified Permissions
840.48 -> and what it looks like
to build an application
842.43 -> that integrates with this service.
844.47 -> I will first go through
a quick walkthrough
847.41 -> into the console and the first
few steps to get started.
850.41 -> And then we will look
at a demo application
852.09 -> and few authorization scenarios
853.68 -> and how to integrate
with this from your code.
857.73 -> So first to get started from the console.
859.44 -> The first thing that comes
out is you'll be greeted
862.05 -> with this screen and asked
to create a policy store.
865.23 -> You can think about a policy store
866.73 -> as a container of your policy.
868.26 -> So if you have multiple
projects, multiple workloads,
871.14 -> probably with different
authorization requirements,
873.45 -> then you will be creating
multiple policy stores.
877.05 -> The policy store is a
container but it's empty.
879.09 -> So you start filling this
policy store with policies.
881.67 -> And you can do this
simply from the console
883.35 -> by providing a policy description
885.18 -> and then the policy body itself.
887.34 -> We'll go into more details
into the policy language
889.74 -> with Emina.
890.76 -> For now this is a simple policy
892.35 -> that allows a principle
to access a resource
894.69 -> as long as this principle is
the owner of the resource.
899.22 -> You keep adding policies
900.39 -> and build your authorization
model with multiple policies.
903.21 -> You can do this using the console.
905.13 -> You can do this using CLI, using APIs.
907.18 -> So it could be also
dynamic policies you create
909.42 -> in your application in
response to certain actions
911.61 -> like sharing a photo or
delegating to another employee
915.36 -> or something like this.
917.52 -> Once you fill your policy store
or you create your policies
920.28 -> you can test the behavior
of this policy store
922.38 -> with some authorization queries.
924.06 -> You can do this with a simulator
925.44 -> that is built into the console.
926.76 -> This helps you to troubleshoot
928.08 -> how the authorization engine behaves,
931.41 -> troubleshoot your data set, and so on.
933.99 -> To do this you provide
these pieces of information.
936.84 -> And this is also the same
data that you provide
939.24 -> to a query at run time from the code.
941.4 -> So you provide who's the principal,
942.96 -> what is the action, what is the resource.
945.18 -> And then optionally you
can provide request context
948.45 -> which is a free form map.
950.37 -> Things like runtime information,
952.02 -> maybe the IP address of the source,
953.7 -> the current time of the system,
954.99 -> anything that is relevant to the policies
956.76 -> in your policy store.
961.41 -> The last piece of information
is providing your dataset.
964.44 -> The dataset is a JSON
format that tells the engine
967.59 -> what are my entities
969.18 -> and what are the relationships
between these entities.
971.73 -> For example, if I ask the engine,
973.387 -> "Is Bob authorized to view the image?
975.66 -> Image dot jpeg"?
977.07 -> I have to tell the engine who's Bob,
978.99 -> what is an image,
980.19 -> what are the attributes of these entities,
982.2 -> and how they are related to each others.
984.09 -> So the engine resonates over this data
986.7 -> using the policies in my policy store
988.44 -> and tells me if it's allowed or denied.
991.38 -> The simulator tells you the decision.
993.15 -> This is an allow.
994.05 -> And if it's an allow
995.25 -> what was the satisfied policy.
997.44 -> And if it's a deny,
999 -> because, yes, there is
no satisfied policy.
1000.51 -> It'll be a plain deny.
1002.24 -> If it's a deny because
of errors in your data,
1005.21 -> like missing attributes,
1006.32 -> you're trying to compare
certain attributes
1009.26 -> that are not provided as
part of your entities.
1011.48 -> It'll also tell you these errors.
1013.01 -> So you can either
1015.23 -> think that this is expected,
this is how I designed it,
1017.63 -> or if this is not expected
1019.04 -> then you go back and fix your data sets
1020.75 -> or change your policies as needed.
1023.6 -> This is all part of the development
1024.98 -> of your authorization model.
1028.22 -> This is what you do from
the console to get started.
1030.86 -> As I mentioned, same thing can be done
1032.45 -> from the APIs and the CLI.
1034.16 -> So this can be binned into your CI/CD.
1036.44 -> It could be dynamic actions
in your application as needed.
1039.74 -> So once I build my policy store,
1042.86 -> how do I use this at run time
1044.78 -> to make authorization decisions in my app?
1047.3 -> We will look at this next
1048.5 -> and for this we will take
Onyx to the vet clinic.
1051.98 -> I'm going to use a sample application
1053.36 -> that simulates the vet clinic portal.
1056.21 -> Onyx was always known for
eating things he's not supposed
1058.94 -> to be eating and he just got sick.
1060.71 -> So we need to take him to the vet.
1062.84 -> What is the scenario we are looking for?
1065.03 -> Dave is Onyx owner
1066.89 -> and he needs to take them to the vet.
1069.26 -> So he contacted Sally, the
office administrator of this vet,
1072.23 -> to scheduled him for an appointment.
1074.63 -> Sally brought him up for an appointment
1076.31 -> with their primary doctor, Dr. Jane.
1078.86 -> Because Dr. Jane is the
primary doctor for Onyx,
1081.44 -> she has access to his history
1082.85 -> and the records of his previous visits.
1085.73 -> But she found that Onyx needs an X-ray.
1088.49 -> So she will refer them to
a specialist, Dr. Adam,
1091.7 -> who will run the X-ray.
1093.08 -> And with this referral,
Dr. Adam gains more access
1095.63 -> into Dave as a client
and Onyx as a patient.
1099.71 -> They use this patient portal application
1101.45 -> and we will be looking
at few of these use cases
1103.52 -> and how this translates into policies
1105.2 -> and how do I evaluate
these policies at run time.
1108.68 -> The first use case is fairly simple
1110.9 -> so viewing client data and
scheduling an appointment.
1115.22 -> As we saw there are different
personas in this system
1117.59 -> and every persona has
different permissions.
1120.47 -> Let's first take a look at
the demo of the scenario
1123.41 -> and then we can go back
to the drawing board
1125.06 -> and look at our policies
and how we structured them.
1128.03 -> Dave is the client.
1129.56 -> If he's signed into the patient portal
1131.39 -> or to the clinic portal,
1132.92 -> he can see his record and information.
1135.17 -> He's allowed to view his profile.
1136.85 -> So if he attempts to do this
1138.23 -> this is an allowed action.
1139.4 -> No issues.
1140.3 -> But he cannot schedule an
appointment for himself.
1142.55 -> If he does this it will be denied.
1144.71 -> And if he tries to refer
himself to a specialist,
1147.35 -> this will also be denied.
1148.79 -> It is his.
1151.01 -> It is not his job.
1151.843 -> He has to go through the
office administrator.