SlideShare a Scribd company logo
1 of 24
Download to read offline
Hands-on workshop
Locking down your Kubernetes
Cluster with Linkerd
Hi, we're Buoyant!
We created Linkerd! And we help you run Linkerd by providing
management tools (Buoyant Cloud), support, training, and much
more.
At your service today:
★ William Morgan, CEO ( @wm)
★ Jason Morgan (not related!), MC ( @RJasonMorgan)
★ Lots of other friendly Buoyant folks in the Linkerd Slack.
Have questions or need help? Join the #workshops channel on
slack.linkerd.io and help each other!
Let's dive right in!
★ Linkerd 2.11 introduced a big new
feature: authorization policy.
★ This feature gives you control over the
types of communication are allowed on
your cluster.
★ It's built on top of mTLS identity and
enforced at the pod level (zero-trust
compatible).
But what do we mean by "authorization policy"?
★ By default, Kubernetes allows all communication to and from any pod.
★ By default, Linkerd also allows all communication to and from any
(meshed) pod.
★ Authorization policy refers to restricting some types of communication.
★ Called "authorization policy" because works by denying requests unless
they're properly authorized.
So authorization policy gives Linkerd the power to say "no".
What kinds of communication can be restricted?
Today, Linkerd's policies are purely server-side policies (enforced by the
inbound proxies) and authorize individual connections. This means they:
★ Can only restrict traffic to meshed pods.
★ Can only restricts connection, not individual requests.
This is just a first step! In the future (e.g. 2.12) we'll add:
★ Client-side policies (restrict traffic from meshed pods)
★ Fine-grained policy (verbs, paths, gRPC methods)
★ More!
Linkerd's authorization policies vs NetworkPolicies
Authorization Policies
★ Use workload identity (i.e.
ServiceAccount)
★ "Include" encryption
★ Enforced at the pod level
(zero trust)
★ Can capture L7 semantics
★ Are ergonomic
Network Policies
★ Use network identity (i.e. IP
address)
★ No encryption
★ Enforced at the CNI layer
★ No L7 semantics
★ Hard to use
How is authorization policy expressed?
Two mechanisms that work together:
★ A default policy, typically set through a
config.linkerd.io/default-inbound-policy annotation.
★ Two CRDs, Server and ServerAuthorization, that specify exceptions
to the default policy.
This brings the total number of Linkerd CRDs to 4. Sorry!
Default policies
★ Every cluster has a cluster-wide default policy, set at install time with
policyController.defaultAllowPolicy
○ By default: all-unauthenticated
★ The default policy can be overridden at the namespace or workload
level
○ Set the config.linkerd.io/default-inbound-policy annotation
★ Every proxy's default policy is fixed at startup time.
○ If you want to change its default policy, you need to restart the pod!
○ Can be viewed in the environment variables for the proxy container.
Available default policies
★ all-unauthenticated: allow all
★ cluster-unauthenticated: allow from clients with source IPs in the
cluster.
★ all-authenticated: allow from clients with Linkerd's mTLS
★ cluster-authenticated: allow from in-cluster clients with Linkerd's
mTLS
★ deny: deny all
A note about cluster networks
★ Kubernetes doesn't give us a great way of knowing what the actual
network IP range is
★ Linkerd just uses all private IP space by default
★ But in practice, you should probably restrict this to the cluster's actual
network space by setting the clusterNetworks variable at
install/upgrade time.
The Server CRD
apiVersion: policy.linkerd.io/v1beta1
kind: Server
metadata:
namespace: emojivoto
name: voting-grpc
spec:
podSelector:
matchLabels:
app: voting-svc
port: voting-grpc
proxyProtocol: gRPC
★ Selects over a port, and a set of
pods, in a namespace
★ Give it a protocol hint and it you
can avoid protocol detection!
Example: the gRPC port on the
emojivoto voting service
Servers can match multiple workloads!
Example: the admin port on every
pod in this namespace
apiVersion: policy.linkerd.io/v1beta1
kind: Server
metadata:
namespace: emojivoto
name: admin
spec:
port: linkerd-admin
podSelector:
matchLabels: {} # every pod
By themselves, Servers deny all traffic!
★ If you create a Server for a port, all traffic to that port will be denied.
○ This overrides the default policy.
★ If you want to allow traffic, you need to create a
ServerAuthorization that references that Server
The ServerAuthorization CRD
apiVersion: policy.linkerd.io/v1beta1
kind: ServerAuthorization
metadata:
namespace: emojivoto
name: admin-unauthed
spec:
server:
name: admin
client:
unauthenticated: true
★ Selects over one or more
Servers
★ Describes the types of traffic
that are allowed to those
Servers
Example: unauthenticated traffic
to the "admin" Server is allowed
ServerAuthz's can match multiple Servers!
apiVersion: policy.linkerd.io/v1beta1
kind: ServerAuthorization
metadata:
namespace: emojivoto
name: internal-grpc
spec:
server:
selector:
matchLabels:
emojivoto/api: internal-grpc
client:
meshTLS:
serviceAccounts:
- name: web
Example: traffic to any Server with
the "emojivoto/api" label is
allowed if it's mTLS traffic from the
"web" ServiceAccount
Putting it all together
So, when a connection comes to a port on a meshed pod, how does
Linkerd decide what to do? It uses this basic logic
Is the (pod, port) selected by a Server?
Yes => Is that Server selected by a ServerAuthorization?
○ Yes => Follow the ServerAuthorization's rules for that connection
○ No => deny the connection
No => Use the default policy for the pod
How does it feel to be rejected?
★ If Linkerd knows this is a gRPC connection
○ Denial is a grpc-status: PermissionDenied response
★ If Linkerd knows this is an HTTP/1 or HTTP/2 connection
○ Denial is a 403 response
★ Otherwise
○ Denial is a refused TCP connection
If you update your policies, Linkerd will happily terminate established
connections if they are no longer allowed!
Gotcha #1: Kubelet probes need to be authorized!
★ If you are building a "deny by default" setup, you need to make sure
Kubelet probes (liveness checks, readiness checks, health checks, etc) are
authorized!
○ Otherwise your pod won't start.
★ This also applies if you're building an "authenticated by default" setup.
Kubelet probes are plaintext / unauthenticated.
Gotcha #2: Default policies are not read dynamically!
★ The default policy for a pod is fixed at startup time, based on the
annotations then present in the namespace and workload.
★ ... with one edge case, which is that you can dynamically change the
cluster-wide default with linkerd update. Only works if no annotations
are overriding it.
The Server and ServerAuthorization CRs are, of course, read dynamically.
Gotcha #3: Ports must be in the pod spec!
If a Server references a port that is not in the pod spec, it will be ignored.
Hands-on time!
Let's take a look at how to get our Emojivoto app into a high security,
"deny by default" namespace.
(Based loosely on Go Directly to Namespace Jail by Linkerd maintainer
Alejandro Pedraza)
Next Workshop
A guide to end-to-end encryption with Emissary-ingress and Linkerd
Thu, Feb 17, 2022
9 am PST | 12 pm EST | 6 pm CET
Register today!
buoyant.io/register/end-to-end-encryption-with-emissary-and-linkerd
….and coming up in March: Certificate management for Linkerd
@BuoyantIO buoyant.io
William Morgan
CEO @ Buoyant
william@buoyant.io
Thank you!
The best way to run
in mission-critical
environments
Request a demo
buoyant.io/demo
★ Automatically track data plane and control plane health
★ Manage mesh certificates and versions
★ Build the ultimate service mesh platform
★ Get full Linkerd support

