SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
Jirayut Nimsaeng (Dear)
CEO & Founder, Opsta (Thailand) Co.,Ltd.
TD Tech - Open House: The Technology Playground @ Sathorn Square
October 29, 2022 https://bit.ly/opsta-tdtech-vault
Secrets Management on
Production
Kubernetes Secrets Management
#whoami
Jirayut Nimsaeng (Dear)
Jirayut has been involved in DevSecOps, Container, Cloud Technology
and Open Source for over 10 years. He has experienced and
succeeded in transforming several companies to deliver greater
values and be more agile.
● He is Founder and CEO of Opsta (Thailand) Co.,Ltd.
● He is Cloud/DevSecOps Transformation Consultant and
Solution Architecture
● He is the first Certified Kubernetes Security Specialist (CKS)
and Certified Kubernetes Administrator (CKA) in Thailand
● He is first Thai Google Cloud Developer Expert (GDE) in
Thailand
Kubernetes Secrets Management
Agenda
● Secrets Management in DevSecOps
● HashiCorp Vault
● Kubernetes Secrets
● External Secrets Operator
● Live Demo
Kubernetes Secrets Management
Secrets Management in
DevSecOps Flow
Kubernetes Secrets Management
What is Secrets?
Secrets authenticate software components like cloud infrastructure,
databases, microservices, third-party APIs, and others – against each other.
● API tokens
● username/password pairs and generic passwords
● database connection URLs
● browser session tokens
services:
mongodb:
image: bitnami/mongodb:5.0.6-debian-10-r46
volumes:
- "./databases:/docker-entrypoint-initdb.d"
environment:
MONGODB_ROOT_PASSWORD: VERYSECUREPASS
MONGODB_EXTRA_USERNAMES
: app
MONGODB_EXTRA_PASSWORDS: SECUREPASS
MONGODB_EXTRA_DATABASES
: app
Kubernetes Secrets Management
How leaky was 2021?
https://www.gitguardian.com/files/the-state-of-secrets-sprawl-report-2022
Kubernetes Secrets Management
Where to handle Secrets in DevSecOps?
Kubernetes Secrets Management
Developer Environments
Developer
Kubernetes Secrets Management
Version Control System
VCS
Kubernetes Secrets Management
CI/CD & Artifacts
Artifacts
CI CD
Kubernetes Secrets Management
Infrastructure
Infrastructure
DEV
UAT
PRD
Kubernetes Secrets Management
Secrets Manager
Kubernetes Secrets Management
Secrets Management Tools
Kubernetes Secrets Management
What we will focus in this session
How we can handle Secrets with
HashiCorp Vault in Kubernetes
Kubernetes Secrets Management
HashiCorp Vault
Kubernetes Secrets Management
HashiCorp Vault
HashiCorp Vault is an identity-based secrets and encryption
management system. Vault provides encryption services that are
gated by authentication and authorization methods. Using Vault’s
UI, CLI, or HTTP API, access to secrets and other sensitive data
can be securely stored and managed, tightly controlled
(restricted), and auditable.
Kubernetes Secrets Management
HashiCorp Vault Architecture
Kubernetes Secrets Management
How Vault works?
Kubernetes Secrets Management
Kubernetes Secrets
Kubernetes Secrets Management
Kubernetes Secret
Kubernetes Secrets Management
How to use Kubernetes Secrets
apiVersion: v1
kind: Secret
metadata:
name: rabbitmq
namespace: default
type: Opaque
data:
RabbitPass: cmFiYml0bXE=
stringData:
RabbitPlain: P@ssw0rd
apiVersion: apps/v1
kind: Pod
metadata:
name: nginx
namespace: default
spec:
containers:
- name: nginx
image: nginx:latest
env:
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: rabbitmq
key: RabbitPass
Create Secret Inject Secret into Container
Environment Variable
Read Secret from Code
[NodeJS]
process.env.RABBITMQ_PASSWORD;
[Python]
import os
os.getenv('RABBITMQ_PASSWORD')
[Golang]
package main
import (
"os"
)
os.Getenv("RABBITMQ_PASSWORD")
Kubernetes Secrets Management
What we need
● Developer can self-manage secrets in non-production environment
● Admin/Security Team can manage secrets on production environment
● Kubernetes should sync secrets from HashiCorp Vault automatically
● Developer just config their application to use secret with agreed
variable name
● Developer should not directly access to Kubernetes Secrets
Kubernetes Secrets Management
There is Vault Agent Sidecar Injector
https://developer.hashicorp.com/vault/docs/platform/k8s/injector
Kubernetes Secrets Management
External Secrets
Operator
Kubernetes Secrets Management
External Secrets Operator
External Secrets Operator is a Kubernetes operator that integrates
external secret management systems like AWS Secrets Manager, HashiCorp
Vault, Google Secrets Manager, Azure Key Vault and many more. The
operator reads information from external APIs and automatically injects
the values into a Kubernetes Secret.
Kubernetes Secrets Management
Why External Secrets Operator?
● Support many Secrets Manager
● Easy to understand for Developer
● Easy to Maintain
● Secure
Kubernetes Secrets Management
External Secrets Operator with Vault
Kubernetes Secrets Management
Multi Tenancy with Shared ClusterSecretStore
https://external-secrets.io/v0.6.0/guides/multi-tenancy/
Kubernetes Secrets Management
Show me your code!
Kubernetes Secrets Management
Vault Production on Kubernetes Checklists
❏ Use Official Vault Helm Chart
❏ Don’t run as root
❏ Run with HA mode
❏ Configure End-to-End TLS
❏ Dedicated worker node if possible
❏ Ensure mlock is Enabled
https://developer.hashicorp.com/vault/tutorials/kubernetes/kubernetes-security-concerns
Kubernetes Secrets Management
Kyverno
Kubernetes Secrets Management
Kyverno
Kyverno (Greek for “govern”) is a policy engine designed specifically
for Kubernetes
Kubernetes Secrets Management
Sample Kyverno Policy
validationFailureAction: enforce
background: true
rules:
- name: privileged-containers
match:
any:
- resources:
kinds:
- Pod
validate:
message: >-
Privileged mode is disallowed. The fields
spec.containers[*].securityContext.privileged
and spec.initContainers[*].securityContext.privileged
must be unset or set to `false`.
pattern:
spec:
containers:
- =(securityContext):
=(privileged): "false"
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: unmatched-key
spec:
validationFailureAction: enforce
rules:
- name: check-unmatch-namespace-and-key
match:
resources:
kinds:
- ExternalSecret
validate:
message: "key must prefix with namespace name"
pattern:
spec:
dataFrom:
- extract:
key: "{{request.namespace}}/?*"
Kubernetes Secrets Management
Further More
● Reloaded Pod when Secrets changed
https://github.com/stakater/Reloader
● Integrate HashiCorp Vault with Databases
● Dynamic or Rotate Secrets
● How to manage Kubernetes secrets with GitOps?
Kubernetes Secrets Management
Contact Us
Jirayut Nimsaeng (Dear)
Facebook:
Email:
Website:
fb.me/DearJirayut
jirayut@opsta.co.th
www.opsta.co.th
Founder & CEO

