Commit Graph

2552 Commits

Author SHA1 Message Date
Leonardo Di Donato
b8b50932fe update: reduce the max burst of event drops
This also introduces a threshold configurable value.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-03-22 19:42:30 +01:00
Kaizhe Huang
7ea80e39b1 rule(Set Setuid or Setgid bit) update: add k3s-agent in the whitelist
Signed-off-by: Kaizhe Huang <derek0405@gmail.com>
2021-03-22 11:36:59 +01:00
Kaizhe Huang
b58f76b268 rule (Debugfs Launched in Privileged Container and Mount Launched in Privileged Container): create
Signed-off-by: Kaizhe Huang <derek0405@gmail.com>
2021-03-22 11:36:59 +01:00
JenTing Hsiao
b1801c28c7 Bump year to 2021
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-03-12 10:45:31 +01:00
JenTing Hsiao
e1d3e68a84 Modprobe/rmmod at systemd service start/stop
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-03-12 10:45:31 +01:00
JenTing Hsiao
5661b491af Removes the comments in systemd service files
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-03-12 10:45:31 +01:00
JenTing Hsiao
39bb5c28c7 Migrate from init to systemd in debian package
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-03-12 10:45:31 +01:00
JenTing Hsiao
3ba62a4031 Migrate from init to systemd in rpm package
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
2021-03-12 10:45:31 +01:00
Shane Lawrence
2f0e09b549 rule (Write below monitored dir): Clean up and use glob matching.
Signed-off-by: Shane Lawrence <shane@lawrence.dev>
2021-03-12 10:37:16 +01:00
POCTEO
34bbe2984f Pocteo as an adopter
Signed-off-by: Walid DRIDI <contact@pocteo.co>
2021-03-11 16:58:59 +01:00
Leonardo Grasso
825e6caf2d build: fetch build deps from download.falco.org
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-03-10 18:00:52 +01:00
jonahjon
96ad761308 adding falco-slim build/push
Signed-off-by: jonahjon <jonahjones094@gmail.com>
2021-03-05 12:22:47 +01:00
Leo Di Donato
bb7ce37159 fix(.circleci): correctly publish the falco-driver-loader container image from master to AWS ECR gallery
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-03-05 12:22:47 +01:00
Leo Di Donato
c66d056f67 fix(.circleci): the falco-driver-loader container images requires FALCO_IMAGE_TAG build arg (release to AWS ECR gallery)
Signed-off-by: Leonardo Di Donato
2021-03-05 12:22:47 +01:00
Leo Di Donato
6a2759fe94 update(.circleci): tag falco-no-driver:<tag> image as falco-no-driver:latest, falco:<tag>-slim, and falco:latest-slim
And publish them too.

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-03-05 12:22:47 +01:00
Leo Di Donato
b91c5b613a update(.circleci): falco-no-driver:latest from bin bucket
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-03-05 12:22:47 +01:00
Leo Di Donato
6fe9f8da0b fix(.circleci): falco-no-driver container images grabs Falco from the bin[-dev] bucket
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-03-05 12:22:47 +01:00
jonahjon
e888a1d354 adding other alternate AWS builds to circleCI
Signed-off-by: jonahjon <jonahjones094@gmail.com>
2021-03-05 12:22:47 +01:00
Isaac Rivera
6e746d71ba fixing typo
Signed-off-by: Isaac Rivera <irivera007@yahoo.com>
2021-03-05 12:16:33 +01:00
Isaac Rivera
2de8176c88 adding shapesecurity to adopters
Signed-off-by: Isaac Rivera <irivera007@yahoo.com>
2021-03-05 12:16:33 +01:00
Shane Lawrence
74164b1ef8 Use default pip version to get avocado version.
Signed-off-by: Shane Lawrence <shane@lawrence.dev>
2021-03-05 10:50:27 +01:00
Shane Lawrence
da8f054043 Fix broken links to docs.
Signed-off-by: Shane Lawrence <shane@lawrence.dev>
2021-03-05 10:48:21 +01:00
Bart van der Schans
05545f228d Add flex and bison to docker for building bpf module on recent amazon linux2
Signed-off-by: Bart van der Schans <bart@vanderschans.nl>
2021-03-05 10:46:10 +01:00
Spencer Krum
b3693a0b75 chore(rules): Add ibmcloud operator lifecycle manager
Signed-off-by: Spencer Krum <nibz@spencerkrum.com>
2021-02-19 12:35:30 +01:00
Spencer Krum
a54f946135 chore(rules): Rule exceptions for ibm cloud
Whitelist ibm images for connecting to k8s api server

IBM Observability by Sysdig has a vendored sysdig/agent image.

IBM's Kubernetes Service ships with an operator manager. Example:

