Configuring the security attributes of pods
As we mentioned in the previous chapter, application developers should be aware of what privileges a microservice must have in order to perform tasks. Ideally, application developers and security engineers work together to harden the microservice at the pod and container level by configuring the security context provided by Kubernetes.
We classify the major security attributes into four categories:
- Setting host namespaces for pods
- Security context at the container level
- Security context at the pod level
- AppArmor profile
By employing such a means of classification, you will find them easy to manage.
Setting host-level namespaces for pods
The following attributes in the pod specification are used to configure the use of host namespaces:
- hostPID: By default, this is
false
. Setting it totrue
allows the pod to have visibility on all the processes in the worker node. - hostNetwork: By default, this...