SlideShare a Scribd company logo
1
10 Tips for
Cloud Native Security
Karthik Gaekwad
Austin Developer Week 2018
10 Tips for better
Cloud Native Security
Karthik Gaekwad
@iteration1
•I’m Karthik Gaekwad
•NOT a DBA
•Cloud Native Evangelist at Oracle Cloud
•https://cloudnative.oracle.com/
•Past: Developer on the Oracle Managed
Kubernetes Team
Hello
@iteration1
Hello
• Been in Industry 15 years.
• In general, I like building stuff with friends.
• Maintainer for Gauntlt- Open source security scanner.
• Love Teaching and building community.
• Run Devopsdays Austin, Container Days, Cloud Austin.
• Chair All Day Devops Cloud Native track.
• LinkedIn Learning Author for Learning Kubernetes (and more).
The Cloud Native Journey
4
Phase I
Developer Focus
Phase II
DevOps Focus
Phase III
Business Focus
(end-to-end)
Container Adoption Application Deployment Intelligent Operations
SpeedEfficiencyAgility
Docker
Kubernetes
Core to Edge
Developer adoption
Dev/Test apps
Simple orchestration
Individual developers
DevOps deployment
Production apps
Advanced orchestration
Teams & lines of business
End-to-end integration
Digital business apps
Serverless, DevSecOps, & ML
Cloud native enterprises
Focus
Applications
Automation
Community
CNCF Survey: August 2018
How Does Your Company Use Containers and Where?
Lots of adoption on
dev/staging
Continued production
increase
CNCF Survey: August 2018
How Does Your Company Use Containers and Where?
Adoption over public and on-prem
Kubernetes Dominates Container
Management
Your company/organization manages
containers with:
Winner!
Kubernetes
Top 5 challenges to cloud native adoption…
0 5 10 15 20 25 30 35 40 45
Complexity
Cultural Challenges
Lack of Training
Security
Monitoring
Percentages
• Managing, maintaining, upgrading Kubernetes Control
Plane
• API Server, etcd, scheduler etc….
• Managing, maintaining, upgrading Kubernetes Data
Plane
• In place upgrades, deploy parallel cluster etc….
• Figuring out container networking & storage
• Overlays, persistent storage etc… - it should just work
• Managing Teams
• How do I manage & control team access to my clusters?
• Security, security, security
9
Kubernetes & Cloud Native Challenges
Source: Oracle Customer Survey 2018
How Are Teams Addressing Complexity, Training Issues?
App Management
Upgrades & Patching
Platform Backup &
Recovery
High Availability
Scaling
App Deployment
Power, HVAC
Rack and Stack
Server Provisioning
Software Installation
Customer Managed Fully-Managed
App Management
Upgrades & Patching
Platform Backup &
Recovery
High Availability
Scaling
App Deployment
Power, HVAC
Rack and Stack
Server Provisioning
Software Installation
 Faster Time to Deploy
 Lower Risk
 Accelerate Innovation