19:12:45.090908160: Notice Unexpected connection to K8s API Server from
container (command=catalog -namespace ibm-system
-configmapServerImage=registry.ng.bluemix.net/armada-master/configmap-operator-registry:v1.6.1
k8s.ns=ibm-system k8s.pod=catalog-operator-6495d76869-ncl2z
container=4ad7a04fa1e0
image=registry.ng.bluemix.net/armada-master/olm:0.14.1-IKS-1
connection=172.30.108.219:48200->172.21.0.1:443) k8s.ns=ibm-system
k8s.pod=catalog-operator-6495d76869-ncl2z container=4ad7a04fa1e0

IBM's Kubernetes service also ships with a metrics collecting agent

Signed-off-by: Spencer Krum <nibz@spencerkrum.com>
2021-02-19 12:35:30 +01:00
Leonardo Grasso
85db1aa997 fix(rules): correct indentation
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-02-19 09:24:55 +01:00
ismail yenigul
37a6caae12 remove commercial images to unblock PR
add endpoint-controller to user_known_sa_list
related event:
    {
        "output": "05:19:25.557989888: Warning Service account created
in kube namespace (user=system:kube-controller-manager
serviceaccount=endpoint-controller ns=kube-system)",
        "priority": "Warning",
        "rule": "Service Account Created in Kube Namespace",
        "time": "2021-02-16T05:19:25.557989888Z",
        "output_fields": {
            "jevt.time": "05:19:25.557989888",
            "ka.target.name": "endpoint-controller",
            "ka.target.namespace": "kube-system",
            "ka.user.name": "system:kube-controller-manager"
        }
    }

Signed-off-by: ismail yenigul <ismailyenigul@gmail.com>
2021-02-19 09:24:55 +01:00
ismail yenigul
2d962dfcb0 rebase to master
update user_known_sa_list with k8s internal sa in kube-system

{
        "output": "10:27:56.539783936: Warning Service account created
in kube namespace (user=system:kube-controller-manager
serviceaccount=replicaset-controller ns=kube-system)",
        "priority": "Warning",
        "rule": "Service Account Created in Kube Namespace",
        "time": "2021-02-15T10:27:56.539783936Z",
        "output_fields": {
            "jevt.time": "10:27:56.539783936",
            "ka.target.name": "replicaset-controller",
            "ka.target.namespace": "kube-system",
            "ka.user.name": "system:kube-controller-manager"
        }
    }

{
        "output": "17:06:18.267429888: Warning Service account created
in kube namespace (user=system:kube-controller-manager
serviceaccount=deployment-controller ns=kube-system)",
        "priority": "Warning",
        "rule": "Service Account Created in Kube Namespace",
        "time": "2021-02-15T17:06:18.267429888Z",
        "output_fields": {
            "jevt.time": "17:06:18.267429888",
            "ka.target.name": "deployment-controller",
            "ka.target.namespace": "kube-system",
            "ka.user.name": "system:kube-controller-manager"
        }
    }

and more..

Signed-off-by: ismail yenigul <ismailyenigul@gmail.com>
2021-02-19 09:24:55 +01:00
Petr Michalec
541845156f rhsm cert updates
Signed-off-by: Petr Michalec <epcim@apealive.net>
Signed-off-by: Petr Michalec <pmichalec@ves.io>
2021-02-18 15:42:06 +01:00
darryk5
0879523776 update: add review suggestions for Rule Sudo Potential Privilege Escalation
Signed-off-by: darryk5 <stefano.chierici@sysdig.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Co-authored-by: Leonardo Grasso <me@leonardograsso.com>
2021-02-17 21:36:51 +01:00
darryk5
81e880b486 Added Rule Sudo Potential Privilege Escalation (CVE-2021-3156)
See #1540

Signed-off-by: darryk5 <stefano.chierici@sysdig.com>
Co-authored-by: Lorenzo Fontana <lo@linux.com>
2021-02-17 21:36:51 +01:00
Carlos Panato
f140cdfd68 falco: add healthz endpoint
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-02-11 20:29:07 +01:00
Matteo Baiguini
6408270476 Added Swissblock to list of adopters
Signed-off-by: Matteo Baiguini <mbaiguini@swissblock.net>
2021-02-05 11:46:07 +01:00
Carlos Panato
5a6cbb190c docs: update link for building from source
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-02-04 17:37:57 +01:00
ismail yenigul
959811a503 add eks:node-manager to allowed_k8s_users list
eks:node-manager  is an Amazon EKS internal service role that performs specific operations for managed node groups and Fargate.
Reference: https://github.com/awsdocs/amazon-eks-user-guide/blob/master/doc_source/logging-monitoring.md
Related falco log

