Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exporter Chart v0.9.5 breaks daemonset when PSP is activated #494

Closed
hardwarefresser opened this issue May 12, 2023 · 7 comments
Closed
Labels
kind/bug Something isn't working lifecycle/rotten

Comments

@hardwarefresser
Copy link
Contributor

hardwarefresser commented May 12, 2023

Describe the bug
PR #487 introduces a security context in values.yaml for falco-exporter which includes a seccomp profile:

securityContext:
  capabilities:
    drop:
    - ALL
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  privileged: false
  seccompProfile:
    type: RuntimeDefault

When the chart is deployed on an environment with PSP enabled, the PSP delivered with the Chart seems not to allow the Seccomp Profile to be set and therefore prevents the pod admission:

$ k get events  | grep exporter
Warning   FailedCreate daemonset/falco-falco-exporter  Error creating: pods "falco-falco-exporter-" is forbidden: 
PodSecurityPolicy: unable to admit pod: [pod.metadata.annotations[container.seccomp.security.alpha.kubernetes.io/falco-exporter]:
Forbidden: seccomp may not be set

According to this comment, adding seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*' to the PSP annotations should solve the problem. I did a quick test and admission was not prevented anymore.
However, as we want to use the seccomp profile RuntimeDefault, it would be better to add seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'RuntimeDefault' as PSP annotation. I will also try this and get back. But I would appreciate of someone could double check the whole issue.

Expected behaviour
PSP should not prevent the pods with seccomp

Environment

  • Falco version: Falco version: 0.34.1 (x86_64)
  • Installation method: Kubernetes using Helm, PSP activated

Additional context
Issue #481

@hardwarefresser hardwarefresser added the kind/bug Something isn't working label May 12, 2023
@hardwarefresser
Copy link
Contributor Author

Setting seccompProfile: null in the values.yaml to override the default value also works.

@hardwarefresser
Copy link
Contributor Author

The best solution should be configuring the PSP as follows via values.yaml:

podSecurityPolicy:
  # Specifies whether a PSP, Role and RoleBinding should be created
  create: true
  # Annotations to add to the PSP, Role and RoleBinding
  annotations:
    seccomp.security.alpha.kubernetes.io/defaultProfileName: runtime/default
    seccomp.security.alpha.kubernetes.io/allowedProfileNames: runtime/default

With this annotations, the PSP will allow the seccomp profile set in the default security context introduced in PR #487
I will open a PR to add the above mentioned annotations by default in values.yaml. This way, the admission of the pods will not be prevented anymore in environments with enabled PSP.

@alacuku
Copy link
Member

alacuku commented May 16, 2023

Hi @hardwarefresser,

PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. I think we should remove the PSP shipped with the chart. cc @leogr

@leogr
Copy link
Member

leogr commented May 17, 2023

Hi @hardwarefresser,

PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. I think we should remove the PSP shipped with the chart. cc @leogr

Totally agree

@poiana
Copy link
Contributor

poiana commented Aug 15, 2023

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
Copy link
Contributor

poiana commented Sep 14, 2023

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

@hardwarefresser
Copy link
Contributor Author

Will close this as PSPs are now deprecated.

@hardwarefresser hardwarefresser closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working lifecycle/rotten
Projects
None yet
Development

No branches or pull requests

4 participants