Mais conteúdo relacionado

Mais procurados

Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Edureka!
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopBob Killen
 
Overview of secret management solutions and architecture
Overview of secret management solutions and architectureOverview of secret management solutions and architecture
Overview of secret management solutions and architectureYuechuan (Mike) Chen
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep diveWinton Winton
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container PlatformDLT Solutions
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive OverviewBob Killen
 
Getting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeGetting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeWinWire Technologies Inc
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Megan O'Keefe
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker ComposeAjeet Singh Raina
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container SecuritySuraj Khetani
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overviewGabriel Carro
 

Mais procurados (20)

Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Overview of secret management solutions and architecture
Overview of secret management solutions and architectureOverview of secret management solutions and architecture
Overview of secret management solutions and architecture
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Helm 3
Helm 3Helm 3
Helm 3
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container Platform
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
 
Getting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeGetting Started with Infrastructure as Code
Getting Started with Infrastructure as Code
 
Helm intro
Helm introHelm intro
Helm intro
 
EKS Workshop
 EKS Workshop EKS Workshop
EKS Workshop
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
 

Semelhante a Kubernetes Secrets Management on Production with Demo

Secrets acrosscloudk8s
Secrets acrosscloudk8sSecrets acrosscloudk8s
Secrets acrosscloudk8sJhonnatan Gil
 
Sharing secret keys in Docker containers and K8s
Sharing secret keys in Docker containers and K8sSharing secret keys in Docker containers and K8s
Sharing secret keys in Docker containers and K8sJose Manuel Ortega Candel
 
Kubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiKubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiRita Zhang
 
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security DevOpsDays Riga
 
K8 Meetup_ K8s secrets management best practices (Git Guardian).pdf
K8 Meetup_ K8s secrets management best practices (Git Guardian).pdfK8 Meetup_ K8s secrets management best practices (Git Guardian).pdf
K8 Meetup_ K8s secrets management best practices (Git Guardian).pdfMichaelOLeary82
 
Knolx_ Sealed Secrets
Knolx_ Sealed SecretsKnolx_ Sealed Secrets
Knolx_ Sealed SecretsKnoldus Inc.
 
Managing your secrets in a cloud environment
Managing your secrets in a cloud environmentManaging your secrets in a cloud environment
Managing your secrets in a cloud environmentTaswar Bhatti
 
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018HashiCorp
 
Attacking and Defending Kubernetes - Nithin Jois
Attacking and Defending Kubernetes - Nithin JoisAttacking and Defending Kubernetes - Nithin Jois
Attacking and Defending Kubernetes - Nithin JoisOWASP Hacker Thursday
 
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...Mary Racter
 
Apache CloudStack Integration with HashiCorp Vault
Apache CloudStack Integration with HashiCorp VaultApache CloudStack Integration with HashiCorp Vault
Apache CloudStack Integration with HashiCorp VaultCloudOps2005
 
Using CredHub for Kubernetes Deployments
Using CredHub for Kubernetes DeploymentsUsing CredHub for Kubernetes Deployments
Using CredHub for Kubernetes DeploymentsVMware Tanzu
 
Hardening Kubernetes Cluster
Hardening Kubernetes ClusterHardening Kubernetes Cluster
Hardening Kubernetes ClusterKnoldus Inc.
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Commit 2024 Secrets Management Made Easy
Commit 2024 Secrets Management Made EasyCommit 2024 Secrets Management Made Easy
Commit 2024 Secrets Management Made EasyAlfredo García Lavilla
 
How we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on KubernetesHow we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on KubernetesOpsta
 
Secret Management with Hashicorp Vault and Consul on Kubernetes
Secret Management with Hashicorp Vault and Consul on KubernetesSecret Management with Hashicorp Vault and Consul on Kubernetes
Secret Management with Hashicorp Vault and Consul on KubernetesAn Nguyen
 

Semelhante a Kubernetes Secrets Management on Production with Demo (20)

Secrets acrosscloudk8s
Secrets acrosscloudk8sSecrets acrosscloudk8s
Secrets acrosscloudk8s
 
Sharing secret keys in Docker containers and K8s
Sharing secret keys in Docker containers and K8sSharing secret keys in Docker containers and K8s
Sharing secret keys in Docker containers and K8s
 
Kubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiKubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csi
 
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
 
K8 Meetup_ K8s secrets management best practices (Git Guardian).pdf
K8 Meetup_ K8s secrets management best practices (Git Guardian).pdfK8 Meetup_ K8s secrets management best practices (Git Guardian).pdf
K8 Meetup_ K8s secrets management best practices (Git Guardian).pdf
 
Knolx_ Sealed Secrets
Knolx_ Sealed SecretsKnolx_ Sealed Secrets
Knolx_ Sealed Secrets
 
Managing your secrets in a cloud environment
Managing your secrets in a cloud environmentManaging your secrets in a cloud environment
Managing your secrets in a cloud environment
 
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
 
Attacking and Defending Kubernetes - Nithin Jois
Attacking and Defending Kubernetes - Nithin JoisAttacking and Defending Kubernetes - Nithin Jois
Attacking and Defending Kubernetes - Nithin Jois
 
Kubernetes security with AWS
Kubernetes security with AWSKubernetes security with AWS
Kubernetes security with AWS
 
Kubernetes 101 for_penetration_testers_-_null_mumbai
Kubernetes 101 for_penetration_testers_-_null_mumbaiKubernetes 101 for_penetration_testers_-_null_mumbai
Kubernetes 101 for_penetration_testers_-_null_mumbai
 
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
 
Apache CloudStack Integration with HashiCorp Vault
Apache CloudStack Integration with HashiCorp VaultApache CloudStack Integration with HashiCorp Vault
Apache CloudStack Integration with HashiCorp Vault
 
Using CredHub for Kubernetes Deployments
Using CredHub for Kubernetes DeploymentsUsing CredHub for Kubernetes Deployments
Using CredHub for Kubernetes Deployments
 