More Related Content

What's hot

どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)
どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)
どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)NTT DATA Technology & Innovation
 
Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18CodeOps Technologies LLP
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In DeepMydbops
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCKernel TLV
 
Windows attacks - AT is the new black
Windows attacks - AT is the new blackWindows attacks - AT is the new black
Windows attacks - AT is the new blackChris Gates
 
Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...Murat Mukhtarov
 
Go micro framework to build microservices
Go micro framework to build microservicesGo micro framework to build microservices
Go micro framework to build microservicesTechMaster Vietnam
 
Managing Egress with Istio
Managing Egress with IstioManaging Egress with Istio
Managing Egress with IstioSolo.io
 
Derbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryWill Schroeder
 
LDAP Injection
LDAP InjectionLDAP Injection
LDAP InjectionNSConclave
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveMichal Rostecki
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthScyllaDB
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondKubeAcademy
 
TCAMのしくみ
TCAMのしくみTCAMのしくみ
TCAMのしくみogatay
 
忙しい人の5分で分かるDocker 2017年春Ver
忙しい人の5分で分かるDocker 2017年春Ver忙しい人の5分で分かるDocker 2017年春Ver
忙しい人の5分で分かるDocker 2017年春VerMasahito Zembutsu
 
Attacker's Perspective of Active Directory
Attacker's Perspective of Active DirectoryAttacker's Perspective of Active Directory
Attacker's Perspective of Active DirectorySunny Neo
 
