SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
Hardening Kubernetes
by Securing Pods
Suraj Deshmukh
Hi, I’m Suraj Deshmukh
suraj.io
surajd_
surajssd
What is Kubernetes?
● Container orchestrating system.
● Project initiated by Google.
● Has robust API system, scheduler to schedule workloads onto Nodes.
● Uses etcd to store cluster state.
Components of Kubernetes
Image Source:: https://kubernetes.io/docs/concepts/architecture/cloud-controller/
Basic unit of workload - Pod
● Its a group of one or more containers, with shared
storage/network, and a specification for how to run
the containers.
● Pod’s contents are always co-located and
co-scheduled, and run in a shared context.
Image Source:: https://kubernetes.io/docs/concepts/workloads/pods/pod/
Threat Models in Kubernetes
● External attacks
● Compromised containers/nodes OR attack from inside
● Compromised credentials
● Misuse of Legitimate privileges
Threat Models in Kubernetes
● External attacks
● Compromised containers/nodes OR attack from inside
● Compromised credentials
● Misuse of Legitimate privileges
What is attack from inside?
We trust our developers
Image Source:: http://turnoff.us/geek/the-depressed-developer-15/
● Multi-tenant setup where your clients are sharing resources like nodes on the same
cluster.
● An attacker gains access to the container’s shell and what they can do from there.
State of Container and
Kubernetes Security
Secure defaults
There are many ways to deliver an “out of the box” experience for users. However, by default,
the experience should be secure, and it should be up to the user to reduce their security – if they
are allowed. It is imperative for the software environment to have default secure settings which
may be opted out of by the user or other options which may be opted into (commonly known as
Opt-in and Opt-out).
- Open Web Application Security Project
● Some of the bad practices we see are
because of the security being opt-in
than opt-out in most of these
systems.
● People are running root in the
container.
● User namespaces are very new.
● Not so secure by default design.
Image Source:: http://www.commitstrip.com/en/2016/10/14/good-old-adminpassword/
uid0 inside container
What is uid0 in container?
FROM registry.fedoraproject.org/fedora:30
ENTRYPOINT ["sleep", "infinity"]
FROM registry.fedoraproject.org/fedora:30
USER 1000
ENTRYPOINT ["sleep", "infinity"]
Containers don’t contain - Dan Walsh
● Containers are just set of linux kernel technologies that work in conjunction to form the
isolation.
● These technologies are comparatively new in Linux kernel and will mature.
● All these technologies are not battle tested like VM which provides actual isolation.
● There are always ways for a root inside container to break out and do some nasty stuff.
CVE-2019-5736
● If a process is running with UID0 inside the container, it could replace the runc binary
on the host and potentially can gain root on host
● This could have been clearly mitigated if root inside container is restricted by default.
Solution to enforce non-root containers?
Enter Pod Security Policy!
What are PSP?
● It’s a cluster wide Kubernetes resource.
● It helps you assign secure defaults.
● You define various aspects of a pod security context & container security context.
● Define what UID, GID is allowed, capabilities a container can have inside container
PSP Demo
PSP attack Demo
rm -rf /
Where does PSP sit in?
Image Source:: https://thenewstack.io/ebooks/kubernetes/kubernetes-deployment-and-security-patterns/
State of PSPs
On Managed Kubernetes offering
In helm charts
Improving this state
● Educating folks of this awesome feature is the way to go
● The current state we are in because security has been an afterthought.
● Use secure practices from day1 of the development phase.
● The docker images and helm charts need a revamp.
Secure Software Development Lifecycle S-SDLC
Security should be given a iterative approach and not a waterfall one.
- Cindy Blake
Defense in depth - PSPs are not enough
● Network Policy
● Secure image building practices
● Audit Logging
● Avoid mounting service accounts
● Permissions on demand in RBAC
● Use containers that actually contain, e.g. katacontainers, kubevirt, gvisor, etc.
● Use admission plugin DenyEscalatingExec
● Containers don’t contain by Dan Walsh https://www.youtube.com/watch?v=a9lE9Urr6AQ
● Kubernetes Deployment and Security Patterns https://thenewstack.io/ebooks/kubernetes/kubernetes-deployment-and-security-patterns/
● GKE Using PodSecurityPolicies https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies
● EKS support for PSP https://github.com/aws/containers-roadmap/issues/174
● Hardening your cluster's security https://cloud.google.com/kubernetes-engine/docs/how-to/hardening-your-cluster
● Securing a Cluster https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/
● Runc and CVE-2019-5736 https://kubernetes.io/blog/2019/02/11/runc-and-cve-2019-5736/
● CVE-2019-5736 Detail https://nvd.nist.gov/vuln/detail/CVE-2019-5736
● Kubernetes Security - Michael Hausenblas, Liz Rice https://www.oreilly.com/library/view/kubernetes-security/9781492039075/
● Kubernetes logo https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
● TheNewStack's - Kubernetes Deployment and Security Patterns
https://thenewstack.io/ebooks/kubernetes/kubernetes-deployment-and-security-patterns/
● How to Secure Your Kubernetes Clusters - Cindy Blake https://youtu.be/M6db_dK0HF4
● Images running root stats https://github.com/surajssd/container-image-stats
● Running with Scissors - Liz Rice https://www.youtube.com/watch?v=ltrV-Qmh3oY
● Dilbert comic about firewall https://dilbert.com/strip/2013-04-07
● AWS EKS Pod Security Policy support PR https://aws.amazon.com/blogs/opensource/using-pod-security-policies-amazon-eks-clusters/
● OWASP secure defaults https://www.owasp.org/index.php/Establish_secure_defaults
References
Thank You

