Néstor Salceda, Integrations Engineer
Docker Barcelona Meetup Sept 27th 2018
Implementing
Active Security with
Sysdig Falco
@nestorsalceda
• I work at Sysdig
• Security and Monitoring passionate
• Open Source enthusiast
• Daddy of twins
• Kubernetes member: Maintainer of Sysdig and Falco Helm charts
• Judo, Aikido and other Gendai Budo martial arts lover
Active Security and Response Engine
CNCF Flavor: NATS & Kubeless approach
AWS Flavor: SNS & Lambda approach
Layers of Container Security
Agenda
What is Sysdig Falco?
•
Layers of
Container
Security
Networking
Cluster
Container Runtime
Host
Infrastructure
Vulnerability Management:
● Upstream OS
● Application Vulnerabilities
Image / Software Provenance:
● Signed Images / Layers
● Artifact Signing
Build
Secure Secrets
Anomaly Detection
Forensics
Service / Container Admittance
Runtime
What is Sysdig
Falco?
• Detects suspicious activity
defined by a set of rules
• Uses Sysdig’s flexible and
powerful filtering expressions
Behavioral
Activity
Monitor
• Uses Sysdig’s container and
orchestrator support
Full Support of
Containers
Orchestration
Flexible
Notification
Methods
Open
Source
Software
• Files
• STDOUT
• Syslog
• Execute other programs
• And more ...
• Welcome contributions
• Transparency
Filter expressions
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 = create 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_probe
Kernel
Module
Kernel
User
Syscalls
Sysdig Libraries
Events
Alerting
Falco Rules
Suspicious
Events
File
Syslog
Stdout
Filter Expression
Shell
More rules implemented in draios/falco-extras repository:
● Traefik
● Redis
● Nginx
● PostgreSQL
Falco ships with a nice default ruleset for best practices:
● Writing files in bin or etc
● Reading sensitive files
● Terminal spawning in a container
Batteries included
Rules
- macro: bin_dir
condition: fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin)
- list: shell_binaries
items: [bash, csh, ksh, sh, tcsh, zsh, dash]
- 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
Try it out!
$ helm install --name sysdig-falco-1
--set fakeEventGenerator.enabled=true
stable/falco
Active
Security and
Response
Engine
Breaches may extend for days or weeks before detected
Attacks are changing to abuse activities rather than data
exfiltration
Ephemeral nature of containers may mean you were
breached but may never know
Many security paradigms are still reactive
Current Security Challenges
CNCF Flavor
Don’t let that Kubeless code spreads in your codebase
Command Design Pattern
Respect PubSub rules
TDD with Playbooks
What worked well?
Talk is cheap,
show me the code
AWS Flavor
Don’t assume anything from your execution environment
If you don’ t test your software, your users will do
Welcome changes. Even in late phases.
Same old story ...
See it in action!
Functions looks like a good fit for react to monitoring
events
Do not rely on your infrastructure, make it swappable
Containers adds more infrastructure, layers and risks. But
we have seen them before: DDoS, Injections ...
Just a quick summary
Moltes gràcies
Questions?
nestor@sysdig.com @nestorsalceda

Implementing Active Security with Sysdig Falco - Docker Meetup Barcelona

  • 1.
    Néstor Salceda, IntegrationsEngineer Docker Barcelona Meetup Sept 27th 2018 Implementing Active Security with Sysdig Falco
  • 2.
    @nestorsalceda • I workat Sysdig • Security and Monitoring passionate • Open Source enthusiast • Daddy of twins • Kubernetes member: Maintainer of Sysdig and Falco Helm charts • Judo, Aikido and other Gendai Budo martial arts lover
  • 3.
    Active Security andResponse Engine CNCF Flavor: NATS & Kubeless approach AWS Flavor: SNS & Lambda approach Layers of Container Security Agenda What is Sysdig Falco?
  • 4.
  • 5.
  • 6.
    Vulnerability Management: ● UpstreamOS ● Application Vulnerabilities Image / Software Provenance: ● Signed Images / Layers ● Artifact Signing Build
  • 7.
  • 8.
  • 9.
    • Detects suspiciousactivity defined by a set of rules • Uses Sysdig’s flexible and powerful filtering expressions Behavioral Activity Monitor • Uses Sysdig’s container and orchestrator support Full Support of Containers Orchestration Flexible Notification Methods Open Source Software • Files • STDOUT • Syslog • Execute other programs • And more ... • Welcome contributions • Transparency
  • 10.
    Filter expressions A shellis 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 = create 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)
  • 11.
  • 12.
    More rules implementedin draios/falco-extras repository: ● Traefik ● Redis ● Nginx ● PostgreSQL Falco ships with a nice default ruleset for best practices: ● Writing files in bin or etc ● Reading sensitive files ● Terminal spawning in a container Batteries included
  • 13.
    Rules - macro: bin_dir condition:fd.directory in (/bin, /sbin, /usr/bin, /usr/sbin) - list: shell_binaries items: [bash, csh, ksh, sh, tcsh, zsh, dash] - 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
  • 14.
    Try it out! $helm install --name sysdig-falco-1 --set fakeEventGenerator.enabled=true stable/falco
  • 15.
  • 16.
    Breaches may extendfor days or weeks before detected Attacks are changing to abuse activities rather than data exfiltration Ephemeral nature of containers may mean you were breached but may never know Many security paradigms are still reactive Current Security Challenges
  • 17.
  • 19.
    Don’t let thatKubeless code spreads in your codebase Command Design Pattern Respect PubSub rules TDD with Playbooks What worked well?
  • 20.
  • 21.
  • 22.
    Don’t assume anythingfrom your execution environment If you don’ t test your software, your users will do Welcome changes. Even in late phases. Same old story ...
  • 23.
    See it inaction!
  • 24.
    Functions looks likea good fit for react to monitoring events Do not rely on your infrastructure, make it swappable Containers adds more infrastructure, layers and risks. But we have seen them before: DDoS, Injections ... Just a quick summary
  • 25.