Commit Graph

1223 Commits

Author SHA1 Message Date
Lorenzo Fontana
39b51562ed fix(rules): modification of a file should trigger as if it was opened or created
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-08-20 09:45:08 +02:00
Lorenzo Fontana
f05d18a847 new: download all dependencies over https
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-08-17 17:36:43 +02:00
Guangming Wang
731e197108 cleanup: fix misspelled words in readme.md
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-16 18:13:42 +02:00
Lorenzo Fontana
e229cecbe1 fix(rules): make chmod rules enabled by default
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-08-16 10:23:28 +02:00
Lorenzo Fontana
3ea98b05dd fix(rules/Set Setuid or Setgid bit): use chmod syscalls instead of chmod command
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-08-16 10:23:28 +02:00
Lorenzo Fontana
7bc3fa165f new: add @kris-nova to owners
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-08-13 22:42:43 +02:00
Leonardo Di Donato
3a1ab88111 new: webserver unit test skeleton
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
Leonardo Di Donato
2439e97da6 update(tests): setup unit tests for userspace/falco too
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
Leonardo Di Donato
8c62ec5472 fix(usperspace): webserver must not fail with input that exceeds the expected ranges
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
Leonardo Di Donato
c9cd6eebf7 update(userspace): falco webserver must catch json type errors (exceptions)
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
Leonardo Di Donato
723bc1cabf fix(userspace): accessing a (json) object can throw exceptions because of wrong types
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
Leonardo Di Donato
330d7ef2d7 fix: ignore build files generated by the regression tests
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-08-13 15:48:06 +02:00
kaizhe
1fc509d78b rule update: fine grained sending to mining domain
Signed-off-by: kaizhe <derek0405@gmail.com>
2019-08-12 17:37:01 +02:00
kaizhe
a7ee01103d rule update: add rules for crypto mining
Signed-off-by: kaizhe <derek0405@gmail.com>
2019-08-12 17:37:01 +02:00
Lorenzo Fontana
03fbf432f1 fix: make sure that when deleting shell history the system call is taken into account
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-08-07 15:38:22 +02:00
Mark Stemm
94d89eaea2 New tests for handling multi-doc files
New automated tests for testing parsing of multiple-doc rules files:

 - invalid_{overwrite,append}_{macro,rule}_multiple_docs are just like
   the previous versions, but with the multiple files combined into a
   single multi-document file.

 - multiple_docs combines the rules file from multiple_rules

The expect the same results and output as the multiple-file versions.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-08-02 11:01:59 -07:00
Mark Stemm
76f64f5d79 Properly parse multi-document yaml files
Properly parse multi-document yaml files e.g. blocks separated by
---. This is easily handled by lyaml itself--you just need to pass the
option all = true to yaml.load, and each document will be provided as a table.

This does break the table iteration a bit, so some more refactoring:

 - Create a load_state table that holds context like the current
 - document index, the required_engine_version, etc.
 - Pull out the parts that parse a single document to load_rules_doc(),
   which is given the table for a single document + load_state.
 - Simplify get_orig_yaml_obj to just provide a single row index and
 - return all rows from that point to the next blank line or line
   starting with '-'

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-08-02 11:01:59 -07:00
kaizhe
3dbd43749a rule update: add exception for write below rpm (#745)
Signed-off-by: kaizhe <derek0405@gmail.com>
2019-08-01 20:07:24 +02:00
Mark Stemm
2439873a96 Prepare for 0.17.0
New changelog, bump version.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-07-31 14:05:12 -07:00
Mark Stemm
204f5f219d Remove containers from empty capture file
A recent sysdig change resulted in container info embedded in capture
files being reported as events. In turn, this caused some tests that
were depending on empty.scap not having any events to fail.

So recreate empty.scap from an environment where no containers were
running. As a result they won't be included in the capture file and
there won't be any container events.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-07-31 12:18:47 -07:00
Mark Stemm
9b7c7ff5e4 Addl test for validation across files
Add new tests that ensure that validation across files and involving
multiple macro/rule objects display the right context. When appending,
both objects are displayed. When overwriting, the overwritten object is
displayed.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-07-31 11:22:38 +02:00
Mark Stemm
1f0065e4b1 Further improvements when displaying contexts
Make additional improvements to display relevant context when validating
files. This handles cases where a macro/rule overwrites a prior rule.

 - Instead of saving the index into the array of lines for each rule,
   save the rule yaml itself, as a property 'context' for each object.

 - When appending rules, the context of the base macro/rule and the
   context of the appended rule/macro are concatenated.

 - New functions get_orig_yaml_obj, build_error, and
   build_error_with_context handle building the error string.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-07-31 11:22:38 +02:00
Jonathan McGowan
bcf83057fa Fix for Write below root error triggering on GKE
GKE regularly calls /exec.fifo from both a system level, and within
individual falco pods.  As is this triggers errors multiple times every
hour.  This change adds /exec.fifo to the expected files below root that
will be called.

Signed-off-by: Jonathan McGowan <jonnymcgow7@gmail.com>
2019-07-30 18:27:17 +02:00
Mark Stemm
46b1a3c841 Fix bugs when verifying macro/rule objects.
Fix a couple of small bugs when verifying macro/rule objects:

1) Yaml can have document separators "---", and those were mistakenly
being considered array items.

