In Kubernetes, pod security policies are a powerful tool for mitigating security risks and enforcing secure configurations within your Kubernetes environment. However, using Kubernetes pod security policies to maximum effect takes some effort. It’s unlikely that your default pod security policies (if in fact you have them set by default at all) are a good match for your needs.
With that challenge in mind, this article explains how to get the most out of Kubernetes pod security policies. We’ll begin by briefly explaining how the policies work and what the goal behind them is. We’ll then walk through best practices for making sure that Kubernetes pod security policies are optimized for your environment.
What are Kubernetes pod security policies?
Put simply, pod security policies are configurations that define which security-related conditions a Kubernetes pod has to meet in order to be accepted into a cluster. They regulate how pods can interact with resources such as networks and storage. They can also be used to configure role-based access control.
Another way to think about Kubernetes pod security policies is to describe them as a way to run automatic conformance tests on your Kubernetes cluster. In the security world, conformance testing is a strategy for ensuring that an environment or application meets predefined security standards before it is allowed to run. Kubernetes pod security policies do the same thing by preventing pods from running unless they meet the security requirements defined in the policy. (To be clear, you don’t have to trigger a conformance test to enforce Kubernetes pod security policies. As long as the policies are enabled and configured, Kubernetes enforces them automatically.)
Kubernetes pod security policies are a cluster-level resource
A point of clarification: (Read more...)
*** This is a Security Bloggers Network syndicated blog from Blog – WhiteSource authored by Gabriel Avner. Read the original post at: https://resources.whitesourcesoftware.com/blog-whitesource/kubernetes-pod-security-policy