SlideShare a Scribd company logo
Public
Version 0.9
beta
OPA in the API
management world
-- Luca Ferrari
VP of myself
Luca Ferrari
Started from REST expanding to the rest (of the
modern technologies)
2
Agenda
Intro
AuthZ basics
AuthZ models
OPA
Demo
Q&A
3
Authentication
&
Authorization
4
AuthN and AuthZ
AuthN: “please show me your ID or Passport”
AuthZ: “please scan your boarding pass on
the bar code reader”
5
Authorization
model
6
Models
There are several models out there, we will be summarizing the following ones:
ACL DAC MAC RBAC ABAC
AuthZ has been there since the beginning of computer systems, for example the first
implementation of ACLs was in the filesystem of Multics in 1965
7
ACL
An Access-Control List is a list of permissions associated with a system resource.
An ACL specifies which users or system are granted access to objects, as well as what
operations are allowed on given objects.
Each entry in a typical ACL specifies a subject and an operation.
It specifies individual users or groups.
In real world: Filesystems
8
ACL in practice
Subject Object Action
Alice Report Create
Bob Report Read
9
DAC
Discretionary Access Control is a way to restrict access to objects based on the
identity of subjects and/or groups to which they belong. The controls are discretionary in
the sense that a subject is capable of passing that permission (perhaps indirectly) on to
any other subject (unless restrained by mandatory access control).
Two implementations:
● Through ownership
● Through capabilities
10
DAC in practice
Subject Object Action
Alice Report Create
Alice Subjects Grant
grant
Subject Object Action
Bob Report Create
11
MAC
Mandatory access control is a way to control where the operating system or database
constrains the ability of a subject to access or perform an action on an object or target.
Whenever a subject attempts to access an object, an authorization rule enforced by the
OS examines these security attributes and decides if the access can take place. Any
operation by any subject on any object is tested against the set of authorization rules
(aka policy) to determine if the operation is allowed.
With mandatory access control, this security policy is centrally controlled by a security
policy administrator; users do not have the ability to override the policy in contrast to
discretionary access control (DAC).
In real world: SELINUX
12
MAC in practice
Subject Object Action
Alice Report Create
Subject Object Action
Report Alice Be created
grant
13
RBAC
Role-Based Access Control is a way to restrict system access to authorized users with
policies defined around roles and privileges. The components of RBAC such as
role-permissions, user-role and role-role relationships make it simple to perform user
assignments across a wide organization with 1000s of users.
There are 3 elements to RBAC:
1. Role assignment
2. Role authorization: A subject's active role must be authorized for the subject.
3. Permission authorization: A subject can exercise a permission only if the permission
is authorized for the subject's active role.
In the real world: IDP
14
RBAC in practice
Subject Role
Alice Creator
Name Action Object
Create report Create Report
Update Report
Read Report
Manage report Approve Report
Read Report
grant
Name Permission
Creator Create report
Permissions Role
ABAC
Attribute-Based Access Control is defined as a system where access rights are
granted to users through the use of policies which combine attributes together. The
policies can use any type of attributes (user attributes, resource attributes, object,
environment attributes etc.).
This model supports Boolean logic, in which rules contain "IF, THEN" statements about
who is making the request, the resource, and the action.
Attribute-based access control is also known as Policy-Based Access Control (PBAC)
or Claims-Based Access Control (CBAC) or IAM in AWS
16
ABAC
The Policy Enforcement Point inspects the request and generates an authorization
request from it which it sends to the PDP.
The Policy Decision Point evaluates incoming requests against policies it has been
configured with. The PDP returns a Permit / Deny decision. The PDP may also use PIPs
to retrieve missing metadata
The Policy Information Point bridges the PDP to external sources of attributes e.g. LDAP
or databases.
17
ABAC in practice
18
Policies
Subject:
Name: Alice
Department: Marketing
Action:
Type: Update
Object:
Type: Report
Mode: Draft
Department: Marketing
Context:
Location: London
Time: between 9am and 6pm GMT
XACML
24
XACML
The "eXtensible Access Control Markup Language" defines a declarative fine-grained,
attribute-based access control policy language, an architecture, and a processing model
describing how to evaluate access requests according to the rules defined in policies.
This was thought to promote interoperability between different implementations by
multiple vendors.
XACML can be considered:
● ABAC
● PBAC
● RBAC
25
XACML
26
Access control in
microservices
27
New challenges
● Authentication and authorization needs to be handled in each microservice
● Microservices should follow the principle of single responsibility. A microservice only
handles its own business logic.
● Authentication and authorization in the microservices architecture involves
scenarios that are more complex, involving users accessing microservice
applications, third-party applications accessing microservice applications, and
multiple microservice applications accessing each other.
28
OPA
30
In brief
Open Policy Agent main characteristics:
● open source
● general-purpose policy engine
● high-level declarative language (Rego) that lets you specify policy as code
● REST APIs to offload policy decision-making
● decoupling policy decision-making from policy enforcement
● Being able to receive and reply with arbitrary structured data (e.g., JSON)
31
In brief
32
Rego
Rego queries are assertions on data stored in OPA. These queries can be used to define
policies that enumerate instances of data that violate the expected state of the system.
Using Rego for defining policy is easy to read and write.
Rego is declarative so policy authors can focus on what queries should return rather than
how queries should be executed. These queries are simpler and more concise than the
equivalent in an imperative language.
https://play.openpolicyagent.org/
33
XACML
Open Policy Agent is similar to XACML in that it provides a policy decision point,
externalized authorization, and a policy language (REGO).
It specializes in infrastructure authorization (e.g. for Kubernetes, Istio...) rather than
general-purpose, API-centric, or data-centric which XACML addresses.
34
Integrating OPA
2 main interfaces:
1. Evaluation: OPA’s interface for querying for policy decisions.
2. Management: OPA’s interface for deploying policies, understanding status,
uploading logs, and so on. Distributing policy, retrieving status, and storing logs in
the same way across all OPAs provides a unified management plane for policy
across many different software systems.
35
Policies evaluation
OPA supports different ways to evaluate policies:
● REST API returns decisions as JSON over HTTP.
● The Go API (GoDoc) returns decisions as simple Go types (bool, string,
map[string]interface{}, etc.)
● WebAssembly compiles Rego policies into WASM instructions so they can be
embedded and evaluated by any WebAssembly runtime
● The SDK provides high-level APIs for obtaining the output of query evaluation as
simple Go types (bool, string, map[string]interface{}, etc.)
36
OPA and / or
API Management
37
Brothers in arms
OPA is the perfect companion of an API Management especially in the new microservice
/ lightweight oriented new world.
While XACML was standardized and has been adopted by some vendors, it was
considered heavyweight and more difficult to define in terms of policies (XML horror,
reminds you of anything you REST aficionados?)
On the base of this vision and of a more modular approach to API Management, several
projects have been initiated, including https://github.com/kuadrant/authorino
38
Demo
39
Setup
A simple HTTP web server that accepts any HTTP GET request that you issue and
echoes the OPA decision back as text.
Our policy is:
● People can see their own salaries (GET /finance/salary/{user} is permitted for
{user})
● A manager can see their direct reports' salaries (GET /finance/salary/{user} is
permitted for {user}’s manager)
40
Components
41
OPA
REST
Microservice
Bundle
OPA can periodically download bundles of
policy and data from remote HTTP servers.
The policies and data are loaded on the fly
without requiring a restart of OPA
Authorize ?
Sync
policies
Alice
request
Steps
❏ Executing a request as Alice
❏ Executing a request as Bob
❏ Executing a request as Betty
42
Loading … PLEASE WAIT
Demo time
43
What just happened
✓ Executing a request as Alice
✓ Executing a request as Bob
✓ Executing a request as Betty
44
Comments
45
Thank you.
46

