SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Protect Your Kubernetes Data
Friends Don’t Let Friends Leave Their Kubernetes Data Unprotected
Rita Zhang
Principal Software Engineer @ Microsoft
@ritazzhang
Rita Zhang
• Software engineer @ Microsoft,
San Francisco
• Kubernetes upstream features,
Azure Kubernetes Service
• Maintainer for K8s KMS plugin for
Azure Key Vault, Keyvault-
flexvolume, aad-pod-identity
(along with @khnidk
@nikhilbhatia @kkwriting
@cpuguy83)
@ritazzhang
@ritazzhang
@ritazzhang
Kubernetes Database
ž Uses etcd as its persistent storage for API objects
ž Stores secrets as base64 encoded plaintext
https://kubernetes.io/docs/concepts/overview/components/#etcd@ritazzhang
https://elweb.co/the-security-footgun-in-etcd/
“Authentication was added in etcd 2.1. … etcd before 2.1 was
a completely open system; anyone with access to the API
could change keys. In order to preserve backward
compatibility and upgradability, this feature is off by
default.” Read more from coreos etcd doc
@ritazzhang
I did a simple search on shodan and came up with 2,284 etcd servers on the open
internet.
CREDENTIALS, a lot of CREDENTIALS. Credentials for things like cms_admin, mysql_root,
postgres, etc. Passwords for databases of all kinds, AWS secret keys, and API keys and
secrets for a bunch of services.
GET http://<ip address>:2379/v2/keys/?recursive=true
@ritazzhang
@ritazzhang
An attacker who can successfully access your cluster
database can compromise your entire cluster and have
access to your cloud resources.
@ritazzhang
So…How do I secure my cluster?
• There are many things you can do
• Control access to the Kubernetes APIs
• Control access to the Kubelet
• Control privileges containers run with
• Restrict network access
• Restrict resource access
• Restrict access to etcd
• Encrypt etcd data at rest
• Store application secrets outside of Kubernetes
• Restrict access to resources with pod identity
https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/
@ritazzhang
Secret
Kubernetes Master
etcd
Node
API
Server
Kubelet
kubectl create secret generic secret1
Secrets
kubectl create –f pod-using-secret.yaml
Pod using Secret
Kubernetes Master
etcd
Node
API
Server
Kubelet Pod
Pod
secret
Mount path:
/etc/fooPod
Secret
Kubernetes Master
etcd
API
Server
Encryption at Rest
• Kubernetes v1.7+
• etcd v3 required
• encryption using keys in
config file on master
• Plain text, encoded with
base64
https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/@ritazzhang
@ritazzhang
Secret
Kubernetes Master
etcd
API
Server
Key Management Service (KMS) Provider
for Encryption at Rest
• Kubernetes v1.10, v1.13 stable
• etcd v3 required
• Separate key management
from K8s cluster management
• Supports encryption using keys
stored in external trusted Key
Management Service (KMS),
e.g. Azure Key Vault, Google
Cloud KMS
• Hardware Security Modules
(HSM)-protected keys
@ritazzhang https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/
KMS
KMS
provider
@ritazzhang
V1.13
High Level Design
@ritazzhang
Demo:
K8s cluster with Azure
Key Vault data
encryption
@ritazzhang https://github.com/Azure/kubernetes-kms
With the KMS provider plugin, we can encrypt
Kubernetes data stored in etcd at rest with a KMS
managed key.
@ritazzhang
What if instead of storing my secrets in etcd, I want to
store and manage access outside of Kubernetes?
@ritazzhang
kubectl create -f pod-using-keyvaultflexvolume.yaml
Pod using Key Vault Flexvolume
Kubernetes Master Node
API
Server
Kubelet Pod
Pod
Keyvault
flexvolume
Mount path:
/etc/foo
KMS
Pod
Demo:
K8s cluster with Azure
Key Vault flexvolume
@ritazzhang https://github.com/Azure/kubernetes-keyvault-flexvol
With the Kubernetes Key Vault FlexVolume driver, we
can store and retrieve secrets from a Key Management
System and mount the data as a volume to containers.
@ritazzhang
What if I want to restrict access to my key vault or my
cloud resources to specific pods?
@ritazzhang
AAD Pod Identity
ž Restrict/enable pods to access individual resources that depend on
Azure AD for access with its own identity (e.g. Azure SQL server or
your own custom API that uses AAD)
ž Kubernetes Custom Resource Definition objects that map pods to
Azure AD identities
ž When pods request access to a resource that uses Azure AD for
access, a matching Azure identity is assigned
https://github.com/Azure/aad-pod-identity@ritazzhang
AAD Pod Identity
@ritazzhang https://docs.microsoft.com/en-us/azure/aks/operator-best-practices-identity - use-pod-identities
Demo:
K8s cluster with AAD
Pod Identity
@ritazzhang https://github.com/Azure/aad-pod-identity
With AAD Pod Identity, we can restrict and enable
specific pods access to resources that need Azure AD for
access based on its identity.
@ritazzhang
Demo:
K8s cluster with Azure
Key Vault Flexvolume
and AAD Pod Identity
@ritazzhang https://github.com/Azure/kubernetes-keyvault-flexvol - option-2---pod-identity
Azure Key Vault KMS plugin
• Use a key, HSM-protected, in Key Vault for etcd encryption
• Secrets/keys/certs are stored in etcd, managed as part of Kubernetes
• Restrict access using K8s concepts: RBAC, Service Accounts, namespaces
• Bring your own keys
• Available on AKS-engine
Key Vault Flexvol + AAD Pod Identity
• Mounts secrets/keys/certs to the pod using a flexvolume
• Secrets/keys/certs are stored in Key Management System
• Restrict access to secrets/keys/certs with specific identities assigned to a pod
• Manage secrets/keys/certs in Key Management System
• Separation of concerns/role-based management access to secrets
• Import or generate HSM-protected (Hardware Security Modules) keys
• Industry compliance
• More granular RBAC at the pod level
@ritazzhang
Recap
Resources
https://ritazh.com/using-azure-key-vault-for-kubernetes-data-encryption-
d5eac8daee71
https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/
https://github.com/Azure/aks-
engine/blob/master/docs/kubernetes/features.md#azure-key-vault-data-encryption
https://github.com/kubernetes/kubernetes/pull/55684
https://github.com/Azure/kubernetes-kms
https://github.com/GoogleCloudPlatform/k8s-cloudkms-plugin/
https://github.com/Azure/kubernetes-keyvault-
flexvol
https://github.com/Azure/aad-pod-identity
@ritazzhang
Kubecon 2018 Seattle -  Friends Don’t Let Friends Leave Their Kubernetes Data Unprotected

