falcosecurity / charts

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

falco-sidekick and falco-sidekick fail to start on OpenShift 4.12 with a security context constraint violation #569

Closed tosmi closed 4 months ago

tosmi commented 9 months ago

Describe the bug

Deployment of falco-sidekick and falco-sidekick-ui with Helm chart version 3.8.0 fails because of wrong security context constraints:

Error creating: pods "falco-falcosidekick-7cfbbbf89f-" is forbidden: unable to validate against any security context constraint

In OpenShift 4.12 the default security context constraint is restricited so pods with a specific user ID will fail (https://github.com/falcosecurity/falcosidekick/blob/master/Dockerfile#L12).

We documented our current fix here: https://blog.stderr.at/openshift/2023-10-23-openshift-falco/#headline-5

The fix is to grant the service accounts falcosidekick and falcosidekick-ui access to the nonroot security context constraint (SCC).

will try to come up with a pull request for the chart.

How to reproduce it

Deploy falco and enable falco-sidekick and falco-sidekick, like in the values file below:

driver:
  kind: ebpf
  loader:
    initContainer:
      image:
        repository: falcosecurity/falco-driver-loader-legacy

falco:
  json_output: true
  json_include_output_property: true
  log_syslog: false
  log_level: info

falcosidekick:
  enabled: true
  webui:
    enabled: true

Expected behaviour

falco-sidekick and falco-sidekick-ui pods should be able to start

Environment

OpenShift 4.12 with Falco 0.36.1 deployed with Helm chart 3.8.0

Issif commented 9 months ago

Hi @tosmi,

The USER 1234 in the Dockerfiles was introduced for the now deprecated PSP. We should think about removing them I guess. For OpenShift, I recently had a discussion with some SRE, and they thought about proposing several "profiles" to auto-set values for specific envs (Openshift, EKS, AKS, GKE, ...), it could a long term solution. Your PR for OS will be welcome anyway, and thank you for your blog post.

poiana commented 6 months ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

poiana commented 5 months ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh with /remove-lifecycle rotten.

Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle rotten

poiana commented 4 months ago

Rotten issues close after 30d of inactivity.

Reopen the issue with /reopen.

Mark the issue as fresh with /remove-lifecycle rotten.

Provide feedback via https://github.com/falcosecurity/community. /close

poiana commented 4 months ago

@poiana: Closing this issue.

In response to [this](https://github.com/falcosecurity/charts/issues/569#issuecomment-2016611799): >Rotten issues close after 30d of inactivity. > >Reopen the issue with `/reopen`. > >Mark the issue as fresh with `/remove-lifecycle rotten`. > >Provide feedback via https://github.com/falcosecurity/community. >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.