Mais conteúdo relacionado

Mais procurados

Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration PlatformKubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Michael O'Sullivan
 

Mais procurados (20)

Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Kubernetes - Security Journey
Kubernetes - Security JourneyKubernetes - Security Journey
Kubernetes - Security Journey
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration PlatformKubernetes: An Introduction to the Open Source Container Orchestration Platform
Kubernetes: An Introduction to the Open Source Container Orchestration Platform
 
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...
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
 
Crossplane @ Mastering GitOps.pdf
Crossplane @ Mastering GitOps.pdfCrossplane @ Mastering GitOps.pdf
Crossplane @ Mastering GitOps.pdf
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1Deep Dive into Kubernetes - Part 1
Deep Dive into Kubernetes - Part 1
 
Secret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s VaultSecret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s Vault
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
MicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMeshMicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMesh
 
Advanced Container Security
Advanced Container Security Advanced Container Security
Advanced Container Security
 
Azure Key Vault - Getting Started
Azure Key Vault - Getting StartedAzure Key Vault - Getting Started
Azure Key Vault - Getting Started
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
 

Semelhante a Hardening Kubernetes by Securing Pods

Semelhante a Hardening Kubernetes by Securing Pods (20)

The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote World
 
Container Security
Container SecurityContainer Security
Container Security
 
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
 
DevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friendDevSecCon Lightning 2021- Container defaults are a hackers best friend
DevSecCon Lightning 2021- Container defaults are a hackers best friend
 
Docker Enterprise Deployment Planning
Docker Enterprise Deployment PlanningDocker Enterprise Deployment Planning
Docker Enterprise Deployment Planning
 
Strategy, planning and governance for enterprise deployments of containers - ...
Strategy, planning and governance for enterprise deployments of containers - ...Strategy, planning and governance for enterprise deployments of containers - ...
Strategy, planning and governance for enterprise deployments of containers - ...
 
(DVO311) Containers, Red Hat & AWS For Extreme IT Agility
(DVO311) Containers, Red Hat & AWS For Extreme IT Agility(DVO311) Containers, Red Hat & AWS For Extreme IT Agility
(DVO311) Containers, Red Hat & AWS For Extreme IT Agility
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containers
 
"Docker best practice", Станислав Коленкин (senior devops, DataArt)
"Docker best practice", Станислав Коленкин (senior devops, DataArt)"Docker best practice", Станислав Коленкин (senior devops, DataArt)
"Docker best practice", Станислав Коленкин (senior devops, DataArt)
 
Python Web Conference 2022 - Why should devs care about container security.pdf
Python Web Conference 2022 - Why should devs care about container security.pdfPython Web Conference 2022 - Why should devs care about container security.pdf
Python Web Conference 2022 - Why should devs care about container security.pdf
 
Kubernetes best practices.odf
Kubernetes best practices.odfKubernetes best practices.odf
Kubernetes best practices.odf
 
