SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
Jorge Salamero Sanz
Lions, Tigers and Deers:
What building zoos
can teach us about
securing microservices?
% whoami
Jorge Salamero Sanz
<jorge.salamero@sysdig.com> @bencerillo
@sysdig
• Working on OSS last 12 years
• Working on OSS+Cloud last 5 years
• Working on monitoring last 3 years
• Technical Marketing geek @sysdig
Sysdig
Open Source system troubleshooting
with native container support
(htop, vmstat, netstat, lsof, tcpdump…)
Monitoring, alerting,
troubleshooting tool for
Docker, Kubernetes, Mesos,
RancherOS, GCE, ECS
Traditional deployment
Full host OS
kernel
systemd
syslogd
App services
MySQL
Nginx
OpenSSL
Java
App A
App B
App C
Ops Devs
Containerized deployment
Full host OS
kernel
+
Docker
MySQL App A
Ops DevOps
Nginx + OpenSSL App B
Java 8.0 build XXX App C
How to secure this?
Containerization is not something new to us...
• Establish trust boundaries
• Identify, minimise, and harden attack surfaces
• Reduce scope and access
• Layer protections and defenses
From Aaron Grattafiori presented “The Golden Ticket: Docker and High Security Microservices
Securing Microservices
Defense in depth Microservices
Single responsibility principle:
• Principle of least privileges
• Principle of least surprise
• Principle of least access
Container Security Techniques
• New workflows (docker pull vs previous apt update/yum update)
• CI/CD Pipeline (Jenkins, Openshift, etc: rebuilds, rolling updates)
• Access management, logging & auditing (Kubernetes, Openshift:
user roles, namespaces, centralized logging, authn & authz, etc)
• Trust boundaries (do you trust entire Docker Hub? Image signing, Docker Notary)
• Simplify container OS, tons of useless stuff (RancherOS, Atomic,
CoreOS, Alpine Linux, etc)
• Network security (Weave, etc)
• Secret management (Vaults instead of environment vars, etc)
Docker Security Techniques
• Drop privileges
• Limit capabilities
• Do not run as root! containers are not VMs!
• cgroups
• Limit resources share, not access restriction
• namespaces
• Useful for not complete security model
• User namespaces
• Kubernetes/Openshift security contexts
• Host security and access (Docker bench, RO access, etc)
Scanning
What are my containers doing?
• Static scanning
• Dynamic scanning
Static Scanning
Yay, this was soo easy to deploy! I Docker Hub!
(your developers too, actually they were already using it :P)
uhm… wait, is someone maintaining this image?
RUN apt-get install -y wget build-essential python python-dev python-pip
python-virtualenv
RUN wget http://nodejs.org/dist/node-latest.tar.gz
RUN tar xvzf node-latest.tar.gz
RUN cd node-v* && ./configure && CXX="g++ -Wno-unused-local-typedefs" make && CXX="g++
-Wno-unused-local-typedefs" make install
• Static Scanning:
• CoreOS Clair, Docker Nautilus, Red Hat CloudForms,
etc
Image Vulnerability Scanning
• Scan contents of images looking for software versions with
known defects
• Container image layering can make this efficient (exploits
immutable nature of images)
Ubuntu: 14.04
Apache: 2.2
Wordpress: 4.6 PHP: 7.0
Image Vulnerability Scanning
• Scan contents of images looking for software versions with
known defects
• Container image layering can make this efficient (exploits
immutable nature of images)
•
Ubuntu: 14.04
Apache: 2.2
Wordpress: 4.6 PHP: 7.0
Image Vulnerability Scanning
• Scan contents of images looking for software versions with
known defects
• Container image layering can make this efficient (exploits
immutable nature of images)
•
Ubuntu: 14.04
Apache: 2.2
Wordpress: 4.6 PHP: 7.0
Image Vulnerability Scanning
• Scan contents of images looking for software versions with
known defects
• Container image layering can make this efficient (exploits
immutable nature of images)
•
Ubuntu: 14.04
Apache: 2.2
Wordpress: 4.6 PHP: 7.0
Container Security Techniques
OK, no known vulnerabilities, still secure?
Containers are black boxes exposing a behaviour, is
something misbehaving?
• Dynamic Scanning:
• Seccomp
• MAC (Mandatory Access Control)
• Behavioral Security Monitoring
Seccomp
• Seccomp: application system call “sandboxing”
• Create filter (BPF program ) with lists of allowed syscalls
• Each syscall matched against filter
• Failures-> log message, error return, and/or kill process
• Docker runs containerized process under a seccomp profile
• Notable disallowed syscalls:
• clone (creating new namespaces)
• reboot (reboot the host)
• setns (change namespaces)
Mandatory Access Control
• SELinux or AppArmor
• Same mechanisms: kernel-level interception/filtering
• features++ && complexity++
• Above syscalls:
• Actors (process)
• Actions (read/write on files/sockets)
• Targets (files, IPs, ports)
• But what if I only want to put some surveillance in?
Behavioral Security Monitoring
• Auditing vs enforcement
• detect intrusions instead of preventing intrusions
• Build rules that define suspicious/anomalous behavior
• Match rules against activity on a system
• Auditd (SELinux logger)
• Falco (with container capabilities)
Sysdig Falco
An anomaly detection system built on
top of the sysdig engine
Sysdig ContainerVision
Kernel
Docker
Container
1
Container
2
Container
3
App App
rkt LXC
Kernel module
Instrumentation
What is Sysdig Falco?
• Detects suspicious activity defined by a set of easy
rules
• Uses sysdig’s flexible and powerful filtering expressions
(in userspace)
• Container support (Docker, Kubernetes, Mesos, etc)
• Flexible notification methods
• Open Source
Quick Examples
A shell is run in a container container.id != host and proc.name = bash
Overwrite system binaries
fd.directory in (/bin, /sbin, /usr/bin,
/usr/sbin) and write
Container namespace change
evt.type = setns and not proc.name in
(docker, sysdig)
Non-device files written in /dev
(evt.type = creat or evt.arg.flags contains
O_CREAT) and proc.name != blkid and
fd.directory = /dev and fd.name != /dev/null
Process tries to access camera
evt.type = open and fd.name = /dev/video0
and not proc.name in (skype, webex)
Falco Rules
• .yaml file containing Macros, Lists, and Rules
- macro: bin_dir
condition: fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin)
- list: package_mgmt_binaries
items: [dpkg, dpkg-preconfigu, rpm, rpmkey, yum, frontend]
- rule: write_binary_dir
desc: an attempt to write to any file below a set of binary directories
condition: bin_dir and evt.dir = < and open_write and not package_mgmt_procs
output: "File below a known binary directory opened for writing
(user=%user.name command=%proc.cmdline file=%fd.name)"
priority: WARNING
Alerts and Outputs
• Events that match filter expression (rule) result in alerts
• output field used to format event into alert message
• Sending to:
• syslog
• file
• stdout
• shell (e.g. mail -s "Falco Notification" alerts@example.com)
• Sysdig Cloud
Falco Demo
Remember
Container behaviour security monitoring
shouldn’t be difficult...
Learn More
Thank You!