More Related Content

PDF
카프카, 산전수전 노하우
if kakao
 
DOCX
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
NeoClova
 
PDF
KAFKA 3.1.0.pdf
wonyong hwang
 
PDF
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
 
PDF
OPA: The Cloud Native Policy Engine
Torin Sandall
 
PDF
Ceph Block Devices: A Deep Dive
Red_Hat_Storage
 
PPTX
OPA APIs and Use Case Survey
Torin Sandall
 
PDF
Redo log improvements MYSQL 8.0
Mydbops
 
카프카, 산전수전 노하우
if kakao
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
NeoClova
 
KAFKA 3.1.0.pdf
wonyong hwang
 
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
 
OPA: The Cloud Native Policy Engine
Torin Sandall
 
Ceph Block Devices: A Deep Dive
Red_Hat_Storage
 
OPA APIs and Use Case Survey
Torin Sandall
 
Redo log improvements MYSQL 8.0
Mydbops
 

What's hot (20)

PDF
Kvm performance optimization for ubuntu
Sim Janghoon
 
PPTX
Centralized Logging System Using ELK Stack
Rohit Sharma
 
PPTX
APACHE KAFKA / Kafka Connect / Kafka Streams
Ketan Gote
 
PDF
Hadoop/Spark で Amazon S3 を徹底的に使いこなすワザ (Hadoop / Spark Conference Japan 2019)
Noritaka Sekiyama
 