Container Stranger Danger - Why should devs care about container security
Container Stranger Danger - Why should devs care about container securityContainer Stranger Danger - Why should devs care about container security
Container Stranger Danger - Why should devs care about container security
 
Why Should Developers Care About Container Security?
Why Should Developers Care About Container Security?Why Should Developers Care About Container Security?
Why Should Developers Care About Container Security?
 
ATO 2022 - Why should devs care about container security.pdf
ATO 2022 - Why should devs care about container security.pdfATO 2022 - Why should devs care about container security.pdf
ATO 2022 - Why should devs care about container security.pdf
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Docker Containers Security
Docker Containers SecurityDocker Containers Security
Docker Containers Security
 
Secure container: Kata container and gVisor
Secure container: Kata container and gVisorSecure container: Kata container and gVisor
Secure container: Kata container and gVisor
 
Understanding Kubernetes
Understanding KubernetesUnderstanding Kubernetes
Understanding Kubernetes
 
CloudNativeTurkey - Lines of Defence.pdf
CloudNativeTurkey - Lines of Defence.pdfCloudNativeTurkey - Lines of Defence.pdf
CloudNativeTurkey - Lines of Defence.pdf
 
Why should developers care about container security?
Why should developers care about container security?Why should developers care about container security?
Why should developers care about container security?
 

Mais de Suraj Deshmukh

Mais de Suraj Deshmukh (13)

Building Container Defence Executable at a Time.pdf
Building Container Defence Executable at a Time.pdfBuilding Container Defence Executable at a Time.pdf
Building Container Defence Executable at a Time.pdf
 
Kubernetes psp and beyond
Kubernetes psp and beyondKubernetes psp and beyond
Kubernetes psp and beyond
 
Kubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 SeattleKubernetes Security Updates from Kubecon 2018 Seattle
Kubernetes Security Updates from Kubecon 2018 Seattle
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
 
Microservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple wayMicroservices on Kubernetes - The simple way
Microservices on Kubernetes - The simple way
 
Kubernetes on CRI-O
Kubernetes on CRI-OKubernetes on CRI-O
Kubernetes on CRI-O
 
Taking containers from development to production
Taking containers from development to productionTaking containers from development to production
Taking containers from development to production
 
JSONSchema with golang
JSONSchema with golangJSONSchema with golang
JSONSchema with golang
 
What's new in kubernetes 1.3?
What's new in kubernetes 1.3?What's new in kubernetes 1.3?
What's new in kubernetes 1.3?
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytest
 
OpenShift meetup Bangalore
OpenShift meetup BangaloreOpenShift meetup Bangalore
OpenShift meetup Bangalore
 
macvlan and ipvlan
macvlan and ipvlanmacvlan and ipvlan
macvlan and ipvlan
 