Más contenido relacionado

La actualidad más candente

Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...
Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...
Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...Cloud Native Day Tel Aviv
 
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...Docker, Inc.
 
A Distributed Malware Analysis System Cuckoo Sandbox
A Distributed Malware Analysis System Cuckoo SandboxA Distributed Malware Analysis System Cuckoo Sandbox
A Distributed Malware Analysis System Cuckoo SandboxAndy Lee
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerJeff Anderson
 
Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Docker, Inc.
 
Secure Substrate: Least Privilege Container Deployment
Secure Substrate: Least Privilege Container Deployment Secure Substrate: Least Privilege Container Deployment
Secure Substrate: Least Privilege Container Deployment Docker, Inc.
 
Containers technologies
Containers technologiesContainers technologies
Containers technologiesJoris Bonnefoy
 
Practical Approaches to Container Security
Practical Approaches to Container SecurityPractical Approaches to Container Security
Practical Approaches to Container SecurityShea Stewart
 
Container Monitoring with Sysdig
Container Monitoring with SysdigContainer Monitoring with Sysdig
Container Monitoring with SysdigSreenivas Makam
 
All Things Open 2017: How to Treat a Network as a Container
All Things Open 2017: How to Treat a Network as a ContainerAll Things Open 2017: How to Treat a Network as a Container
All Things Open 2017: How to Treat a Network as a ContainerRosemary Wang
 
5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and Beyond5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and BeyondBlack Duck by Synopsys
 
Securing your Container Environment with Open Source
Securing your Container Environment with Open SourceSecuring your Container Environment with Open Source
Securing your Container Environment with Open SourceMichael Ducy
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloudDobrica Pavlinušić
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Nicolas De Loof
 
Docker Online Meetup #31: Unikernels
Docker Online Meetup #31: UnikernelsDocker Online Meetup #31: Unikernels
Docker Online Meetup #31: UnikernelsDocker, Inc.
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101inside-BigData.com
 
