SlideShare una empresa de Scribd logo
1 de 43
Authorization in Micro Services world
ISTIO and Open Policy Agent
Sitaraman Lakshminarayanan
About Me
• Sitaraman Lakshminarayanan
• Work: Security Architect at Pure Storage
• Books : Author Oracle Web Services Manager,
Co-Author ASP.NET Security
• Twitter @Lsitaraman
Definitions
• Role Based Access Control
– Define Roles
– Roles map directly to API endpoints or via Permissions
• Attribute Based Access Control
– User’s Age, Title, Location / IP , etc.
– Combination of In line code + external api call.
• Policy Based Access Control
– Describes what User/Role or Group can perform what
Actions on a resource under certain conditions. E.g.
AWS IAM
What we will cover are..
• Role Based Access Control – Client /Server
App and its Challenges
• Web Based / Service Oriented Architecture
model and its Challenges
• Externalizing Authorization and how it can
address your Access Control needs
• One big idea is how Open Policy Agent can
help
RBAC in Client Server Applications –
‘late 90s
Authorization Logic in the Code
Function
Button_SaveCustomer_Clicked()
{
If ( Form.Name == “CreateCustomer” )
{
if ( LoggedInUser.Role !=
“CustomerAdmin” )
{
Exception “Access
Denied”
}
}
}
• Three Tier Architecture – early to mid 2000’s
AuthZ code on Web
Server before Page
is rendered / when
Submitted Trust relationship –
Firewall, Custom
Headers, etc.
Web Access
Management that
Protects URL
Patterns
API Gateway
API Gateway with Internal
Services
A
P
I
G
a
t
e
w
a
y
Business Domain -
Web Service 1
Business Domain Web
Service 2
Business Domain Web
Service 3
Internal
API
Gateway
DB CRUD
Service
Internal
Service2
Web App
Mobile App
WS-Security / SAML/WS-Trust Internal AuthN / AuthZ
SOA + Gateway
• Authorization enforcement at different places
– API Gateway
– Internal Gateway
– At Service /endpoint for any Business Specific ACL
• Makes it harder to change Authorization Rules
without changing code
• Or Every AuthZ decision is pushed to Gateway
making Gateway
– Bloated , Monolithic and Bureaucratic
API Gateway – Before CI/CD
But REST API will solve ...
• Oh well not really
• We moved from XML to JSON
• JWT - JSON Web Token
– JSON data
– Digitally Signed
– Represents User Information, May be Roles/
Scopes
REST API + JWT + HTTP Filter
What’s the issue with filters?
• Hard to change API to
Role/Permission without
changing Code
• Any Code change would
require regression testing
• But Gateway’s are hard to
manage, more overhead
and takes time
How do we move forward?
• Externalize Authorization from Code
– Not Just Gateway that acts as Check Point
– Making it developer friendly and easy to develop,
deploy and change policies.
• Externalizing Authorization from code is not
new
– API Gateway was one such solution
– Extensible Access Control Markup Language
(XACML) standard was supposed to address this.
XACML to the rescue
• Extensible Access Control Markup Language –
first attempt towards externalizing Policy
Decisions in a standardized manner.
XACML and API Integration
Policy Decision Point
that makes decisions
Policy enforcement
point – Integrates with
your API and PDP to
get decisions
XACML retrospective
• Pros
– Externalized Authorization from code
– Policies can be developed and deployed outside of
Code
• Cons
– XACML integration required learning specific
syntax
– Not much open source integration
XACML Replacement – Build
your own AuthZ API
• Build your own Authorization API
• Integrations between AuthZ API and
App/Service are proprietary
Custom Authorization Decision
API
When you build your own
AuthZ API
• You own everything
– Contract between Client and Authorization API /
Policy Decision Point
– Build SDK for languages within your enterprise
– Train every developer on your own API and
Integration, no community to source information
from
– Suddenly you are asking yourself – Am I Building
Feature X? or Am I a Security product?
Kubernetes Authorization
Kubernetes API
Server
Kubernetes
Dashboard
Kubernetes CLI -
Kubectl
RBAC- Role
based
Custom – Web
Hook
ABAC – Attribute
Based
Kubernetes Web Hook
Authorization
• To Make Authorization Decision, you need
– Resource being accessed
– Action being perform ( GET, POST, etc.)
– Incoming User Identity / Token
• Write Web Hook that return Allow or Deny
• Enable Web Hook Authorization with
Kubernetes Framework
• Now every request to Kubernetes API will
invoke the Web Hook for Authorization
Example Web Hook AuthZ in
K8
{ "apiVersion":
"authorization.k8s.io/v1beta1",
"kind": "SubjectAccessReview",
"spec":
{ "resourceAttributes":
{ "namespace":
"kittensandponies",
"verb": "get",
"group":
"unicorn.example.org",
"resource":
"pods"
},
"user": "jane",
"group": [ "group1",
"group2" ]
}}
K8 API Version, so you can
make decision based on
Version of K8 API Server
Kind –
SubjectAccessReview
Describes type of Object.
Provides flexibility to add
any other review later.
ResourceAttributes – tells
everything you need to know.
What namespace being
accessed, whether its HTTP
get or post , user identity and
Group information ( can
come from JWT Token from
your SSO System, etc.)
AuthZ Decision
{ "apiVersion": "authorization.k8s.io/v1beta1",
"kind": "SubjectAccessReview",
"status":
{
"allowed": true
}
}
Unified Response
format to tell K8 if
request is allowed
or denied.
Why I love K8 AuthZ model
• You let customers manage their own Risk. You
provide the framework.
• No one size fits all RBAC model
• Its designed with API First approach – so
everything is a Resource.
• Externalized Authorization through Web Hook
let you manage the Risk, implement Policy and
Process around your deployment.
What about Services deployed
on K8
• Micro Services have gained huge adoption and
its much easier with Kubernetes.
• But you still have to manage Authorization for
your Business Services.
• ISTIO brings together faster deployment and
Gateway approach for Services.
ISTIO overview
ISTIO Things to know
• Without going into ISTIO jargons… ISTIO makes it
easy to
– Enforce Authorization
– Logging
– Collect Telemetry
– Quotas
– Deploys Envoy Proxy as SideCar
• In other words, ISTIO is light weight proxy in front
of your API Services
• ISTIO components are at Ingress and Egress layer
ISTIO Authorization
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRole
metadata:
name: tester
namespace: default
spec:
rules:
- services: ["test-*"]
methods: ["*"]
- services:
["bookstore.default.svc.cluster.local"
]
paths: ["*/reviews"]
methods: ["GET"]
Authorization now
moved from Code /
Gateway config to
YAML .. We all love
Yet another.. 
Fine Grained ACL gets
challenging.
This is external to
code but still requires
re-deployment.
ISTIO Service to Service
Deploying ISTIO completely
hides the complexity of
Service Discovery and
Service Invocation
mTLS, Protocol Translation,
etc.
But what about
Authorization?- YAML file

