SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Istio’s Mixer:
Policy Enforcement with Custom Adapters
Limin Wang, Software Engineer, Google
Torin Sandall, Software Engineer, Styra
Outline
● Istio and policy (how to enforce your custom
policy in Istio)
● Integrate Open Policy Agent to Istio
(demo)
What is Istio?
An open platform to connect, manage, secure microservices
•Istio provides:
• Traffic management
• Observation
• Policy Enforcement
• Service Identity and Security
• And more …
istio.io
github.com/istio
Istio Architecture
HTTP/1.1, HTTP/2, gRPC, TCP
with or without TLS
svcA
Envoy
Pod
Service A
svcB
Envoy
Service B
Pilot
Control Plane API
Mixer
Discovery & Config data to
Envoys
Policy checks,
telemetry
Control flow during request
processing Istio-Auth
TLS certs to
Envoy
Policies in Istio
● Route rules
○ Load balancing, traffic splitting, request timeout, retry, fault injection
● Quota policies
● Monitoring policies
○ Metrics, logging, tracing
● Security policies
○ Service-to-service mTLS authentication
○ Simple authorization: denier, white/black list, expression language
(ABAC)
Policies in Istio (cont.)
● Upcoming security policies
○ Authentication policy
■ Enable/disable mTLS per service
■ End user authentication
○ Authorization policy
■ Role Based Access Control (RBAC)
■ Open Policy Agent
■ Expression language with richer semantics
○ Audit policy
Example Policy (RBAC)
kind: ServiceRole
apiVersion: config.istio.io/v1alpha2
metadata:
name: review-product-viewer
namespace: default
spec:
rules:
- services: [“reviews”]
methods: [“GET”, “HEAD”]
- services: [“products”]
paths: [“/books”, “/books/*”]
methods: [“GET”, “HEAD”]
kind: ServiceRoleBinding
apiVersion: config.istio.io/v1alpha2
metadata:
name: example-role-binding
namespace: default
spec:
subjects:
- name: “istio-ingress-service-account”
roleRef:
kind: ServiceRole
name: review-product-viewer
More information on Istio RBAC Design Doc.
Extend Policy System through Mixer
● Mixer is the central point for policy evaluation
and extensibility.
● Mixer provides the following core features:
○ Precondition and quota checking (Check)
○ Telemetry reporting (Report)
● Mixer achieves high extensibility by having a
general purpose plug-in model - the plug-ins
are known as Adapters.
Mixer
List
Memquota
Statsd
Stackdriver
Prometheus
Denier
Mixer’s Adapters
● Mixer is an attribute-processing and routing machine.
○ Attributes => Instances => Adapters => (Backends)
Envoy Mixer
Infra
Backends
Infra
Backends
Infra
Backends
Infra
Backends
Infra
Backends
Attributes
Backend-Specific
Protocols
Policy&
Config
Operator
How to Provide a Custom Adapter
● Determine your adapter type (check/quota/report)
● Determine the runtime input to your adapter
○ Template: adapter input schema
○ You can apply multiple templates
■ Built-in templates, or your custom templates
● Determine how to configure your adapter.
○ Handler: configured adapter
● Determine the business logic for your adapter to handle runtime
input.
More information on https://github.com/istio/istio/blob/master/mixer/doc/adapters.md
Example: A Toy Adapter
Build an adapter to verify a string is present in a list (simplified
built-in ListEntry adapter).
● Adapter type: check
● Adapter input: built-in listEntry template
● Adapter configuration: a list of strings.
● How the adapter handles runtime input: looks up the value in a
list of strings.
...
package listEntry;
option (istio.mixer.v1.template.template_variety) = TEMPLATE_VARIETY_CHECK;
message Template {
// Specifies the entry to verify in the list.
string value = 1;
}
Steps to Build a Custom Adapter
Step 1. Write basic adapter skeleton code (online tutorial or build-in
adapters)
...
func GetInfo() adapter.Info {
return adapter.Info{
Name: "listChecker",
Description: "Checks whether a string is in the list",
SupportedTemplates: []string{
listentry.TemplateName,
},
NewBuilder: func() adapter.HandlerBuilder { return &builder{} },
DefaultConfig: &config.Params{},
}
}
Steps to Build a Custom Adapter
Step 2. Write adapter configuration.
package adapter.listChecker.config;
message Params {
repeated string list = 1;
}
Step 3. Validate adapter configuration.
func (b *builder) SetAdapterConfig(cfg adapter.Config) { b.conf = cfg.(*config.Params) }
func (b *builder) Validate() (ce *adapter.ConfigErrors) {
// Check if the list is empty
if b.conf.List == nil {
ce = ce.Append(“list”, “list cannot be empty”)
}
return
}
Steps to Build a Custom Adapter
func (b *builder) Build(context context.Context, env adapter.Env) (adapter.Handler, error)
{ return &handler{list: b.conf.List}, nil }
func (h *handler) HandleListEntry(ctx context.Context, inst *listentry.Instance) (adapter.CheckResult, error) {
code := rpc.OK
for _, str := range h.list {
if inst.Value == str {
code = rpc.NOT_FOUND
break
}
}
return adapter.CheckResult{
Status: rpc.Status{Code: int32(code)},
}, nil
}
Step 4. Write business logic for your adapter.
Configure Policy Using Custom Adapter
apiVersion: “config.istio.io/v1alpha2”
kind: listentry
metadata:
name: srcVersion
spec:
value: source.labels[“version”]
1. Create an instance of listentry template.
apiVersion: “config.istio.io/v1alpha2”
kind: listChecker
metadata:
name: versionChecker
spec:
list: [“v1”, “v2”]
2. Create a handler of listChecker adapter.
apiVersion: “config.istio.io/v1alpha2”
kind: rule
metadata:
name: checkVersion
spec:
match: destination.labels[“app”] == “ratings”
actions:
- handler: versionChecker.listChecker
instances:
- srcVersion.listentry
3. Create a checkVersion policy
istioctl create -f *.yaml
4. Apply the policy!
+
● Overview: Open Policy Agent
● OPA Adapter
● Demo
•General-purpose policy engine
• Offload authorization decisions
•Declarative Policy Language (Rego)
• Is X allowed to call operation Y on resource Z?
•Library or Daemon
• In-memory policies and data
• Zero runtime dependencies
• Implemented in Go
•Don’t roll your own authorization engine!
Policy
(Rego)
Data
(JSON)
Open Policy Agent (OPA)
•Adapter type: Check
•Attributes: (authz template)
• Subject: map<string, value>
• Action: map<string, value>
• Standalone adapter
• No external dependencies
•Fail closed (deny) in case of error(s)
• To be configurable in future
Envoy
Mixer
check(attributes)
OPA
adapter
OPA
incoming
request
allow/deny
Mixer’s OPA Adapter
apiVersion: config.istio.io/v1alpha2
kind: rule
metadata:
name: authz
spec:
actions:
- handler: opa-handler
instances:
- authz-instance
Mixer config (1/3): Rule
Mixer
OPA
adapter
OPA
Istio Config Store
istioctl
apiVersion: config.istio/v1alpha2
kind: authz
metadata:
name: authz-instance
spec:
subject:
user: source.uid | “”
action:
namespace: target.namespace | “default”
service: target.service | “”
path: target.path | “”
method: request.method | “”
Mixer config (2/3): Instance
Mixer
OPA
adapter
OPA
Istio Config Store
istioctl
apiVersion: config.istio.io/v1alpha2
kind: opa
metadata:
name: opa-handler
spec:
checkMethod: authz.allow
policy: |
package authz
default allow = false
allow { is_read }
is_read { input.action.method = “GET” }
Mixer config (3/3): Handler
Mixer
OPA
adapter
OPA
Istio Config Store
istioctl
Demo
Conclusion
•Use Istio to enforce wide range of policy across
your microservices
•Plugin framework makes it easy to add adapters
• Authorization, quota, telemetry, …
•Come join us!
• istio-users@googlegroups.com
• Istio working groups (Security, Integrations, …)
• More information: istio.io, github.com/istio
Questions?

Contenu connexe

Tendances

Hydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsHydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsMarkus Lanthaler
 
OAuth 2.0 Integration Patterns with XACML
OAuth 2.0 Integration Patterns with XACMLOAuth 2.0 Integration Patterns with XACML
OAuth 2.0 Integration Patterns with XACMLPrabath Siriwardena
 
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...Amazon Web Services Korea
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon Web Services Korea
 
2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법
2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법 2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법
2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법 Amazon Web Services Korea
 
OPA APIs and Use Case Survey
OPA APIs and Use Case SurveyOPA APIs and Use Case Survey
OPA APIs and Use Case SurveyTorin Sandall
 
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016Amazon Web Services Korea
 
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018Amazon Web Services Korea
 
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)Amazon Web Services Korea
 
[AWS Builders] AWS상의 보안 위협 탐지 및 대응
[AWS Builders] AWS상의 보안 위협 탐지 및 대응[AWS Builders] AWS상의 보안 위협 탐지 및 대응
[AWS Builders] AWS상의 보안 위협 탐지 및 대응Amazon Web Services Korea
 
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021Amazon Web Services Korea
 
Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)Amazon Web Services
 
DevOps 2년차 이직 성공기
DevOps 2년차 이직 성공기DevOps 2년차 이직 성공기
DevOps 2년차 이직 성공기Byungho Lee
 
Kubernetes Security with Calico and Open Policy Agent
Kubernetes Security with Calico and Open Policy AgentKubernetes Security with Calico and Open Policy Agent
Kubernetes Security with Calico and Open Policy AgentCloudOps2005
 
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기Jongwon Han
 
Introduction to OPA
Introduction to OPAIntroduction to OPA
Introduction to OPAKnoldus Inc.
 
Monitoramento de Aplicações Web Modernas com Zabbix
Monitoramento de Aplicações Web Modernas com ZabbixMonitoramento de Aplicações Web Modernas com Zabbix
Monitoramento de Aplicações Web Modernas com ZabbixAndré Déo
 

Tendances (20)

Hydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIsHydra: A Vocabulary for Hypermedia-Driven Web APIs
Hydra: A Vocabulary for Hypermedia-Driven Web APIs
 
OAuth 2.0 Integration Patterns with XACML
OAuth 2.0 Integration Patterns with XACMLOAuth 2.0 Integration Patterns with XACML
OAuth 2.0 Integration Patterns with XACML
 
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
 
2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법
2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법 2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법
2017 AWS DB Day | 개발자가 알아야 할 Amazon DynamoDB 활용법
 
OPA APIs and Use Case Survey
OPA APIs and Use Case SurveyOPA APIs and Use Case Survey
OPA APIs and Use Case Survey
 
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
게임서비스를 위한 ElastiCache 활용 전략 :: 구승모 솔루션즈 아키텍트 :: Gaming on AWS 2016
 
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
AWS 기반 블록체인 (1부) - 블록체인 환경 구성하기 (박혜영 & 유다니엘, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
 
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
 
JSON-LD and MongoDB
JSON-LD and MongoDBJSON-LD and MongoDB
JSON-LD and MongoDB
 
[AWS Builders] AWS상의 보안 위협 탐지 및 대응
[AWS Builders] AWS상의 보안 위협 탐지 및 대응[AWS Builders] AWS상의 보안 위협 탐지 및 대응
[AWS Builders] AWS상의 보안 위협 탐지 및 대응
 
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
더욱 진화하는 AWS 네트워크 보안 - 신은수 AWS 시큐리티 스페셜리스트 솔루션즈 아키텍트 :: AWS Summit Seoul 2021
 
Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)Introduction to Identity and Access Management (IAM)
Introduction to Identity and Access Management (IAM)
 
DevOps 2년차 이직 성공기
DevOps 2년차 이직 성공기DevOps 2년차 이직 성공기
DevOps 2년차 이직 성공기
 
AWS IAM
AWS IAMAWS IAM
AWS IAM
 
Kubernetes Security with Calico and Open Policy Agent
Kubernetes Security with Calico and Open Policy AgentKubernetes Security with Calico and Open Policy Agent
Kubernetes Security with Calico and Open Policy Agent
 
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
20180726 AWS KRUG - RDS Aurora에 40억건 데이터 입력하기
 
Introduction to OPA
Introduction to OPAIntroduction to OPA
Introduction to OPA
 
Azure CosmosDb
Azure CosmosDbAzure CosmosDb
Azure CosmosDb
 
Monitoramento de Aplicações Web Modernas com Zabbix
Monitoramento de Aplicações Web Modernas com ZabbixMonitoramento de Aplicações Web Modernas com Zabbix
Monitoramento de Aplicações Web Modernas com Zabbix
 

Similaire à Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)

Tizen Web Application Checker
Tizen Web Application CheckerTizen Web Application Checker
Tizen Web Application CheckerRyo Jin
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...Ted Chien
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverAltitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverFastly
 
Putting microservices on a diet with Istio
Putting microservices on a diet with IstioPutting microservices on a diet with Istio
Putting microservices on a diet with IstioQAware GmbH
 
Backend Development - Django
Backend Development - DjangoBackend Development - Django
Backend Development - DjangoAhmad Sakhleh
 
Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features WSO2
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using GoCloudOps2005
 
Apache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT ManagementApache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT ManagementApache StreamPipes
 
Building Push Triggers for Logic Apps
Building Push Triggers for Logic AppsBuilding Push Triggers for Logic Apps
Building Push Triggers for Logic AppsBizTalk360
 
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...Paul Brebner
 
How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...Paul Brebner
 
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTechNETFest
 
Observability and its application
Observability and its applicationObservability and its application
Observability and its applicationThao Huynh Quang
 

Similaire à Istio's mixer policy enforcement with custom adapters (cloud nativecon 17) (20)

Tizen Web Application Checker
Tizen Web Application CheckerTizen Web Application Checker
Tizen Web Application Checker
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Mulesoft lisbon_meetup_asyncapis
Mulesoft lisbon_meetup_asyncapisMulesoft lisbon_meetup_asyncapis
Mulesoft lisbon_meetup_asyncapis
 
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverAltitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, Ever
 
About QTP 9.2
About QTP 9.2About QTP 9.2
About QTP 9.2
 
About Qtp_1 92
About Qtp_1 92About Qtp_1 92
About Qtp_1 92
 
About Qtp 92
About Qtp 92About Qtp 92
About Qtp 92
 
Putting microservices on a diet with Istio
Putting microservices on a diet with IstioPutting microservices on a diet with Istio
Putting microservices on a diet with Istio
 
Backend Development - Django
Backend Development - DjangoBackend Development - Django
Backend Development - Django
 
Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features Complex Event Processor 3.0.0 - An overview of upcoming features
Complex Event Processor 3.0.0 - An overview of upcoming features
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
 
Apache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT ManagementApache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT Management
 
Building Push Triggers for Logic Apps
Building Push Triggers for Logic AppsBuilding Push Triggers for Logic Apps
Building Push Triggers for Logic Apps
 
Monitoring with Prometheus
Monitoring with PrometheusMonitoring with Prometheus
Monitoring with Prometheus
 
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
ApacheCon2019 Talk: Improving the Observability of Cassandra, Kafka and Kuber...
 
How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...How to Improve the Observability of Apache Cassandra and Kafka applications...
How to Improve the Observability of Apache Cassandra and Kafka applications...
 
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
.NET Fest 2018. Антон Молдован. One year of using F# in production at SBTech
 
Observability and its application
Observability and its applicationObservability and its application
Observability and its application
 
ql.io at NodePDX
ql.io at NodePDXql.io at NodePDX
ql.io at NodePDX
 

Dernier

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)

  • 1. Istio’s Mixer: Policy Enforcement with Custom Adapters Limin Wang, Software Engineer, Google Torin Sandall, Software Engineer, Styra
  • 2. Outline ● Istio and policy (how to enforce your custom policy in Istio) ● Integrate Open Policy Agent to Istio (demo)
  • 3. What is Istio? An open platform to connect, manage, secure microservices •Istio provides: • Traffic management • Observation • Policy Enforcement • Service Identity and Security • And more … istio.io github.com/istio
  • 4. Istio Architecture HTTP/1.1, HTTP/2, gRPC, TCP with or without TLS svcA Envoy Pod Service A svcB Envoy Service B Pilot Control Plane API Mixer Discovery & Config data to Envoys Policy checks, telemetry Control flow during request processing Istio-Auth TLS certs to Envoy
  • 5. Policies in Istio ● Route rules ○ Load balancing, traffic splitting, request timeout, retry, fault injection ● Quota policies ● Monitoring policies ○ Metrics, logging, tracing ● Security policies ○ Service-to-service mTLS authentication ○ Simple authorization: denier, white/black list, expression language (ABAC)
  • 6. Policies in Istio (cont.) ● Upcoming security policies ○ Authentication policy ■ Enable/disable mTLS per service ■ End user authentication ○ Authorization policy ■ Role Based Access Control (RBAC) ■ Open Policy Agent ■ Expression language with richer semantics ○ Audit policy
  • 7. Example Policy (RBAC) kind: ServiceRole apiVersion: config.istio.io/v1alpha2 metadata: name: review-product-viewer namespace: default spec: rules: - services: [“reviews”] methods: [“GET”, “HEAD”] - services: [“products”] paths: [“/books”, “/books/*”] methods: [“GET”, “HEAD”] kind: ServiceRoleBinding apiVersion: config.istio.io/v1alpha2 metadata: name: example-role-binding namespace: default spec: subjects: - name: “istio-ingress-service-account” roleRef: kind: ServiceRole name: review-product-viewer More information on Istio RBAC Design Doc.
  • 8. Extend Policy System through Mixer ● Mixer is the central point for policy evaluation and extensibility. ● Mixer provides the following core features: ○ Precondition and quota checking (Check) ○ Telemetry reporting (Report) ● Mixer achieves high extensibility by having a general purpose plug-in model - the plug-ins are known as Adapters. Mixer List Memquota Statsd Stackdriver Prometheus Denier
  • 9. Mixer’s Adapters ● Mixer is an attribute-processing and routing machine. ○ Attributes => Instances => Adapters => (Backends) Envoy Mixer Infra Backends Infra Backends Infra Backends Infra Backends Infra Backends Attributes Backend-Specific Protocols Policy& Config Operator
  • 10. How to Provide a Custom Adapter ● Determine your adapter type (check/quota/report) ● Determine the runtime input to your adapter ○ Template: adapter input schema ○ You can apply multiple templates ■ Built-in templates, or your custom templates ● Determine how to configure your adapter. ○ Handler: configured adapter ● Determine the business logic for your adapter to handle runtime input. More information on https://github.com/istio/istio/blob/master/mixer/doc/adapters.md
  • 11. Example: A Toy Adapter Build an adapter to verify a string is present in a list (simplified built-in ListEntry adapter). ● Adapter type: check ● Adapter input: built-in listEntry template ● Adapter configuration: a list of strings. ● How the adapter handles runtime input: looks up the value in a list of strings. ... package listEntry; option (istio.mixer.v1.template.template_variety) = TEMPLATE_VARIETY_CHECK; message Template { // Specifies the entry to verify in the list. string value = 1; }
  • 12. Steps to Build a Custom Adapter Step 1. Write basic adapter skeleton code (online tutorial or build-in adapters) ... func GetInfo() adapter.Info { return adapter.Info{ Name: "listChecker", Description: "Checks whether a string is in the list", SupportedTemplates: []string{ listentry.TemplateName, }, NewBuilder: func() adapter.HandlerBuilder { return &builder{} }, DefaultConfig: &config.Params{}, } }
  • 13. Steps to Build a Custom Adapter Step 2. Write adapter configuration. package adapter.listChecker.config; message Params { repeated string list = 1; } Step 3. Validate adapter configuration. func (b *builder) SetAdapterConfig(cfg adapter.Config) { b.conf = cfg.(*config.Params) } func (b *builder) Validate() (ce *adapter.ConfigErrors) { // Check if the list is empty if b.conf.List == nil { ce = ce.Append(“list”, “list cannot be empty”) } return }
  • 14. Steps to Build a Custom Adapter func (b *builder) Build(context context.Context, env adapter.Env) (adapter.Handler, error) { return &handler{list: b.conf.List}, nil } func (h *handler) HandleListEntry(ctx context.Context, inst *listentry.Instance) (adapter.CheckResult, error) { code := rpc.OK for _, str := range h.list { if inst.Value == str { code = rpc.NOT_FOUND break } } return adapter.CheckResult{ Status: rpc.Status{Code: int32(code)}, }, nil } Step 4. Write business logic for your adapter.
  • 15. Configure Policy Using Custom Adapter apiVersion: “config.istio.io/v1alpha2” kind: listentry metadata: name: srcVersion spec: value: source.labels[“version”] 1. Create an instance of listentry template. apiVersion: “config.istio.io/v1alpha2” kind: listChecker metadata: name: versionChecker spec: list: [“v1”, “v2”] 2. Create a handler of listChecker adapter. apiVersion: “config.istio.io/v1alpha2” kind: rule metadata: name: checkVersion spec: match: destination.labels[“app”] == “ratings” actions: - handler: versionChecker.listChecker instances: - srcVersion.listentry 3. Create a checkVersion policy istioctl create -f *.yaml 4. Apply the policy!
  • 16. + ● Overview: Open Policy Agent ● OPA Adapter ● Demo
  • 17. •General-purpose policy engine • Offload authorization decisions •Declarative Policy Language (Rego) • Is X allowed to call operation Y on resource Z? •Library or Daemon • In-memory policies and data • Zero runtime dependencies • Implemented in Go •Don’t roll your own authorization engine! Policy (Rego) Data (JSON) Open Policy Agent (OPA)
  • 18. •Adapter type: Check •Attributes: (authz template) • Subject: map<string, value> • Action: map<string, value> • Standalone adapter • No external dependencies •Fail closed (deny) in case of error(s) • To be configurable in future Envoy Mixer check(attributes) OPA adapter OPA incoming request allow/deny Mixer’s OPA Adapter
  • 19. apiVersion: config.istio.io/v1alpha2 kind: rule metadata: name: authz spec: actions: - handler: opa-handler instances: - authz-instance Mixer config (1/3): Rule Mixer OPA adapter OPA Istio Config Store istioctl
  • 20. apiVersion: config.istio/v1alpha2 kind: authz metadata: name: authz-instance spec: subject: user: source.uid | “” action: namespace: target.namespace | “default” service: target.service | “” path: target.path | “” method: request.method | “” Mixer config (2/3): Instance Mixer OPA adapter OPA Istio Config Store istioctl
  • 21. apiVersion: config.istio.io/v1alpha2 kind: opa metadata: name: opa-handler spec: checkMethod: authz.allow policy: | package authz default allow = false allow { is_read } is_read { input.action.method = “GET” } Mixer config (3/3): Handler Mixer OPA adapter OPA Istio Config Store istioctl
  • 22. Demo
  • 23. Conclusion •Use Istio to enforce wide range of policy across your microservices •Plugin framework makes it easy to add adapters • Authorization, quota, telemetry, … •Come join us! • istio-users@googlegroups.com • Istio working groups (Security, Integrations, …) • More information: istio.io, github.com/istio