keycloak-scim/authorization_services/topics/overview/architecture.adoc

145 lines
8.7 KiB
Text
Raw Normal View History

2016-11-29 15:30:53 +00:00
[[_overview_architecture]]
=== Architecture
2016-11-29 15:30:53 +00:00
image:../../images/authz-arch-overview.png[alt="{{book.project.name}} AuthZ Architecture Overview"]
From a design perspective, {{book.project.module}} is based on a well-defined set of authorization patterns providing these capabilities:
* **Policy Administration Point (PAP)**
+
Provides a set of UIs based on the {{book.project.name}} Administration Console to manage resource servers, resources, scopes, permissions, and policies.
2016-11-29 15:30:53 +00:00
Part of this is also accomplished remotely through the use of the <<fake/../../service/protection/protection-api.adoc#_service_protection_api, Protection API>>.
+
* **Policy Decision Point (PDP)**
+
Provides a distributable policy decision point to where authorization requests are sent and policies are evaluated accordingly with the permissions being requested. Part of this is also accomplished remotely through the use of the
2016-11-29 15:30:53 +00:00
<<fake/../../service/authorization/authorization-api.adoc#_service_authorization_api, Authorization>> and <<fake/../../service/entitlement/entitlement-api.adoc#_service_entitlement_api, Entitlement>> APIs.
+
* **Policy Enforcement Point (PEP)**
+
2016-06-01 22:36:22 +00:00
Provides implementations for different environments to actually enforce authorization decisions at the resource server side.
2016-11-29 15:30:53 +00:00
{{book.project.name}} provides some built-in <<fake/../../enforcer/overview.adoc#_enforcer_overview, Policy Enforcers>>.
+
* **Policy Information Point (PIP)**
+
2016-06-01 22:36:22 +00:00
Being based on {{book.project.name}} Authentication Server, you can obtain attributes from identities and runtime environment during the evaluation of authorization policies.
==== The Authorization Process
2016-06-01 22:36:22 +00:00
Three main processes define the necessary steps to understand how to use {{book.project.name}} to enable fine-grained authorization to your applications:
2016-06-01 22:36:22 +00:00
* *Resource Management*
* *Permission and Policy Management*
2016-06-05 22:17:31 +00:00
* *Policy Enforcement*
===== Resource Management
2016-06-01 22:36:22 +00:00
*Resource Management* involves all the necessary steps to define what is being protected.
image:../../images/resource-mgmt-process.png[alt="Resource Management Overview"]
2016-11-29 15:30:53 +00:00
First, you need to specify {{book.project.name}} what are you looking to protect, which usually represents a web application or a set of one or more services. For more information on resource servers see <<fake/../../overview/terminology.adoc#_overview_terminology, Terminology>>.
2016-06-01 22:36:22 +00:00
Resource servers are managed using the {{book.project.name}} Administration Console. There you can enable any registered client application as a resource server and start managing the resources and scopes you want to protect.
2016-06-01 22:36:22 +00:00
2016-06-01 22:42:14 +00:00
image:../../images/rs-r-scopes.png[alt="Resource Server Overview"]
A resource can be a web page, a RESTFul resource, a file in your file system, an EJB, and so on. They can represent a group of resources (just like a Class in Java) or they can represent a single and specific resource.
2016-06-01 22:36:22 +00:00
For instance, you might have a _Bank Account_ resource that represents all banking accounts and use it to define the authorization policies that are common to all banking accounts. However, you might want to define specific policies for _Alice Account_ (a resource instance that belongs to a customer), where only the owner is allowed to access some information or perform an operation.
2016-06-01 22:36:22 +00:00
2016-11-29 15:30:53 +00:00
Resources can be managed using the {{book.project.name}} Administration Console or the <<fake/../../service/protection/protection-api.adoc#_service_protection_api, Protection API>>. In the latter case, resource servers are able to manage their resources remotely.
2016-06-01 22:36:22 +00:00
Scopes usually represent the actions that can be performed on a resource, but they are not limited to that. You can also use scopes to represent one or more attributes within a resource.
2016-06-01 22:36:22 +00:00
===== Permission and Policy Management
2016-06-05 22:17:31 +00:00
Once you have defined your resource server and all the resources you want to protect, you must set up permissions and policies.
2016-06-01 22:36:22 +00:00
2016-06-05 22:17:31 +00:00
This process involves all the necessary steps to actually define the security and access requirements that govern your resources.
2016-06-01 22:36:22 +00:00
image:../../images/policy-mgmt-process.png[alt="Permission and Policy Management Overview"]
Policies define the conditions that must be satisfied to access or perform operations on something (resource or scope), but they are not tied to what they are protecting. They are generic and can be reused to build permissions or even more complex policies.
2016-06-01 22:36:22 +00:00
For instance,to allow access to a group of resources only for users granted with a role "User Premium,"" you can use RBAC (Role-based Access Control).
2016-06-01 22:36:22 +00:00
{{book.project.name}} provides a few built-in policy types (and their respective policy providers) covering the most common access control mechanisms. You can even create policies based on rules written using JavaScript or JBoss Drools.
2016-06-01 22:36:22 +00:00
Once you have your policies defined, you can start defining your permissions. Permissions are coupled with the resource they are protecting. Here you specify
what you want to protect (resource or scope) and the policies that must be satisfied to grant or deny permission.
2016-06-01 22:36:22 +00:00
===== Policy Enforcement
2016-06-05 22:17:31 +00:00
*Policy Enforcement* involves the necessary steps to actually enforce authorization decisions to a resource server. This is achieved by enabling a *Policy Enforcement Point* or PEP at the resource server that is capable of communicating with the authorization server, ask for authorization data and control access to protected resources based on the decisions and permissions returned by the server.
2016-06-05 22:17:31 +00:00
image:../../images/pep-pattern-diagram.png[alt="PEP Overview"]
2016-11-29 15:30:53 +00:00
{{book.project.name}} provides some built-in <<fake/../../enforcer/overview.adoc#_enforcer_overview, Policy Enforcers>> implementations that you can use to protect your applications depending on the platform they are running on.
2016-06-05 22:17:31 +00:00
2016-06-01 22:36:22 +00:00
==== Authorization Services
2016-06-01 22:36:22 +00:00
Authorization services consist of the following RESTFul APIs:
2016-06-01 22:36:22 +00:00
2016-06-02 00:13:35 +00:00
* *Protection API*
* *Authorization API*
* *Entitlement API*
2016-06-01 22:36:22 +00:00
Each of these services provides a specific API covering the different steps involved in the authorization process.
2016-06-02 00:13:35 +00:00
===== Protection API
2016-06-02 00:13:35 +00:00
The *Protection API* is a https://docs.kantarainitiative.org/uma/rec-uma-core.html[UMA-compliant] endpoint providing a small set of operations
for resource servers to help them manage their resources and scopes. Only resource servers are allowed to access this API, which also requires a
2016-06-02 00:13:35 +00:00
*uma_protection* scope.
The operations provided by the Protection API can be organized in two main groups:
2016-06-05 22:17:31 +00:00
* *Resource Management*
2016-06-02 00:13:35 +00:00
** Create Resource
** Delete Resource
** Find by Id
** Find All
** Find with filters (for example, search by name, type, or URI)
2016-06-05 22:17:31 +00:00
* *Permission Management*
2016-06-02 00:13:35 +00:00
** Issue Permission Tickets
[NOTE]
2016-06-05 22:17:31 +00:00
By default, Remote Resource Management is enabled. You can change that using the {{book.project.name}} Administration Console and only allow resource management through the console.
2016-06-02 00:13:35 +00:00
When using the UMA protocol, the issuance of Permission Tickets by the Protection API is an important part of the whole authorization process. As described in a subsequent section, they represent the permissions being requested by the client and that are sent to the server to obtain a final token with all permissions granted during the evaluation of the permissions and policies associated with the resources and scopes being requested.
2016-06-02 00:13:35 +00:00
2016-11-29 15:30:53 +00:00
For more information, see <<fake/../../service/protection/protection-api.adoc#_service_protection_api, Protection API>>.
2016-06-02 00:13:35 +00:00
===== Authorization API
2016-06-02 00:13:35 +00:00
2016-11-29 15:30:53 +00:00
The Authorization API is also a https://docs.kantarainitiative.org/uma/rec-uma-core.html[UMA-compliant] endpoint providing a single operation that exchanges an Access Token and <<fake/.././terminology.adoc#_overview_terminology_permission_ticket, Permission Ticket>> with a Requesting Party Token (RPT).
2016-06-02 00:13:35 +00:00
2017-01-06 19:11:58 +00:00
The RPT contains all permissions granted to a client and can be used to call a resource server to get access to its protected resources.
2016-06-02 00:13:35 +00:00
2017-01-06 19:11:58 +00:00
When requesting an RPT you can also provide a previously issued RPT. In this case, the resulting RPT will consist of the union of the permissions from the previous RPT and the new ones
2016-06-05 22:17:31 +00:00
within a permission ticket.
2016-06-02 00:13:35 +00:00
image:../../images/authz-calls.png[alt="Authorization API Overview"]
2016-11-29 15:30:53 +00:00
For more information, see <<fake/../../service/authorization/authorization-api.adoc#_service_authorization_api, Authorization API>>.
2016-06-02 00:13:35 +00:00
==== Entitlement API
2016-06-02 00:13:35 +00:00
The Entitlement API provides a 1-legged protocol to issue RPTs. Unlike the Authorization API, the Entitlement API only expects an access token.
2016-06-05 22:17:31 +00:00
From this API you can obtain all the entitlements or permissions for a user (based on the resources managed by a given resource server) or just the entitlements for a set of
2016-06-05 22:17:31 +00:00
one or more resources.
2016-06-02 00:13:35 +00:00
image:../../images/entitlement-calls.png[alt="Entitlement API Overview"]
2016-11-29 15:30:53 +00:00
For more information see <<fake/../../service/entitlement/entitlement-api.adoc#_service_entitlement_api, Entitlement API>>.
2016-06-02 00:13:35 +00:00