Externalizing AuthZ in Micro Services World
• Let’s agree to a standard of communicating
– Resource ( end point being invoked)
– Operations / Actions being performed
– Identity of Caller
– Payload
• You can use your own proprietary, or Platform
Specific or use Open Policy Agent
Open Policy Agent
• It’s a Policy Engine
• Available as RESTful API with JSON and HTTP ,
so no new integration patterns.
• Data can be static or Dynamic that can be
used to make the decision
• Policies are written in declarative language
Rego
• Policies are updated in OPA via /v1/policies
API endpoint
OPA
Authorization Logic
OPA-Rego and Policies
• OPA uses its native query language Rego
• Policy decisions are written in Rego
• Policies are defined inside Module.
– Each Module should have one Package name
– Zero or more statements
– Zero or more Rules
OPA Policy Walkthrough
Package Name
Rule Name
Compares Input – If method is
GET, Path is finance and
Username , if everything is true it
returns True.
Input is keyword. Assign Input as
http_api variable
package httpapi.authz
subordinates = {"alice": [], "charlie": [],
"bob": ["alice"], "betty": ["charlie"]} Static Data
import input as http_api
allow {
http_api.method = "GET"
http_api.path = ["finance",
"salary", username]
username = http_api.user }
How is OPA Policy invoked?
input_dict =
{ # create input to hand to OPA "input":
{ "user": api_user_from_jwt,
"path": “finance”,
"method": “GET”
}
}
rsp =
requests.post("http://example.com/v1/data/htt
papi/authz", data=json.dumps(input_dict))
if rsp.json()["allow"]
Gather Input.
HTTP Filter that gathers all
the data such as User ,
Method, URL Path, etc.
Make a Call to OPA - POST
v1/data/{PolicyName} and
supply the Input, get a
decision back as JSON
JSON is returned with
allow:True or can be any
specific data
OPA and API Authorziation
OPA Integration Architecture
OPA - Benefits
• You can update the Policy without changing
Code
• Policy definition can be left to development
teams to implement, but just outside of the
core Business API
• It can be used beyond REST API – Anywhere
there can be a Plugin, OPA can be integrated
as Plugin.
Micro Services, ISTIO and OPA
• API’s are deployed in Kubernetes
• ISTIO runs as Side Car
• OPA Plugin for ISTIO makes Policy Decision
Queries against OPA
Key Takeaways
• Externalize Authorization from code
• OPA provides easy way to write Policies and
Integrate via API
• REST API integration with Policy Decision makes it
easier to adapt across Platforms – Java, Node,
Python, etc.
• Policies and Data can be made available as
Bundle.
• Policy Change does not require re deployment of
code.
Questions?
• Thanks to K8 and OPA Community
• Various Authors who blogged about OPA
Thank You

Más contenido relacionado

La actualidad más candente

SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound IntegrationsSujit Kumar
 
Mohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuthMohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuthfossmy
 
amis-adf-enterprise-mobility
amis-adf-enterprise-mobilityamis-adf-enterprise-mobility
amis-adf-enterprise-mobilityLuc Bors
 
The Ultimate Guide to Mobile API Security
The Ultimate Guide to Mobile API SecurityThe Ultimate Guide to Mobile API Security
The Ultimate Guide to Mobile API SecurityStormpath
 
Complete open source IAM solution
Complete open source IAM solutionComplete open source IAM solution
Complete open source IAM solutionRadovan Semancik
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service DesignLorna Mitchell
 
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Eric Shupps
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
Usergrid Overview
Usergrid OverviewUsergrid Overview
Usergrid Overviewusergrid
 
Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APIEric Shupps
 
Open Source Mobile Backend on Cassandra
Open Source Mobile Backend on CassandraOpen Source Mobile Backend on Cassandra
Open Source Mobile Backend on CassandraEd Anuff
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonCSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonKunaal Kapoor
 
Serverless solution architecture in AWS
Serverless solution architecture in AWSServerless solution architecture in AWS
Serverless solution architecture in AWSRuncy Oommen
 
Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Stormpath
 
Build A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIStormpath
 
OPA: The Cloud Native Policy Engine
OPA: The Cloud Native Policy EngineOPA: The Cloud Native Policy Engine
OPA: The Cloud Native Policy EngineTorin Sandall
 
CIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST APICIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST APICloudIDSummit
 

La actualidad más candente (20)

API Design- Best Practices
API Design-   Best PracticesAPI Design-   Best Practices
API Design- Best Practices
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
 
Mohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuthMohanraj - Securing Your Web Api With OAuth
Mohanraj - Securing Your Web Api With OAuth
 
amis-adf-enterprise-mobility
amis-adf-enterprise-mobilityamis-adf-enterprise-mobility
amis-adf-enterprise-mobility
 
The Ultimate Guide to Mobile API Security
The Ultimate Guide to Mobile API SecurityThe Ultimate Guide to Mobile API Security
The Ultimate Guide to Mobile API Security
 
Complete open source IAM solution
Complete open source IAM solutionComplete open source IAM solution
Complete open source IAM solution
 
Best Practices in Web Service Design
Best Practices in Web Service DesignBest Practices in Web Service Design
Best Practices in Web Service Design
 
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
Usergrid Overview
Usergrid OverviewUsergrid Overview
Usergrid Overview
 
Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST API
 
Open Source Mobile Backend on Cassandra
Open Source Mobile Backend on CassandraOpen Source Mobile Backend on Cassandra
Open Source Mobile Backend on Cassandra
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonCSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
 
Serverless solution architecture in AWS
Serverless solution architecture in AWSServerless solution architecture in AWS
Serverless solution architecture in AWS
 
Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)
 
