extending sysdig with chisel

23
Extending Sysdig Gianluca Borello, Engineering Manager

Upload: sysdig

Post on 14-Apr-2017

367 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Extending Sysdig with Chisel

Extending SysdigGianluca Borello, Engineering Manager

Page 2: Extending Sysdig with Chisel

Information presented is confidential

Sysdig modular architecture

Page 3: Extending Sysdig with Chisel

Information presented is confidential

Command line

Page 4: Extending Sysdig with Chisel

Information presented is confidential

Command line

Sysdig embraces the UNIX philosophy, with a very powerful textual output that can be

piped into other tools for further processing:

• Standard command line output

• Custom output format

Page 5: Extending Sysdig with Chisel

Information presented is confidential

Command line

• json output

• Various data buffer encodings

Page 6: Extending Sysdig with Chisel

Information presented is confidential

Chisels

Page 7: Extending Sysdig with Chisel

Information presented is confidential

Chisels

• A chisel is a Lua script that is automatically called from sysdig, and

receives all the system events with all their precious state attached

• Rich bidirectional API with the sysdig engine (documented at

github.com/draios/sysdig/wiki/Sysdig-Chisel-API-Reference-Manual)

• Very good performance thanks to embedded LuaJIT engine

• Trivial to extend sysdig: creating a chisel is as simple as dropping

a script under ~/.chisels

• Endless possibilities via third-party Lua libraries

Page 8: Extending Sysdig with Chisel

Information presented is confidential

Chisels

Page 9: Extending Sysdig with Chisel

Information presented is confidential

Chisels

Initializationboilerplate.

Page 10: Extending Sysdig with Chisel

Information presented is confidential

Chisels

Callbacks calledautomatically bythe engine.

Page 11: Extending Sysdig with Chisel

Information presented is confidential

Chisels

The chisel contactsthe engine requestingspecific fields for the events.

Page 12: Extending Sysdig with Chisel

Information presented is confidential

Chisels

Called at everysystem event. This is where the magic happens.

Page 13: Extending Sysdig with Chisel

Information presented is confidential

Advanced extensions

Page 14: Extending Sysdig with Chisel

Information presented is confidential

libsinsp

Page 15: Extending Sysdig with Chisel

Information presented is confidential

libsinsp

• Event-based C++ API

• Supports state

• Supports filters

• Understands files/network connections/threads/processes

• Understands containers and their metadata

• Understands cluster orchestrators (Kubernetes, Mesos…)

• Fully independent shared library that can be used stand-alone

• Ideal for building advanced stateful applications

(but you should look into chisels first)

Page 16: Extending Sysdig with Chisel

Information presented is confidential

libsinsp

Page 17: Extending Sysdig with Chisel

Information presented is confidential

libscap

Page 18: Extending Sysdig with Chisel

Information presented is confidential

libscap

• Lower level event-based C API (simil libpcap)

• Mostly stateless

• Extracts system events from the kernel as fast as possible

• Helpers for gathering information from /proc

• Fully independent shared library that can be used stand-alone

• Building block for high-performance system event analyzers

• Use case: high speed correlation between network packets

and processes:

ntop.org/pf_ring/using-sysdig-from-pf_ring-and-soon-from-all-ntop-apps

Page 19: Extending Sysdig with Chisel

Information presented is confidential

libscap

Page 20: Extending Sysdig with Chisel

Let’s extend sysdig!

Page 21: Extending Sysdig with Chisel

Information presented is confidential

Use case

https://groups.google.com/forum/#!topic/sysdig/Vl_pbNR749I

Page 22: Extending Sysdig with Chisel

Information presented is confidential

The scavenger chisel

Page 23: Extending Sysdig with Chisel

Thank You!