Commit Graph

272 Commits

Author SHA1 Message Date
Leonardo Di Donato
3e9ebfb354 fix(docker): adapt dockerfiles to HOST_ROOT env var
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-11-14 10:00:36 -08:00
Leonardo Di Donato
3ce2056dc5 fix(docker): glob rather than ls in the docker entrypoints
Plus, make them use HOST_ROOT env var, not SYSDIG_HOST_ROOT

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-11-14 10:00:36 -08:00
Yash Bhutwala
8c2a36ca00 fix the image name and tag for the linuxkit Dockerfile
Signed-off-by: Yash Bhutwala <ymb002@bucknell.edu>
2019-11-05 15:46:33 +01:00
Lorenzo Fontana
eae65475e0 docs(docker): version bump to 0.18.0
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-10-31 12:32:39 +01:00
Leonardo Di Donato
f71c4f0bfd update: refer to latest probeinstaller library in falcoctl/pkg
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-10-11 19:43:56 +02:00
Lorenzo Fontana
7dc62b3119 docs: reflect the changes to probeloader docker images
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-10-11 19:43:56 +02:00
Lorenzo Fontana
707cdb5184 chore(docker/minimal): fix typo and set 0.17.1 as base
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-10-11 19:43:56 +02:00
Lorenzo Fontana
3c30ad9d38 chore(docker/kernel/linuxkit): reformat dockerfile
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-10-11 19:43:56 +02:00
Lorenzo Fontana
0c6d21eca4 update: httploader now is named probeloader and uses the falcoctl
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-10-11 19:43:56 +02:00
Michael Ducy
b49ade5627 use COPY not ADD
Signed-off-by: Michael Ducy <michael@ducy.org>
2019-10-11 19:43:56 +02:00
Michael Ducy
5a703ddbb8 updates based on code review rnd 1
Signed-off-by: Michael Ducy <michael@ducy.org>
2019-10-11 19:43:56 +02:00
Michael Ducy
01abe71256 add init container module loader
Signed-off-by: Michael Ducy <michael@ducy.org>
2019-10-11 19:43:56 +02:00
Michael Ducy
ac8204dc30 Initial try at slimmer images
Signed-off-by: Michael Ducy <michael@ducy.org>
2019-10-11 19:43:56 +02:00
Lorenzo Fontana
c76518c681 update: license headers
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-10-08 16:02:26 +02:00
Leonardo Di Donato
a019b54fe6 docs: specify labels that apply to each area
If this work as intended PR will automatically get the area labels depending on the files he modified.
In case the user wants it can still apply other areas manually, by slash command, or editing the PR template during the opening of the PR.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-09-16 10:11:25 +02:00
Sumit Kumar
34654fd753 fix(docker/stable): fix libgcc-6-dev dependencies
added `libmpx2` to be install during `apt-get install` which is a dependency for `dpkg: libgcc-6-dev:amd64`
Signed-off-by: Sumit Kumar <sumitsaiwal@gmail.com>
2019-09-15 10:29:41 +02:00
Lorenzo Fontana
7d8e1dee9b fix(docker/local): fix build dependencies
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-21 14:45:37 +02:00
Leonardo Di Donato
323a9ef51d chore: switching back to latest falco-builder and falco-tester docker images for CI
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
b369de3801 fix(docker/builder): enforce DRAIOS_DEBUG_FLAGS to DNDEBUG when BUILD_TYPE=debug
This is a temporary fix for Travis CI (which is where we use
falco-builder docker image).

