Commit Graph

1821 Commits

Author SHA1 Message Date
Lorenzo Fontana
fb3f47a7c3 new: reorganize cmakelists.txt
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-01-17 19:09:31 +01:00
Lorenzo Fontana
fb42613cf1 new: use travis as the actual build environment
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-01-17 19:09:31 +01:00
Lorenzo Fontana
f492992c28 new: cpack under cmake folder
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-01-17 19:09:31 +01:00
Lorenzo Fontana
bcd485530a new: organize cmake dependencies better
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-01-17 19:09:31 +01:00
Lorenzo Fontana
b96e17fe5d new: fix lyaml dependencies
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-01-17 19:09:31 +01:00
Lorenzo Fontana
abdd099c0a new: initial dynamic build changes
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2020-01-17 19:09:31 +01:00
Mark Stemm
09cdc857c1 Fix compile warnings
Noticed these while compiling in the latest alpine image.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-01-15 09:35:28 +01:00
Mark Stemm
c3f7d15e26 Add k8s audit support to falco event generator
Currently, the falco event generator only generates system call
activity. This adds support for k8s_audit events by adding a script +
supporting k8s object files that generate activity that matches the k8s
audit event ruleset.

The main script is k8s_event_generator.sh, which loops over the files in
the yaml subdirectory, running kubectl apply -f for each.

In the interests of keeping things self-contained, all objects are
created in a `falco-event-generator` namespace. This means that some
activity related with cluster roles/cluster role bindings is not
performed.

Each k8s object has annotations that note:

1. The specific falco rules that should trigger.
2. A user-friendly message to print when apply-ing the file.

You can provide a specific rule name to the script. If provided, only
those objects related to that rule will trigger. The default is "all",
meaning that all objects are created.

The script loops forever, deleting the falco-event-generator namespace
after each iteration.

Additionally, the docker image has been updated to also copy the script
+ supporting files, as well as fetching the latest available `kubectl`
binary. The entrypoint is now a script that allows choosing between:
 - syscall activity: run with .... "syscall"
 - k8s_audit activity: run with .... "k8s_audit"
 - spawn a shell: run with .... "bash"

The default is "syscall" to preserve existing behavior.

In most cases, you'll need to provide kube config
files/directories that allow access to your cluster. A
command like the following will work:

```
docker run -v $HOME/.kube:/root/.kube -it falcosecurity/falco-event-generator
k8s_audit
```

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-01-15 09:35:28 +01:00
Nacho Rasche
4a7e318833 Add Skyscanner to adopters
Signed-off-by: Nacho Rasche <nacho.rasche@skyscanner.net>
2020-01-14 13:41:08 +01:00
toc-me[bot]
373d2bfd89 Update ToC for proposals/20191217-rules-naming-convention.md
Signed-off-by: kaizhe <derek0405@gmail.com>

address comments

Signed-off-by: kaizhe <derek0405@gmail.com>
2020-01-07 14:58:12 +01:00
Kaizhe Huang
4065af25c1 Update proposals/20191217-rules-naming-convention.md
Co-Authored-By: Leo Di Donato <leodidonato@gmail.com>

Signed-off-by: kaizhe <derek0405@gmail.com>
2020-01-07 14:58:12 +01:00
kaizhe
cc1892177a falco rule naming convention
Signed-off-by: kaizhe <derek0405@gmail.com>
2020-01-07 14:58:12 +01:00
Michael Ducy
2041932ad2 move audit doc
Signed-off-by: Michael Ducy <michael@ducy.org>
2019-12-17 09:15:41 +01:00
Michael Ducy
64b50978e0 Publish security audit
Signed-off-by: Michael Ducy <michael@ducy.org>
2019-12-17 09:15:41 +01:00
Mark Stemm
c53df3af00 Don't rethrow exceptions in parse_k8s_audit_json
Callers aren't expected to catch execeptions and instead rely on the
bool return value to indicate whether or not the parsing was successful.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-12-16 17:00:50 -08:00
Mark Stemm
4c576f31f2 Also allow json arrays of k8s audit evts
Currently, the json object POSTed to the /k8s_audit endpoint is assumed
to be an obect, with a "type" of either "Event" or "EventList". When the
K8s API Server POSTs events, it aggregates them into an EventList,
ensuring that there is always a single object.

However, we're going to add some intermediate tools that tail log files
and send them to the endpoint, and the easiest way to send a batch of
events is to pass them as a json array instead of a single object.