Ten layers of container security for CloudCamp Nov 2017
Ten layers of container security  for CloudCamp Nov 2017Ten layers of container security  for CloudCamp Nov 2017
Ten layers of container security for CloudCamp Nov 2017Gordon Haff
 
DockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep DiveDockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep DiveDocker, Inc.
 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeLee Calcote
 

La actualidad más candente (20)

Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...
Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...
Kafka Mirror Tester: Go and Kubernetes Powered Test Suite for Kafka Replicati...
 
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
DockerCon EU 2015: Docker and PCI-DSS - Lessons learned in a security sensiti...
 
A Distributed Malware Analysis System Cuckoo Sandbox
A Distributed Malware Analysis System Cuckoo SandboxA Distributed Malware Analysis System Cuckoo Sandbox
A Distributed Malware Analysis System Cuckoo Sandbox
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support Engineer
 
Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?
 
Secure Substrate: Least Privilege Container Deployment
Secure Substrate: Least Privilege Container Deployment Secure Substrate: Least Privilege Container Deployment
Secure Substrate: Least Privilege Container Deployment
 
Containers technologies
Containers technologiesContainers technologies
Containers technologies
 
Practical Approaches to Container Security
Practical Approaches to Container SecurityPractical Approaches to Container Security
Practical Approaches to Container Security
 
Container Monitoring with Sysdig
Container Monitoring with SysdigContainer Monitoring with Sysdig
Container Monitoring with Sysdig
 
All Things Open 2017: How to Treat a Network as a Container
All Things Open 2017: How to Treat a Network as a ContainerAll Things Open 2017: How to Treat a Network as a Container
All Things Open 2017: How to Treat a Network as a Container
 
5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and Beyond5 Ways to Secure Your Containers for Docker and Beyond
5 Ways to Secure Your Containers for Docker and Beyond
 
Securing your Container Environment with Open Source
Securing your Container Environment with Open SourceSecuring your Container Environment with Open Source
Securing your Container Environment with Open Source
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
 
Security of Linux containers in the cloud
Security of Linux containers in the cloudSecurity of Linux containers in the cloud
Security of Linux containers in the cloud
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge
 
Docker Online Meetup #31: Unikernels
Docker Online Meetup #31: UnikernelsDocker Online Meetup #31: Unikernels
Docker Online Meetup #31: Unikernels
 
Linux Container Technology 101
Linux Container Technology 101Linux Container Technology 101
Linux Container Technology 101
 
Ten layers of container security for CloudCamp Nov 2017
Ten layers of container security  for CloudCamp Nov 2017Ten layers of container security  for CloudCamp Nov 2017
Ten layers of container security for CloudCamp Nov 2017
 
DockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep DiveDockerCon EU 2015: Docker Networking Deep Dive
DockerCon EU 2015: Docker Networking Deep Dive
 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtime
 

Destacado

The Dark Art of Container Monitoring - Spanish
The Dark Art of Container Monitoring - SpanishThe Dark Art of Container Monitoring - Spanish
The Dark Art of Container Monitoring - SpanishSysdig
 
Extending Sysdig with Chisel
Extending Sysdig with ChiselExtending Sysdig with Chisel
Extending Sysdig with ChiselSysdig
 
Building Trustworthy Containers
Building Trustworthy ContainersBuilding Trustworthy Containers
Building Trustworthy ContainersSysdig
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing ToolsSysdig
 
A brief history of system calls
A brief history of system callsA brief history of system calls
A brief history of system callsSysdig
 
How to Monitor Microservices
How to Monitor MicroservicesHow to Monitor Microservices
How to Monitor MicroservicesSysdig
 
Find the Hacker
Find the HackerFind the Hacker
Find the HackerSysdig
 
Troubleshooting Kubernetes
Troubleshooting KubernetesTroubleshooting Kubernetes
Troubleshooting KubernetesSysdig
 
Stunning Smoky nature scenery
Stunning Smoky nature sceneryStunning Smoky nature scenery
Stunning Smoky nature sceneryDINISHA
 
The most interesting facts about lions you can’t afford to miss!
The most interesting facts about lions you can’t afford to miss!The most interesting facts about lions you can’t afford to miss!
The most interesting facts about lions you can’t afford to miss!Lisa Mathew
 
The collapse of the universe
The collapse of the universeThe collapse of the universe
The collapse of the universeXenia Y
 