Build A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON APIBuild A Killer Client For Your REST+JSON API
Build A Killer Client For Your REST+JSON API
 
Restful Services
Restful ServicesRestful Services
Restful Services
 
OPA: The Cloud Native Policy Engine
OPA: The Cloud Native Policy EngineOPA: The Cloud Native Policy Engine
OPA: The Cloud Native Policy Engine
 
CIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST APICIS14: Early Peek at PingFederate Administrative REST API
CIS14: Early Peek at PingFederate Administrative REST API
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 

Similar a Externalizing Authorization in Micro Services world

MongoDB World 2019: Securing Application Data from Day One
MongoDB World 2019: Securing Application Data from Day OneMongoDB World 2019: Securing Application Data from Day One
MongoDB World 2019: Securing Application Data from Day OneMongoDB
 
How Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudHow Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudTorin Sandall
 
First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)Daniel Toomey
 
API Gateways are going through an identity crisis
API Gateways are going through an identity crisisAPI Gateways are going through an identity crisis
API Gateways are going through an identity crisisChristian Posta
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayAWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayVadim Zendejas
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APIDavid Keener
 
Bitquery GraphQL for Analytics on ClickHouse
Bitquery GraphQL for Analytics on ClickHouseBitquery GraphQL for Analytics on ClickHouse
Bitquery GraphQL for Analytics on ClickHouseAltinity Ltd
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
Building IAM for OpenStack
Building IAM for OpenStackBuilding IAM for OpenStack
Building IAM for OpenStackSteve Martinelli
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016Ortus Solutions, Corp
 
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS'sMongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS'sMongoDB
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
Security enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakSecurity enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakCharles Moulliard
 
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & ProvidersDEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & ProvidersCisco DevNet
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyManageIQ
 