Was already done in the past (see:
9285aa59c1 (diff-354f30a63fb0907d4ad57269548329e3)).

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
8156c9214c fix(docker/tester): regression tests' scripts need xargs (findutils)
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
d11ad9a005 fix(docker/tester): switch to fedora 28 and avocado 69
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
7b2b0b14a5 chore(docker): falco-builder docker image refinements
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
c4cd9e326a docs(docker): usage and labels for falco-tester docker image
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
533e8247fd fix(docker/local): make falco version build argument mandatory
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
38cf3c6f29 fix(docker): falco builder does not need docker
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
50f04897e5 update(docker): falco tester image
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
62be14dde6 new(docker): default usage command for falco tester image
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
c5e296576d update(docker): falco tester entrypoint performs checks in order to be more robust
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
c61c0e7020 build: always check the BUILD_TYPE within the entrypoint
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
ebcb133f00 build: docker builder's BUILD_TYPE variable is "release" by default, otherwise it can only be "debug"
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
44f0633f47 update: falco builder image has FALCO_VERSION build arg and env var again
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
e02318db7c update: centos 7 falco builder
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
9f7e3bdfcd update: usage examples for falco builder
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
2cda10caeb new: default (usage) command for falco builder image
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
7efec602e8 new: script to enable toolset 7 in falco builder containers
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
8fb4c7f2f6 update: entrypoint checks for sysdig and falco dirs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
e92a721521 build: install cmake at docker build phase rather than at runtime
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Mark Stemm
0e1c436d14
Add jenkins checks (#584)
* Supporting files to build/test via jenkins

Changes to build/test via jenkins, which also means running all tests in
a container instead of directly on the host:

- Jenkinsfile controls the stages, build.sh does the build and
  run-tests.sh does the regression tests.

- Create a new container falcosecurity/falco-tester that includes the
  dependencies required to run the regression tests. This is a different
  image than falco-builder because it doesn't need to be centos 6 based,
  doesn't install any compiler/etc, and installs the test running
  framework we use (avocado). We now use a newer version of avocado,
  which resulted in some small changes to how it is run and how yaml
  options are parsed.

- Modify run_regression_tests.sh to download trace files to the build
  directory and only if not present. Also honor BUILD_TYPE/BUILD_DIR,
  which is provided via the docker run cmd.

- The package tests are now moved to a separate falco_tests_package.yaml
  file. They will use rpm installs by default instead of debian
  packages. Also add the ability to install rpms in addition to debian
  packages.

- Automate the process of creating the docker local package by: 1)
  Adding CMake rules to copy the Dockerfile, entrypoint to the build
  directory and 2) Copy test trace files and rules into the build
  directory. This allows running the docker build command from
  build/docker/local instead of the source directory.

- Modify the way the container test is run a bit to use the trace
  files/rules copied into the container directly instead of host-mounted
  trace files.

* Use container builder + tester for travis

We'll probably be using jenkins soon, but this will allow switching back
to travis later if we want.

* Use download.draios.com for binutils packages