(Ab)Using GPOs for Active Directory Pwnage
(Ab)Using GPOs for Active Directory Pwnage(Ab)Using GPOs for Active Directory Pwnage
(Ab)Using GPOs for Active Directory PwnagePetros Koutroumpis
 

What's hot (20)

どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)
どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)
どうやって決める?kubernetesでのシークレット管理方法(Cloud Native Days 2020 発表資料)
 
Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18Kubernetes Networking - Sreenivas Makam - Google - CC18
Kubernetes Networking - Sreenivas Makam - Google - CC18
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In Deep
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
 
Uygulamali Sizma Testi (Pentest) Egitimi Sunumu - 2
Uygulamali Sizma Testi (Pentest) Egitimi Sunumu - 2Uygulamali Sizma Testi (Pentest) Egitimi Sunumu - 2
Uygulamali Sizma Testi (Pentest) Egitimi Sunumu - 2
 
Drive into calico architecture
Drive into calico architectureDrive into calico architecture
Drive into calico architecture
 
Windows attacks - AT is the new black
Windows attacks - AT is the new blackWindows attacks - AT is the new black
Windows attacks - AT is the new black
 
Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...
 
Go micro framework to build microservices
Go micro framework to build microservicesGo micro framework to build microservices
Go micro framework to build microservices
 
Managing Egress with Istio
Managing Egress with IstioManaging Egress with Istio
Managing Egress with Istio
 
Derbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active Directory
 
LDAP Injection
LDAP InjectionLDAP Injection
LDAP Injection
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep Dive
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster Health
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
 
TCAMのしくみ
TCAMのしくみTCAMのしくみ
TCAMのしくみ
 
忙しい人の5分で分かるDocker 2017年春Ver
忙しい人の5分で分かるDocker 2017年春Ver忙しい人の5分で分かるDocker 2017年春Ver
忙しい人の5分で分かるDocker 2017年春Ver
 
Attacker's Perspective of Active Directory
Attacker's Perspective of Active DirectoryAttacker's Perspective of Active Directory
Attacker's Perspective of Active Directory
 
BTRisk Zararlı Yazılım Analizi Eğitimi Sunumu - Bölüm 2
BTRisk Zararlı Yazılım Analizi Eğitimi Sunumu - Bölüm 2BTRisk Zararlı Yazılım Analizi Eğitimi Sunumu - Bölüm 2
BTRisk Zararlı Yazılım Analizi Eğitimi Sunumu - Bölüm 2
 
(Ab)Using GPOs for Active Directory Pwnage
(Ab)Using GPOs for Active Directory Pwnage(Ab)Using GPOs for Active Directory Pwnage
(Ab)Using GPOs for Active Directory Pwnage
 

Similar to Locking down your Kubernetes cluster with Linkerd

Pluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerPluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerBob Killen
 
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29MysoreMuleSoftMeetup
 
OPA open policy agent
OPA open policy agentOPA open policy agent
OPA open policy agentKnoldus Inc.
 
Montreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptxMontreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptxshubhamkalsi2
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE
 
Cloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For OperationsCloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For OperationsVMware Tanzu
 
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureToronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureAlexandra N. Martinez
 
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...Simplilearn
 
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...Jitendra Bafna
 
Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container securityVolodymyr Shynkar
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsFederico Michele Facca
 
Kubernetes policies 101 - apolicy.io
Kubernetes policies 101 - apolicy.ioKubernetes policies 101 - apolicy.io
Kubernetes policies 101 - apolicy.iojoanwlevin
 
MuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLB
MuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLBMuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLB
MuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLBJitendra Bafna
 
Как мы взломали распределенные системы конфигурационного управления
Как мы взломали распределенные системы конфигурационного управленияКак мы взломали распределенные системы конфигурационного управления
Как мы взломали распределенные системы конфигурационного управленияPositive Hack Days
 
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3Alfonso Martino
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Jakub Hajek
 
Kong Ingress Controller - Fullstaq Show N Tell
Kong Ingress Controller - Fullstaq Show N TellKong Ingress Controller - Fullstaq Show N Tell
Kong Ingress Controller - Fullstaq Show N TellArnold Van Wijnbergen
 
Setting Up a Cloud Server - Part 4 - Transcript.pdf
Setting Up a Cloud Server - Part 4 - Transcript.pdfSetting Up a Cloud Server - Part 4 - Transcript.pdf
Setting Up a Cloud Server - Part 4 - Transcript.pdfShaiAlmog1
 
MuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventMuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventVikalp Bhalia
 
9th docker meetup 2016.07.13
9th docker meetup 2016.07.139th docker meetup 2016.07.13
9th docker meetup 2016.07.13Amrita Prasad
 

Similar to Locking down your Kubernetes cluster with Linkerd (20)

Pluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and DockerPluggable Infrastructure with CI/CD and Docker
Pluggable Infrastructure with CI/CD and Docker
 
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
Platform configuration on CloudHub 2.0 | MuleSoft Mysore Meetup #29
 
OPA open policy agent
OPA open policy agentOPA open policy agent
OPA open policy agent
 
Montreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptxMontreal MuleSoft_Meetup_16-Aug.pptx
Montreal MuleSoft_Meetup_16-Aug.pptx
 
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE PlatformsFIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
 
Cloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For OperationsCloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For Operations
 
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureToronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
 
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 2 | Devops Interview Questions And Answers ...
 
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
 
Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container security
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 
Kubernetes policies 101 - apolicy.io
Kubernetes policies 101 - apolicy.ioKubernetes policies 101 - apolicy.io
Kubernetes policies 101 - apolicy.io
 
MuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLB
MuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLBMuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLB
MuleSoft Surat Live Demonstration Virtual Meetup#1 - Anypoint VPC VPN and DLB
 
Как мы взломали распределенные системы конфигурационного управления
Как мы взломали распределенные системы конфигурационного управленияКак мы взломали распределенные системы конфигурационного управления
Как мы взломали распределенные системы конфигурационного управления
 
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 3
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0
 
Kong Ingress Controller - Fullstaq Show N Tell
Kong Ingress Controller - Fullstaq Show N TellKong Ingress Controller - Fullstaq Show N Tell
Kong Ingress Controller - Fullstaq Show N Tell
 
Setting Up a Cloud Server - Part 4 - Transcript.pdf
Setting Up a Cloud Server - Part 4 - Transcript.pdfSetting Up a Cloud Server - Part 4 - Transcript.pdf
Setting Up a Cloud Server - Part 4 - Transcript.pdf
 
MuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual EventMuleSoft Meetup Vancouver 5th Virtual Event
MuleSoft Meetup Vancouver 5th Virtual Event
 