Similar a Externalizing Authorization in Micro Services world (20)

MongoDB World 2019: Securing Application Data from Day One
MongoDB World 2019: Securing Application Data from Day OneMongoDB World 2019: Securing Application Data from Day One
MongoDB World 2019: Securing Application Data from Day One
 
06 web api
06 web api06 web api
06 web api
 
How Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudHow Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their Cloud
 
First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)First Look at Azure Logic Apps (BAUG)
First Look at Azure Logic Apps (BAUG)
 
API Gateways are going through an identity crisis
API Gateways are going through an identity crisisAPI Gateways are going through an identity crisis
API Gateways are going through an identity crisis
 
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API GatewayAWS Summit Barcelona 2015 - Introducing Amazon API Gateway
AWS Summit Barcelona 2015 - Introducing Amazon API Gateway
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services API
 
REST APIs
REST APIsREST APIs
REST APIs
 
Bitquery GraphQL for Analytics on ClickHouse
Bitquery GraphQL for Analytics on ClickHouseBitquery GraphQL for Analytics on ClickHouse
Bitquery GraphQL for Analytics on ClickHouse
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Building IAM for OpenStack
Building IAM for OpenStackBuilding IAM for OpenStack
Building IAM for OpenStack
 
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
 
Nordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API DocumentationNordic APIs - Automatic Testing of (RESTful) API Documentation
Nordic APIs - Automatic Testing of (RESTful) API Documentation
 
Rest ful tools for lazy experts
Rest ful tools for lazy expertsRest ful tools for lazy experts
Rest ful tools for lazy experts
 
RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016RESTFul Tools For Lazy Experts - CFSummit 2016
RESTFul Tools For Lazy Experts - CFSummit 2016
 
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS'sMongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Security enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakSecurity enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & Keycloak
 
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & ProvidersDEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 