PDF
Efficient monitoring and alerting
Tobias Schmidt
 
PDF
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
PDF
Open Policy Agent
Torin Sandall
 
PDF
Fluent Bit: Log Forwarding at Scale
Eduardo Silva Pereira
 
PPTX
Web App for Containers + Cosmos DBで コンテナ対応したMEANアプリを作ろう!
Yoichi Kawasaki
 
PPTX
Introduction to rook
Rohan Gupta
 
PDF
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
 
PDF
Federated Engine 실무적용사례
I Goo Lee
 
PDF
AWS で Presto を徹底的に使いこなすワザ
Noritaka Sekiyama
 
PDF
Apache Kafka Architecture & Fundamentals Explained
confluent
 
PPTX
はじめてのElasticsearchクラスタ
Satoyuki Tsukano
 
PPTX
Zuul @ Netflix SpringOne Platform
Mikey Cohen - Hiring Amazing Engineers
 
PDF
톰캣 운영 노하우
jieunsys
 
PDF
20190703 AWS Black Belt Online Seminar Amazon MQ
Amazon Web Services Japan
 
PDF
How IBM's Massive POWER9 UNIX Servers Benefit from InfluxDB and Grafana Techn...
DevOps.com
 
PPT
OpenSearch
hchen1
 
Kvm performance optimization for ubuntu
Sim Janghoon
 
Centralized Logging System Using ELK Stack
Rohit Sharma
 
APACHE KAFKA / Kafka Connect / Kafka Streams
Ketan Gote
 
Hadoop/Spark で Amazon S3 を徹底的に使いこなすワザ (Hadoop / Spark Conference Japan 2019)
Noritaka Sekiyama
 
Efficient monitoring and alerting
Tobias Schmidt
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
Open Policy Agent
Torin Sandall
 
Fluent Bit: Log Forwarding at Scale
Eduardo Silva Pereira
 
Web App for Containers + Cosmos DBで コンテナ対応したMEANアプリを作ろう!
Yoichi Kawasaki
 
Introduction to rook
Rohan Gupta
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
 
Federated Engine 실무적용사례
I Goo Lee
 
AWS で Presto を徹底的に使いこなすワザ
Noritaka Sekiyama
 
Apache Kafka Architecture & Fundamentals Explained
confluent
 
はじめてのElasticsearchクラスタ
Satoyuki Tsukano
 
Zuul @ Netflix SpringOne Platform
Mikey Cohen - Hiring Amazing Engineers
 
톰캣 운영 노하우
jieunsys
 
20190703 AWS Black Belt Online Seminar Amazon MQ
Amazon Web Services Japan
 
How IBM's Massive POWER9 UNIX Servers Benefit from InfluxDB and Grafana Techn...
DevOps.com
 
OpenSearch
hchen1
 
Ad

Similar to Opa in the api management world (20)

PDF
Securing FIWARE Architectures
FIWARE
 
PDF
IRJET- A Review On - Controlchain: Access Control using Blockchain
IRJET Journal
 
PPTX
The day when role based access control disappears
Ulf Mattsson
 
PPT
2004 10 21 Rbac At Mazda Horst Walther
CardinaleWay Mazda
 
PDF
S5-Authorization
zakieh alizadeh
 
PPT
Zou Layered VO PDCAT2008 V0.5 Concise
yongqiangzou
 
PDF
Axiomatics webinar 13 june 2013 shared
Finn Frisch
 