Hardening Kubernetes Cluster
Hardening Kubernetes ClusterHardening Kubernetes Cluster
Hardening Kubernetes Cluster
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Commit 2024 Secrets Management Made Easy
Commit 2024 Secrets Management Made EasyCommit 2024 Secrets Management Made Easy
Commit 2024 Secrets Management Made Easy
 
How we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on KubernetesHow we can do Multi-Tenancy on Kubernetes
How we can do Multi-Tenancy on Kubernetes
 
Kubernetes Security
Kubernetes SecurityKubernetes Security
Kubernetes Security
 
Secret Management with Hashicorp Vault and Consul on Kubernetes
Secret Management with Hashicorp Vault and Consul on KubernetesSecret Management with Hashicorp Vault and Consul on Kubernetes
Secret Management with Hashicorp Vault and Consul on Kubernetes
 

Mais de Opsta

Deploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOpsDeploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOpsOpsta
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with BackstageOpsta
 
Introduction of CCE and DevCloud
Introduction of CCE and DevCloudIntroduction of CCE and DevCloud
Introduction of CCE and DevCloudOpsta
 
How to build DevSecOps Platform on Huawei Cloud
How to build DevSecOps Platform on Huawei CloudHow to build DevSecOps Platform on Huawei Cloud
How to build DevSecOps Platform on Huawei CloudOpsta
 
Make a better DevOps with GitOps
Make a better DevOps with GitOpsMake a better DevOps with GitOps
Make a better DevOps with GitOpsOpsta
 
Deploy Application on Kubernetes
Deploy Application on KubernetesDeploy Application on Kubernetes
Deploy Application on KubernetesOpsta
 
Platform Engineering
Platform EngineeringPlatform Engineering
Platform EngineeringOpsta
 
Manage Kubernetes Clusters with Cluster API and ArgoCD
Manage Kubernetes Clusters with Cluster API and ArgoCDManage Kubernetes Clusters with Cluster API and ArgoCD
Manage Kubernetes Clusters with Cluster API and ArgoCDOpsta
 
Security Process in DevSecOps
Security Process in DevSecOpsSecurity Process in DevSecOps
Security Process in DevSecOpsOpsta
 
Scaling DevSecOps Culture for Enterprise
Scaling DevSecOps Culture for EnterpriseScaling DevSecOps Culture for Enterprise
Scaling DevSecOps Culture for EnterpriseOpsta
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demoOpsta
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKEOpsta
 
Introduction to Google Cloud Platform
Introduction to Google Cloud PlatformIntroduction to Google Cloud Platform
Introduction to Google Cloud PlatformOpsta
 
Managing traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshopManaging traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshopOpsta
 
How to pass the Google Certification Exams
How to pass the Google Certification ExamsHow to pass the Google Certification Exams
How to pass the Google Certification ExamsOpsta
 
How to Become DevOps
How to Become DevOpsHow to Become DevOps
How to Become DevOpsOpsta
 
DevOps: The Future of Software Development
DevOps: The Future of Software DevelopmentDevOps: The Future of Software Development
DevOps: The Future of Software DevelopmentOpsta
 
Real World CI/CD with Kubernetes
Real World CI/CD with KubernetesReal World CI/CD with Kubernetes
Real World CI/CD with KubernetesOpsta
 
Journey of Kubernetes Scaling
Journey of Kubernetes ScalingJourney of Kubernetes Scaling
Journey of Kubernetes ScalingOpsta
 
DevOps Transformation in Technical
DevOps Transformation in TechnicalDevOps Transformation in Technical
DevOps Transformation in TechnicalOpsta
 

Mais de Opsta (20)

Deploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOpsDeploy 22 microservices from scratch in 30 mins with GitOps
Deploy 22 microservices from scratch in 30 mins with GitOps
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
Introduction of CCE and DevCloud
Introduction of CCE and DevCloudIntroduction of CCE and DevCloud
Introduction of CCE and DevCloud
 
How to build DevSecOps Platform on Huawei Cloud
How to build DevSecOps Platform on Huawei CloudHow to build DevSecOps Platform on Huawei Cloud
How to build DevSecOps Platform on Huawei Cloud
 
Make a better DevOps with GitOps
Make a better DevOps with GitOpsMake a better DevOps with GitOps
Make a better DevOps with GitOps
 
