Dynamic admission control ◦ Gatekeeper ◦ OPA ◦ Rego ◦ Constraint templates and constraints • Practice with Rancher ◦ Installing OPA Gatekeeper with Rancher v2.6 ◦ Applying a constraint template ◦ Applying a constraint ◦ Verification • Other OPA use cases
like this... • General policies ◦ All images must be from approved repositories ◦ All pods must have resource limits ◦ All ingress hostnames must be globally unique ◦ Disallow NodePort services ◦ Disallow “latest” container image tag ◦ Require speicfic labels or annotations ◦ Require container probles • Pod security policies ◦ Disallow running as root ◦ Disallow privileged containers ◦ Allow only specific hostPath volumes
for PodSecurityPolicy. • The current plan is to remove PSP from Kubernetes in the 1.25 release. • PSP has some serious usability problems that can’t be addressed without making breaking changes. • New "PSP Replacement Policy." for the feature. https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/
in self-hosted webhooks • Avoiding operating on the kube-system namespace https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/
engine. • OPA’s high-level declarative policy language: Rego. • Can enforce policies in microservices, Kubernetes, CI/CD pipelines, API gateways, and more. https://www.openpolicyagent.org/docs/latest/
a lot of out-of-the-box templates for common use cases. https://www.openpolicyagent.org/docs/latest/#rego https://www.openpolicyagent.org/docs/latest/policy-language/