GithubHelp home page GithubHelp logo

falcosecurity / falcosidekick Goto Github PK

View Code? Open in Web Editor NEW
521.0 16.0 166.0 6.8 MB

Connect Falco to your ecosystem

License: Apache License 2.0

Go 98.48% Dockerfile 0.15% Makefile 0.91% Shell 0.46%
falco docker kubernetes security falco-event response-engine hacktoberfest

falcosidekick's Introduction

Falcosidekick

Falco Ecosystem Repository Stable

falcosidekick

release last commit licence docker pulls

Description

A simple daemon for connecting Falco to your ecosystem. It takes a Falco events and forward them to different outputs in a fan-out way.

It works as a single endpoint for as many as you want Falco instances :

falco_with_falcosidekick

Table of contents

Outputs

Falcosidekick manages a large variety of outputs with different purposes.

Note

Follow the links to get the configuration of each output.

Chat

Metrics / Observability

Alerting

Logs

Object Storage

FaaS / Serverless

Message queue / Streaming

Email

Database

Web

SIEM

Workflow

Traces

Other

Installation

Run the daemon as any other daemon in your architecture (systemd, k8s deployment, swarm service, ...).

Localhost

With docker

Use the environment variables to set up the outputs:

docker run -d -p 2801:2801 -e SLACK_WEBHOOKURL=XXXX -e DATADOG_APIKEY=XXXX falcosecurity/falcosidekick

