introducing sysdig falco: the behavioral activity monitor with container support

18
The Behavioral Activity Monitor With Container Support Mark Stemm, Falco Engineer

Upload: knox-anderson

Post on 16-Apr-2017

91 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidential

The Behavioral Activity Monitor With Container Support

Mark Stemm, Falco Engineer

Page 2: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Home Security Analogy

• Home Security Prevents Intrusion • Door locks • Window sensors • Bars on ground floor windows • Exterior cameras

• …And Detects Intrusion • Motion sensors

Page 3: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Computer System Security

• Prevents Intrusion • Passwords • Two-factor authentication • Fixing software vulnerabilities • Firewalls

• Detects Intrusion • Sysdig Falco!

• Both methods essential for full protection

Page 4: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

What is Sysdig Falco

• A behavioral activity monitor • Detects suspicious activity defined by a set of rules • Uses sysdig’s flexible and powerful filtering

expressions • With full support for containers

• Utilizes sysdig’s container support • And flexible notification methods

• Alert to files, standard output, syslog • Open Source

• Anyone can contribute rules or improvements

Page 5: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidential

Quick Examples

A shell is run in a container container.id != host and proc.name = bash

Overwrite system binariesfd.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 cameraevt.type = open and fd.name = /dev/video0 and not proc.name in (skype, webex)

Page 6: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Falco Architecture

sysdig_probe Kernel

ModuleKernel

User

Syscalls

Sysdig Libraries

Filter Expression

Events

Alerting

Falco Rules

Suspicious Events File

Syslog

Stdout

Page 7: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Falco Rules

• .yaml file containing Rules and Macros • Example:

- macro: bin_dir condition: fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin)

- 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

Page 8: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Falco Rules

• Macros • name: text to use in later rules • condition: filter expression snippet

• Rules • name: used to identify rule • desc: description of rule • condition: filter expression, can contain macro

references • output: message to emit when rule triggers, can

contain formatted info from event • priority: severity of rule (WARNING, INFO, etc.)

Page 9: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Falco Rules

• Filtering Expressions • Use the same format as sysdig • Full container/k8s/mesos/etc support

• Falco rules are combined into one giant filtering expression, joined by ORs

• Each rule must contain at least one evt.type expression • i.e. evt.type=open and …• Allows for very fast filtering of events.

Page 10: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Alerts And Outputs

• Events that match filter expression result in alerts • Rule’s output field used to format event into

alert message • Falco configuration used to control where alert

message is sent. • Any combination of • Syslog • File • Standard Output

Page 11: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Installing Falco

• Debian Package • apt-get -y install falco

• Redhat Package • yum -y install falco

• Installation Script • curl -s https://s3.amazonaws.com/download.draios.com/stable/install-falco | sudo bash

• More on making this safe in the demo! • Docker container

• docker pull sysdig/falco• Full instructions: https://github.com/draios/falco/wiki/How-to-

Install-Falco-for-Linux

Page 12: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Running Falco

• As a service • $ service falco start

• alerts to syslog • By hand

• $ sudo falco -r <rules file> -c <config file>• alerts to syslog, stdout

• Using docker • docker run -i -t --name falco --privileged -v /var/run/docker.sock:/

host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro sysdig/falco

• Full Instructions: https://github.com/draios/falco/wiki/Running-Falco

Page 13: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Demo

Page 14: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

What we’re going to show you

• Falco installation using docker • Overview of rules file • Walkthrough of simple attacks • Writing to files below /bin • Running bash inside container

• Walkthrough of man-in-the-middle attack against pipe installers • Related blog post: https://sysdig.com/

blog/friends-dont-let-friends-curl-bash/

Page 15: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Man-in-the-middle Attack Diagram

install-software.sh

ApacheNginx

Software Vendor

curl http://server/install-software.sh |

bash

(Evil) Apache

Attacker

Botnet Master

Falco

Client

Page 16: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Join The Community

• Website • http://www.sysdig.org/falco/

• Mailing List • https://groups.google.com/forum/#!forum/

falco • Public Slack • https://sysdig.slack.com/messages/falco/

• Blog • https://sysdig.com/blog/tag/falco/

Page 17: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Learn More

• Github • https://github.com/draios/falco • Pull Requests welcome!

• Wiki • https://github.com/draios/falco/wiki

• Docker Hub • https://hub.docker.com/r/sysdig/falco/

Page 18: Introducing Sysdig Falco: The Behavioral Activity Monitor With Container Support

Information presented is confidentialInformation presented is confidential

Thanks (that’s the end)