To properly handle this, modify parse_k8s_audit_event_json to also
handle a json array. For arrays, it iterates over the objects, calling
parse_k8s_audit_json recursively. This only iterates an initial top
level array to avoid excessive recursion/attacks involving degenerate
json objects with excessively nested arrays.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2019-12-16 17:00:50 -08:00
Hiroki Suezawa
cd94d05cd9 rule(list network_tool_binaries): delete ssh from the list
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-16 22:27:12 +01:00
Hiroki Suezawa
23a7203e50 rule(list network_tool_binaries): add network tool names
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-16 22:27:12 +01:00
Leonardo Di Donato
28fa4a72e8 docs(docker/builder): usage reports clang version too
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-13 13:04:23 +01:00
Leonardo Di Donato
ac4f089903 update(docker/builder): add llvm-toolset-7
Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-13 13:04:23 +01:00
Leonardo Di Donato
cd1b23d2bc update(.github): remove unused kind/* label from PR template
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-13 11:17:02 +01:00
Leonardo Di Donato
de8714d2be chore(.github): delete issue templates in favor of default ones
Default issue templates can be found in https://github.com/falcosecurity/.github repo.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-13 11:17:02 +01:00
Hiroki Suezawa
93fdf8ef61 rule(macro user_known_k8s_client_container): Rephrase the comment
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-11 12:53:06 +01:00
Hiroki Suezawa
bcc84c47c6 rule(macro user_known_k8s_client_container): have more strict condition to avoid false positives
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-11 12:53:06 +01:00
Chris Goller
965ead0c2a build: use consistent case for options in message
Signed-off-by: Chris Goller <goller@gmail.com>
2019-12-10 21:15:16 +01:00
Chris Goller
d66125278a build: use consistent case for falco options
Signed-off-by: Chris Goller <goller@gmail.com>
2019-12-10 21:15:16 +01:00
Chris Goller
e31bfeb8b2 build: add FALCO_Coverage CMake option
With cmake FALCO_Coverage=on the --coverage option
is passed to both clang and gcc to help analyze untested
portions of the code base.  It produces gcov files.

These files can be analyzed by many tools such as lcov,
gcovr, etc.

Here is an example of one such tool, lcov:

 lcov --directory . --capture --output-file coverage.info
 lcov --extract coverage.info '/source/*' --output-file coverage.info
 genhtml coverage.info

Signed-off-by: Chris Goller <goller@gmail.com>
2019-12-10 21:15:16 +01:00
Leonardo Di Donato
7159b43f68 update(proposals): goals, non-goals and use cases of the Falco API
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-09 16:46:16 +01:00
Leonardo Di Donato
b684aee817 update(proposals): better summary for Falco API
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-09 16:46:16 +01:00
Leonardo Di Donato
ae52dc4d3b proposals: complete the Falco API proposal
Co-Authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-09 16:46:16 +01:00
Leo Di Donato
a64f7faa3c fix(proposals): typos and language
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>

Co-Authored-By: Lorenzo Fontana <lo@linux.com>
2019-12-09 16:46:16 +01:00
Leonardo Di Donato
ced04a4d89 update: goals and (initial) architecture for API services
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-09 16:46:16 +01:00
Leonardo Di Donato
2b75ca9024 new: setup Falco API proposal
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-09 16:46:16 +01:00
Lorenzo Fontana
8069eacc94 build: use secure grpc when it is not bundled
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-12-06 13:36:16 +01:00
Nicolas Marier
13931ab5d7 rule(Write below etc): whitelist automount writing under /etc
This commit allows automount to write under /etc/mtab without flagging
it as an error.

Signed-off-by: Nicolas Marier <nmarier@coveo.com>
2019-12-05 19:27:18 +01:00
Hiroki Suezawa
559b7e1bb1 rule(The docker client is executed in a container): modify condition to reduce false positive
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-05 14:32:22 +01:00
Hiroki Suezawa
fc58ac7356 rule update: modify rule to detect connection to K8S API Server from a container
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-05 10:59:05 +01:00
Leonardo Di Donato
e893e048a1 docs(README): community call + repo planning + correct mailing list URL
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-04 18:41:28 +01:00
Leo Di Donato
0c9787624b docs(CONTRIBUTING): rule type subsection title
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2019-12-04 18:09:14 +01:00
Lorenzo Fontana
daca750cd9 docs(CONTRIBUTING): commit convention details
Signed-off-by: Lorenzo Fontana <lo@linux.com>
2019-12-04 18:09:14 +01:00
Jean-Philippe Lachance
418bcf2177 Apply Kaizhe's code review
Signed-off-by: Jean-Philippe Lachance <jplachance@coveo.com>
2019-12-04 03:36:04 +01:00
Jean-Philippe Lachance
f97a33d40a Exclude exe_running_docker_save in the "Update Package Repository" rule
Signed-off-by: Jean-Philippe Lachance <jplachance@coveo.com>
2019-12-04 03:36:04 +01:00
Jean-Philippe Lachance
df7a356e1d Apply Kaizhe's code review
Signed-off-by: Jean-Philippe Lachance <jplachance@coveo.com>
2019-12-04 03:35:11 +01:00
Jean-Philippe Lachance
03e8b7f53d Exclude exe_running_docker_save in the "Modify Shell Configuration File" rule
Signed-off-by: Jean-Philippe Lachance <jplachance@coveo.com>
2019-12-04 03:35:11 +01:00
Jean-Philippe Lachance
146343e5f0 Update the exe_running_docker_save macro to support docker in docker
Signed-off-by: Jean-Philippe Lachance <jplachance@coveo.com>
2019-12-04 02:20:21 +01:00
Hiroki Suezawa
7da245e902 rule update: Modify rule to detect raw packets creation
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-04 00:19:26 +00:00
Hiroki Suezawa
d0e6279bb2 rule update: Modify condition for raw packets creation
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-04 00:19:26 +00:00
Hiroki Suezawa
8b2d4e1fe6 rule update: Fix condition for raw packets creation and renamed
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-04 00:19:26 +00:00
Hiroki Suezawa
ebec520ebc rule update: Add rules to detect raw packets creation
Signed-off-by: Hiroki Suezawa <suezawa@gmail.com>
2019-12-04 00:19:26 +00:00
kaizhe
2f8caf99cd rule update: align sensitive mount macro between k8s_audit rules and syscall rules
Signed-off-by: kaizhe <derek0405@gmail.com>
2019-12-03 12:58:21 -08:00