```
{"output":"10:56:31.181308928: Warning K8s Operation performed by user not in allowed list of users
 (user=eks:node-manager target=aws-auth/configmaps verb=get uri=/api/v1/namespaces/kube-system/configmaps/aws-auth?timeout=19s resp=200)","priority":"Warning","rule":"Disallowed K8s User","time":"2021-01-26T10:56:31.181308928Z", "output_fields":
{"jevt.time":"10:56:31.181308928","ka.response.code":"200","ka.target.name":"aws-auth","ka.target.resource":"configmaps","ka.uri":"/api/v1/namespaces/kube-system/configmaps/aws-auth?timeout=19s","ka.user.name":"eks:node-manager","ka.verb":"get"}}
```

Signed-off-by: ismailyenigul <ismailyenigul@gmail.com>
2021-02-04 17:33:54 +01:00
Leonardo Di Donato
19fe7240e2 new(proposals): libraries donation
Donate:
- libsinsp
- libscap
- the kernel module driver
- the eBPF driver sources

by moving them to the Falco project.

Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
2021-02-04 17:29:42 +01:00
Didier Durand
b76420fe47 Fix various typos in markdown files.
Signed-off-by: Didier Durand <durand.didier@gmail.com>
2021-01-19 16:38:58 +01:00
Leonardo Grasso
2883df5808 docs: move governance to falcosecurity/.github
See https://github.com/falcosecurity/.github/pull/25

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
2021-01-19 10:42:07 +01:00
Mark Stemm
8c4040b610 Also include all exception fields in rule_result
When returning a rule_result struct, also include a set of field names
used by all exceptions for this rule. This may make building exception
values a bit easier.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
49b8f87db4 Make the req. engine version 8 for k8s_audit rules
These define exceptions too.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
cd8234d8b3 Remove falco_tests.yaml from gitignore
It was renamed from falco_tests.yaml.in in
5bafa198c6.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
e6b0d2697f Use the right not equals operator.
Fix typo, "!" should be "!=".

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
987ececa54 Remove test case for unknown objects.
The rules loader now allows objects with unknown keys.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
7f4afffe3e Remove old unused macros/lists
Remove old macros/lists that aren't being used by any current rules.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
91bfa379ce Properly note lists in other lists as used
If a list:

- list: foo
  items: [a, b, c]

Was referenced in another list:

- list: bar
  items: [foo, d, e, f]

The first list would not be marked as used, when it should.

This avoids mistaken messages like "list xxx not refered to by any rule/macro/list"

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
64a231b962 Add exceptions fields/comps/values to rules files
Take advantage of the changes to support exceptions and refactor rules
to use them whenever feasible:

- Define exceptions for every rule. In cases where no practical
  exception exists e.g. "K8s <obj> Created/Deleted", define an empty
  exception property just to avoid warnings when loading rules.
- Go through all rules and convert macros-used-as-exceptions that
  matched against 2-3 filter fields into exceptions. In most cases,
  switching from equality (e.g proc.name=nginx) to in (e.g. proc.name
  in (nginx)) allowed for better groupings into a smaller set of
  exception items.
- In cases where the exception had complex combinations of fields, keep
  the macro as is.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
7b030727a2 Bump falco engine version to 8 for exceptions.
Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
b2eb3ec345 Don't look for event counts with -V/validate
When running falco with -V/valdiate <rules file>, you won't get any
event counts. All prior tests didn't get this far as they also resulted
in rules parsing errors.

However, validating can now result in warnings only. This won't exit but
won't print event counts either.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
b4eb5b87b6 Automated tests for exceptions
Handle various positive and negative cases. Should handle every error
and warning path when reading exceptions objects or rule exception
fields, and various positive cases of using exceptions to prevent
alerts.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00
Mark Stemm
a582599778 Support exceptions properties on rules
Support exceptions properties on rules as described in
https://github.com/falcosecurity/falco/pull/1376.

- When parsing rules, add an empty exceptions table if not specified.
- If exceptions are specified, they must contain names and lists of
  fields, and optionally can contain lists of comps and lists of lists of
  values.
- If comps are not specified, = is used.
- If a rule has exceptions and append:true, add values to the original rule's
  exception values with the matching name.
- It's a warning but not an error to have exception values with a name
  not matching any fields.

After loading all rules, build the exception condition string based on
any exceptions:

- If an exception has a single value for the "fields" property, values are
  combined into a single set to build a condition string like "field
  cmp (val1, val2, ...)".
- Otherwise, iterate through each rule's exception
  values, finding the matching field names (field1, field2, ...) and
  comp operators (cmp1, cmp2, ...), then
  iterating over the list of field values (val1a, val1b, ...), (val2a,
  val2b, ...), building up a string of the form:
    and not ((field1 cmp1 val1a and field2 cmp2 val1b and ...) or
              (field1 cmp1 val2a and field2 cmp2 val2b and ...)...
	     )"
- If a value is not already quoted and contains a space, quote it in the
  string.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
2021-01-19 10:37:55 +01:00