Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scale16x: A DevOps State of Mind: Continuous Security with Kubernetes

Scale16x: A DevOps State of Mind: Continuous Security with Kubernetes

With the rise of DevOps, containers are at the brink of becoming a pervasive technology in Enterprise IT to accelerate application delivery for the business. When it comes to adopting containers in the enterprise, Security is the highest adoption barrier. Is your organization ready to address the security risks with containers for your DevOps environment?

In this presentation, you'll learn about:

- The top security risks with containers and how to manage theses risks at scale including Images, Builds, Registry, Deployment, Hosts, Network, Storage, APIs, Monitoring/Logging, Federation.

- How to make your Container enabled DevOps workflow more secure without slowing down your CI/CD pipeline

- Automating security vulnerability management and compliance checking for container images

Also, a demo of Kubernetes managing the container image lifecycle, automating container security scans, and deployment strategies for security updates at scale including Canary, Blue/Green deployments and A/B testing.

Chris Van Tuin

March 11, 2018
Tweet

More Decks by Chris Van Tuin

Other Decks in Technology

Transcript

  1. A DEVOPS STATE OF MIND: Continuous Security with Kubernetes Chris

    Van Tuin Chief Technologist, NA West / Silicon Valley [email protected]
  2. INNOVATION & EXECUTION Shift to Executing at Scale in Dynamic

    Execution Innovation Innovation Execution
  3. DEV QA OPS Walled off people, walled off processes, walled

    off technologies “THROW IT OVER THE WALL”
  4. HOW DOES I.T. TRANSFORM FROM A COST CENTER INTO AN

    INNOVATION CENTER? Months Innovation
  5. Culture of experimentation A B 20% vs. 25% Empowered organization

    Time Change Rapid Innovation THE DISRUPTORS = AI /
 ML Data-driven intelligence Data, Data, Data
  6. DEV QA OPS Open organization + 
 cross-functional teams Software

    factory automation Linux + Containers IaaS Orchestration CI/CD Source Control Management Collaboration Build and Artifact Management Testing Frameworks Open Source CI/CD pipelines with feedback + + Culture Process Technology BREAKING DOWN THE WALLS WITH DEVOPS
  7. THE VALUE OF DEVOPS Faster Time to Market Security More

    time To Innovate Faster Resolution Of Problems More Stable Operating Environment Improved Communication & Collaboration Less Complex Less Risk
  8. DEV QA OPS SECURITY IS AN AFTERTHOUGHT | SECURITY |

    “Patch? The servers are behind the firewall.” - Anonymous (far too many to name), 2005 - …
  9. DEVSECOPS + + SECURITY DEV QA OPS Linux + Containers

    IaaS Orchestration CI/CD Source Control Management Collaboration Build and Artifact Management Testing Frameworks Open Source Culture Process Technology
  10. DEVSECOPS Continuous Security Improvement Process Optimization Security Automation Dev QA

    Prod Reduce Risks, Lower Costs, Speed Delivery, Speed Reaction
  11. docker.io Registry Private Registry FROM fedora:1.0 CMD echo “Hello” Build

    file Physical, Virtual, Cloud Image Container Build Run Ship CONTAINERS
  12. Web Database replicas=1, 
 role=db replicas=2, 
 role=web ORCHESTRATION Deployment,

    Declarative Nodes Controller Manager & Data Store (etcd)
  13. role=web role=db role=web Pods Nodes Image Registry ORCHESTRATION Schedule +

    Provision Pods (Compute/Storage/Network) Web replicas=2, 
 role=web ReplicaSet Database replicas=1, 
 role=db StatefulSet
  14. Web Database role=web role=db role=web replicas=1, 
 role=db replicas=2, 


    role=web ORCHESTRATION Service (Load Balancer) Pods Nodes Services Controller Manager & Data Store (etcd)
  15. HEALTH CHECK Monitoring & Logging Pods Nodes Services Web Database

    role=web role=db role=web replicas=1, 
 role=db replicas=2, 
 role=web
  16. HEALTH CHECK Pods Nodes Services Web Database role=web role=db role=web

    replicas=1, 
 role=db replicas=2, 
 role=web role=web Controller Manager & Data Store (etcd)
  17. Web Database replicas=1, 
 role=db replicas=2, 
 role=web HEALTH CHECK

    Pods Nodes Services role=web role=db role=web Controller Manager & Data Store (etcd)
  18. Web Database replicas=1, 
 role=db replicas=2, 
 role=web AUTO-SCALE Monitoring

    & Logging 80% CPU Pods Nodes Services role=web role=db role=web
  19. Web Database replicas=1, 
 role=db replicas=3 
 role=web AUTO-SCALE 80%

    CPU Pods Nodes Services role=web role=db role=web role=web Controller Manager & Data Store (etcd)
  20. Pods Nodes Services Web Database replicas=1, 
 role=db replicas=3 


    role=web AUTO-SCALE 50% CPU role=web role=db role=web role=web Controller Manager & Data Store (etcd)
  21. Network isolation Storage API & Platform access Monitoring & Logging

    Federated clusters Registry Container host {} Builds CI/CD Images SECURING CONTAINERS
  22. 4 • Are there known vulnerabilities in the application layer?

    • Are the runtime and OS layers up to date? • How frequently will the container be updated and how will I know when it’s updated? CONTENT: EACH LAYER MATTERS CONTAINER OS RUNTIME APPLICATION CONTENT: EACH LAYER MATTERS AYER MATTERS CONTAINER OS RUNTIME APPLICATION JAR CONTAINER
  23. code config data Kubernetes configmaps secrets Container image Traditional 


    data services, Kubernetes 
 persistent volumes TREAT CONTAINERS AS IMMUTABLE
  24. 64% of official images in Docker Hub 
 contain high

    priority security vulnerabilities examples: ShellShock (bash) Heartbleed (OpenSSL) Poodle (OpenSSL) Source: Over 30% of Official Images in Docker Hub Contain High Priority Security Vulnerabilities, Jayanth Gummaraju, Tarun Desikan, and Yoshio Turner, BanyanOps, May 2015 (http://www.banyanops.com/pdf/BanyanOps-AnalyzingDockerHub-WhitePaper.pdf) WHAT’S INSIDE THE CONTAINER MATTERS
  25. CI/CD PIPELINE Continuous Integration Continuous Build Continuous Deployment Developer ->

    Source -> Git Git -> RPMS -> Images-> Registry Images from 
 Registry -> Clusters
  26. FROM fedora:latest CMD echo “Hello” Build file Build Best Practices

    • Treat as a Blueprint • Don’t login to build/configure • Version control build file • Be explicit with versions, not latest • Each Run creates a new layer BUILDS
  27. AUTOMATED SECURITY SCANNING with OpenSCAP Reports Scan SCAP Security Guide

    for RHEL CCE-27002-5 Set Password Minimum Length Content Scan physical servers, virtual machines, docker images and containers
 for Security Policy Compliance (CCEs) and known Security Vulnerabilities (CVEs)
  28. Standard Docker Host Security Profile Java Runtime Environment (JRE) Upstream

    Firefox STIG RHEL OSP STIG Red Hat Corporate Profile for Certified Cloud Providers (RH CCP) STIG for Red Hat Enterprise Linux 6, 7 Server STIG for Red Hat Virtualization Hypervisor Common Profile for General-Purpose Debian Systems Common Profile for General-Purpose Fedora Systems Common Profile for General-Purpose Ubuntu Systems Payment Card Industry – Data Security Standard (PCI-DSS) v3 U.S. Government Commercial Cloud Services (C2S) CNSSI 1253 Low/Low/Low Control Baseline for Red Hat Enterprise Linux 7 Criminal Justice Information Services (CJIS) Security Policy Unclassified Information in Non-federal Information Systems and Organizations (NIST 800-171) U.S. Government Configuration Baseline (NIAP OSPP v4.0, USGCB, STIG) Security Policies in SCAP Security Guide (partial)
  29. CONTINUOUS DELIVERY DEPLOYMENT STRATEGIES DEPLOYMENT STRATEGIES • Recreate • Rolling

    updates • Blue / Green deployment • Canary deployments • A / B testing
  30. Version 1.2 Version 1.2 Version 1.2 RECREATE WITH DOWNTIME Use

    Case • Non-mission critical services Cons • Downtime Pros • Simple, clean • No Schema incompatibilities • No API versioning
  31. Version 1 Version 1 Version 1 Version 1.2 ` Tests

    / CI ROLLING UPDATES with ZERO DOWNTIME
  32. Deploy new version and wait until it’s ready… Version 1

    Version 1 V1.2 Health Check: readiness probe e.g. tcp, http, script V1
  33. Each container/pod is updated one by one Version 1.2 Version

    1.2 Version 1.2 100% Use Case • Horizontally scaled • Backward compatible API/data • Microservices Cons • Require backward compatible APIs/data • Resource overhead Pros • Zero downtime • Reduced risk, gradual rollout w/health checks • Ready for rollback
  34. Version 1 BLUE / GREEN DEPLOYMENT Rollback Route Version 1.2

    BLUE GREEN Use Case • Self-contained micro services (data) Cons • Resource overhead • Data synchronization Pros • Low risk, never change production • No downtime • Production like testing • Rollback
  35. ”only about 1/3 of ideas improve the metrics 
 they

    were designed to improve.”
 Ronny Kohavi, Microsoft (Amazon) MICROSERVICES RAPID INNNOVATION & EXPERIMENTATION
  36. Version 1.2 Version 1 100% Tests / CI Version 1.2

    Route 25% Conversion Rate ?! Conversion Rate CANARY DEPLOYMENTS
  37. 50% 50% Version 1.2 Version 1 Route Version 1.2 25%

    Conversion Rate 30% Conversion Rate CANARY DEPLOYMENTS
  38. 25% Conversion Rate 100% Version 1 Version 1.2 Route Version

    1.2 30% Conversion Rate CANARY DEPLOYMENTS
  39. Version 1.2 Version 1 100% Route Rollback 25% Conversion Rate

    20% Conversion Rate CANARY DEPLOYMENTS
  40. Kernel Hardware (Intel, AMD) or Virtual Machine Containers Containers Containers

    Unit File Docker Image Container CLI SYSTEMD Cgroups Namespaces SELinux Drivers CONTAINERS ARE LINUX seccomp Read Only mounts
  41. SELINUX - MANDATORY ACCESS CONTROLS Password Files Web Server Attacker

    Discretionary Access Controls 
 (file permissions) Mandatory Access Controls 
 (selinux) Internal Network Firewall Rules Password Files Firewall Rules Internal Network Web Server selinux policy
  42. Best Practices • Don’t run as root • Limit SSH

    Access • Use namespaces • Define resource quotas • Enable logging • Apply Security Errata • Apply Security Context and seccomp filters http://blog.kubernetes.io/2016/08/security-best-practices-kubernetes-deployment.html CONTAINER HOST SECURITY Kernel Hardware (Intel, AMD) or Virtual Machine Containers Containers Containers Unit File Docker Image Container SYSTEM Cgroup Namespace SELinu Driver seccom Read Only
  43. Network isolation Storage API & Platform access Monitoring & Logging

    Federated clusters Registry Container host {} Builds CI/CD Images SECURING CONTAINERS
  44. NETWORK POLICY example: 
 all pods in namespace ‘project-a’ allow

    traffic 
 from any other pods in the same namespace.”
  45. Authentication via OAuth tokens and SSL certificate Authorization via Policy

    Engine checks User/Group Defined Roles API & PLATFORM ACCESS
  46. Deployment Frequency Lead Time Deployment
 Failure Rate Mean Time to

    Recover 99.999 Service Availability DEVSECOPS METRICS Compliance Score