Ligers True Or False
Ligers True Or FalseLigers True Or False
Ligers True Or FalseHelga
 
Future
FutureFuture
FutureHelga
 
Heaven's Gate Presentation
Heaven's Gate PresentationHeaven's Gate Presentation
Heaven's Gate PresentationDaniel Potes
 
Golden Temple (kitchen & food)
Golden Temple (kitchen & food)Golden Temple (kitchen & food)
Golden Temple (kitchen & food)Nikkitta M
 
Monitoring Docker with ELK
Monitoring Docker with ELKMonitoring Docker with ELK
Monitoring Docker with ELKDaniel Berman
 
Golden Temple India
Golden Temple IndiaGolden Temple India
Golden Temple IndiaHelga
 
African lion presentation
African lion presentationAfrican lion presentation
African lion presentationDarwesh Murad
 
King Of The Jungle
King Of The JungleKing Of The Jungle
King Of The Jungledowneya
 

Destacado (20)

The Dark Art of Container Monitoring - Spanish
The Dark Art of Container Monitoring - SpanishThe Dark Art of Container Monitoring - Spanish
The Dark Art of Container Monitoring - Spanish
 
Extending Sysdig with Chisel
Extending Sysdig with ChiselExtending Sysdig with Chisel
Extending Sysdig with Chisel
 
Building Trustworthy Containers
Building Trustworthy ContainersBuilding Trustworthy Containers
Building Trustworthy Containers
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
A brief history of system calls
A brief history of system callsA brief history of system calls
A brief history of system calls
 
How to Monitor Microservices
How to Monitor MicroservicesHow to Monitor Microservices
How to Monitor Microservices
 
Find the Hacker
Find the HackerFind the Hacker
Find the Hacker
 
Troubleshooting Kubernetes
Troubleshooting KubernetesTroubleshooting Kubernetes
Troubleshooting Kubernetes
 
Stunning Smoky nature scenery
Stunning Smoky nature sceneryStunning Smoky nature scenery
Stunning Smoky nature scenery
 
The most interesting facts about lions you can’t afford to miss!
The most interesting facts about lions you can’t afford to miss!The most interesting facts about lions you can’t afford to miss!
The most interesting facts about lions you can’t afford to miss!
 
The collapse of the universe
The collapse of the universeThe collapse of the universe
The collapse of the universe
 
Ligers True Or False
Ligers True Or FalseLigers True Or False
Ligers True Or False
 
Future
FutureFuture
Future
 
Heaven's Gate Presentation
Heaven's Gate PresentationHeaven's Gate Presentation
Heaven's Gate Presentation
 
Golden Temple (kitchen & food)
Golden Temple (kitchen & food)Golden Temple (kitchen & food)
Golden Temple (kitchen & food)
 
Monitoring Docker with ELK
Monitoring Docker with ELKMonitoring Docker with ELK
Monitoring Docker with ELK
 
Golden Temple India
Golden Temple IndiaGolden Temple India
Golden Temple India
 
African lion presentation
African lion presentationAfrican lion presentation
African lion presentation
 
King Of The Jungle
King Of The JungleKing Of The Jungle
King Of The Jungle
 
Beauties
BeautiesBeauties
Beauties
 

Similar a Lions, Tigers and Deers: What building zoos can teach us about securing microservices?

Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsGianluca Varisco
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime SecuritySysdig
 
Docker Security
Docker SecurityDocker Security
Docker Securityantitree
 
Containers and security
Containers and securityContainers and security
Containers and securitysriram_rajan
 
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 WorldDevOps.com
 
Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok   Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok Docker, Inc.
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Codemotion
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDocker, Inc.
 
Container Security
Container SecurityContainer Security
Container SecuritySalman Baset
 
Secure container: Kata container and gVisor
Secure container: Kata container and gVisorSecure container: Kata container and gVisor
Secure container: Kata container and gVisorChing-Hsuan Yen
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudSalman Baset
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityPhil Estes
 
Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?Michael Boelen
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)Amazon Web Services
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)Amazon Web Services
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...NETWAYS
 
Securing your Kubernetes applications
Securing your Kubernetes applicationsSecuring your Kubernetes applications
Securing your Kubernetes applicationsNéstor Salceda
 

Similar a Lions, Tigers and Deers: What building zoos can teach us about securing microservices? (20)

Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
 
Dockers zero to hero
Dockers zero to heroDockers zero to hero
Dockers zero to hero
 
Docker Security
Docker SecurityDocker Security
Docker Security
 
Containers and security
Containers and securityContainers and security
Containers and security
 
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
 
