SlideShare a Scribd company logo
Policy & Governance for Kubernetes
Docker Rosenheim Meetup, June 2020
Nico Meisenzahl
• Senior Cloud & DevOps Consultant at white duck
• Microsoft MVP, GitLab Hero, Docker Community
Leader
• loves Kubernetes, DevOps and Cloud
© white duck GmbH 2020
Phone: +49 8031 230159 0
Email: nico.meisenzahl@whiteduck.de
Twitter: @nmeisenzahl
LinkedIn: https://www.linkedin.com/in/nicomeisenzahl
Blog: https://meisenzahl.org
Agenda
• Cloud Governance? Why do we need it?
• Governance for Kubernetes
• Open Policy Agent – the foundation
• OPA Gatekeeper – the Kubernetes implementation
© white duck GmbH 2020
CLOUD GOVERNANCE
Why do we need it?
© white duck GmbH 2020
Cloud Governance …
… is used to provide a set of rules that defines
guidelines that can either be enforced or audited.
© white duck GmbH 2020
Why do we need it?
• decisions are made decentralized & taken at a rapid pace
• therefore it is important to
• reduce risk
• control shadow IT
• make it easier to manage cloud resources
• reduce effort
© white duck GmbH 2020
KUBERNETES GOVERNANCE
Why do we need it?
© white duck GmbH 2020
Governance for Kubernetes
• Authorization with Role-based Access Control (RBAC)
• is used to define who is allowed to do what
• very granular
• But: Kubernetes offers nothing to control/change the
specification of resources
• which is essential for successfully governing a cluster
© white duck GmbH 2020
Some examples are
• whitelist of trusted container registries, images or tags
• required container security specifications
• required labels to group resources
• permit conflicting Ingress host resources
• permit publicly exposed LoadBalancer services
© white duck GmbH 2020
OPEN POLICY AGENT
The foundation
© white duck GmbH 2020
Open Policy Agent
• “policy-based control for cloud native environments”
• general-purpose policy engine
• open-source project created by styra
• CNCF project since 2018
• declarative policy language
• decoupled
• Golang library
• REST API with sidecar or daemon
© white duck GmbH 2020
© white duck GmbH 2020
Ecosystem
• API and service authorization with Envoy, Kong or Traefik
• Authorization policies for SQL, Kafka and others
• Container Network authorization with Istio
• Test policies for Terraform infrastructure changes
• Polices for SSH and sudo
• Policy and Governance for Kubernetes
• and many more
• https://www.openpolicyagent.org/docs/latest/ecosystem/
© white duck GmbH 2020
How OPA works
© white duck GmbH 2020
How OPA works
© white duck GmbH 2020
POST /api HTTP/1.1
Authorization: nico
{
“method”: “POST”,
“path”: “api”,
“user”: “nico”
}
{
“allow”: “true”
}
{
}
Rego
• “ray-go”
• inspired by Datalog with support for JSON
• declarative Policy Language
• ”is Nico allowed to POST a payload to /api”
• Build-in functions
• JWTs
• date/time
• Regex
• …
© white duck GmbH 2020
package app.abac
default allow = false
allow {
action_is_post
user_is_owner
}
action_is_post {
input.method == ”POST"
}
user_is_owner {
input.user == "nico"
}
Rego in action
© white duck GmbH 2020
POST /api HTTP/1.1
Authorization: nico
{
“method”: “POST”,
“path”: “api”,
“user”: “nico”
}
{
“allow”: “true”
}
package app.abac
default allow = false
allow {
action_is_post
user_is_owner
}
action_is_post {
input.method == ”POST"
}
user_is_owner {
input.user == "nico"
}
{
}
OPA Tips
• OPA binary
• opa run, opa test, …
• Rego Playground
• https://play.openpolicyagent.org/
• VS Code plugin
• management APIs
• bundle API à send policies and data to OPA
• status API à for observability/monitoring
• log API à for receiving audit logs
© white duck GmbH 2020
OPA GATEKEEPER
OPA Kubernetes implementation
© white duck GmbH 2020
OPA Gatekeeper
• Kubernetes implementation of OPA
• build by Google, Microsoft, Red Hat, and styra
• based on
• Open Policy Agent daemon
• Kubernetes Admission Controller
• Custom Resource Definitions (CRDs)
• AuthZ Webhook
• based on OPA Constraint Framework
• can be installed with Helm or kubectl apply
• https://github.com/open-policy-agent/gatekeeper
© white duck GmbH 2020
How Gatekeeper works
© white duck GmbH 2020
https://kubernetes.io/blog/2019/08/06/opa-gatekeeper-policy-and-governance-for-kubernetes/
How Gatekeeper works
© white duck GmbH 2020
How Gatekeeper works
© white duck GmbH 2020
Demos
• OPA Gatekeeper in action
• example rules
• required label
• trusted images
• unique ingress hosts
• auditing
© white duck GmbH 2020
Questions?
Slides: https://www.slideshare.net/nmeisenzahl
Demos: https://gitlab.com/nico-meisenzahl/opa-gatekeeper-sample
Nico Meisenzahl (Senior Cloud & DevOps Consultant)
Phone: +49 8031 230159 0
Email: nico.meisenzahl@whiteduck.de
Twitter: @nmeisenzahl
LinkedIn: https://www.linkedin.com/in/nicomeisenzahl
Blog: https://meisenzahl.org
© white duck GmbH 2020