Último

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Último (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Externalizing Authorization in Micro Services world

  • 1. Authorization in Micro Services world ISTIO and Open Policy Agent Sitaraman Lakshminarayanan
  • 2. About Me • Sitaraman Lakshminarayanan • Work: Security Architect at Pure Storage • Books : Author Oracle Web Services Manager, Co-Author ASP.NET Security • Twitter @Lsitaraman
  • 3. Definitions • Role Based Access Control – Define Roles – Roles map directly to API endpoints or via Permissions • Attribute Based Access Control – User’s Age, Title, Location / IP , etc. – Combination of In line code + external api call. • Policy Based Access Control – Describes what User/Role or Group can perform what Actions on a resource under certain conditions. E.g. AWS IAM
  • 4. What we will cover are.. • Role Based Access Control – Client /Server App and its Challenges • Web Based / Service Oriented Architecture model and its Challenges • Externalizing Authorization and how it can address your Access Control needs • One big idea is how Open Policy Agent can help
  • 5. RBAC in Client Server Applications – ‘late 90s
  • 6. Authorization Logic in the Code Function Button_SaveCustomer_Clicked() { If ( Form.Name == “CreateCustomer” ) { if ( LoggedInUser.Role != “CustomerAdmin” ) { Exception “Access Denied” } } }
  • 7. • Three Tier Architecture – early to mid 2000’s AuthZ code on Web Server before Page is rendered / when Submitted Trust relationship – Firewall, Custom Headers, etc. Web Access Management that Protects URL Patterns
  • 9. API Gateway with Internal Services A P I G a t e w a y Business Domain - Web Service 1 Business Domain Web Service 2 Business Domain Web Service 3 Internal API Gateway DB CRUD Service Internal Service2 Web App Mobile App WS-Security / SAML/WS-Trust Internal AuthN / AuthZ
  • 10. SOA + Gateway • Authorization enforcement at different places – API Gateway – Internal Gateway – At Service /endpoint for any Business Specific ACL • Makes it harder to change Authorization Rules without changing code • Or Every AuthZ decision is pushed to Gateway making Gateway – Bloated , Monolithic and Bureaucratic
  • 11. API Gateway – Before CI/CD
  • 12. But REST API will solve ... • Oh well not really • We moved from XML to JSON • JWT - JSON Web Token – JSON data – Digitally Signed – Represents User Information, May be Roles/ Scopes
  • 13. REST API + JWT + HTTP Filter
  • 14. What’s the issue with filters? • Hard to change API to Role/Permission without changing Code • Any Code change would require regression testing • But Gateway’s are hard to manage, more overhead and takes time
  • 15. How do we move forward? • Externalize Authorization from Code – Not Just Gateway that acts as Check Point – Making it developer friendly and easy to develop, deploy and change policies. • Externalizing Authorization from code is not new – API Gateway was one such solution – Extensible Access Control Markup Language (XACML) standard was supposed to address this.
  • 16. XACML to the rescue • Extensible Access Control Markup Language – first attempt towards externalizing Policy Decisions in a standardized manner.
  • 17. XACML and API Integration Policy Decision Point that makes decisions Policy enforcement point – Integrates with your API and PDP to get decisions
  • 18. XACML retrospective • Pros – Externalized Authorization from code – Policies can be developed and deployed outside of Code • Cons – XACML integration required learning specific syntax – Not much open source integration
  • 19. XACML Replacement – Build your own AuthZ API • Build your own Authorization API • Integrations between AuthZ API and App/Service are proprietary
  • 21. When you build your own AuthZ API • You own everything – Contract between Client and Authorization API / Policy Decision Point – Build SDK for languages within your enterprise – Train every developer on your own API and Integration, no community to source information from – Suddenly you are asking yourself – Am I Building Feature X? or Am I a Security product?
  • 22. Kubernetes Authorization Kubernetes API Server Kubernetes Dashboard Kubernetes CLI - Kubectl RBAC- Role based Custom – Web Hook ABAC – Attribute Based
  • 23. Kubernetes Web Hook Authorization • To Make Authorization Decision, you need – Resource being accessed – Action being perform ( GET, POST, etc.) – Incoming User Identity / Token • Write Web Hook that return Allow or Deny • Enable Web Hook Authorization with Kubernetes Framework • Now every request to Kubernetes API will invoke the Web Hook for Authorization
  • 24. Example Web Hook AuthZ in K8 { "apiVersion": "authorization.k8s.io/v1beta1", "kind": "SubjectAccessReview", "spec": { "resourceAttributes": { "namespace": "kittensandponies", "verb": "get", "group": "unicorn.example.org", "resource": "pods" }, "user": "jane", "group": [ "group1", "group2" ] }} K8 API Version, so you can make decision based on Version of K8 API Server Kind – SubjectAccessReview Describes type of Object. Provides flexibility to add any other review later. ResourceAttributes – tells everything you need to know. What namespace being accessed, whether its HTTP get or post , user identity and Group information ( can come from JWT Token from your SSO System, etc.)
  • 25. AuthZ Decision { "apiVersion": "authorization.k8s.io/v1beta1", "kind": "SubjectAccessReview", "status": { "allowed": true } } Unified Response format to tell K8 if request is allowed or denied.
  • 26. Why I love K8 AuthZ model • You let customers manage their own Risk. You provide the framework. • No one size fits all RBAC model • Its designed with API First approach – so everything is a Resource. • Externalized Authorization through Web Hook let you manage the Risk, implement Policy and Process around your deployment.
  • 27. What about Services deployed on K8 • Micro Services have gained huge adoption and its much easier with Kubernetes. • But you still have to manage Authorization for your Business Services. • ISTIO brings together faster deployment and Gateway approach for Services.
  • 29. ISTIO Things to know • Without going into ISTIO jargons… ISTIO makes it easy to – Enforce Authorization – Logging – Collect Telemetry – Quotas – Deploys Envoy Proxy as SideCar • In other words, ISTIO is light weight proxy in front of your API Services • ISTIO components are at Ingress and Egress layer
  • 30. ISTIO Authorization apiVersion: "rbac.istio.io/v1alpha1" kind: ServiceRole metadata: name: tester namespace: default spec: rules: - services: ["test-*"] methods: ["*"] - services: ["bookstore.default.svc.cluster.local" ] paths: ["*/reviews"] methods: ["GET"] Authorization now moved from Code / Gateway config to YAML .. We all love Yet another..  Fine Grained ACL gets challenging. This is external to code but still requires re-deployment.
  • 31. ISTIO Service to Service Deploying ISTIO completely hides the complexity of Service Discovery and Service Invocation mTLS, Protocol Translation, etc. But what about Authorization?- YAML file 
  • 32. Externalizing AuthZ in Micro Services World • Let’s agree to a standard of communicating – Resource ( end point being invoked) – Operations / Actions being performed – Identity of Caller – Payload • You can use your own proprietary, or Platform Specific or use Open Policy Agent
  • 33. Open Policy Agent • It’s a Policy Engine • Available as RESTful API with JSON and HTTP , so no new integration patterns. • Data can be static or Dynamic that can be used to make the decision • Policies are written in declarative language Rego • Policies are updated in OPA via /v1/policies API endpoint
  • 35. OPA-Rego and Policies • OPA uses its native query language Rego • Policy decisions are written in Rego • Policies are defined inside Module. – Each Module should have one Package name – Zero or more statements – Zero or more Rules
  • 36. OPA Policy Walkthrough Package Name Rule Name Compares Input – If method is GET, Path is finance and Username , if everything is true it returns True. Input is keyword. Assign Input as http_api variable package httpapi.authz subordinates = {"alice": [], "charlie": [], "bob": ["alice"], "betty": ["charlie"]} Static Data import input as http_api allow { http_api.method = "GET" http_api.path = ["finance", "salary", username] username = http_api.user }
  • 37. How is OPA Policy invoked? input_dict = { # create input to hand to OPA "input": { "user": api_user_from_jwt, "path": “finance”, "method": “GET” } } rsp = requests.post("http://example.com/v1/data/htt papi/authz", data=json.dumps(input_dict)) if rsp.json()["allow"] Gather Input. HTTP Filter that gathers all the data such as User , Method, URL Path, etc. Make a Call to OPA - POST v1/data/{PolicyName} and supply the Input, get a decision back as JSON JSON is returned with allow:True or can be any specific data
  • 38. OPA and API Authorziation
  • 40. OPA - Benefits • You can update the Policy without changing Code • Policy definition can be left to development teams to implement, but just outside of the core Business API • It can be used beyond REST API – Anywhere there can be a Plugin, OPA can be integrated as Plugin.
  • 41. Micro Services, ISTIO and OPA • API’s are deployed in Kubernetes • ISTIO runs as Side Car • OPA Plugin for ISTIO makes Policy Decision Queries against OPA
  • 42. Key Takeaways • Externalize Authorization from code • OPA provides easy way to write Policies and Integrate via API • REST API integration with Policy Decision makes it easier to adapt across Platforms – Java, Node, Python, etc. • Policies and Data can be made available as Bundle. • Policy Change does not require re deployment of code.
  • 43. Questions? • Thanks to K8 and OPA Community • Various Authors who blogged about OPA Thank You