Más contenido relacionado

Último

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
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...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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 - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Destacado

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Destacado (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Kubecon 2018 Seattle - Friends Don’t Let Friends Leave Their Kubernetes Data Unprotected

  • 1. Protect Your Kubernetes Data Friends Don’t Let Friends Leave Their Kubernetes Data Unprotected Rita Zhang Principal Software Engineer @ Microsoft @ritazzhang
  • 2. Rita Zhang • Software engineer @ Microsoft, San Francisco • Kubernetes upstream features, Azure Kubernetes Service • Maintainer for K8s KMS plugin for Azure Key Vault, Keyvault- flexvolume, aad-pod-identity (along with @khnidk @nikhilbhatia @kkwriting @cpuguy83) @ritazzhang
  • 5. Kubernetes Database ž Uses etcd as its persistent storage for API objects ž Stores secrets as base64 encoded plaintext https://kubernetes.io/docs/concepts/overview/components/#etcd@ritazzhang
  • 6. https://elweb.co/the-security-footgun-in-etcd/ “Authentication was added in etcd 2.1. … etcd before 2.1 was a completely open system; anyone with access to the API could change keys. In order to preserve backward compatibility and upgradability, this feature is off by default.” Read more from coreos etcd doc @ritazzhang
  • 7. I did a simple search on shodan and came up with 2,284 etcd servers on the open internet. CREDENTIALS, a lot of CREDENTIALS. Credentials for things like cms_admin, mysql_root, postgres, etc. Passwords for databases of all kinds, AWS secret keys, and API keys and secrets for a bunch of services. GET http://<ip address>:2379/v2/keys/?recursive=true @ritazzhang
  • 9. An attacker who can successfully access your cluster database can compromise your entire cluster and have access to your cloud resources. @ritazzhang
  • 10.
  • 11. So…How do I secure my cluster? • There are many things you can do • Control access to the Kubernetes APIs • Control access to the Kubelet • Control privileges containers run with • Restrict network access • Restrict resource access • Restrict access to etcd • Encrypt etcd data at rest • Store application secrets outside of Kubernetes • Restrict access to resources with pod identity https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/ @ritazzhang
  • 13. kubectl create –f pod-using-secret.yaml Pod using Secret Kubernetes Master etcd Node API Server Kubelet Pod Pod secret Mount path: /etc/fooPod
  • 14. Secret Kubernetes Master etcd API Server Encryption at Rest • Kubernetes v1.7+ • etcd v3 required • encryption using keys in config file on master • Plain text, encoded with base64 https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/@ritazzhang
  • 16. Secret Kubernetes Master etcd API Server Key Management Service (KMS) Provider for Encryption at Rest • Kubernetes v1.10, v1.13 stable • etcd v3 required • Separate key management from K8s cluster management • Supports encryption using keys stored in external trusted Key Management Service (KMS), e.g. Azure Key Vault, Google Cloud KMS • Hardware Security Modules (HSM)-protected keys @ritazzhang https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/ KMS KMS provider
  • 19. Demo: K8s cluster with Azure Key Vault data encryption @ritazzhang https://github.com/Azure/kubernetes-kms
  • 20. With the KMS provider plugin, we can encrypt Kubernetes data stored in etcd at rest with a KMS managed key. @ritazzhang
  • 21. What if instead of storing my secrets in etcd, I want to store and manage access outside of Kubernetes? @ritazzhang
  • 22. kubectl create -f pod-using-keyvaultflexvolume.yaml Pod using Key Vault Flexvolume Kubernetes Master Node API Server Kubelet Pod Pod Keyvault flexvolume Mount path: /etc/foo KMS Pod
  • 23. Demo: K8s cluster with Azure Key Vault flexvolume @ritazzhang https://github.com/Azure/kubernetes-keyvault-flexvol
  • 24. With the Kubernetes Key Vault FlexVolume driver, we can store and retrieve secrets from a Key Management System and mount the data as a volume to containers. @ritazzhang
  • 25. What if I want to restrict access to my key vault or my cloud resources to specific pods? @ritazzhang
  • 26. AAD Pod Identity ž Restrict/enable pods to access individual resources that depend on Azure AD for access with its own identity (e.g. Azure SQL server or your own custom API that uses AAD) ž Kubernetes Custom Resource Definition objects that map pods to Azure AD identities ž When pods request access to a resource that uses Azure AD for access, a matching Azure identity is assigned https://github.com/Azure/aad-pod-identity@ritazzhang
  • 27. AAD Pod Identity @ritazzhang https://docs.microsoft.com/en-us/azure/aks/operator-best-practices-identity - use-pod-identities
  • 28. Demo: K8s cluster with AAD Pod Identity @ritazzhang https://github.com/Azure/aad-pod-identity
  • 29. With AAD Pod Identity, we can restrict and enable specific pods access to resources that need Azure AD for access based on its identity. @ritazzhang
  • 30. Demo: K8s cluster with Azure Key Vault Flexvolume and AAD Pod Identity @ritazzhang https://github.com/Azure/kubernetes-keyvault-flexvol - option-2---pod-identity
  • 31. Azure Key Vault KMS plugin • Use a key, HSM-protected, in Key Vault for etcd encryption • Secrets/keys/certs are stored in etcd, managed as part of Kubernetes • Restrict access using K8s concepts: RBAC, Service Accounts, namespaces • Bring your own keys • Available on AKS-engine Key Vault Flexvol + AAD Pod Identity • Mounts secrets/keys/certs to the pod using a flexvolume • Secrets/keys/certs are stored in Key Management System • Restrict access to secrets/keys/certs with specific identities assigned to a pod • Manage secrets/keys/certs in Key Management System • Separation of concerns/role-based management access to secrets • Import or generate HSM-protected (Hardware Security Modules) keys • Industry compliance • More granular RBAC at the pod level @ritazzhang Recap