PDF
Yii Framework Security
Ilko Kacharov
 
PDF
Dev confus.2020 compliance operator
jaormx
 
PPTX
Microservices With Istio Service Mesh
Natanael Fonseca
 
PDF
SAP BI Security Features
dw_anil
 
PDF
An expert guide to new sap bi security features
Shazia_Sultana
 
PDF
Attribute-Based Access Control in Symfony
Adam Elsodaney
 
PDF
Peeples authentication authorization_services_with_saml_xacml_with_jboss_eap6
Kenneth Peeples
 
PDF
Advanced Controls access and user security for superusers con8824
Oracle
 
PDF
Four ways to represent computer executable rules
Jeff Long
 
PDF
The WSO2 Identity Server - An answer to your common XACML dilemmas
sureshattanayake
 
PDF
The WSO2 Identity Server - An answer to your common XACML dilemmas
WSO2
 
PDF
The WSO2 Identity Server - An answer to your common XACML dilemmas
sureshattanayake
 
PPTX
FIWARE Wednesday Webinars - How to Secure FIWARE Architectures
FIWARE
 
Securing FIWARE Architectures
FIWARE
 
IRJET- A Review On - Controlchain: Access Control using Blockchain
IRJET Journal
 
The day when role based access control disappears
Ulf Mattsson
 
2004 10 21 Rbac At Mazda Horst Walther
CardinaleWay Mazda
 
S5-Authorization
zakieh alizadeh
 
Zou Layered VO PDCAT2008 V0.5 Concise
yongqiangzou
 
Axiomatics webinar 13 june 2013 shared
Finn Frisch
 
Yii Framework Security
Ilko Kacharov
 
Dev confus.2020 compliance operator
jaormx
 
Microservices With Istio Service Mesh
Natanael Fonseca
 
SAP BI Security Features
dw_anil
 
An expert guide to new sap bi security features
Shazia_Sultana
 
Attribute-Based Access Control in Symfony
Adam Elsodaney
 
Peeples authentication authorization_services_with_saml_xacml_with_jboss_eap6
Kenneth Peeples
 
Advanced Controls access and user security for superusers con8824
Oracle
 
Four ways to represent computer executable rules
Jeff Long
 
The WSO2 Identity Server - An answer to your common XACML dilemmas
sureshattanayake
 
The WSO2 Identity Server - An answer to your common XACML dilemmas
WSO2
 
The WSO2 Identity Server - An answer to your common XACML dilemmas
sureshattanayake
 
FIWARE Wednesday Webinars - How to Secure FIWARE Architectures
FIWARE
 
Ad

More from Red Hat (20)

PDF
Meetup 2023 - Gateway API.pdf
Red Hat
 
PDF
Meetup 2022 - APIs with Quarkus.pdf
Red Hat
 
PDF
Meetup 2022 - API Gateway landscape.pdf
Red Hat
 
PPTX
APIs at the Edge
Red Hat
 
PDF
How easy (or hard) it is to monitor your graph ql service performance
Red Hat
 
PDF
Covid impact on digital identity
Red Hat
 
PPTX
How do async ap is survive in a rest world
Red Hat
 
PPTX
The new (is it really ) api stack
Red Hat
 
PDF
The case for a unified way of speaking to things
Red Hat
 
PDF
What is the best approach to tdd
Red Hat
 
PDF
Leverage event streaming framework to build intelligent applications
Red Hat
 
PDF
Using Streaming APIs in Production
Red Hat
 
PDF
The independence facts
Red Hat
 
PDF
Api observability
Red Hat
 
PPTX
Api service mesh and microservice tooling
Red Hat
 
PDF
Api design best practice
Red Hat
 
PDF
Certificate complexity
Red Hat
 
PDF
Lucamaf1 2949-db--winter2013-accomplishment
Red Hat
 
PDF
certificate game theory
Red Hat
 
PDF
statement of accomplishment - heterogeneous parallel programming
Red Hat
 
Meetup 2023 - Gateway API.pdf
Red Hat
 
Meetup 2022 - APIs with Quarkus.pdf
Red Hat
 
Meetup 2022 - API Gateway landscape.pdf
Red Hat
 
APIs at the Edge
Red Hat
 
How easy (or hard) it is to monitor your graph ql service performance
Red Hat
 