Securing the Container Pipeline
Securing the Container PipelineSecuring the Container Pipeline
Securing the Container Pipeline
 
Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok   Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at Netflix
 
Container Security
Container SecurityContainer Security
Container Security
 
Secure container: Kata container and gVisor
Secure container: Kata container and gVisorSecure container: Kata container and gVisor
Secure container: Kata container and gVisor
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production Cloud
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
 
Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?
 
Containers and Security for DevOps
Containers and Security for DevOpsContainers and Security for DevOps
Containers and Security for DevOps
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
 
Securing your Kubernetes applications
Securing your Kubernetes applicationsSecuring your Kubernetes applications
Securing your Kubernetes applications
 

Más de Sysdig

Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionSysdig
 
What Prometheus means for monitoring vendors
What Prometheus means for monitoring vendorsWhat Prometheus means for monitoring vendors
What Prometheus means for monitoring vendorsSysdig
 
15 kubernetes failure points you should watch
15 kubernetes failure points you should watch15 kubernetes failure points you should watch
15 kubernetes failure points you should watchSysdig
 
CI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in KubernetesCI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in KubernetesSysdig
 
Continuous Security
Continuous SecurityContinuous Security
Continuous SecuritySysdig
 
The top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitorThe top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitorSysdig
 
The top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitorThe top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitorSysdig
 

Más de Sysdig (7)

Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
 
What Prometheus means for monitoring vendors
What Prometheus means for monitoring vendorsWhat Prometheus means for monitoring vendors
What Prometheus means for monitoring vendors
 
15 kubernetes failure points you should watch
15 kubernetes failure points you should watch15 kubernetes failure points you should watch
15 kubernetes failure points you should watch
 
CI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in KubernetesCI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in Kubernetes
 
Continuous Security
Continuous SecurityContinuous Security
Continuous Security
 
The top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitorThe top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitor
 
The top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitorThe top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitor
 

Último

US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptxNikhil Raut
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 

Último (20)

US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Steel Structures - Building technology.pptx
Steel Structures - Building technology.pptxSteel Structures - Building technology.pptx
Steel Structures - Building technology.pptx
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 

