Commit Graph

1994 Commits

Author SHA1 Message Date
Mark Stemm
7666bc3f3a rule(System ClusterRole Modified/Deleted): + role
Add system:managed-certificate-controller as a system role that can be
modified. Can be changed as a part of upgrades.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
08d38d8269 Rule(Pod Created in Kube Namespace): add images
Add several images seen in GKE environments that can run in the
kube-system namespace.

Also change the names of the lists to be more specific. The old names
are retained but are kept around for backwards compatibility.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
3fd4464dee rule(Disallowed K8s User): add known users
Seen when using K8s cluster autoscaling or addon manager.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
702d989cd0 rule(Create HostNetwork Pod): add images
Add a set of images known to run in the host network. Mostly related to
GKE, sometimes plus metrics collection.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
de9c8720c0 rule(Launch Privileged Container) add images
Most of these are seen in GKE and are uses for core routing/metrics
collection.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
534cb8e59f rule(Launch Privileged Container): sort/reorg list
Sort the items in the list falco_privileged_images alphabetically
and also separate them into individual lines. Make it easier to note
changes to the entries in the list using git blame.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
9b3adc1373 rule(Read sensitive file untrusted):google_oslogin
Related to https://github.com/GoogleCloudPlatform/guest-oslogin, full
cmdline is google_oslogin_control.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
fb5e13c694 rule(Write below root): add mysqlsh
Let mysqlsh write below /root/.mysqlsh.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
7effc02c60 rule(Write below etc): add calco exceptions
Add several calico images and command line programs that end up writing
below /etc/calico.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
7ae0ce1936 rule(Update Package Repository): restrict files
Previously any write to a file called sources.list would match the
access_repositories condition, even a file /usr/tmp/..../sources.list.

Change the macro so the files in repository_files must be somewhere
below any of repository_directories.

Also allow programs spawned by package management programs to change
these files, using package_mgmt_ancestor_procs.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
891965375d rule(Read sensitive file untrusted): linux-bench
Let programs spawned by linux-bench (CIS Linux Benchmark program) read
/etc/shadow. Tests in the benchmark check for permissions of the file
and accounts in the contents of the file.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Mark Stemm
7a4d790458 rule(Change thread namespace): Require proc name
In some cases, dropped events around the time a new container is started
can result in missing the exec/clone for a process that does a setns to
enter the namespace of a container. Here's an example from an oss
capture:

```

282273 09:01:22.098095673 30 runc:[0:PARENT] (168555) < setns res=0
282283 09:01:22.098138869 30 runc:[0:PARENT] (168555) < setns res=0
282295 09:01:22.098179685 30 runc:[0:PARENT] (168555) < setns res=0
517284 09:01:30.128723777 13 <NA> (168909) < setns res=0
517337 09:01:30.129054963 13 <NA> (168909) < setns res=0
517451 09:01:30.129560037 2 <NA> (168890) < setns res=0
524597 09:01:30.162741004 19 <NA> (168890) < setns res=0
527433 09:01:30.179786170 18 runc:[0:PARENT] (168927) < setns res=0
527448 09:01:30.179852428 18 runc:[0:PARENT] (168927) < setns res=0
535566 09:01:30.232420372 25 nsenter (168938) < setns res=0
537412 09:01:30.246200357 0 nsenter (168941) < setns res=0
554163 09:01:30.347158783 17 nsenter (168950) < setns res=0
659908 09:01:31.064622960 12 runc:[0:PARENT] (169023) < setns res=0
659919 09:01:31.064665759 12 runc:[0:PARENT] (169023) < setns res=0
732062 09:01:31.608297074 4 nsenter (169055) < setns res=0
812985 09:01:32.217527319 6 runc:[0:PARENT] (169077) < setns res=0
812991 09:01:32.217579396 6 runc:[0:PARENT] (169077) < setns res=0
813000 09:01:32.217632211 6 runc:[0:PARENT] (169077) < setns res=0
```