Deploy Application on Kubernetes
Deploy Application on KubernetesDeploy Application on Kubernetes
Deploy Application on Kubernetes
 
Platform Engineering
Platform EngineeringPlatform Engineering
Platform Engineering
 
Manage Kubernetes Clusters with Cluster API and ArgoCD
Manage Kubernetes Clusters with Cluster API and ArgoCDManage Kubernetes Clusters with Cluster API and ArgoCD
Manage Kubernetes Clusters with Cluster API and ArgoCD
 
Security Process in DevSecOps
Security Process in DevSecOpsSecurity Process in DevSecOps
Security Process in DevSecOps
 
Scaling DevSecOps Culture for Enterprise
Scaling DevSecOps Culture for EnterpriseScaling DevSecOps Culture for Enterprise
Scaling DevSecOps Culture for Enterprise
 
Introduction to Kubernetes with demo
Introduction to Kubernetes with demoIntroduction to Kubernetes with demo
Introduction to Kubernetes with demo
 
Introduction to Kubernetes and GKE
Introduction to Kubernetes and GKEIntroduction to Kubernetes and GKE
Introduction to Kubernetes and GKE
 
Introduction to Google Cloud Platform
Introduction to Google Cloud PlatformIntroduction to Google Cloud Platform
Introduction to Google Cloud Platform
 
Managing traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshopManaging traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshop
 
How to pass the Google Certification Exams
How to pass the Google Certification ExamsHow to pass the Google Certification Exams
How to pass the Google Certification Exams
 
How to Become DevOps
How to Become DevOpsHow to Become DevOps
How to Become DevOps
 
DevOps: The Future of Software Development
DevOps: The Future of Software DevelopmentDevOps: The Future of Software Development
DevOps: The Future of Software Development
 
Real World CI/CD with Kubernetes
Real World CI/CD with KubernetesReal World CI/CD with Kubernetes
Real World CI/CD with Kubernetes
 
Journey of Kubernetes Scaling
Journey of Kubernetes ScalingJourney of Kubernetes Scaling
Journey of Kubernetes Scaling
 
DevOps Transformation in Technical
DevOps Transformation in TechnicalDevOps Transformation in Technical
DevOps Transformation in Technical
 

Último

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 

Último (20)

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 