Lions, Tigers and Deers: What building zoos can teach us about securing microservices?

  • 1. Jorge Salamero Sanz Lions, Tigers and Deers: What building zoos can teach us about securing microservices?
  • 2. % whoami Jorge Salamero Sanz <jorge.salamero@sysdig.com> @bencerillo @sysdig • Working on OSS last 12 years • Working on OSS+Cloud last 5 years • Working on monitoring last 3 years • Technical Marketing geek @sysdig
  • 3. Sysdig Open Source system troubleshooting with native container support (htop, vmstat, netstat, lsof, tcpdump…) Monitoring, alerting, troubleshooting tool for Docker, Kubernetes, Mesos, RancherOS, GCE, ECS
  • 4. Traditional deployment Full host OS kernel systemd syslogd App services MySQL Nginx OpenSSL Java App A App B App C Ops Devs
  • 5. Containerized deployment Full host OS kernel + Docker MySQL App A Ops DevOps Nginx + OpenSSL App B Java 8.0 build XXX App C
  • 6. How to secure this? Containerization is not something new to us... • Establish trust boundaries • Identify, minimise, and harden attack surfaces • Reduce scope and access • Layer protections and defenses From Aaron Grattafiori presented “The Golden Ticket: Docker and High Security Microservices
  • 7. Securing Microservices Defense in depth Microservices Single responsibility principle: • Principle of least privileges • Principle of least surprise • Principle of least access
  • 8. Container Security Techniques • New workflows (docker pull vs previous apt update/yum update) • CI/CD Pipeline (Jenkins, Openshift, etc: rebuilds, rolling updates) • Access management, logging & auditing (Kubernetes, Openshift: user roles, namespaces, centralized logging, authn & authz, etc) • Trust boundaries (do you trust entire Docker Hub? Image signing, Docker Notary) • Simplify container OS, tons of useless stuff (RancherOS, Atomic, CoreOS, Alpine Linux, etc) • Network security (Weave, etc) • Secret management (Vaults instead of environment vars, etc)
  • 9. Docker Security Techniques • Drop privileges • Limit capabilities • Do not run as root! containers are not VMs! • cgroups • Limit resources share, not access restriction • namespaces • Useful for not complete security model • User namespaces • Kubernetes/Openshift security contexts • Host security and access (Docker bench, RO access, etc)
  • 10. Scanning What are my containers doing? • Static scanning • Dynamic scanning
  • 11. Static Scanning Yay, this was soo easy to deploy! I Docker Hub! (your developers too, actually they were already using it :P) uhm… wait, is someone maintaining this image? RUN apt-get install -y wget build-essential python python-dev python-pip python-virtualenv RUN wget http://nodejs.org/dist/node-latest.tar.gz RUN tar xvzf node-latest.tar.gz RUN cd node-v* && ./configure && CXX="g++ -Wno-unused-local-typedefs" make && CXX="g++ -Wno-unused-local-typedefs" make install • Static Scanning: • CoreOS Clair, Docker Nautilus, Red Hat CloudForms, etc
  • 12. Image Vulnerability Scanning • Scan contents of images looking for software versions with known defects • Container image layering can make this efficient (exploits immutable nature of images) Ubuntu: 14.04 Apache: 2.2 Wordpress: 4.6 PHP: 7.0
  • 13. Image Vulnerability Scanning • Scan contents of images looking for software versions with known defects • Container image layering can make this efficient (exploits immutable nature of images) • Ubuntu: 14.04 Apache: 2.2 Wordpress: 4.6 PHP: 7.0
  • 14. Image Vulnerability Scanning • Scan contents of images looking for software versions with known defects • Container image layering can make this efficient (exploits immutable nature of images) • Ubuntu: 14.04 Apache: 2.2 Wordpress: 4.6 PHP: 7.0
  • 15. Image Vulnerability Scanning • Scan contents of images looking for software versions with known defects • Container image layering can make this efficient (exploits immutable nature of images) • Ubuntu: 14.04 Apache: 2.2 Wordpress: 4.6 PHP: 7.0
  • 16. Container Security Techniques OK, no known vulnerabilities, still secure? Containers are black boxes exposing a behaviour, is something misbehaving? • Dynamic Scanning: • Seccomp • MAC (Mandatory Access Control) • Behavioral Security Monitoring
  • 17. Seccomp • Seccomp: application system call “sandboxing” • Create filter (BPF program ) with lists of allowed syscalls • Each syscall matched against filter • Failures-> log message, error return, and/or kill process • Docker runs containerized process under a seccomp profile • Notable disallowed syscalls: • clone (creating new namespaces) • reboot (reboot the host) • setns (change namespaces)
  • 18. Mandatory Access Control • SELinux or AppArmor • Same mechanisms: kernel-level interception/filtering • features++ && complexity++ • Above syscalls: • Actors (process) • Actions (read/write on files/sockets) • Targets (files, IPs, ports) • But what if I only want to put some surveillance in?
  • 19. Behavioral Security Monitoring • Auditing vs enforcement • detect intrusions instead of preventing intrusions • Build rules that define suspicious/anomalous behavior • Match rules against activity on a system • Auditd (SELinux logger) • Falco (with container capabilities)
  • 20. Sysdig Falco An anomaly detection system built on top of the sysdig engine
  • 22. What is Sysdig Falco? • Detects suspicious activity defined by a set of easy rules • Uses sysdig’s flexible and powerful filtering expressions (in userspace) • Container support (Docker, Kubernetes, Mesos, etc) • Flexible notification methods • Open Source
  • 23. Quick Examples A shell is run in a container container.id != host and proc.name = bash Overwrite system binaries fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin) and write Container namespace change evt.type = setns and not proc.name in (docker, sysdig) Non-device files written in /dev (evt.type = creat or evt.arg.flags contains O_CREAT) and proc.name != blkid and fd.directory = /dev and fd.name != /dev/null Process tries to access camera evt.type = open and fd.name = /dev/video0 and not proc.name in (skype, webex)
  • 24. Falco Rules • .yaml file containing Macros, Lists, and Rules - macro: bin_dir condition: fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin) - list: package_mgmt_binaries items: [dpkg, dpkg-preconfigu, rpm, rpmkey, yum, frontend] - rule: write_binary_dir desc: an attempt to write to any file below a set of binary directories condition: bin_dir and evt.dir = < and open_write and not package_mgmt_procs output: "File below a known binary directory opened for writing (user=%user.name command=%proc.cmdline file=%fd.name)" priority: WARNING
  • 25. Alerts and Outputs • Events that match filter expression (rule) result in alerts • output field used to format event into alert message • Sending to: • syslog • file • stdout • shell (e.g. mail -s "Falco Notification" alerts@example.com) • Sysdig Cloud
  • 27. Remember Container behaviour security monitoring shouldn’t be difficult...