1

Traditionally I would have prevented root/UID 0 containers from running in kubernetes using pod security policies. However it seems that in 1.21 PSPs have been deprecated. Are there any other recommended ways to prevent these from running at a cluster level?

thewire247
  • 146
  • 1
  • 6
  • Well, did you read [their handy blog post](https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/#what-does-this-mean-for-you), wherein they cited using OPA Gatekeeper to enforce cluster-wide policies like that? – mdaniel Sep 30 '21 at 14:57

1 Answers1

0

As @mdaniel comments suggests, it's worth reading PodSecurityPolicy Deprecation: Past, Present, and Future article, where you will find that Kubernetes team recommends using Gatekeeper Policy Library for complex binding rules.

For more details I'd recommend to read:

You can setup Gatekeeper at a cluster level:

  • scope accepts *, Cluster, or Namespaced which determines if cluster-scoped and/or namesapced-scoped resources are selected. (defaults to *)

For you usage, you will probably find Gatekeeper Constraint users to be useful. Check examples in the samples folder.

Mikolaj S.
  • 208
  • 1
  • 7