Kubernetes Secrets Management on Production with Demo

  • 1. Jirayut Nimsaeng (Dear) CEO & Founder, Opsta (Thailand) Co.,Ltd. TD Tech - Open House: The Technology Playground @ Sathorn Square October 29, 2022 https://bit.ly/opsta-tdtech-vault Secrets Management on Production
  • 2. Kubernetes Secrets Management #whoami Jirayut Nimsaeng (Dear) Jirayut has been involved in DevSecOps, Container, Cloud Technology and Open Source for over 10 years. He has experienced and succeeded in transforming several companies to deliver greater values and be more agile. ● He is Founder and CEO of Opsta (Thailand) Co.,Ltd. ● He is Cloud/DevSecOps Transformation Consultant and Solution Architecture ● He is the first Certified Kubernetes Security Specialist (CKS) and Certified Kubernetes Administrator (CKA) in Thailand ● He is first Thai Google Cloud Developer Expert (GDE) in Thailand
  • 3. Kubernetes Secrets Management Agenda ● Secrets Management in DevSecOps ● HashiCorp Vault ● Kubernetes Secrets ● External Secrets Operator ● Live Demo
  • 4. Kubernetes Secrets Management Secrets Management in DevSecOps Flow
  • 5. Kubernetes Secrets Management What is Secrets? Secrets authenticate software components like cloud infrastructure, databases, microservices, third-party APIs, and others – against each other. ● API tokens ● username/password pairs and generic passwords ● database connection URLs ● browser session tokens services: mongodb: image: bitnami/mongodb:5.0.6-debian-10-r46 volumes: - "./databases:/docker-entrypoint-initdb.d" environment: MONGODB_ROOT_PASSWORD: VERYSECUREPASS MONGODB_EXTRA_USERNAMES : app MONGODB_EXTRA_PASSWORDS: SECUREPASS MONGODB_EXTRA_DATABASES : app
  • 6. Kubernetes Secrets Management How leaky was 2021? https://www.gitguardian.com/files/the-state-of-secrets-sprawl-report-2022
  • 7. Kubernetes Secrets Management Where to handle Secrets in DevSecOps?
  • 10. Kubernetes Secrets Management CI/CD & Artifacts Artifacts CI CD
  • 14. Kubernetes Secrets Management What we will focus in this session How we can handle Secrets with HashiCorp Vault in Kubernetes
  • 16. Kubernetes Secrets Management HashiCorp Vault HashiCorp Vault is an identity-based secrets and encryption management system. Vault provides encryption services that are gated by authentication and authorization methods. Using Vault’s UI, CLI, or HTTP API, access to secrets and other sensitive data can be securely stored and managed, tightly controlled (restricted), and auditable.
  • 21. Kubernetes Secrets Management How to use Kubernetes Secrets apiVersion: v1 kind: Secret metadata: name: rabbitmq namespace: default type: Opaque data: RabbitPass: cmFiYml0bXE= stringData: RabbitPlain: P@ssw0rd apiVersion: apps/v1 kind: Pod metadata: name: nginx namespace: default spec: containers: - name: nginx image: nginx:latest env: - name: RABBITMQ_PASSWORD valueFrom: secretKeyRef: name: rabbitmq key: RabbitPass Create Secret Inject Secret into Container Environment Variable Read Secret from Code [NodeJS] process.env.RABBITMQ_PASSWORD; [Python] import os os.getenv('RABBITMQ_PASSWORD') [Golang] package main import ( "os" ) os.Getenv("RABBITMQ_PASSWORD")
  • 22. Kubernetes Secrets Management What we need ● Developer can self-manage secrets in non-production environment ● Admin/Security Team can manage secrets on production environment ● Kubernetes should sync secrets from HashiCorp Vault automatically ● Developer just config their application to use secret with agreed variable name ● Developer should not directly access to Kubernetes Secrets
  • 23. Kubernetes Secrets Management There is Vault Agent Sidecar Injector https://developer.hashicorp.com/vault/docs/platform/k8s/injector
  • 25. Kubernetes Secrets Management External Secrets Operator External Secrets Operator is a Kubernetes operator that integrates external secret management systems like AWS Secrets Manager, HashiCorp Vault, Google Secrets Manager, Azure Key Vault and many more. The operator reads information from external APIs and automatically injects the values into a Kubernetes Secret.
  • 26. Kubernetes Secrets Management Why External Secrets Operator? ● Support many Secrets Manager ● Easy to understand for Developer ● Easy to Maintain ● Secure
  • 27. Kubernetes Secrets Management External Secrets Operator with Vault
  • 28. Kubernetes Secrets Management Multi Tenancy with Shared ClusterSecretStore https://external-secrets.io/v0.6.0/guides/multi-tenancy/
  • 30. Kubernetes Secrets Management Vault Production on Kubernetes Checklists ❏ Use Official Vault Helm Chart ❏ Don’t run as root ❏ Run with HA mode ❏ Configure End-to-End TLS ❏ Dedicated worker node if possible ❏ Ensure mlock is Enabled https://developer.hashicorp.com/vault/tutorials/kubernetes/kubernetes-security-concerns
  • 32. Kubernetes Secrets Management Kyverno Kyverno (Greek for “govern”) is a policy engine designed specifically for Kubernetes
  • 33. Kubernetes Secrets Management Sample Kyverno Policy validationFailureAction: enforce background: true rules: - name: privileged-containers match: any: - resources: kinds: - Pod validate: message: >- Privileged mode is disallowed. The fields spec.containers[*].securityContext.privileged and spec.initContainers[*].securityContext.privileged must be unset or set to `false`. pattern: spec: containers: - =(securityContext): =(privileged): "false" apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: unmatched-key spec: validationFailureAction: enforce rules: - name: check-unmatch-namespace-and-key match: resources: kinds: - ExternalSecret validate: message: "key must prefix with namespace name" pattern: spec: dataFrom: - extract: key: "{{request.namespace}}/?*"
  • 34. Kubernetes Secrets Management Further More ● Reloaded Pod when Secrets changed https://github.com/stakater/Reloader ● Integrate HashiCorp Vault with Databases ● Dynamic or Rotate Secrets ● How to manage Kubernetes secrets with GitOps?
  • 35. Kubernetes Secrets Management Contact Us Jirayut Nimsaeng (Dear) Facebook: Email: Website: fb.me/DearJirayut jirayut@opsta.co.th www.opsta.co.th Founder & CEO