Commit Graph

224 Commits

Author SHA1 Message Date
Leonardo Di Donato
a200d17581 chore: improving naming
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-11-14 10:00:36 -08:00
Leonardo Di Donato
514d8bacc3 update(docker): introduce SKIP_MODULE_LOAD env variable
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-11-14 10:00:36 -08:00
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