That way we won't be dependent on snapshot.debian.org.
2019-04-26 12:24:15 -07:00
Mark Stemm
e26a9505d6
Change log timestamp to ISO8601 w/ timezone (#518)
* Add option to display times in ISO 8601 UTC

ISO 8601 time is useful when, say, running falco in a container, which
may have a different /etc/localtime than the host system.

A new config option time_format_iso_8601 controls whether log message
and event times are displayed in ISO 8601 in UTC or in local time. The
default is false (display times in local time).

This option is passed to logger init as well as outputs. For outputs it
eventually changes the time format field from %evt.time/%jevt.time to
%evt.time.iso8601/%jevt.time.iso8601.

Adding this field changes the falco engine version so increment it.

This depends on https://github.com/draios/sysdig/pull/1317.

* Unit test for ISO 8601 output

A unit test for ISO 8601 output ensures that both the log and event time
is in ISO 8601 format.

* Use ISO 8601 output by default in containers

Now that we have an option that controls iso 8601 output, use it by
default in containers. We do this by changing the value of
time_format_iso_8601 in falco.yaml in the container.

* Handle errors in strftime/asctime/gmtime

A placeholder "N/A" is used in log messages instead.
2019-04-09 09:41:00 -07:00
Xiang Dai
04b1b4da67 delete all duplicate empty blanks (#542)
falco-CLA-1.0-signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-27 11:53:40 -05:00
Jorge Salamero Sanz
a6c5926336 Adds packaging for RHEL (#544) 2019-02-26 10:44:20 -05:00
Mark Stemm
d7568ac42f
Add gcc back from manual packages (#536)
Related to https://github.com/falcosecurity/falco/pull/526, it turns out
attempting to build a kernel module on the default debian-based ami used
by kops tries to invoke gcc-6:

-----
* Setting up /usr/src links from host
* Unloading falco-probe, if present
* Running dkms install for falco

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.9.0-7-amd64 -C /lib/modules/4.9.0-7-amd64/build
M=/var/lib/dkms/falco/0.14.0/build...(bad exit status: 2)
Error! Bad return status for module build on kernel:
4.9.0-7-amd64 (x86_64)
Consult /var/lib/dkms/falco/0.14.0/build/make.log for more information.
* Running dkms build failed, dumping
  /var/lib/dkms/falco/0.14.0/build/make.log
  DKMS make.log for falco-0.14.0 for kernel 4.9.0-7-amd64 (x86_64)
  Wed Feb 13 01:02:01 UTC 2019
  make: Entering directory '/host/usr/src/linux-headers-4.9.0-7-amd64'
  arch/x86/Makefile:140: CONFIG_X86_X32 enabled but no binutils support
  /host/usr/src/linux-headers-4.9.0-7-common/scripts/gcc-version.sh:
  line 25: gcc-6: command not found
-----

So manually add back gcc-6 and its dependencies.
2019-02-13 08:18:07 -08:00
Mark Stemm
7b71eb875f
Docker-based way to build falco (#522)
To allow for a more portable build environment, create a builder image
that is based on centos 6 with devtoolset-2 for a refrence g++.

In that image, install all required packages and run a script that can
either run cmake or make.

The image depends on the following parameters:

FALCO_VERSION: the version to give any built packages
BUILD_TYPE: Debug or Release
BUILD_DRIVER/BPF: whether or not to build the kernel module/bpf program when
   building. This should usually be OFF, as the kernel module would be
   built for the files in the centos image, not the host.
BUILD_WARNINGS_AS_ERRORS: consider all build warnings fatal
MAKE_JOBS: passed to the -j argument of make

A typical way to run this builder is the following. Assumes you have
checked out falco and sysdig to directories below /home/user/src, and
want to use a build directory of /home/user/build/falco:

$ docker run --user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd:ro -e MAKE_JOBS=4 -it -v /home/user/src:/source -v /home/user/build/falco:/build falco-builder cmake
$ docker run --user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd:ro -e MAKE_JOBS=4 -it -v /home/user/src:/source -v /home/user/build/falco:/build falcosecurity/falco-builder package
2019-02-11 13:27:47 -08:00
Mark Stemm
26eba69ec4
Remove gcc 6. (#526)
Debian:unstable recently removed gcc 6, so remove it from our Dockerfiles.
2019-02-10 14:56:09 -08:00
Mark Stemm
b8a25c6e71
Add gcc 5 by hand rather than from debian unstable (#501)
gcc 5 is no longer included in debian unstable, but we need it to build
centos kernels, which are 3.x based and explicitly want a gcc version 3,
4, or 5 compiler.

So grab copies we've saved from debian snapshots with the prefix
https://snapshot.debian.org/archive/debian/20190122T000000Z. They're
stored at downloads.draios.com and installed in a dpkg -i step after the
main packages are installed, but before any other by-hand packages are
installed.
2019-01-23 18:02:03 -08:00
Mark Stemm
53c7e101fe
Add netcat to docker images (#456)
It may be useful as a way to enable generic event forwarding.

This fixes https://github.com/falcosecurity/falco/issues/433.
2018-11-05 17:50:53 -08:00
TaoBeier
bc34e438ce fix deprecated statement. (#429)
falco-CLA-1.0-signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2018-10-12 19:43:57 -07:00
Mark Stemm
6445cdb950
Better copyright notices (#426)
* Use correct copyright years.

Also include the start year.

* Improve copyright notices.

Use the proper start year instead of just 2018.

Add the right owner Draios dba Sysdig.

Add copyright notices to some files that were missing them.
2018-09-26 19:49:19 -07:00
Brett Bertocci
fc70c635d1 Add dkms+xz dependencies to falco container 2018-09-25 12:06:19 -07:00
Mark Stemm
2352b96d6b
Change license to Apache 2.0 (#419)
Replace references to GNU Public License to Apache license in:

 - COPYING file
 - README
 - all source code below falco
 - rules files
 - rules and code below test directory
 - code below falco directory
 - entrypoint for docker containers (but not the Dockerfiles)

I didn't generally add copyright notices to all the examples files, as
they aren't core falco. If they did refer to the gpl I changed them to
apache.
2018-09-20 11:47:10 -07:00
Mark Stemm
ab0413a9ee
Downgrade binutils in docker image (#397)
debian:unstable head contains binutils 2.31, which generates binaries
that are incompatible with kernels < 4.16.

To fix this, after installing everything, downgrade binutils to
2.30-22. This has to be done as the last step as it introduces conflicts
in other dependencies of the various gcc versions and some of the
packages already in the image.
2018-07-31 10:44:47 -07:00
Brett Bertocci
7289315837 Ensure the /lib/modules symlink to /host/lib/modules is set correctly
If /lib/modules exists in the base image, the symlink will get created at
/lib/modules/modules. This removes any existing empty directory but will
fail if we try to remove a non-empty /lib/modules. (Punting on how to
handle non-empty base image dirs for now)
2018-07-16 13:42:41 -07:00
Michael Ducy
81a38fb909 add gcc-6 to Dockerfiles: (#382) 2018-06-12 13:07:15 -07:00
Gianluca Borello
2a7851c77b eBPF support for Falco 2018-05-09 14:15:10 -07:00
David Archer
73e1ae616a Don't make driver compilation fail when kernel is compiled with CONFIG_ORC_UNWINDER or CONFIG_STACK_VALIDATION. (#362)
sysdig-CLA-1.0-signed-off-by: David Archer <darcher@gmail.com>
2018-04-30 14:40:28 -07:00
Mark Stemm
b6b490e26e
Add Rule for unexpected udp traffic (#320)
* Add Rule for unexpected udp traffic

New rule Unexpected UDP Traffic checks for udp traffic not on a list of
expected ports. Currently blocked on
https://github.com/draios/falco/issues/308.

* Add sendto/recvfrom in inbound/outbound macros

Expand the inbound/outbound macros to handle sendfrom/recvto events, so
they can work on unconnected udp sockets. In order to avoid a flood of
events, they also depend on fd.name_changed to only consider
sendto/recvfrom when the connection tuple changes.

Also make the check for protocol a positive check for udp instead of not tcp,
to avoid a warning about event type filters potentially appearing before
a negative condition. This makes filtering rules by event type easier.

This depends on https://github.com/draios/sysdig/pull/1052.

* Add additional restrictions for inbound/outbound

 - only look for fd.name_changed on unconnected sockets.
 - skip connections where both ips are 0.0.0.0 or localhost network.
 - only look for successful or non-blocking actions that are in progress

* Add a combined inbound/outbound macro

Add a combined inbound/outbound macro so you don't have to do all the
other net/result related tests more than once.

* Fix evt generator for new in/outbound restrictions

The new rules skip localhost, so instead connect a udp socket to a
non-local port. That still triggers the inbound/outbound macros.

* Address FPs in regression tests

In some cases, an app may make a udp connection to an address with a
port of 0, or to an address with an application's port, before making a
tcp connection that actually sends/receives traffic. Allow these
connects.

Also, check both the server and client port and only consider the
traffic unexpected if neither port is in range.
2018-04-18 10:07:22 -07:00
Luca Marturana
ba6d6dbf9d Use gcc 5 by default to compile properly on Ubuntu Xenial, remove gcc 4.9 since CentOS does not work anyway due to glibc 2018-02-27 09:39:13 -08:00
Jean-Philippe Lachance
4d8e982f78 + Add gdb in the development Docker image to help debugging (#323)
sysdig-CLA-1.0-signed-off-by: Jean-Philippe Lachance <jplachance@coveo.com>
2018-02-20 11:54:13 -05:00
Mark Stemm
d6d975e28c
Refactor shell rules (#301)
* Refactor shell rules to avoid FPs.

Refactoring the shell related rules to avoid FPs. Instead of considering
all shells suspicious and trying to carve out exceptions for the
legitimate uses of shells, only consider shells spawned below certain
processes suspicious.

The set of processes is a collection of commonly used web servers,
databases, nosql document stores, mail programs, message queues, process
monitors, application servers, etc.

Also, runsv is also considered a top level process that denotes a
service. This allows a way for more flexible servers like ad-hoc nodejs
express apps, etc to denote themselves as a full server process.

* Update event generator to reflect new shell rules

spawn_shell is now a silent action. its replacement is
spawn_shell_under_httpd, which respawns itself as httpd and then runs a
shell.

db_program_spawn_binaries now runs ls instead of a shell so it only
matches db_program_spawn_process.

* Comment out old shell related rules

* Modify nodejs example to work w/ new shell rules

Start the express server using runit's runsv, which allows falco to
consider any shells run by it as suspicious.

* Use the updated argument for mkdir

In https://github.com/draios/sysdig/pull/757 the path argument for mkdir
moved to the second argument. This only became visible in the unit tests
once the trace files were updated to reflect the other shell rule
changes--the trace files had the old format.

* Update unit tests for shell rules changes

Shell in container doesn't exist any longer and its functionality has
been subsumed by run shell untrusted.

* Allow git binaries to run shells

In some cases, these are run below a service runsv so we still need
exceptions for them.

* Let consul agent spawn curl for health checks

* Don't protect tomcat

There's enough evidence of people spawning general commands that we
can't protect it.

* Reorder exceptions, add rabbitmq exception

Move the nginx exception to the main rule instead of the
protected_shell_spawner macro. Also add erl_child_setup (related to
rabbitmq) as an allowed shell spawner.

* Add additional spawn binaries

All off these are either below nginx, httpd, or runsv but should still
be allowed to spawn shells.

* Exclude shells when ancestor is a pkg mgmt binary

Skip shells when any process ancestor (parent, gparent, etc) is a
package management binary. This includes the program needrestart. This
is a deep search but should prevent a lot of other more detailed
exceptions trying to find the specific scripts run as a part of
installations.

* Skip shells related to serf

Serf is a service discovery tool and can in some cases be spawned by
apache/nginx. Also allow shells that are just checking the status of
pids via kill -0.

* Add several exclusions back

Add several exclusions back from the shell in container rule. These are
all allowed shell spawns that happen to be below
nginx/fluentd/apache/etc.

* Remove commented-out rules

This saves space as well as cleanup. I haven't yet removed the
macros/lists used by these rules and not used anywhere else. I'll do
that cleanup in a separate step.

* Also exclude based on command lines

Add back the exclusions based on command lines, using the existing set
of command lines.

* Add addl exclusions for shells

Of note is runsv, which means it can directly run shells (the ./run and
./finish scripts), but the things it runs can not.

* Don't trigger on shells spawning shells

We'll detect the first shell and not any other shells it spawns.

* Allow "runc:" parents to count as a cont entrypnt

In some cases, the initial process for a container can have a parent
"runc:[0:PARENT]", so also allow those cases to count as a container
entrypoint.

* Use container_entrypoint macro

Use the container_entrypoint macro to denote entering a container and
also allow exe to be one of the processes that's the parent of an
entrypoint.
2017-11-28 07:04:37 -08:00
Mark Stemm
ec5adfe892 Build and package standalone falco kernel module
Start packaging (and building when necessary) a falco-specific kernel
module in falco releases. Previously, falco would depend on sysdig and
use its kernel module instead.

The kernel module was already templated to some degree in various
places, so we just had to change the templated name from
sysdig/sysdig-probe to falco/falco-probe.

In containers, run falco-probe-loader instead of
sysdig-probe-loader. This is actually a script in the sysdig repository
which is modified in https://github.com/draios/sysdig/pull/789, and uses
the filename to indicate what kernel module to build and/or load.

For the falco package itself, don't depend on sysdig any longer but instead
depend on dkms and its dependencies, using sysdig as a guide on the set
of required packages.

Additionally, for the package pre-install/post-install scripts start
running falco-probe-loader.

Finally, add a --version argument to falco so it can pass the desired
version string to falco-probe-loader.
2017-03-20 15:56:37 -07:00
Mark Stemm
6356490b1c Misc demo improvements.
Small changes to improve the use of falco_event_generator with falco:

 - In event_generator, some actions like exec_ls won't trigger
   notifications on their own. So exclude them from -a all.
 - For all actions, print details on what the action will do.
 - For actions that won't result in a falco notification in containers,
   note that in the output.
 - The short version of --once wasn't working, fix the getopt.
 - Explicitly saying -a all wasn't working, fix.
 - Don't rely on an external ruleset in the nodejs docker-compose
   demo--the built in rules are sufficient now.
2017-02-01 14:51:18 -08:00
Mark Stemm
10d0c8f982 Add a local dockerfile variant.
Add a local dockerfile variant that allows creating an image from a
local .deb package.
2017-01-17 10:24:38 -08:00
Luca Marturana
af3a708251
Improve comment 2017-01-04 18:05:46 +01:00
Carl Sverre
858a69bb2c Added envvar SYSDIG_SKIP_LOAD to Dockerfile to skip kernel module manipulation
This helps when running on a system which has the module loaded, but getting
access to the module file is hard for some reason.  Since I know that the right
version of the module is loaded I just want falco to connect.

I tested this with this run command:

docker run -e SYSDIG_SKIP_LOAD=1 -it -v /dev:/host/dev -v /proc:/host/proc --privileged falco

And it successfully connected to Sysdig and started printing out warnings for my
system.

falco-CLA-1.0-signed-off-by: Carl Sverre accounts@carlsverre.com
2016-12-22 12:55:36 -08:00
Mark Stemm
c66b6402d8 Add jq to docker images.
Add jq to the docker image containing falco. jq is very handy for
transforming json, which comes into play if you want to post to
slack (or other) webhooks.
2016-10-24 15:56:45 -07:00
Mark Stemm
2e5ed34357 Add exfiltration action, env-specified actions.
Add an exfiltration action that reads /etc/shadow and sends the contents
to a arbitrary ip address and port via a udp datagram.

Add the ability to specify actions via the environment instead of the
command line. If actions are specified via the environment, they replace
any actions specified on the command line.
2016-10-24 15:56:45 -07:00
Mark Stemm
3e1117d746 Add license comments to all source code.
Add comment blocks to all source code w/ our gpl copyright notice.
2016-10-24 15:56:45 -07:00
Mark Stemm
7fddaf2499 Install gcc-4.9 from Debian Jessie repositories
As luca did for the agent, install gcc 4.9 from the debian jesse
repository, as it has been removed from unstable.
2016-10-24 15:56:45 -07:00
Mark Stemm
f64148999a Program/docker image that performs bad activities.
C++ program that performs bad activities related to the current falco
ruleset. There are configurable actions for almost all of the current
ruleset, via the --action argument.

By default runs in a loop forever. Can be overridden via --once.

Also add a Dockerfile that compiles event_generator.cpp within an alpine
linux image and copies it to /usr/local/bin. This image has been pushed
to docker hub as "sysdig/falco-event-generator:latest".

Add a Makefile that runs the right docker build command.
2016-10-24 15:56:45 -07:00
Mark Stemm
0c44711e76 Fix docker builds.
gnupg2 is missing on latest debian:unstable.
2016-10-24 15:56:45 -07:00
Mark Stemm
0e40ad26c4 Run falco by default in containers.
Instead of running bash as the sysdig container does, run falco. This
makes sense as falco doesn't have a general purpose use like sysdig
does.

To make it easier to run both in docker and as a daemon using the
default command line, enable both syslog and stdout/stderr output by
default. Now that falco dups stdout/stderr to /dev/null when
daemonizing, the stdout/stderr is just thrown away. And when running in
docker, the syslog output will just be discarded unless someone plumbs
the container's syslog output.

Update README.md to reflect that specifying the falco command is not
necessary.
2016-05-11 17:35:02 -07:00
Mark Stemm
c2ee87976c Add docker files to create images using apt-get.
Based on the Dockerfiles from the sysdig repository. The only change
from the sysdig versions is to use environment variable FALCO_REPOSITORY
and to install falco instead of sysdig.

Note that the entrypoint still uses sysdig-probe-loader and
SYSDIG_HOST_ROOT, as it's building the kernel module for sysdig.

I verified I could create and run an image using the dev version using
"docker build ." from docker/dev, and run it using:

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:r\o sysdig/falco falco -r /etc/falco_rules.conf

I still need to update jenkins to create a release build.
2016-05-03 17:10:55 -07:00