2) When reading macros and rules and using array position to find the
right document offset, the overall object order should be
used (e.g. this is the 5th object from the file) and not the array
position (e.g. this is the 3rd rule from the file).

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-07-30 15:56:04 +02:00
Mark Stemm
a42ec9d7c7 Tests for rule name matching using patterns
Modify the disabled_rules_using_regex test to
disabled_rules_using_substring with an appropriate substring.

Also add a test where rule names have regex chars and allow rule names
to have regex chars when parsing falco's output in tests. These changes
are future-looking in case we want to add back support for rule
enabling/disabling using regexes.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-07-29 23:24:13 +02:00
Mark Stemm
3fedd00cfc Enable/disable rules using substrings not regexes
Given the compiler we currently use, you can't actually enable/disable
regexes in falco_engine::enable_rule using a regex pattern. The regex
either will fail to compile or will compile but not actually match
strings. This is noted on the c++11 compatibility notes for gcc 4.8.2:
https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/manual/manual/status.html#status.iso.2011.

The only use of using enable_rule was treating the regex pattern as a
substring match anyway, so we can change the engine to treat the pattern
as a substring.

So change the method/supporting sub-classes to note that the argument is
a substring match, and change falco itself to refer to substrings
instead of patterns.

This fixes https://github.com/falcosecurity/falco/issues/742.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-07-29 23:24:13 +02:00
Leonardo Di Donato
4a4701b4fd fix(scripts/jenkins): ensure to pull docker images (falco builder and tester)
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
40111a5d6e chore: moving travis build script in scripts directory
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +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
49752fc81a update(scripts): jenkins pipeline improvements
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
4224329905 fix(test): correct bash shebangs
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
b7c35d3b54 chore: output falco version
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
d1c642cbd2 build: bump minimum cmake version to 3.3.2
Ideally I'd like to have 3.5 as minimum version.
Nevertheless for the moment I bump this to 3.3.2  to match the CMake
version of the internal Jenkins 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
95a7cf3ea8 fix(build): ignore unused variables warnings
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
dc03dbee18 fix(build): draios debug flags before checking build type
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
c71703b566 update(test): better handling of build type
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
8400066ac8 update(test): ignore for generated traces
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
f18fc46a1c build: update cpack variables
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
e598606505 build: force falco version to always start with a digit
Falco version respects the following rules:
If the current commit matches (exactly) a git tag then the
FALCO_VERSION equals it (with the initial "v" stripped out).
Otherwise FALCO_VERSION is 0.<commit hash>[.-dirty].

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
e422337ed7 fix(hack): strip ^M from current falco version and call test command of falco-tester
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
736aa92b5e chore: remove travis notifications
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-07-26 03:23:01 +02:00
Leonardo Di Donato
3e1ab78536 build: set sysdig directory to its realpath
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