Extending Security Using Open Policy Agent
So far, we have covered Kubernetes’ built-in authentication and authorization capabilities, which help to secure a cluster. While this will cover most use cases, it doesn’t cover all of them. Some security best practices that Kubernetes can’t handle are pre-authorizing container registries and ensuring that Ingress objects don’t overlap (though most Ingress controllers do check, such as NGINX).
These tasks are left to outside systems and are called dynamic admission controllers. Open Policy Agent (OPA) and its Kubernetes native sub-project, Gatekeeper, is one of the most popular ways to handle these use cases. This chapter will detail the deployment of OPA and Gatekeeper, how OPA is architected, and how to develop policies.
In this chapter, we will cover the following topics:
- Introduction to dynamic admission controllers
- What is OPA and how does it work?
- Using Rego to write policies...