With systemd

  • Download the latest release:

    VER=$(curl --silent -qI https://github.com/falcosecurity/falcosidekick/releases/latest | awk -F '/' '/^location/ {print  substr($NF, 1, length($NF)-1)}')
    wget -c https://github.com/falcosecurity/falcosidekick/releases/download/${VER}/falcosidekick_${VER}_linux_arm64.tar.gz -O - | tar -xz
    or
    wget -c https://github.com/falcosecurity/falcosidekick/releases/download/${VER}/falcosidekick_${VER}_linux_amd64.tar.gz -O - | tar -xz
    chmod +x falcosidekick
    sudo mv falcosidekick /usr/local/bin/
  • Create the /etc/falcosidekick/config.yaml file, see Configuration.

  • Create the systemd unit files /etc/systemd/system/falcosidekick.service:

    sudo touch /etc/systemd/system/falcosidekick.service
    sudo chmod 664 /etc/systemd/system/falcosidekick.service
    [Unit]
    Description=Falcosidekick
    After=network.target
    StartLimitIntervalSec=0
    
    [Service]
    Type=simple
    Restart=always
    RestartSec=1
    ExecStart=/usr/local/bin/falcosidekick -c /etc/falcosidekick/config.yaml
    
    [Install]
    WantedBy=default.target
  • Reload systemd and start Falcosidekick:

    sudo systemctl daemon-reload
    sudo systemctl enable falcosidekick
    sudo systemctl start falcosidekick
  • Check if Falcosidekick runs:

    curl localhost:2801/healthz

In Kubernetes

With Helm

See https://github.com/falcosecurity/charts/blob/master/charts/falcosidekick/README.md

helm repo add falcosecurity https://falcosecurity.github.io/charts
helm repo update

helm install falcosidekick --set config.debug=true falcosecurity/falcosidekick

Note

You can also deploy falcosidekick as a dependency of the falco chart, the settings for the communication between falco and falcosidekick are automatically set. Just prefix all falcosidekick settings with falcosidekick.:

helm repo add falcosecurity https://falcosecurity.github.io/charts
helm repo update

helm install falco --set falcosidekick.enabled=true falcosecurity/falco

Connect Falco

To connect Falco with Falcosidekick, you need to change it configuration as following:

with falco.yaml

If managing falco.yaml manually, set this:

json_output: true
json_include_output_property: true
http_output:
  enabled: true
  url: "http://localhost:2801/"

with Helm

If installing falco with Helm, set this (adapted to your environment) in your values.yaml :

falcosidekick:
  enabled: true

or

jsonOutput: true
jsonIncludeOutputProperty: true
httpOutput:
  enabled: true
  url: "http://falcosidekick:2801/"

or

jsonOutput: true
jsonIncludeOutputProperty: true
programOutput:
  enabled: true
  keepAlive: false
  program: "curl -d @- falcosidekick:2801/"

Configuration

Configuration is made by file (yaml) and env vars, both can be used but env vars override values from file.

YAML File

See config_example.yaml :

#listenaddress: "" # ip address to bind falcosidekick to (default: "" meaning all addresses)
#listenport: 2801 # port to listen for daemon (default: 2801)
debug: false # if true all outputs will print in stdout the payload they send (default: false)
customfields: # custom fields are added to falco events, if the value starts with % the relative env var is used
  # Akey: "AValue"
  # Bkey: "BValue"
  # Ckey: "CValue"
templatedfields: # templated fields are added to falco events and metrics, it uses Go template + output_fields values
  # Dkey: '{{ or (index . "k8s.ns.labels.foo") "bar" }}'
# bracketreplacer: "_" # if not empty, replace the brackets in keys of Output Fields
outputFieldFormat: "<timestamp>: <priority> <output> <custom_fields> <templated_fields>" # if not empty, allow to change the format of the output field. (default: "<timestamp>: <priority> <output>")
mutualtlsfilespath: "/etc/certs" # folder which will used to store client.crt, client.key and ca.crt files for mutual tls for outputs, will be deprecated in the future (default: "/etc/certs")
mutualtlsclient: # takes priority over mutualtlsfilespath if not emtpy
  certfile: "/etc/certs/client/client.crt" # client certification file
  keyfile: "/etc/certs/client/client.key" # client key
  cacertfile: "/etc/certs/client/ca.crt" # for server certification
tlsclient:
  cacertfile: "/etc/certs/client/ca.crt" # CA certificate file for server certification on TLS connections, appended to the system CA pool if not empty
tlsserver:
  deploy: false # if true, TLS server will be deployed instead of HTTP
  certfile: "/etc/certs/server/server.crt" # server certification file
  keyfile: "/etc/certs/server/server.key" # server key
  mutualtls: false # if true, mTLS server will be deployed instead of TLS, deploy also has to be true
  cacertfile: "/etc/certs/server/ca.crt" # for client certification if mutualtls is true
  notlsport: 2810 # port to serve http server serving selected endpoints (default: 2810)
  notlspaths: # if not empty, and tlsserver.deploy is true, a separate http server will be deployed for the specified endpoints
    - "/ping"
    # - "/metrics"
    # - "/healthz"

Note

For the confiuration of the outputs, see the docs.

Usage

Usage :

usage: falcosidekick [<flags>]

Flags:
      --help                     Show context-sensitive help (also try --help-long and --help-man).
  -c, --config-file=CONFIG-FILE  config file

Endpoints

Different endpoints (handlers) are available :

  • / : main and default handler, your falco config must be configured to use it
  • /ping : you will get a pong as answer, useful to test if falcosidekick is running and its port is opened (for healthcheck purpose for example). This endpoint is deprecated and it will be removed in 3.0.0.
  • /healthz: you will get a HTTP status code 200 response as answer, useful to test if falcosidekick is running and its port is opened (for healthcheck or purpose for example)
  • /test : (for debug only) send a test event to all enabled outputs.
  • /debug/vars : get statistics from daemon (in JSON format), it uses classic expvar package and some custom values are added
  • /metrics : prometheus endpoint, for scraping metrics about events and falcosidekick

Logs

All logs are sent to stdout.

2019/05/10 14:32:06 [INFO] : Enabled Outputs : Slack Datadog

Mutual TLS

Outputs with mutualtls enabled in their configuration require the client.crt, client.key and ca.crt filepaths to be configured in the mutualtlsclient_certfile, mutualtlsclient_keyfile and mutualtlsclient_cacertfile global parameter.

docker run -d -p 2801:2801 -e MUTUALTLSCLIENT_CERTFILE=/etc/certs/client/client.crt -e MUTUALTLSCLIENT_KEYFILE=/etc/certs/client/client.key -e MUTUALTLSCLIENT_CACERTFILE=/etc/certs/client/ca.crt -e ALERTMANAGER_HOSTPORT=https://XXXX -e ALERTMANAGER_MUTUALTLS=true -e INFLUXDB_HOSTPORT=https://XXXX -e INFLUXDB_MUTUALTLS=true -e WEBHOOK_ADDRESS=XXXX -v /localpath/myclientcert.crt:/etc/certs/client/client.crt -v /localpath/myclientkey.key:/etc/certs/client/client.key -v /localpath/ca.crt:/etc/certs/client/ca.crt falcosecurity/falcosidekick

Alternately the path where the client.crt, client.key and ca.crt files are stored can be configured in mutualtlsfilespath global parameter. (Important: file names must be preserved)

docker run -d -p 2801:2801 -e MUTUALTLSFILESPATH=/etc/certs -e ALERTMANAGER_HOSTPORT=https://XXXX -e ALERTMANAGER_MUTUALTLS=true -e INFLUXDB_HOSTPORT=https://XXXX -e INFLUXDB_MUTUALTLS=true -e WEBHOOK_ADDRESS=XXXX -v /localpath/myclientcert.crt:/etc/certs/client.crt -v /localpath/myclientkey.key:/etc/certs/client.key -v /localpath/ca.crt:/etc/certs/ca.crt falcosecurity/falcosidekick

In above example, the same client certificate will be used for both Alertmanager & InfluxDB outputs which have mutualtls flag set to true.

Metrics

Golang ExpVar

The daemon exposes the common Golang metrics and some custom values in JSON format. It's useful for monitoring purpose.

expvar json expvarmon

Prometheus

The daemon exposes a prometheus endpoint on URI /metrics.

See the docs for more info.

StatsD / DogStatsD

The daemon is able to push its metrics to a StatsD/DogstatsD server. See Configuration section for how-to.

See the statsd docs and dogstastd docs for more info.

Try

Run you daemon and try (from Falco's documentation):

curl -XPOST "http://localhost:2801/" -d'{"output":"16:31:56.746609046: Error File below a known binary directory opened for writing (user=root command=touch /bin/hack file=/bin/hack)","hostname": "localhost", "priority":"Error","rule":"Write below binary dir","time":"2019-05-17T15:31:56.746609046Z", "output_fields": {"evt.time":1507591916746609046,"fd.name":"/bin/hack","proc.cmdline":"touch /bin/hack","user.name":"root"}}'

Development

Build

make falcosidekick

Quicktest

Create a debug event

curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" localhost:2801/test

Test & Coverage

make test

With Coverage

make test-coverage

Author

Thomas Labarussias (https://github.com/Issif)

falcosidekick's People

Contributors

actgardner avatar annadorottya avatar anushkamittal20 avatar arminc avatar bc-sb avatar bdluca avatar blu3r4y avatar cartyc avatar cccsss01 avatar cpanato avatar dependabot[bot] avatar developer-guy avatar distortedsignal avatar gauravgahlot avatar ianrobertson-wpe avatar ibice avatar idrissneumann avatar issif avatar jgmartinez avatar jjo avatar keisukeyamashita avatar leogr avatar livinginsyn avatar lowaiz avatar maxgio92 avatar nibalizer avatar perriea avatar spyder-kyle avatar umaaz avatar yindia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

falcosidekick's Issues

Current StatsD implementation works only with DogStatsD

Last release has added support for StatsD as Output with usage of this package from Datadog.

It works well with Dogstatsd but it's not full functionnal with more classic implementation of StatsD protocol. The glitch is on all metrics with tags, that's a custom feature which is only available in Dogstatsd, classic statsd doesn't accept them.

cc @actgardner

v2.0.0 Roadmap

Before integrating new outputs I'm planning some changes (and possible breaks) for a v2.0.0. Here what and why.

Configuration

Until now, configuration is only possible through environment variables, I would like to add a config file as the number of option is increasing as long I'm adding new outputs. My idea is to use https://github.com/spf13/viper and use its capacity to handle different methods for configuration with a hierarchy "env vars > yaml config file > default values".

Add Test & Code Coverage

For that, I need to change some methods, some of outputs have endpoint of their services which are hard coded. For adding tests, I will add function to create Client object with as much modifiable parameters that needed.

Automatic code coverage test will run on https://coveralls.io/.

Remove useless handlers

โœ”๏ธ #18

/checkpayload is not usefull anymore, DEBUG config option will print input and outputs in stdout.

โœ”๏ธ #18

Change format of output configuration in logs

โœ”๏ธ #18 #19

We have currently :

2018/10/11 08:53:25 [INFO] : Outputs configuration : Slack=enabled, Datadog=disabled, Alertmanager=disabled

That will be :

2018/10/11 08:53:25 [INFO] : Enabled Outputs : Slack
2018/10/11 08:53:25 [INFO] : Disabled Outputs : Datadog, Alertmanager

This syntax is more concise.

Add stats

Add /stats handler that will return a json with classic metrics (number of goroutines, heap, etc) from expvar package and custom ones :

  • number of inputs from falco
  • number of OK sents to different outputs
  • number of KO sents to different outputs

Enable/Disable detailed view for Slack output

โœ”๏ธ #18

refer #15

Add an helm chart

refer #16

replace lib log to logrus or other logging library

Motivation
using another logging library like logrus we can use some features, like enable log level and other things and not need to write the type of the log by hand as we do today.

since this can be a breaking change for people that are parsing the logs and the format will change a bit we can make a major release

/milestone 3.0.0

Make the Helm chart available in Helm Hub

Motivation

It would make sense to make the chart release so it can be available in the Helm Hub. This allows the project to be used without needing the GitHub project or having to copy the current deployment Helm files in this repo.

Feature

Chart available in Helm Hub.

Migrating Documentation into Falco.org

What to document

As falcosidekick is becoming bigger and bigger, the documentation can't be only in a long readme. I would like to create a dedicated section in documentation of falco.org that will be easier to read. The readme here will only been a description and links to according section in official documentation.

Log pushes for Kubernetes Audit Events to Loki are failing

Describe the bug

I'm using falcosidekick to send host os events and Kubernetes audit events to Grafana Loki. If a host os rule is triggered, the event is send to Loki as expected. If I trigger a Kubernetes Audit Event the push to Loki failed with 400 - Header Missing.

Working example for Host Rule:

Bildschirmfoto 2021-02-06 um 20 32 53

The Example described in the Documentation https://falco.org/docs/event-sources/kubernetes-audit/#example failed:

2021/02/06 19:26:16 [DEBUG] : Falco's payload : {"output":"20:25:53.706802944: Notice K8s ConfigMap Deleted (user=system:serviceaccount:cattle-system:kontainer-engine configmap=my-config ns=stage resp=200 decision=allow reason=RBAC: allowed by ClusterRoleBinding \"globaladmin-user-r62pf\" of ClusterRole \"cluster-admin\" to User \"user-r62pf\")","priority":"Notice","rule":"K8s ConfigMap Deleted","time":"2021-02-06T19:25:53.706802944Z","output_fields":{"jevt.time":"20:25:53.706802944","ka.auth.decision":"allow","ka.auth.reason":"RBAC: allowed by ClusterRoleBinding \"globaladmin-user-r62pf\" of ClusterRole \"cluster-admin\" to User \"user-r62pf\"","ka.response.code":"200","ka.target.name":"my-config","ka.target.namespace":"stage","ka.user.name":"system:serviceaccount:cattle-system:kontainer-engine","source":"falco"}}
2021/02/06 19:26:16 [DEBUG] : Loki payload : {"streams":[{"labels":"{katargetname=\"my-config\",katargetnamespace=\"stage\",kausername=\"system:serviceaccount:cattle-system:kontainer-engine\",source=\"falco\",jevttime=\"20:25:53.706802944\",kaauthdecision=\"allow\",kaauthreason=\"RBAC: allowed by ClusterRoleBinding \"globaladmin-user-r62pf\" of ClusterRole \"cluster-admin\" to User \"user-r62pf\"\",karesponsecode=\"200\",rule=\"K8s ConfigMap Deleted\",priority=\"Notice\"}","entries":[{"ts":"2021-02-06T19:25:53Z","line":"20:25:53.706802944: Notice K8s ConfigMap Deleted (user=system:serviceaccount:cattle-system:kontainer-engine configmap=my-config ns=stage resp=200 decision=allow reason=RBAC: allowed by ClusterRoleBinding \"globaladmin-user-r62pf\" of ClusterRole \"cluster-admin\" to User \"user-r62pf\")"}]}]}

2021/02/06 19:26:16 [ERROR] : Loki - Header missing (400)
2021/02/06 19:26:16 [ERROR] : Loki - Header missing

How to reproduce it

  1. Installing falco
  2. Configure Kube API Server to send Kubernetes Audit Events to falco
  3. Install falcosidekick and configure falco http_output send logs
  4. Configure falcosidekick to send logs to Loki
  5. Try the ConfigMap Example from the Documentation

Expected behaviour

Sends Kubernetes Audit Events successfully to Loki

Screenshots

See the issue description

Environment

  • Falco version:

Falco 0.27.0
Driver version: 5c0b863ddade7a45568c0ac97d037422c9efb750

  • System info:

{
"machine": "x86_64",
"nodename": "dev-node-3",
"release": "5.11.0-051100rc6-generic",
"sysname": "Linux",
"version": "#202101312230 SMP Sun Jan 31 22:33:58 UTC 2021"
}

  • OS: Ubuntu 20.04
  • Kernel: Linux 5.11.0-051100rc6-generic
  • Installation method: DEB for falco, Helm for falcosidekick

[SLACK Integration]: Message Format Interpolation Failure

Describe the bug
As documented the message formatting works as expected:

messageformat: "Alert : rule *{{ .Rule }}* triggered by user *{{ index .OutputFields \"user.name\" }}*"

In an attempt to be more dynamic it appears that interpolation completely fails:

messageformat: "*{{ index.OutputFields \"priority\"}}* : rule *{{ .Rule }}* triggered by user *{{ index .OutputFields \"user.name\" }}*"

How to reproduce it

Pass in the above Slack Message Formatting and test. Using the above format will remove all format text and logging will not indicate a failure.

Expected behaviour

Since we can pull selected fields into the message format normally I expected that instead of hard coding alert we could instead get Warning/Critical/Alert etc.

Screenshots
Screen Shot 2019-12-11 at 7 56 27 AM

Environment

  • Falco version:
    Falco version: 0.17.1
  • System info:
{
  "machine": "x86_64",
  "nodename": "qa-kare-falco-xblfq",
  "release": "4.14.146-119.123.amzn2.x86_64",
  "sysname": "Linux",
  "version": "#1 SMP Mon Sep 23 16:58:43 UTC 2019"
}
  • Cloud provider or hardware configuration:
  • OS:
PRETTY_NAME="Debian GNU/Linux bullseye/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
  • Kernel:
Linux falco-xblfq 4.14.146-119.123.amzn2.x86_64 #1 SMP Mon Sep 23 16:58:43 UTC 2019 x86_64 GNU/Linux
  • Installation method:

Falco: Kubernetes Upstream Helm Chart
Sidekick: Kubernetes Upstream Helm Chart
Additional context

Refactor PagerDuty output to use Events v2 API

Motivation

PagerDuty's API documentation states that the Events v2 API should be used by monitoring tools instead of the Rest API.

The REST API provides a way for third parties to connect to a PagerDuty account and access or manipulate configuration data on that account. It is not for connecting your monitoring tools to send events to PagerDuty; for that, use the Events API.

Feature

Replace the existing PagerdutyCreateIncident call with one that sends a POST request to the https://events.pagerduty.com/v2/enqueue endpoint. This would remove the APIKey, Asignee, EscalationPolicy, and Service configuration options, and consolidate alert routing/authentication via a provided routing key (see API syntax here)

Alternatives

Additional context

I've spiked out an initial changeset. If the proposed change makes sense, I'd be happy to submit a PR.

Include dateformat suffix to Elasticsearch indices

It is really helpful to have indices that can group data on a daily, monthly or annually basis. Here we have some examples:
Daily index: sample-2019.06.24
Monthly index: sample-2019.06
Annual index: sample-2019

Add test endpoint

Add an endpoint /test to check communications with enabled outputs.

Alertmanager output - Header missing (400)

Describe the bug

Alerts are not sent, not enough log details about actual bug. Additionally this raises we shall export prometheus metrics about recieved/sent events and health state, as suggested in: #60

2020/09/03 09:45:14 [ERROR] : AlertManager - Header missing (400)
2020/09/03 09:45:19 [ERROR] : AlertManager - Header missing (400)
2020/09/03 09:47:33 [INFO]  : AlertManager - Post OK (200)
2020/09/03 09:47:47 [ERROR] : AlertManager - Header missing (400)
2020/09/03 09:48:50 [ERROR] : AlertManager - Header missing (400)
2020/09/03 09:49:19 [ERROR] : AlertManager - Header missing (400)

Caused by:

level=error ts=2020-09-03T13:47:41.979Z caller=api.go:781 component=api version=v1 msg="API error" err="bad_data: \"proc_aname[2]\" is not a valid label name"
level=error ts=2020-09-03T13:48:14.139Z caller=api.go:781 component=api version=v1 msg="API error" err="bad_data: \"proc_aname[2]\" is not a valid label name"

Will provide MR with fix.

Add Google Chat support

Motivation

Google Chat(former Google Hangout Chat) adoption is increasing these days.

Feature

Send notification like Slack and Mattermost

Alternatives

Additional context

May I add this feature?
I would like to contribute.

Add tls support for SMTP output

As an office 365 user, I'd like to be able to configure falcosidekick to send emails on my behalf for notifications

Currently, there are not any documented configs for enabling tls or smarttls for SMTP output. which is required for using office 365's SMTP servers.

I'd like to add an option to enable tls for smtp output

Add unit tests for all outputs

Motivation

Falcosidekick is used more and more, and even if we review all PR, we faced some regressions in code base. For avoiding to impact customers, we need to implement unit tests for every outputs, not only the most used.

Feature

A good test framework
Unit tests for all outputs

Alternatives

N/A

Additional context

N/A

Falcosidekick does not notify on slack Webhooks when it is installed using Helm

Describe the bug

Falcosidekick does not notify on slack Webhooks when it is installed using Helm
How to reproduce it

  1. Create a K3s cluster

  2. Install Falco and Falcosidekick using Helm: helm install falco falcosecurity/falco -n falco --set falco.jsonOutput=true --set falco.jsonIncludeOutputProperty=true --set falco.httpOut.enabled=true --set falco.httpOutput.url=http://falcosidekick:2801/ --set falco.programOutput.program=""jq '{text: .output}' | curl -d @- -X POST https://hooks.slack.com/services/T01k9A05X55/B01KM16MAG5/KCYBsvMPDeHyJ3KhmSeN93nY\"" --set falcosidekick.enabled=true --set config.slack.webhookurl="https://hooks.slack.com/services/T01k9A05X55/B01KM16MAG5/KCYBsvMPDeHyJ3KhmSeN93nY" --set config.slack.minimumpriority="debug" --set config.debug=true

  3. Spawn a falco pod. Falcosidekick does not sent a notification to the Slack workspace.

Expected behaviour

Screenshots
Screenshot 2021-01-31 at 9 15 24 PM

Environment

  • Falco version:
  • System info:
  • Cloud provider or hardware configuration:
  • OS:
  • Kernel:
  • Installation method:

Additional context

Unable to add more than one custom field with Helm

Describe the bug

How to reproduce it

Install Falcosidekick with Helm and add more than one custom fields.
Screenshot 2021-02-01 at 8 11 37 PM

Expected behaviour

Screenshots

Environment

  • Falco version:
  • System info:
  • Cloud provider or hardware configuration:
  • OS:
  • Kernel:
  • Installation method:

Additional context

Add email output

Add email as available output.

Daemon will not send emails directly but will use net/smtp package to use a remote smtp server. As other inputs, config will be with env vars.

Alertmanager forwarder only add fields for string values.

Motivation

I'm using falco to capture events where some of the fields values are numbers (network ports) and would like that information in the alertmanager alert fields

Feature

Currently anything not a string is ignored, for at least integer values it should be simple enough to convert to a string and add to the alert labels.

Assuming this is accepted I'm happy to make a PR for it.

Suppor PagerDuty as output

Motivation

In my company, we use PagerDuty as a pager system.
If there are high-level priority detection, I want to get a call.

Feature

Page Pagerduty team if the output of Falco is higher than the minimunpriority.

Alternatives

Additional context

OWNERS file

What to document

The OWNERS responsible of approving and reviewing the code changes in falcosidekick.

For sure the first one is @Issif

Would you suggest other maintainers?

I can volunteer for keeping an eye on it when I have some spare time, btw.

[Slack Alerts] Change Header to only include Rule Name

Currently, if your falco rule output is fairly long, each slack alert by falcosidekick will spit out a really ugly json blob (even though that information is already captured in the slack event right below).

I think it may make sense to change it to be just the rule name or configurable via environment variables.

image

Expose events as Prometheus metrics (counter)

Motivation

I would like to use falcosidekick to expose metrics to Prometheus in the same manner as falco-exporter, which will allow me to use Grafana to visualize as well as create AlertManager rules based on the Prometheus data (e.g. statistical analysis of event count) as opposed to relaying Falco event payloads directly to AlertManager.

The reason I am looking at falcosidekick for this, is it seems to be designed as a sidecar, and also does not (currently) enforce mTLS to communicate with the Falco gRPC server to acquire event stream.

Feature

falcosidekick implements /metrics endpoint with a Prometheus Counter type for events; ideally labelled with Falco rule, priority and pod's hostname. Summary or Histogram types may be appropriate for different fleet sizes or analysis.

Alternatives

n/a

Additional context
https://github.com/falcosecurity/falco-exporter/blob/master/pkg/exporter/exporter.go#L37-L47

Add route logic in config yaml

Motivation

In any PaaS/SaaS running falco, as a cluster-admin I want to see all falco-events, but as a tenant-admin (client with admin permissions over specific resources) I only want to see falco events related to my tenant (i.e events in my k8s namespaces if we are taking about k8s)

This can be achieved using software like Prometheus, AlertManager, OpsGenie... but it would be great if falco didn't need any of these to get the same goal.

Feature

Add some route logic could be inserted in config.yaml so an alert will be sent to an specific output depending on the value of some of its labels. For example:

slack:
  webhookurl: "" # Slack WebhookURL (ex: https://hooks.slack.com/services/XXXX/YYYY/ZZZZ), if not empty, Slack output is enabled
  outputformat: "all" # all (default), text, fields
  minimumpriority: "debug" 
  messageformat: "Alert : rule *{{ .Rule }}* triggered by user *{{ index .OutputFields \"user.name\" }}*"
  filterexpr: "{{ .k8s_ns_name }} == "mytenant" and {{ .Rule }} == "Launch Privileged Container"

This would trigger the Slack webhook only if filterexpr is True

Alternatives

You can get the same behaviour with specific monitoring tools like Prometheus and AlertManager.

Additional context

Add Microsoft Teams integration

What would you like to be added:
native Microsoft Teams integration to allow for pushing alerts to the chat platform

Why is this needed:
Currently the program_output example isn't accepted by MS teams:
[plundering-grasshopper-falco-jfjp9] Invalid webhook request - Empty Payload18:16:22.370929225: Notice A shell was spawned in a container with an attached terminal (user=<NA> k8s.ns=default k8s.pod=edgy-iguana-mariadb-0 container=791fa4a27927 shell=bash parent=docker-runc cmdline=bash terminal=34817 container_id=791fa4a27927 image=bitnami/mariadb) [plundering-grasshopper-falco-jfjp9] parse error: Expected string key before ':' at line 1, column 3

Support GCP Cloud Functions and Cloud Run

Motivation

I am a heavy user of GCP and also serverless products(Cloud Functions & Cloud Run).

Many documents use Cloud PubSub + Cloud Functions(Playbook). But we must treat the event messages with care because Cloud PubSub message semantics are at least once and there might be duplicated messages.

Therefore, the backend Cloud Functions or the Cloud Run has to handle the duplication and it's not that easy. In many cases, it requires a database to share context between the instances of Cloud Functions or Cloud Run services.

I want the Falcosidekick to HTTP request with OAuth token directly to Cloud Function or Cloud Run to make the backend easier to implement.

Feature

Support Cloud Function and Cloud Run. It will use the service account key for authorization.

I want to add the config like below

gcp:
  credentials: "" # The base64-encoded JSON key file for the GCP service account
+  functions:
+    webhookurl: "" # The URL of the function
+    # minimumpriority: "debug" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)
  pubsub:
    projectid: "" # The GCP Project ID containing the Pub/Sub Topic
    topic: "" # The name of the Pub/Sub topic
    # minimumpriority: "debug" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)
+  run:
+    webhookurl: "" # The URL of the Cloud Run service
+    # minimumpriority: "debug" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

Alternatives

Additional context

The webhook client can't be used because the OAuth token expires and can't be hardcoded.

Migrate Slack attachments to block kit

Motivation

Slack Attachments are now legacy way to post rich messages to Slack. The next generation is Block Kits.
Not only it is legacy, Attachments has limit that the emojis are displayed as "emojis" like below and kinda ugly now(See :true: emoji):

image

We can disable this and show as plain text if we use the latest generation Block kit.

Feature

Use Slack Block Kit as posting rich messages.

Alternatives

Additional context

If it looks fine to the maintainers, I would be happy to work on this ๐Ÿš€

Missing metrics for statds/dogstastd

Describe the bug

Several outputs are not configured for updating metrics for statsd/dogstatsd :

  • alertmanager
  • azure event hub
  • datadog
  • discord
  • elasticseearch
  • google chat
  • influxdb
  • loki
  • mattermost
  • opsgenie
  • rocketchat
  • slack
  • teams
  • webhook

How to reproduce it

Expected behaviour

All outputs should export their metrics

Screenshots

Environment

All releases of falcosidekick are concerned

Additional context

Alertmanager forwarder throws x509: certificate signed by unknown authority

Describe the bug
I'm trying to forward falco alerts to Alertmanager which is running an SSL proxy sidecar. This sidecar allows to only communicate via HTTPS. A custom CA cert is being generated and used by Alertmanager.

When FalcoSideKick tries to forward alert to Alertmanager it throws the following error:

2020/07/29 08:18:40 [ERROR] : AlertManager - Post "https://alertmanager-main.openshift-monitoring.svc:9092/api/v1/alerts": x509: certificate signed by unknown authority

How to reproduce it
Use an Alertmanager with SSL enabled generated via custom CA

Expected behaviour
Falco alert reaches the Alertmanager successfully over HTTPS

Screenshots

Environment

  • Falco version:
Falco version: 0.24.0
Driver version: 85c88952b018fdbce2464222c3303229f5bfcfad
  • System info:
{
  "machine": "x86_64",
  "nodename": "ip-10-0-196-186",
  "release": "4.18.0-193.12.1.el8_2.x86_64",
  "sysname": "Linux",
  "version": "#1 SMP Thu Jul 2 15:48:14 UTC 2020"
}
  • Cloud provider or hardware configuration:
  • OS:
  • Kernel:
    Linux ip-10-0-196-186 4.18.0-193.12.1.el8_2.x86_64 #1 SMP Thu Jul 2 15:48:14 UTC 2020 x86_64 GNU/Linux
  • Installation method:
    Openshift/Kubernetes

Additional context

falcosidekick cannot be deployed on k8s with Pod Security Policy enabled

Describe the bug

The helm chart does not contain a pod security policy, a clusterrole and an assignment.

How to reproduce it

Try to deploy it in k8s with PSPs enabled.

Expected behaviour

helm charts deployes without errors. and pod starts.

Screenshots

Environment

  • Falco version:
    0.18.0

  • System info:

  • Cloud provider or hardware configuration:
    AWS

  • OS:
    kops based k8s with falcosidekick container

  • Kernel:

  • Installation method:

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.