Henge
HengeHenge
Henge
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Último (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

Hardening Kubernetes by Securing Pods

  • 1. Hardening Kubernetes by Securing Pods Suraj Deshmukh
  • 2. Hi, I’m Suraj Deshmukh suraj.io surajd_ surajssd
  • 3. What is Kubernetes? ● Container orchestrating system. ● Project initiated by Google. ● Has robust API system, scheduler to schedule workloads onto Nodes. ● Uses etcd to store cluster state.
  • 4. Components of Kubernetes Image Source:: https://kubernetes.io/docs/concepts/architecture/cloud-controller/
  • 5. Basic unit of workload - Pod ● Its a group of one or more containers, with shared storage/network, and a specification for how to run the containers. ● Pod’s contents are always co-located and co-scheduled, and run in a shared context. Image Source:: https://kubernetes.io/docs/concepts/workloads/pods/pod/
  • 6. Threat Models in Kubernetes ● External attacks ● Compromised containers/nodes OR attack from inside ● Compromised credentials ● Misuse of Legitimate privileges
  • 7. Threat Models in Kubernetes ● External attacks ● Compromised containers/nodes OR attack from inside ● Compromised credentials ● Misuse of Legitimate privileges
  • 8. What is attack from inside?
  • 9. We trust our developers Image Source:: http://turnoff.us/geek/the-depressed-developer-15/
  • 10. ● Multi-tenant setup where your clients are sharing resources like nodes on the same cluster. ● An attacker gains access to the container’s shell and what they can do from there.
  • 11. State of Container and Kubernetes Security
  • 12. Secure defaults There are many ways to deliver an “out of the box” experience for users. However, by default, the experience should be secure, and it should be up to the user to reduce their security – if they are allowed. It is imperative for the software environment to have default secure settings which may be opted out of by the user or other options which may be opted into (commonly known as Opt-in and Opt-out). - Open Web Application Security Project
  • 13. ● Some of the bad practices we see are because of the security being opt-in than opt-out in most of these systems. ● People are running root in the container. ● User namespaces are very new. ● Not so secure by default design. Image Source:: http://www.commitstrip.com/en/2016/10/14/good-old-adminpassword/
  • 15. What is uid0 in container? FROM registry.fedoraproject.org/fedora:30 ENTRYPOINT ["sleep", "infinity"] FROM registry.fedoraproject.org/fedora:30 USER 1000 ENTRYPOINT ["sleep", "infinity"]
  • 16. Containers don’t contain - Dan Walsh ● Containers are just set of linux kernel technologies that work in conjunction to form the isolation. ● These technologies are comparatively new in Linux kernel and will mature. ● All these technologies are not battle tested like VM which provides actual isolation. ● There are always ways for a root inside container to break out and do some nasty stuff.
  • 17. CVE-2019-5736 ● If a process is running with UID0 inside the container, it could replace the runc binary on the host and potentially can gain root on host ● This could have been clearly mitigated if root inside container is restricted by default.
  • 18.
  • 19. Solution to enforce non-root containers?
  • 21. What are PSP? ● It’s a cluster wide Kubernetes resource. ● It helps you assign secure defaults. ● You define various aspects of a pod security context & container security context. ● Define what UID, GID is allowed, capabilities a container can have inside container
  • 24. Where does PSP sit in? Image Source:: https://thenewstack.io/ebooks/kubernetes/kubernetes-deployment-and-security-patterns/
  • 28. Improving this state ● Educating folks of this awesome feature is the way to go ● The current state we are in because security has been an afterthought. ● Use secure practices from day1 of the development phase. ● The docker images and helm charts need a revamp.
  • 29. Secure Software Development Lifecycle S-SDLC Security should be given a iterative approach and not a waterfall one. - Cindy Blake
  • 30. Defense in depth - PSPs are not enough ● Network Policy ● Secure image building practices ● Audit Logging ● Avoid mounting service accounts ● Permissions on demand in RBAC ● Use containers that actually contain, e.g. katacontainers, kubevirt, gvisor, etc. ● Use admission plugin DenyEscalatingExec
  • 31. ● Containers don’t contain by Dan Walsh https://www.youtube.com/watch?v=a9lE9Urr6AQ ● Kubernetes Deployment and Security Patterns https://thenewstack.io/ebooks/kubernetes/kubernetes-deployment-and-security-patterns/ ● GKE Using PodSecurityPolicies https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies ● EKS support for PSP https://github.com/aws/containers-roadmap/issues/174 ● Hardening your cluster's security https://cloud.google.com/kubernetes-engine/docs/how-to/hardening-your-cluster ● Securing a Cluster https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/ ● Runc and CVE-2019-5736 https://kubernetes.io/blog/2019/02/11/runc-and-cve-2019-5736/ ● CVE-2019-5736 Detail https://nvd.nist.gov/vuln/detail/CVE-2019-5736 ● Kubernetes Security - Michael Hausenblas, Liz Rice https://www.oreilly.com/library/view/kubernetes-security/9781492039075/ ● Kubernetes logo https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png ● TheNewStack's - Kubernetes Deployment and Security Patterns https://thenewstack.io/ebooks/kubernetes/kubernetes-deployment-and-security-patterns/ ● How to Secure Your Kubernetes Clusters - Cindy Blake https://youtu.be/M6db_dK0HF4 ● Images running root stats https://github.com/surajssd/container-image-stats ● Running with Scissors - Liz Rice https://www.youtube.com/watch?v=ltrV-Qmh3oY ● Dilbert comic about firewall https://dilbert.com/strip/2013-04-07 ● AWS EKS Pod Security Policy support PR https://aws.amazon.com/blogs/opensource/using-pod-security-policies-amazon-eks-clusters/ ● OWASP secure defaults https://www.owasp.org/index.php/Establish_secure_defaults References