9th docker meetup 2016.07.13
9th docker meetup 2016.07.139th docker meetup 2016.07.13
9th docker meetup 2016.07.13
 

Recently uploaded

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
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.
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
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
 
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
 
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
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 

Recently uploaded (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
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 ...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
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...
 
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
 
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
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 

Locking down your Kubernetes cluster with Linkerd

  • 1. Hands-on workshop Locking down your Kubernetes Cluster with Linkerd
  • 2. Hi, we're Buoyant! We created Linkerd! And we help you run Linkerd by providing management tools (Buoyant Cloud), support, training, and much more. At your service today: ★ William Morgan, CEO ( @wm) ★ Jason Morgan (not related!), MC ( @RJasonMorgan) ★ Lots of other friendly Buoyant folks in the Linkerd Slack. Have questions or need help? Join the #workshops channel on slack.linkerd.io and help each other!
  • 3. Let's dive right in! ★ Linkerd 2.11 introduced a big new feature: authorization policy. ★ This feature gives you control over the types of communication are allowed on your cluster. ★ It's built on top of mTLS identity and enforced at the pod level (zero-trust compatible).
  • 4. But what do we mean by "authorization policy"? ★ By default, Kubernetes allows all communication to and from any pod. ★ By default, Linkerd also allows all communication to and from any (meshed) pod. ★ Authorization policy refers to restricting some types of communication. ★ Called "authorization policy" because works by denying requests unless they're properly authorized. So authorization policy gives Linkerd the power to say "no".
  • 5. What kinds of communication can be restricted? Today, Linkerd's policies are purely server-side policies (enforced by the inbound proxies) and authorize individual connections. This means they: ★ Can only restrict traffic to meshed pods. ★ Can only restricts connection, not individual requests. This is just a first step! In the future (e.g. 2.12) we'll add: ★ Client-side policies (restrict traffic from meshed pods) ★ Fine-grained policy (verbs, paths, gRPC methods) ★ More!
  • 6. Linkerd's authorization policies vs NetworkPolicies Authorization Policies ★ Use workload identity (i.e. ServiceAccount) ★ "Include" encryption ★ Enforced at the pod level (zero trust) ★ Can capture L7 semantics ★ Are ergonomic Network Policies ★ Use network identity (i.e. IP address) ★ No encryption ★ Enforced at the CNI layer ★ No L7 semantics ★ Hard to use
  • 7. How is authorization policy expressed? Two mechanisms that work together: ★ A default policy, typically set through a config.linkerd.io/default-inbound-policy annotation. ★ Two CRDs, Server and ServerAuthorization, that specify exceptions to the default policy. This brings the total number of Linkerd CRDs to 4. Sorry!
  • 8. Default policies ★ Every cluster has a cluster-wide default policy, set at install time with policyController.defaultAllowPolicy ○ By default: all-unauthenticated ★ The default policy can be overridden at the namespace or workload level ○ Set the config.linkerd.io/default-inbound-policy annotation ★ Every proxy's default policy is fixed at startup time. ○ If you want to change its default policy, you need to restart the pod! ○ Can be viewed in the environment variables for the proxy container.
  • 9. Available default policies ★ all-unauthenticated: allow all ★ cluster-unauthenticated: allow from clients with source IPs in the cluster. ★ all-authenticated: allow from clients with Linkerd's mTLS ★ cluster-authenticated: allow from in-cluster clients with Linkerd's mTLS ★ deny: deny all
  • 10. A note about cluster networks ★ Kubernetes doesn't give us a great way of knowing what the actual network IP range is ★ Linkerd just uses all private IP space by default ★ But in practice, you should probably restrict this to the cluster's actual network space by setting the clusterNetworks variable at install/upgrade time.
  • 11. The Server CRD apiVersion: policy.linkerd.io/v1beta1 kind: Server metadata: namespace: emojivoto name: voting-grpc spec: podSelector: matchLabels: app: voting-svc port: voting-grpc proxyProtocol: gRPC ★ Selects over a port, and a set of pods, in a namespace ★ Give it a protocol hint and it you can avoid protocol detection! Example: the gRPC port on the emojivoto voting service
  • 12. Servers can match multiple workloads! Example: the admin port on every pod in this namespace apiVersion: policy.linkerd.io/v1beta1 kind: Server metadata: namespace: emojivoto name: admin spec: port: linkerd-admin podSelector: matchLabels: {} # every pod
  • 13. By themselves, Servers deny all traffic! ★ If you create a Server for a port, all traffic to that port will be denied. ○ This overrides the default policy. ★ If you want to allow traffic, you need to create a ServerAuthorization that references that Server
  • 14. The ServerAuthorization CRD apiVersion: policy.linkerd.io/v1beta1 kind: ServerAuthorization metadata: namespace: emojivoto name: admin-unauthed spec: server: name: admin client: unauthenticated: true ★ Selects over one or more Servers ★ Describes the types of traffic that are allowed to those Servers Example: unauthenticated traffic to the "admin" Server is allowed
  • 15. ServerAuthz's can match multiple Servers! apiVersion: policy.linkerd.io/v1beta1 kind: ServerAuthorization metadata: namespace: emojivoto name: internal-grpc spec: server: selector: matchLabels: emojivoto/api: internal-grpc client: meshTLS: serviceAccounts: - name: web Example: traffic to any Server with the "emojivoto/api" label is allowed if it's mTLS traffic from the "web" ServiceAccount
  • 16. Putting it all together So, when a connection comes to a port on a meshed pod, how does Linkerd decide what to do? It uses this basic logic Is the (pod, port) selected by a Server? Yes => Is that Server selected by a ServerAuthorization? ○ Yes => Follow the ServerAuthorization's rules for that connection ○ No => deny the connection No => Use the default policy for the pod
  • 17. How does it feel to be rejected? ★ If Linkerd knows this is a gRPC connection ○ Denial is a grpc-status: PermissionDenied response ★ If Linkerd knows this is an HTTP/1 or HTTP/2 connection ○ Denial is a 403 response ★ Otherwise ○ Denial is a refused TCP connection If you update your policies, Linkerd will happily terminate established connections if they are no longer allowed!
  • 18. Gotcha #1: Kubelet probes need to be authorized! ★ If you are building a "deny by default" setup, you need to make sure Kubelet probes (liveness checks, readiness checks, health checks, etc) are authorized! ○ Otherwise your pod won't start. ★ This also applies if you're building an "authenticated by default" setup. Kubelet probes are plaintext / unauthenticated.
  • 19. Gotcha #2: Default policies are not read dynamically! ★ The default policy for a pod is fixed at startup time, based on the annotations then present in the namespace and workload. ★ ... with one edge case, which is that you can dynamically change the cluster-wide default with linkerd update. Only works if no annotations are overriding it. The Server and ServerAuthorization CRs are, of course, read dynamically.
  • 20. Gotcha #3: Ports must be in the pod spec! If a Server references a port that is not in the pod spec, it will be ignored.
  • 21. Hands-on time! Let's take a look at how to get our Emojivoto app into a high security, "deny by default" namespace. (Based loosely on Go Directly to Namespace Jail by Linkerd maintainer Alejandro Pedraza)
  • 22. Next Workshop A guide to end-to-end encryption with Emissary-ingress and Linkerd Thu, Feb 17, 2022 9 am PST | 12 pm EST | 6 pm CET Register today! buoyant.io/register/end-to-end-encryption-with-emissary-and-linkerd ….and coming up in March: Certificate management for Linkerd
  • 23. @BuoyantIO buoyant.io William Morgan CEO @ Buoyant william@buoyant.io Thank you!
  • 24. The best way to run in mission-critical environments Request a demo buoyant.io/demo ★ Automatically track data plane and control plane health ★ Manage mesh certificates and versions ★ Build the ultimate service mesh platform ★ Get full Linkerd support