When this happens, it can cause false positives for the "Change thread
namespace" rule as it allows certain process names like "runc",
"containerd", etc to perform setns calls.

Other rules already use the proc_name_exists macro to require that the
process name exists. This change adds proc_name_exists to the Change
Thread Namespace rule as well.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2020-09-03 18:56:51 +02:00
Loris Degioanni
5d71d70a14 added brakets to three macros to make them less ambiguous
Signed-off-by: Loris Degioanni <loris@sysdig.com>
2020-08-31 18:02:10 +02:00
Leonardo Grasso
0b8ecfaed3 docs(README.md): correct CONTRIBUTING.md URL
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2020-08-31 17:08:06 +02:00
Leonardo Grasso
b003c92080 docs(RELEASE.md): correct typo in YYYY
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2020-08-31 17:08:06 +02:00
Chuck Schweizer
d678be5579 Adding user.loginuid to the default falco rules in any place user.name exists
This update will provide information as to which process uid intitiated the event.  This is really important for processes that are started
by a different user name.

Signed-off-by: Chuck Schweizer <chuck.schweizer.lvk2@statefarm.com>
2020-08-28 10:02:19 +02:00
Lorenzo Fontana
0a4d60c22b docs: changelog for 0.25.0
Co-Authored-By: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-25 16:19:21 +02:00
Leonardo Grasso
385d6eff6d fix(userspace/falco): do not always rethrow the exception
Co-Authored-By: Lorenzo Fontana <fontanalorenz@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2020-08-25 14:27:40 +02:00
Leonardo Grasso
e0b66ecae9 revert: "build: temporary remove falco_traces.yaml from integration test suite"
This reverts commit 7a2708de09.

Co-Authored-By: Lorenzo Fontana <fontanalorenz@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2020-08-24 20:32:24 +02:00
Leonardo Grasso
a87913c822 build: update sysdig version to ae104eb20ff0198a5dcb0c91cc36c86e7c3f25c7
Co-Authored-By: Lorenzo Fontana <fontanalorenz@gmail.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2020-08-24 20:32:24 +02:00
Lorenzo Fontana
7a2708de09 build: temporary remove falco_traces.yaml from integration test suite
This happens because the file descriptors paths have been fixed
in this commit [0].
However, the scap files fixtures we have for the tests still contain
the old paths causing this problem.

We are commenting out those tests and opening an issue to get this fixed
later.

[0] 37aab8debf

Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Leonardo Di Donato
fbac5b77ff build(cmake/modules): change driver version to 37aab8
This driver version brings into the following features:
- fix for https://github.com/draios/sysdig/issues/1659 (correct handling
  of the pathnames args for *at syscalls)
- update JQ + builtin oniguruma

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
fc39c92048 build: update sysdig shasum
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
32374e9d95 build(cmake/modules/jq): explaination for jq mirroring link
Co-Authored-By: Leonardo Grasso <me@leonardograsso.com>
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
220274601c build(cmake/jq): mirror jq 1.6 in Falco bintray
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
08f6ddb889 build: CentOS 8 dependencies
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
4166f02668 build: CentOS 8 builds
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
d6279bd474 build: bump gRPC to 1.31.1
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
a20e3267cd build: make sure lyaml is linked with the bundled libyaml
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
1362ad7c10 build: add ubuntu bionic to circleci
This is done to avoid breaking the compatibility with it.

Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
0324e8b610 build: update gRPC to 0.27.0
This change was needed because gRPC was using some internal classes
to do vector operations in 0.25.0

Those operations were leading to sigsegv under certain operating
systems, like Ubuntu 18.04

In 0.27.0 they swapped their internal libraries with abseil-cpp.

I tested this and our gRPC server works very well with this new version
as well the CRI api.

I didn't go to 0.31.0 yet because it's very different now and it will
require more iterations to get there, specifically on the CRI api code.

Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
feb39010bb build: include openssl libraries in falco
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
59b2bdac9d build: avoid autoreconf -fi in jq
In their readme, jq claims that you don't have
to do autoreconf -fi when downloading a released tarball.

