falcosecurity / charts

Community managed Helm charts for running Falco with Kubernetes
Apache License 2.0
239 stars 285 forks source link

Falcosidekick's WebHook connector ignores WEBHOOK_CUSTOMHEADERS env variable #658

Closed PrettySolution closed 5 months ago

PrettySolution commented 5 months ago

Describe the bug Falcosidekick's WebHook connector ignores WEBHOOK_CUSTOMHEADERS env variable in falco-falcosidekick pod, resulting in an error in the logs: WebHook - 415 Unsupported Media Type

I've installed Falco Chart version 4.2.4 and made sure to configure all the necessary values for the falcosidekick.config.webhook object. Additionally, I've set up falcosidekick.config.webhook.customHeaders. Upon inspecting the environment variables within the falco-falcosidekick pod using the env command, I confirmed that the WEBHOOK_CUSTOMHEADERS environment variable is properly set with the content-type:application/json.

Even after configuring the webhook headers correctly, I'm still encountering a 415 Unsupported Media Type error in the logs.

How to reproduce it install falco chart 4.2.4, enable falcosidekick and set up webhook connector check logs in falco-falcosidekick Pod: Webhook - Unexpected Response (415)

set falcosidekick.enabled = true set falcosidekick.config.webhook.address = http://xxx.yyy.194.126:10029/falco set falcosidekick.config.webhook.method = POST set falcosidekick.config.webhook.checkcert = false set falcosidekick.config.webhook.customHeaders = content-type:application/json

Expected behaviour

Falcosidekick - Post OK (200)

Screenshots

Screenshot 2024-04-18 at 19 37 16 Screenshot 2024-04-18 at 19 41 16

Environment

Additional context

Issif commented 5 months ago

Hi,

What was finally the issue and how did you solve it? Could be useful if others face the same. Thanks

PrettySolution commented 5 months ago

Hi, later on I learned that I could not override the Content-Type header, https://github.com/falcosecurity/falcosidekick/issues/856