Covid impact on digital identity
Red Hat
 
How do async ap is survive in a rest world
Red Hat
 
The new (is it really ) api stack
Red Hat
 
The case for a unified way of speaking to things
Red Hat
 
What is the best approach to tdd
Red Hat
 
Leverage event streaming framework to build intelligent applications
Red Hat
 
Using Streaming APIs in Production
Red Hat
 
The independence facts
Red Hat
 
Api observability
Red Hat
 
Api service mesh and microservice tooling
Red Hat
 
Api design best practice
Red Hat
 
Certificate complexity
Red Hat
 
Lucamaf1 2949-db--winter2013-accomplishment
Red Hat
 
certificate game theory
Red Hat
 
statement of accomplishment - heterogeneous parallel programming
Red Hat
 

Recently uploaded (20)

PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
Presentation about variables and constant.pptx
kr2589474
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Presentation about variables and constant.pptx
safalsingh810
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 

Opa in the api management world

  • 1. Public Version 0.9 beta OPA in the API management world -- Luca Ferrari
  • 2. VP of myself Luca Ferrari Started from REST expanding to the rest (of the modern technologies) 2
  • 5. AuthN and AuthZ AuthN: “please show me your ID or Passport” AuthZ: “please scan your boarding pass on the bar code reader” 5
  • 7. Models There are several models out there, we will be summarizing the following ones: ACL DAC MAC RBAC ABAC AuthZ has been there since the beginning of computer systems, for example the first implementation of ACLs was in the filesystem of Multics in 1965 7
  • 8. ACL An Access-Control List is a list of permissions associated with a system resource. An ACL specifies which users or system are granted access to objects, as well as what operations are allowed on given objects. Each entry in a typical ACL specifies a subject and an operation. It specifies individual users or groups. In real world: Filesystems 8
  • 9. ACL in practice Subject Object Action Alice Report Create Bob Report Read 9
  • 10. DAC Discretionary Access Control is a way to restrict access to objects based on the identity of subjects and/or groups to which they belong. The controls are discretionary in the sense that a subject is capable of passing that permission (perhaps indirectly) on to any other subject (unless restrained by mandatory access control). Two implementations: ● Through ownership ● Through capabilities 10
  • 11. DAC in practice Subject Object Action Alice Report Create Alice Subjects Grant grant Subject Object Action Bob Report Create 11
  • 12. MAC Mandatory access control is a way to control where the operating system or database constrains the ability of a subject to access or perform an action on an object or target. Whenever a subject attempts to access an object, an authorization rule enforced by the OS examines these security attributes and decides if the access can take place. Any operation by any subject on any object is tested against the set of authorization rules (aka policy) to determine if the operation is allowed. With mandatory access control, this security policy is centrally controlled by a security policy administrator; users do not have the ability to override the policy in contrast to discretionary access control (DAC). In real world: SELINUX 12
  • 13. MAC in practice Subject Object Action Alice Report Create Subject Object Action Report Alice Be created grant 13
  • 14. RBAC Role-Based Access Control is a way to restrict system access to authorized users with policies defined around roles and privileges. The components of RBAC such as role-permissions, user-role and role-role relationships make it simple to perform user assignments across a wide organization with 1000s of users. There are 3 elements to RBAC: 1. Role assignment 2. Role authorization: A subject's active role must be authorized for the subject. 3. Permission authorization: A subject can exercise a permission only if the permission is authorized for the subject's active role. In the real world: IDP 14
  • 15. RBAC in practice Subject Role Alice Creator Name Action Object Create report Create Report Update Report Read Report Manage report Approve Report Read Report grant Name Permission Creator Create report Permissions Role
  • 16. ABAC Attribute-Based Access Control is defined as a system where access rights are granted to users through the use of policies which combine attributes together. The policies can use any type of attributes (user attributes, resource attributes, object, environment attributes etc.). This model supports Boolean logic, in which rules contain "IF, THEN" statements about who is making the request, the resource, and the action. Attribute-based access control is also known as Policy-Based Access Control (PBAC) or Claims-Based Access Control (CBAC) or IAM in AWS 16
  • 17. ABAC The Policy Enforcement Point inspects the request and generates an authorization request from it which it sends to the PDP. The Policy Decision Point evaluates incoming requests against policies it has been configured with. The PDP returns a Permit / Deny decision. The PDP may also use PIPs to retrieve missing metadata The Policy Information Point bridges the PDP to external sources of attributes e.g. LDAP or databases. 17
  • 18. ABAC in practice 18 Policies Subject: Name: Alice Department: Marketing Action: Type: Update Object: Type: Report Mode: Draft Department: Marketing Context: Location: London Time: between 9am and 6pm GMT
  • 20. XACML The "eXtensible Access Control Markup Language" defines a declarative fine-grained, attribute-based access control policy language, an architecture, and a processing model describing how to evaluate access requests according to the rules defined in policies. This was thought to promote interoperability between different implementations by multiple vendors. XACML can be considered: ● ABAC ● PBAC ● RBAC 25
  • 23. New challenges ● Authentication and authorization needs to be handled in each microservice ● Microservices should follow the principle of single responsibility. A microservice only handles its own business logic. ● Authentication and authorization in the microservices architecture involves scenarios that are more complex, involving users accessing microservice applications, third-party applications accessing microservice applications, and multiple microservice applications accessing each other. 28
  • 25. In brief Open Policy Agent main characteristics: ● open source ● general-purpose policy engine ● high-level declarative language (Rego) that lets you specify policy as code ● REST APIs to offload policy decision-making ● decoupling policy decision-making from policy enforcement ● Being able to receive and reply with arbitrary structured data (e.g., JSON) 31
  • 27. Rego Rego queries are assertions on data stored in OPA. These queries can be used to define policies that enumerate instances of data that violate the expected state of the system. Using Rego for defining policy is easy to read and write. Rego is declarative so policy authors can focus on what queries should return rather than how queries should be executed. These queries are simpler and more concise than the equivalent in an imperative language. https://play.openpolicyagent.org/ 33
  • 28. XACML Open Policy Agent is similar to XACML in that it provides a policy decision point, externalized authorization, and a policy language (REGO). It specializes in infrastructure authorization (e.g. for Kubernetes, Istio...) rather than general-purpose, API-centric, or data-centric which XACML addresses. 34
  • 29. Integrating OPA 2 main interfaces: 1. Evaluation: OPA’s interface for querying for policy decisions. 2. Management: OPA’s interface for deploying policies, understanding status, uploading logs, and so on. Distributing policy, retrieving status, and storing logs in the same way across all OPAs provides a unified management plane for policy across many different software systems. 35
  • 30. Policies evaluation OPA supports different ways to evaluate policies: ● REST API returns decisions as JSON over HTTP. ● The Go API (GoDoc) returns decisions as simple Go types (bool, string, map[string]interface{}, etc.) ● WebAssembly compiles Rego policies into WASM instructions so they can be embedded and evaluated by any WebAssembly runtime ● The SDK provides high-level APIs for obtaining the output of query evaluation as simple Go types (bool, string, map[string]interface{}, etc.) 36
  • 31. OPA and / or API Management 37
  • 32. Brothers in arms OPA is the perfect companion of an API Management especially in the new microservice / lightweight oriented new world. While XACML was standardized and has been adopted by some vendors, it was considered heavyweight and more difficult to define in terms of policies (XML horror, reminds you of anything you REST aficionados?) On the base of this vision and of a more modular approach to API Management, several projects have been initiated, including https://github.com/kuadrant/authorino 38
  • 34. Setup A simple HTTP web server that accepts any HTTP GET request that you issue and echoes the OPA decision back as text. Our policy is: ● People can see their own salaries (GET /finance/salary/{user} is permitted for {user}) ● A manager can see their direct reports' salaries (GET /finance/salary/{user} is permitted for {user}’s manager) 40
  • 35. Components 41 OPA REST Microservice Bundle OPA can periodically download bundles of policy and data from remote HTTP servers. The policies and data are loaded on the fly without requiring a restart of OPA Authorize ? Sync policies Alice request
  • 36. Steps ❏ Executing a request as Alice ❏ Executing a request as Bob ❏ Executing a request as Betty 42
  • 37. Loading … PLEASE WAIT Demo time 43
  • 38. What just happened ✓ Executing a request as Alice ✓ Executing a request as Bob ✓ Executing a request as Betty 44