However, they forgot to push the released makefiles
into their release tarbal.

For this reason, we have to mirror their release after
doing the configuration ourselves.

This is needed because many distros do not ship the right
version of autoreconf, making virtually impossible to build
Falco on them.

Here is how it was created:

git clone https://github.com/stedolan/jq.git
cd jq
git checkout tags/jq-1.6
git submodule update --init
autoreconf -fi

Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
f388d95591 build: gRPC link to bundled OpenSSL
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
8bfd6eaef7 build: fix JQ compilation issues and link oniguruma
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Lorenzo Fontana
4db3cc1f72 build: fix cURL ssl compilation issues
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-20 19:26:56 +02:00
Tommy McCormick
52a2c253ce docs(community health files): fall back to org default community health files
Signed-off-by: Tommy McCormick <mccormick9@gmail.com>
2020-08-19 10:14:51 +02:00
Leonardo Grasso
1f1f7c16b6 chore(rules): add renameat2 to rename macro
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2020-08-18 11:23:24 +02:00
Kris Nova
ff77a36a03 feat(docs): Updating links for gRPC and Protobuf
Signed-off-by: Kris Nova <kris@nivenly.com>
2020-08-18 09:20:42 +02:00
Kris Nova
213e4f6aaf feat(docs): Fixing formatting in README.md
Signed-off-by: Kris Nova <kris@nivenly.com>
2020-08-18 09:20:42 +02:00
Kris Nova
5839e41093 feat(docs): Adding SDKs and gRPC to README.md
Signed-off-by: Kris Nova <kris@nivenly.com>
2020-08-18 09:20:42 +02:00
Kris Nova
974efadaee feat(doc): Adding incubating to README.md
Signed-off-by: Kris Nova <kris@nivenly.com>
2020-08-18 09:20:42 +02:00
Kris Nova
615313e8fa feat(doc): Updating README.md
Updating Readme with most recent doc changes

Signed-off-by: Kris Nova <kris@nivenly.com>
2020-08-18 09:20:42 +02:00
Lorenzo Fontana
4c25135bf9 update: bump sysdig to 0.27.0
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
2020-08-17 18:21:45 +02:00
kaizhe
1bb0a9b44a minor fix
Signed-off-by: kaizhe <derek0405@gmail.com>
2020-08-13 20:34:39 +02:00
kaizhe
ca3c4814fe add sematext images back
Signed-off-by: kaizhe <derek0405@gmail.com>
2020-08-13 20:34:39 +02:00
kaizhe
50832c7990 remove non-oss images in the whitelist
Signed-off-by: kaizhe <derek0405@gmail.com>
2020-08-13 20:34:39 +02:00
kaizhe
4eba59c3f0 keep both w/ docker.io and w/o docker.io for sysdig images
Signed-off-by: kaizhe <derek0405@gmail.com>
2020-08-13 20:34:39 +02:00
kaizhe
3e98c2efc0 macro(user_read_sensitive_file_containers): replace endswiths with exact image repo name
macro(user_trusted_containers): replace endswiths with exact image repo name
macro(user_privileged_containers): replace endswiths with exact image repo name
macro(trusted_images_query_miner_domain_dns): replace endswiths with exact image repo name
macro(falco_privileged_containers): append "/" to quay.io/sysdig
list(falco_privileged_images): add images docker.io/sysdig/agent-slim and docker.io/sysdig/node-image-analyzer
list(falco_sensitive_mount_images): add image docker.io/sysdig/agent-slim
list(k8s_containers): prepend docker.io to images

Signed-off-by: kaizhe <derek0405@gmail.com>
2020-08-13 20:34:39 +02:00
Radu Andries
938ece8f4e macro(exe_running_docker_save): add better support for centos
dockerd and docker have "-current" suffix on centos and rhel. This
macro does not match causing false positives on multiple rules
using it

Signed-off-by: Radu Andries <radu@sysdig.com>
2020-08-13 19:43:48 +02:00