More Related Content

PDF
Global Azure Virtual: Container & Kubernetes on Azure
PDF
Virtual Azure Community Day: Azure Kubernetes Service Basics
PDF
DevOpsCon London: How containerized Pipelines can boost your CI/CD
PDF
DevOps Gathering - How Containerized Pipelines Can Boost Your CI/CD
PDF
The Future of Workflow Automation Is Now - Hassle-Free ARM Template Deploymen...
PPTX
FestiveTechCalendar2021 - Have Yourself An​ Azure Container Registry
PPTX
AzDevCom2021 - Bicep vs Terraform
PDF
Cloud Native Day: Cloud-native Anwendungsentwicklung im Jahr 2021
Global Azure Virtual: Container & Kubernetes on Azure
Virtual Azure Community Day: Azure Kubernetes Service Basics
DevOpsCon London: How containerized Pipelines can boost your CI/CD
DevOps Gathering - How Containerized Pipelines Can Boost Your CI/CD
The Future of Workflow Automation Is Now - Hassle-Free ARM Template Deploymen...
FestiveTechCalendar2021 - Have Yourself An​ Azure Container Registry
AzDevCom2021 - Bicep vs Terraform
Cloud Native Day: Cloud-native Anwendungsentwicklung im Jahr 2021

What's hot (20)

PDF
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?
PDF
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
PDF
Azure Rosenheim Meetup: Azure Service Operator
PDF
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...
PDF
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
PDF
GitLab Commit: Enhance your Compliance with Policy-Based CI/CD
PDF
GitLab Commit DevOps: How GitLab Can Save your Kubernetes environment from Be...
PDF
GitHub Actions 101
PDF
Hijack a Kubernetes Cluster - a Walkthrough
PPTX
Distributed Storage in the Cloud
PDF
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
PDF
All Things Cloud Native Meetup: Azure Kubernetes Service Basics
PDF
Journey from on prem to the cloud with kubernetes
PDF
GitLab Remote Meetup: Enhance Your Kubernetes CI/CD Pipelines with GitLab & ...
PDF
Continuous Lifecycle: Hijack Kubernetes
PDF
azdevcom - Hijack a Kubernetes Cluster
PPTX
Building Cloud Native Applications Using Azure Kubernetes Service
PDF
Was ist ein Service Mesh und wie funktioniert es?
PPTX
Event sourcing your React-Redux applications
PDF
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Azure Rosenheim Meetup: Azure Service Operator
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
GitLab Commit: Enhance your Compliance with Policy-Based CI/CD
GitLab Commit DevOps: How GitLab Can Save your Kubernetes environment from Be...
GitHub Actions 101
Hijack a Kubernetes Cluster - a Walkthrough
Distributed Storage in the Cloud
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
All Things Cloud Native Meetup: Azure Kubernetes Service Basics
Journey from on prem to the cloud with kubernetes
GitLab Remote Meetup: Enhance Your Kubernetes CI/CD Pipelines with GitLab & ...
Continuous Lifecycle: Hijack Kubernetes
azdevcom - Hijack a Kubernetes Cluster
Building Cloud Native Applications Using Azure Kubernetes Service
Was ist ein Service Mesh und wie funktioniert es?
Event sourcing your React-Redux applications
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
Ad

Similar to Docker Rosenheim Meetup: Policy & Governance for Kubernetes (20)