Fully managed
Benefits
YOU
Which brings us to security…
Where no news, is good news!
Unsecured K8s dashboards
• Unsecured Kubernetes
Dashboard with account creds.
• Used this to mine
cryptocurrency.
• 2017: Aviva
• 2018: Tesla, Weight Watchers
• https://redlock.io/blog/cryptojacking-
tesla
Kubelet credentials hack
• Shopify: Server Side request
Forgery
• Get kubelet certs/private key
• Root access to any container in
part of infrastructure.
• https://hackerone.com/reports/341876
CVE’s Happen…
Even more relevant with increased
production usage of containers…
CVE’s Happen…
Container
Escaping
Privilege
Escalation
10 tips for Cloud Native Security
10 tips for Cloud Native Security
10 tips for Cloud Native Security
How did we get here?
“Kubernetes is too complicated”
“Kubernetes is too complicated”
“We hope it’ll get easier”
What is your strate
Let’s look at:
•Attack Surface
• More importantly, how to limit damage
•Security related features in K8s
• The more you know, the better you build
•Opensource Tooling to help
• Because we all need help
Attack Surface
Attack Surface
Goal: Reduce the attack surface
•Analysis for:
•Host(s)
•Container (Images and running)
•Kubernetes Cluster
Attack Surface: Host
• These are the machines you’re running Kubernetes on.
• Age old principles of Linux still apply:
• Enable SELinux
• AppArmor
• Seccomp
• Hardened Images
• Goal: Minimize privilege to applications running on the host
• Good news: Already a wealth of information on this subject!
• http://lmgtfy.com/?q=how+to+reduce+attack+surface+linux
Attack Surface: Container Images
GOAL: Know your base image when
building containers
Attack Surface: Container Images
GOAL: Know your base image when building containers
**BTW, this is just a ruby helloworld app
Attack Surface: Container Images
GOAL: Know your base image when building containers
Full disclosure: I’m karthequian; I created this as a ruby 101 container for learning purposes only
Attack Surface: Container Images
GOAL: Know your base image when building containers
• When in doubt, stick to an official images!
• Or start from a sane base image (example: alpine linux)
Attack Surface: Container Images
GOAL: Smaller the image, the better
• Less things for an attacker to exploit.
• Quicker to push, quicker to pull.
Attack Surface: Container Images
GOAL: Don’t rely on :latest tag
• :latest image yesterday might not be :latest image tomorrow
• Instead, you’d want to know what specific version you’re operating
with.
• Side benefit: If there is a new vulnerability announced for OS version
x.y.z, you know immediately whether you’re running that version!
Attack Surface: Container Images
GOAL: Check for vulnerabilities
periodically
• Plenty of ways to do this in registries. We’ll cover more in the tooling
section
Attack Surface: Running Containers
GOAL: Don’t run as root
• Containers running as root might be completely unnecessary for the
actual application.
• If compromised, attacker can do a lot more things..
• Pod security policies can help (we’ll see how later).
Attack Surface: Running Containers
GOAL: Limit host mounts
• Be wary of images that require broad access to paths on the host.
• Limit your host mount to a smaller subset of directories.
• Reduces blast radius on compromise.
Attack Surface:
Kubernetes Cluster
Kubernetes Cluster- TLS
TLS ALL THE THINGS
Kubernetes Cluster- TLS
Kubernetes Cluster- TLS
• TLS Checklist:
1. User and Master
2. Nodes and Master
3. Everything etcd
4. Kubelet to API
Server
CVE’s
41
GOAL: Have an upgrade strategy
• Because…CVE’s are fixed in new minor versions.
• Don’t treat K8s as “install once, run all the time”.
• Make your K8s install repeatable for different versions.
• ..Or use a Managed Provider.
• Either automatically patch for you, or tell you what to do.
We’re a little
better off now.
But what else to do?
K8s Features
How can the platform help
me make secure choices?
K8s Features
• Kubernetes Secrets
• Authentication
• Authorization
• Audit Logging
• Network Policies
• Pod security policies
• Open Policy Agent
Kubernetes Secrets
• GOAL: Use Kubernetes secrets to store sensitive data instead of
config maps.
• Also look at: secrets encryption provider.
• Controls how etcd encrypts API data
• --experimental-encryption-provider-config
• https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/
Authentication and Authorization
• Do you know how you are authenticating with Kubernetes?
• Many ways to Authenticate
• Client Certs
• Static token file
• Service Account tokens
• OpenID
• Webhook Mode
• And more (https://kubernetes.io/docs/reference/access-authn-authz/authentication/)
Whatever you do,
DO NOT YOLO!
Goal: Pick a strategy that fits
your use case
You can pick an authz strategy..
If you DO NOT YOLO…
Authentication and Authorization
https://kubernetes.io/docs/reference/acc
ess-authn-authz/authorization/
Authentication and Authorization
• Pro tip: Nobody uses ABAC anymore. Don’t be that guy….
• RBAC is the defacto standard
• Based on roles and role bindings
• Good set of defaults: https://github.com/uruddarraju/kubernetes-rbac-policies
• Can use multiple authorizers together, but can get confusing.
• 1st authorizer to authorize passes authz
Kubernetes Cluster- Audit Logs
• Wat?
• “Kubernetes auditing provides a security-relevant chronological set of
records documenting the sequence of activities that have affected
system by individual users, administrators or other components of the
system.”
• Answers: What/when/who/where information on security events.
• Your job: Periodically watch Kubernetes Audit logs
• https://kubernetes.io/docs/tasks/debug-application-cluster/audit/
10 tips for Cloud Native Security
Kubernetes Cluster- Network Policies
• Consider adding a network policy to the cluster…
• Default Policy: All pods can talk to all other pods.
• Consider limiting this with a Network Policy
• https://kubernetes.io/docs/concepts/services-networking/network-policies/
Kubernetes Cluster- Pod Security Policies
• Consider adding Pod Security policies
• PodSecurityPolicy: A Defined set of conditions a pod must run with.
• Think of this as authorization for pods.
Kubernetes Cluster: Pod Security Policies
https://kubernetes.io/docs/concepts/policy/pod-security-policy/#what-is-a-pod-security-policy
Capability for an
admin to
control specific
actions
Open Policy Agent
• Policy based control for your whole environment.
• Full featured Policy Engine to offload policy decisions from each
application/service.
• Deploy OPA alongside your service
• Add policy data to OPA’s store
• Query OPA on decisions.
• Great idea, still early, watch this space…
• Standardize policies for all clusters
• https://www.openpolicyagent.org/
56
ToolingOpensource Tooling
Keep tabs on the CNCF Security landscape
https://landscape.cncf.io/landscape=security-complia
CNCF Projects
• “The Update Framework”
• Is a framework or a
methodology.
• Used for secure software
updates.
• Based on ideas surrounding trust
and integrity.
• Is a project.
• Based on TUF.
• A solution to secure software
updates and distribution.
• Used in Docker Trusted Registry.
Clair
• Open source project for the static analysis of vulnerabilities in
containers.
• Find vulnerable images in your repo.
• Built into quay.io, but you can add to your own repo.
• https://github.com/coreos/clair
10 tips for Cloud Native Security
Harbor
• Newer! CNCF Project
• Registry product
• Supports vulnerability scanning,
image signing and identity
control
• Scope is larger than clair
Harbor
Kube-bench
• Checks whether a Kubernetes cluster is deployed according to
security best practices.
• Run this after creating your K8s cluster.
• https://github.com/aquasecurity/kube-bench
• Defined by the CIS Benchmarks Docs: https://www.cisecurity.org/cis-
benchmarks/
• Run it against your Kubernetes Master, or Kubernetes node.
Kube-bench example
Kubesec
• Helps you quantify risk for Kubernetes resources.
• Run against your K8s applications (deployments/pods/daemonsets
etc)
• https://kubesec.io/ from controlplane
• Can be used standalone, or as a kubectl plugin
(https://github.com/stefanprodan/kubectl-kubesec)
Kubesec example
Kubeaudit
• Opensourced from Shopify.
• Auditing your applications in your K8s cluster.
• https://github.com/Shopify/kubeaudit
• Little more targeted than Kubesec.
10 tips for Cloud Native Security
Kubeaudit example
Put it all together…
71
Apply It!
72
• Day 1:
• Know what version of Docker and Kubernetes you use.
• Understand if your control and data plane nodes are
hardened.
• Understand how your Docker containers are built.
• Find out how you authenticate and authorize for your
clusters.
Apply It!
73
•Week 1:
•Build an Automation Pipeline:
• To build Docker images on code pushes
• Versioning strategy for code
• To build your Kubernetes clusters
Apply It!
74
•1st Month
•Sanitize your code:
• Know your base images
• Implement versioning for your containers
• Invest in a registry (or tooling) that does vulnerability
scanning
•Kubernetes:
• Have an upgrade strategy in place
• Analyze secrets/sensitive cluster data
• Turn on audit logging
Apply It!
75
• 3 Months:
• Continuously Monitor
• Tooling like Kubesec/Kube-audit
• Plan how to address vulnerabilities/CVE’s
• K8s:
• Strategy for Pod Security Policies
• Strategy for Network Policies
• Run scans (like kube-bench) on cluster creation
Apply It!
76
•6 Months:
•Re-ask day 1 questions.
•Review strategies- is it working? What needs
tweaking?
•Review tooling- are there new tools that help? Are
existing tools working?
•Review CVE’s
Couple more resources to look at:
• 11 ways not to get hacked:
https://kubernetes.io/blog/2018/07/18/11-ways-not-to-get-hacked
• K8s security (from Image Hygiene to Network Policy):
https://speakerdeck.com/mhausenblas/kubernetes-security-from-
image-hygiene-to-network-policies
KEEP CALM
AND
KUBE ON
@iteration1

More Related Content

PPTX
DevSecOps in a cloudnative world
PPTX
Practical Approaches to Cloud Native Security
PPTX
Kube Apps in action
PDF
Kubernetes security and you
PDF
DCSF19 Containerized Databases for Enterprise Applications
PPTX
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
PPTX
PKS - Solving Complexity for Modern Data Workloads
PDF
Cisco Cloud Networking Workshop
DevSecOps in a cloudnative world
Practical Approaches to Cloud Native Security
Kube Apps in action
Kubernetes security and you
DCSF19 Containerized Databases for Enterprise Applications
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
PKS - Solving Complexity for Modern Data Workloads
Cisco Cloud Networking Workshop

What's hot (20)

PPTX
Weave User Group Talk - DockerCon 2017 Recap
PDF
Cloud Native Security: New Approach for a New Reality
PDF
Practical Guide to Securing Kubernetes
PDF
DCSF 19 Improving the Human Condition with Docker
PPTX
Orchestrating stateful applications with PKS and Portworx
PDF
Monitoring Your AWS EKS Environment with Datadog
PDF
Driving Digital Transformation With Containers And Kubernetes Complete Deck
PDF
ADDO 2020: "The past, present, and future of cloud native API gateways"
PDF
Making Friendly Microservices by Michele Titlol
PDF
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
PPTX
Docker Cap Gemini CloudXperience 2017 - la revolution des conteneurs logiciels
PDF
Containers - Transforming the data centre as we know it 2016
PDF
Fully Orchestrating Applications, Microservices and Enterprise Services with ...
PDF
App sec in the time of docker containers
PDF
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
PPTX
Oscon 2017: Build your own container-based system with the Moby project
PDF
Container Security Essentials
PDF
Netflix Open Source Meetup Season 4 Episode 3
PPTX
Cloud Native Summit 2019 Summary
PDF
Barbican 1.0 - Open Source Key Management for OpenStack
Weave User Group Talk - DockerCon 2017 Recap
Cloud Native Security: New Approach for a New Reality
Practical Guide to Securing Kubernetes
DCSF 19 Improving the Human Condition with Docker
Orchestrating stateful applications with PKS and Portworx
Monitoring Your AWS EKS Environment with Datadog
Driving Digital Transformation With Containers And Kubernetes Complete Deck
ADDO 2020: "The past, present, and future of cloud native API gateways"
Making Friendly Microservices by Michele Titlol
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
Docker Cap Gemini CloudXperience 2017 - la revolution des conteneurs logiciels
Containers - Transforming the data centre as we know it 2016
Fully Orchestrating Applications, Microservices and Enterprise Services with ...
App sec in the time of docker containers
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
Oscon 2017: Build your own container-based system with the Moby project
Container Security Essentials
Netflix Open Source Meetup Season 4 Episode 3
Cloud Native Summit 2019 Summary
Barbican 1.0 - Open Source Key Management for OpenStack
Ad

Similar to 10 tips for Cloud Native Security (20)

PPTX
Kubernetes Security
PDF
Moving a Monolith to Kubernetes
PPTX
Simplify Your Way To Expert Kubernetes Management
PDF
Agile Secure Cloud Application Development Management
PPTX
Database as a Service (DBaaS) on Kubernetes
PDF
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
PPTX
Why kubernetes matters
PPTX
Kubernetes and container security
PPTX
Kubernetes: від знайомства до використання у CI/CD
PDF
Kubernetes deep dive - - Huawei 2015-10
PDF
WSO2Con USA 2015: Keynote - Kubernetes – A Platform for Automating Deployment...
PDF
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
PPTX
Why to Cloud Native
PPTX
Stop Caring About Kubernetes
PPTX
Kubernetes @ meetic
PDF
DCSF19 Container Security: Theory & Practice at Netflix
PPTX
DefCore: The Interoperability Standard for OpenStack
PDF
Containers, microservices and serverless for realists
PDF
Secure your K8s cluster from multi-layers
PDF
From Containerized Application to Secure and Scaling With Kubernetes
Kubernetes Security
Moving a Monolith to Kubernetes
Simplify Your Way To Expert Kubernetes Management
Agile Secure Cloud Application Development Management
Database as a Service (DBaaS) on Kubernetes
4Developers 2018: Zero-Downtime deployments with Kubernetes (Mateusz Dymiński)
Why kubernetes matters
Kubernetes and container security
Kubernetes: від знайомства до використання у CI/CD
Kubernetes deep dive - - Huawei 2015-10
WSO2Con USA 2015: Keynote - Kubernetes – A Platform for Automating Deployment...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
Why to Cloud Native
Stop Caring About Kubernetes
Kubernetes @ meetic
DCSF19 Container Security: Theory & Practice at Netflix
DefCore: The Interoperability Standard for OpenStack
Containers, microservices and serverless for realists
Secure your K8s cluster from multi-layers
From Containerized Application to Secure and Scaling With Kubernetes
Ad

More from Karthik Gaekwad (19)

PDF
Mental Health studies and devops
PPTX
This is your community
PPTX
KubeSecOps
PPTX
Kube applications in action
PDF
Devops and Dadops
PDF
Containers and microservices for realists
PDF
13 practical tips for writing secure golang applications
PPTX
Why to docker
PDF
Docker management
PDF
Agile 2014- Metrics driven development and devops
PDF
Devopsdays Austin 2014 Ignite: Keep devops weird
PDF
Cloud Austin 2013: Conferenced2013
PDF
LASCON 2013 Talk: User Auth for Winners, how to get it right the first time!
PDF
Agile 2013 Talk: How DevOps Changes Everything
PDF
DevOps at the CIA
PDF
Sexy HTML with Twitter Bootstrap
PPTX
12 Clouds of Christmas 2012- Stormpath
PPTX
We built this city on Dev and Ops
PPTX
30 days or less: New Features to Production
Mental Health studies and devops
This is your community
KubeSecOps
Kube applications in action
Devops and Dadops
Containers and microservices for realists
13 practical tips for writing secure golang applications
Why to docker
Docker management
Agile 2014- Metrics driven development and devops
Devopsdays Austin 2014 Ignite: Keep devops weird
Cloud Austin 2013: Conferenced2013
LASCON 2013 Talk: User Auth for Winners, how to get it right the first time!
Agile 2013 Talk: How DevOps Changes Everything
DevOps at the CIA
Sexy HTML with Twitter Bootstrap
12 Clouds of Christmas 2012- Stormpath
We built this city on Dev and Ops
30 days or less: New Features to Production

Recently uploaded (20)

PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
Sustainable Sites - Green Building Construction
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Geodesy 1.pptx...............................................
PPT
Project quality management in manufacturing
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Welding lecture in detail for understanding
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
CYBER-CRIMES AND SECURITY A guide to understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Operating System & Kernel Study Guide-1 - converted.pdf
Construction Project Organization Group 2.pptx
Sustainable Sites - Green Building Construction
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Arduino robotics embedded978-1-4302-3184-4.pdf
Geodesy 1.pptx...............................................
Project quality management in manufacturing
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Lecture Notes Electrical Wiring System Components
Welding lecture in detail for understanding
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Structs to JSON How Go Powers REST APIs.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd

10 tips for Cloud Native Security

  • 1. 1 10 Tips for Cloud Native Security Karthik Gaekwad Austin Developer Week 2018 10 Tips for better Cloud Native Security Karthik Gaekwad @iteration1
  • 2. •I’m Karthik Gaekwad •NOT a DBA •Cloud Native Evangelist at Oracle Cloud •https://cloudnative.oracle.com/ •Past: Developer on the Oracle Managed Kubernetes Team Hello @iteration1
  • 3. Hello • Been in Industry 15 years. • In general, I like building stuff with friends. • Maintainer for Gauntlt- Open source security scanner. • Love Teaching and building community. • Run Devopsdays Austin, Container Days, Cloud Austin. • Chair All Day Devops Cloud Native track. • LinkedIn Learning Author for Learning Kubernetes (and more).
  • 4. The Cloud Native Journey 4 Phase I Developer Focus Phase II DevOps Focus Phase III Business Focus (end-to-end) Container Adoption Application Deployment Intelligent Operations SpeedEfficiencyAgility Docker Kubernetes Core to Edge Developer adoption Dev/Test apps Simple orchestration Individual developers DevOps deployment Production apps Advanced orchestration Teams & lines of business End-to-end integration Digital business apps Serverless, DevSecOps, & ML Cloud native enterprises Focus Applications Automation Community
  • 5. CNCF Survey: August 2018 How Does Your Company Use Containers and Where? Lots of adoption on dev/staging Continued production increase
  • 6. CNCF Survey: August 2018 How Does Your Company Use Containers and Where? Adoption over public and on-prem
  • 7. Kubernetes Dominates Container Management Your company/organization manages containers with: Winner! Kubernetes
  • 8. Top 5 challenges to cloud native adoption… 0 5 10 15 20 25 30 35 40 45 Complexity Cultural Challenges Lack of Training Security Monitoring Percentages
  • 9. • Managing, maintaining, upgrading Kubernetes Control Plane • API Server, etcd, scheduler etc…. • Managing, maintaining, upgrading Kubernetes Data Plane • In place upgrades, deploy parallel cluster etc…. • Figuring out container networking & storage • Overlays, persistent storage etc… - it should just work • Managing Teams • How do I manage & control team access to my clusters? • Security, security, security 9 Kubernetes & Cloud Native Challenges Source: Oracle Customer Survey 2018
  • 10. How Are Teams Addressing Complexity, Training Issues? App Management Upgrades & Patching Platform Backup & Recovery High Availability Scaling App Deployment Power, HVAC Rack and Stack Server Provisioning Software Installation Customer Managed Fully-Managed App Management Upgrades & Patching Platform Backup & Recovery High Availability Scaling App Deployment Power, HVAC Rack and Stack Server Provisioning Software Installation  Faster Time to Deploy  Lower Risk  Accelerate Innovation Fully managed Benefits YOU
  • 11. Which brings us to security…
  • 12. Where no news, is good news!
  • 13. Unsecured K8s dashboards • Unsecured Kubernetes Dashboard with account creds. • Used this to mine cryptocurrency. • 2017: Aviva • 2018: Tesla, Weight Watchers • https://redlock.io/blog/cryptojacking- tesla
  • 14. Kubelet credentials hack • Shopify: Server Side request Forgery • Get kubelet certs/private key • Root access to any container in part of infrastructure. • https://hackerone.com/reports/341876
  • 15. CVE’s Happen… Even more relevant with increased production usage of containers…
  • 20. How did we get here?
  • 21. “Kubernetes is too complicated”
  • 22. “Kubernetes is too complicated” “We hope it’ll get easier”
  • 23. What is your strate
  • 24. Let’s look at: •Attack Surface • More importantly, how to limit damage •Security related features in K8s • The more you know, the better you build •Opensource Tooling to help • Because we all need help
  • 26. Attack Surface Goal: Reduce the attack surface •Analysis for: •Host(s) •Container (Images and running) •Kubernetes Cluster
  • 27. Attack Surface: Host • These are the machines you’re running Kubernetes on. • Age old principles of Linux still apply: • Enable SELinux • AppArmor • Seccomp • Hardened Images • Goal: Minimize privilege to applications running on the host • Good news: Already a wealth of information on this subject! • http://lmgtfy.com/?q=how+to+reduce+attack+surface+linux
  • 28. Attack Surface: Container Images GOAL: Know your base image when building containers
  • 29. Attack Surface: Container Images GOAL: Know your base image when building containers **BTW, this is just a ruby helloworld app
  • 30. Attack Surface: Container Images GOAL: Know your base image when building containers Full disclosure: I’m karthequian; I created this as a ruby 101 container for learning purposes only
  • 31. Attack Surface: Container Images GOAL: Know your base image when building containers • When in doubt, stick to an official images! • Or start from a sane base image (example: alpine linux)
  • 32. Attack Surface: Container Images GOAL: Smaller the image, the better • Less things for an attacker to exploit. • Quicker to push, quicker to pull.
  • 33. Attack Surface: Container Images GOAL: Don’t rely on :latest tag • :latest image yesterday might not be :latest image tomorrow • Instead, you’d want to know what specific version you’re operating with. • Side benefit: If there is a new vulnerability announced for OS version x.y.z, you know immediately whether you’re running that version!
  • 34. Attack Surface: Container Images GOAL: Check for vulnerabilities periodically • Plenty of ways to do this in registries. We’ll cover more in the tooling section
  • 35. Attack Surface: Running Containers GOAL: Don’t run as root • Containers running as root might be completely unnecessary for the actual application. • If compromised, attacker can do a lot more things.. • Pod security policies can help (we’ll see how later).
  • 36. Attack Surface: Running Containers GOAL: Limit host mounts • Be wary of images that require broad access to paths on the host. • Limit your host mount to a smaller subset of directories. • Reduces blast radius on compromise.
  • 38. Kubernetes Cluster- TLS TLS ALL THE THINGS
  • 40. Kubernetes Cluster- TLS • TLS Checklist: 1. User and Master 2. Nodes and Master 3. Everything etcd 4. Kubelet to API Server
  • 41. CVE’s 41 GOAL: Have an upgrade strategy • Because…CVE’s are fixed in new minor versions. • Don’t treat K8s as “install once, run all the time”. • Make your K8s install repeatable for different versions. • ..Or use a Managed Provider. • Either automatically patch for you, or tell you what to do.
  • 42. We’re a little better off now. But what else to do?
  • 43. K8s Features How can the platform help me make secure choices?
  • 44. K8s Features • Kubernetes Secrets • Authentication • Authorization • Audit Logging • Network Policies • Pod security policies • Open Policy Agent
  • 45. Kubernetes Secrets • GOAL: Use Kubernetes secrets to store sensitive data instead of config maps. • Also look at: secrets encryption provider. • Controls how etcd encrypts API data • --experimental-encryption-provider-config • https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/
  • 46. Authentication and Authorization • Do you know how you are authenticating with Kubernetes? • Many ways to Authenticate • Client Certs • Static token file • Service Account tokens • OpenID • Webhook Mode • And more (https://kubernetes.io/docs/reference/access-authn-authz/authentication/)
  • 47. Whatever you do, DO NOT YOLO! Goal: Pick a strategy that fits your use case
  • 48. You can pick an authz strategy.. If you DO NOT YOLO…
  • 50. Authentication and Authorization • Pro tip: Nobody uses ABAC anymore. Don’t be that guy…. • RBAC is the defacto standard • Based on roles and role bindings • Good set of defaults: https://github.com/uruddarraju/kubernetes-rbac-policies • Can use multiple authorizers together, but can get confusing. • 1st authorizer to authorize passes authz
  • 51. Kubernetes Cluster- Audit Logs • Wat? • “Kubernetes auditing provides a security-relevant chronological set of records documenting the sequence of activities that have affected system by individual users, administrators or other components of the system.” • Answers: What/when/who/where information on security events. • Your job: Periodically watch Kubernetes Audit logs • https://kubernetes.io/docs/tasks/debug-application-cluster/audit/
  • 53. Kubernetes Cluster- Network Policies • Consider adding a network policy to the cluster… • Default Policy: All pods can talk to all other pods. • Consider limiting this with a Network Policy • https://kubernetes.io/docs/concepts/services-networking/network-policies/
  • 54. Kubernetes Cluster- Pod Security Policies • Consider adding Pod Security policies • PodSecurityPolicy: A Defined set of conditions a pod must run with. • Think of this as authorization for pods.
  • 55. Kubernetes Cluster: Pod Security Policies https://kubernetes.io/docs/concepts/policy/pod-security-policy/#what-is-a-pod-security-policy Capability for an admin to control specific actions
  • 56. Open Policy Agent • Policy based control for your whole environment. • Full featured Policy Engine to offload policy decisions from each application/service. • Deploy OPA alongside your service • Add policy data to OPA’s store • Query OPA on decisions. • Great idea, still early, watch this space… • Standardize policies for all clusters • https://www.openpolicyagent.org/ 56
  • 58. Keep tabs on the CNCF Security landscape https://landscape.cncf.io/landscape=security-complia
  • 59. CNCF Projects • “The Update Framework” • Is a framework or a methodology. • Used for secure software updates. • Based on ideas surrounding trust and integrity. • Is a project. • Based on TUF. • A solution to secure software updates and distribution. • Used in Docker Trusted Registry.
  • 60. Clair • Open source project for the static analysis of vulnerabilities in containers. • Find vulnerable images in your repo. • Built into quay.io, but you can add to your own repo. • https://github.com/coreos/clair
  • 62. Harbor • Newer! CNCF Project • Registry product • Supports vulnerability scanning, image signing and identity control • Scope is larger than clair
  • 64. Kube-bench • Checks whether a Kubernetes cluster is deployed according to security best practices. • Run this after creating your K8s cluster. • https://github.com/aquasecurity/kube-bench • Defined by the CIS Benchmarks Docs: https://www.cisecurity.org/cis- benchmarks/ • Run it against your Kubernetes Master, or Kubernetes node.
  • 66. Kubesec • Helps you quantify risk for Kubernetes resources. • Run against your K8s applications (deployments/pods/daemonsets etc) • https://kubesec.io/ from controlplane • Can be used standalone, or as a kubectl plugin (https://github.com/stefanprodan/kubectl-kubesec)
  • 68. Kubeaudit • Opensourced from Shopify. • Auditing your applications in your K8s cluster. • https://github.com/Shopify/kubeaudit • Little more targeted than Kubesec.
  • 71. Put it all together… 71
  • 72. Apply It! 72 • Day 1: • Know what version of Docker and Kubernetes you use. • Understand if your control and data plane nodes are hardened. • Understand how your Docker containers are built. • Find out how you authenticate and authorize for your clusters.
  • 73. Apply It! 73 •Week 1: •Build an Automation Pipeline: • To build Docker images on code pushes • Versioning strategy for code • To build your Kubernetes clusters
  • 74. Apply It! 74 •1st Month •Sanitize your code: • Know your base images • Implement versioning for your containers • Invest in a registry (or tooling) that does vulnerability scanning •Kubernetes: • Have an upgrade strategy in place • Analyze secrets/sensitive cluster data • Turn on audit logging
  • 75. Apply It! 75 • 3 Months: • Continuously Monitor • Tooling like Kubesec/Kube-audit • Plan how to address vulnerabilities/CVE’s • K8s: • Strategy for Pod Security Policies • Strategy for Network Policies • Run scans (like kube-bench) on cluster creation
  • 76. Apply It! 76 •6 Months: •Re-ask day 1 questions. •Review strategies- is it working? What needs tweaking? •Review tooling- are there new tools that help? Are existing tools working? •Review CVE’s
  • 77. Couple more resources to look at: • 11 ways not to get hacked: https://kubernetes.io/blog/2018/07/18/11-ways-not-to-get-hacked • K8s security (from Image Hygiene to Network Policy): https://speakerdeck.com/mhausenblas/kubernetes-security-from- image-hygiene-to-network-policies

Editor's Notes

  • #2: Photo by Piotr Chrobot on Unsplash
  • #10: However, customers face challenges along the way.  As we have spoken to customers, many have agreed with the challenges presented on this slide.
  • #11: Faster Time to Deploy No need to provision and maintain Operating System and Platforms (Linux, Kubernetes, Docker Registry, Continuous Integration Systems) Lower Risk Oracle is committed to SLAs on Performance and Manageability, in addition to Availability Accelerate Innovation Develop new Container Native apps quickly, and port existing apps faster
  • #16: Photo by rawpixel on Unsplash
  • #17: Photo by rawpixel on Unsplash
  • #22: Photo by Byron Sterk on Unsplash
  • #23: Photo by Byron Sterk on Unsplash
  • #24: Photo by rawpixel on Unsplash
  • #26: Photo by rawpixel on Unsplash
  • #38: Photo by rawpixel on Unsplash
  • #40: Diagram from https://docs.google.com/presentation/d/1Gp-2blk5WExI_QR59EUZdwfO2BWLJqa626mK2ej-huo/edit#slide=id.g1e639c415b_0_56. Thanks @Lucas Käldström
  • #48: Photo by Mikhail Vasilyev on Unsplash
  • #49: Photo by Mikhail Vasilyev on Unsplash
  • #57: https://www.openpolicyagent.org/docs/how-does-opa-work.html#overview
  • #58: Photo by Barn Images on Unsplash
  • #72: Photo by Damon Lam on Unsplash
  • #73: Photo by Damon Lam on Unsplash
  • #74: Photo by Damon Lam on Unsplash
  • #75: Photo by Damon Lam on Unsplash
  • #76: Photo by Damon Lam on Unsplash
  • #77: Photo by Damon Lam on Unsplash