PDF
Policy & Governance für Kubernetes
PDF
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...
PDF
GitLab Remote Meetup: Enhance Your Kubernetes CI/CD Pipelines with GitLab & O...
PDF
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
PDF
How to Prevent Your Kubernetes Cluster From Being Hacked
PDF
Azure Service Operator - Provision Your Resources in a Cloud-Native Way
PDF
Container Days: Hijack a Kubernetes Cluster - a Walkthrough
PPTX
Hijack a Kubernetes Cluster - a Walkthrough
PDF
OpenFaaS 2019 Project Update
PPTX
AzDevCom 2022 - YAMLize your infrastructure with the Azure Service Operator a...
PDF
Microsoft DevOps Forum 2021 – DevOps & Security
PDF
GitLab London Meetup: How Containerized Pipelines and Kubernetes Can Boost Yo...
PPTX
Migrating from IBM API Connect v5 to v2018
PDF
The Current And Future State Of Service Mesh
PPT
Build A Cloud Day London - Introduction
PDF
Effiziente CI/CD-Pipelines – mit den richtigen Tools klappt das
PDF
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
PDF
DEVNET-1149 Leveraging Rapid Development with PaaS on Cisco Cloud
PDF
WSO2 Product Release webinar - WSO2 BAM 2.5
PPTX
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Policy & Governance für Kubernetes
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...
GitLab Remote Meetup: Enhance Your Kubernetes CI/CD Pipelines with GitLab & O...
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
How to Prevent Your Kubernetes Cluster From Being Hacked
Azure Service Operator - Provision Your Resources in a Cloud-Native Way
Container Days: Hijack a Kubernetes Cluster - a Walkthrough
Hijack a Kubernetes Cluster - a Walkthrough
OpenFaaS 2019 Project Update
AzDevCom 2022 - YAMLize your infrastructure with the Azure Service Operator a...
Microsoft DevOps Forum 2021 – DevOps & Security
GitLab London Meetup: How Containerized Pipelines and Kubernetes Can Boost Yo...
Migrating from IBM API Connect v5 to v2018
The Current And Future State Of Service Mesh
Build A Cloud Day London - Introduction
Effiziente CI/CD-Pipelines – mit den richtigen Tools klappt das
OpenStack + Cloud Foundry for the OpenStack Boston Meetup
DEVNET-1149 Leveraging Rapid Development with PaaS on Cisco Cloud
WSO2 Product Release webinar - WSO2 BAM 2.5
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Ad

More from Nico Meisenzahl (10)

PDF
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
PDF
Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked
PDF
Festive Tech Calendar: Festive time with AKS networking
PDF
ContainerConf 2022: Hijack Kubernetes
PDF
ContainerConf 2022: Kubernetes is awesome - but...
PDF
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
PDF
Cloud Love Conference: Kubernetes is awesome, but...
PDF
Hijack a Kubernetes Cluster - a Walkthrough
PDF
Azure Saturday Hamburg: Containerize Your .NET Microservice - the Right Way!
PDF
Die Evolution von Container Image Builds
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked
Festive Tech Calendar: Festive time with AKS networking
ContainerConf 2022: Hijack Kubernetes
ContainerConf 2022: Kubernetes is awesome - but...
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
Cloud Love Conference: Kubernetes is awesome, but...
Hijack a Kubernetes Cluster - a Walkthrough
Azure Saturday Hamburg: Containerize Your .NET Microservice - the Right Way!
Die Evolution von Container Image Builds

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Understanding_Digital_Forensics_Presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
Encapsulation_ Review paper, used for researhc scholars
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Monthly Chronicles - July 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf

Docker Rosenheim Meetup: Policy & Governance for Kubernetes

  • 1. Policy & Governance for Kubernetes Docker Rosenheim Meetup, June 2020
  • 2. Nico Meisenzahl • Senior Cloud & DevOps Consultant at white duck • Microsoft MVP, GitLab Hero, Docker Community Leader • loves Kubernetes, DevOps and Cloud © white duck GmbH 2020 Phone: +49 8031 230159 0 Email: nico.meisenzahl@whiteduck.de Twitter: @nmeisenzahl LinkedIn: https://www.linkedin.com/in/nicomeisenzahl Blog: https://meisenzahl.org
  • 3. Agenda • Cloud Governance? Why do we need it? • Governance for Kubernetes • Open Policy Agent – the foundation • OPA Gatekeeper – the Kubernetes implementation © white duck GmbH 2020
  • 4. CLOUD GOVERNANCE Why do we need it? © white duck GmbH 2020
  • 5. Cloud Governance … … is used to provide a set of rules that defines guidelines that can either be enforced or audited. © white duck GmbH 2020
  • 6. Why do we need it? • decisions are made decentralized & taken at a rapid pace • therefore it is important to • reduce risk • control shadow IT • make it easier to manage cloud resources • reduce effort © white duck GmbH 2020
  • 7. KUBERNETES GOVERNANCE Why do we need it? © white duck GmbH 2020
  • 8. Governance for Kubernetes • Authorization with Role-based Access Control (RBAC) • is used to define who is allowed to do what • very granular • But: Kubernetes offers nothing to control/change the specification of resources • which is essential for successfully governing a cluster © white duck GmbH 2020
  • 9. Some examples are • whitelist of trusted container registries, images or tags • required container security specifications • required labels to group resources • permit conflicting Ingress host resources • permit publicly exposed LoadBalancer services © white duck GmbH 2020
  • 10. OPEN POLICY AGENT The foundation © white duck GmbH 2020
  • 11. Open Policy Agent • “policy-based control for cloud native environments” • general-purpose policy engine • open-source project created by styra • CNCF project since 2018 • declarative policy language • decoupled • Golang library • REST API with sidecar or daemon © white duck GmbH 2020
  • 12. © white duck GmbH 2020
  • 13. Ecosystem • API and service authorization with Envoy, Kong or Traefik • Authorization policies for SQL, Kafka and others • Container Network authorization with Istio • Test policies for Terraform infrastructure changes • Polices for SSH and sudo • Policy and Governance for Kubernetes • and many more • https://www.openpolicyagent.org/docs/latest/ecosystem/ © white duck GmbH 2020
  • 14. How OPA works © white duck GmbH 2020
  • 15. How OPA works © white duck GmbH 2020 POST /api HTTP/1.1 Authorization: nico { “method”: “POST”, “path”: “api”, “user”: “nico” } { “allow”: “true” } { }
  • 16. Rego • “ray-go” • inspired by Datalog with support for JSON • declarative Policy Language • ”is Nico allowed to POST a payload to /api” • Build-in functions • JWTs • date/time • Regex • … © white duck GmbH 2020 package app.abac default allow = false allow { action_is_post user_is_owner } action_is_post { input.method == ”POST" } user_is_owner { input.user == "nico" }
  • 17. Rego in action © white duck GmbH 2020 POST /api HTTP/1.1 Authorization: nico { “method”: “POST”, “path”: “api”, “user”: “nico” } { “allow”: “true” } package app.abac default allow = false allow { action_is_post user_is_owner } action_is_post { input.method == ”POST" } user_is_owner { input.user == "nico" } { }
  • 18. OPA Tips • OPA binary • opa run, opa test, … • Rego Playground • https://play.openpolicyagent.org/ • VS Code plugin • management APIs • bundle API à send policies and data to OPA • status API à for observability/monitoring • log API à for receiving audit logs © white duck GmbH 2020
  • 19. OPA GATEKEEPER OPA Kubernetes implementation © white duck GmbH 2020
  • 20. OPA Gatekeeper • Kubernetes implementation of OPA • build by Google, Microsoft, Red Hat, and styra • based on • Open Policy Agent daemon • Kubernetes Admission Controller • Custom Resource Definitions (CRDs) • AuthZ Webhook • based on OPA Constraint Framework • can be installed with Helm or kubectl apply • https://github.com/open-policy-agent/gatekeeper © white duck GmbH 2020
  • 21. How Gatekeeper works © white duck GmbH 2020 https://kubernetes.io/blog/2019/08/06/opa-gatekeeper-policy-and-governance-for-kubernetes/
  • 22. How Gatekeeper works © white duck GmbH 2020
  • 23. How Gatekeeper works © white duck GmbH 2020
  • 24. Demos • OPA Gatekeeper in action • example rules • required label • trusted images • unique ingress hosts • auditing © white duck GmbH 2020
  • 25. Questions? Slides: https://www.slideshare.net/nmeisenzahl Demos: https://gitlab.com/nico-meisenzahl/opa-gatekeeper-sample Nico Meisenzahl (Senior Cloud & DevOps Consultant) Phone: +49 8031 230159 0 Email: nico.meisenzahl@whiteduck.de Twitter: @nmeisenzahl LinkedIn: https://www.linkedin.com/in/nicomeisenzahl Blog: https://meisenzahl.org © white duck GmbH 2020