bpbpublications / Cloud-Native-Microservices-with-Spring-and-Kubernetes

Cloud Native Microservices with Spring and Kubernetes, published by BPB Publications
MIT License
14 stars 15 forks source link

Security Misconfiguration: Absent security context #4

Open akondasif opened 2 years ago

akondasif commented 2 years ago

We have noticed an instance of no security context in one of your Kubernetes manifests. The recommended practice is use of security context for pods. without defining a security context for the pod, a container may run with root privilege and write permission into the root file system, making the Kubernetes cluster vulnerable. For examples of Kubernetes security anti-patterns we are following our peer-reviewed publication on Kubernetes security best practices (https://arxiv.org/pdf/2006.15275.pdf).

Location: https://github.com/bpbpublications/Cloud-Native-Microservices-with-Spring-and-Kubernetes/blob/34795e451f54000bf5f18b99b7abea7aea7f6a6a/Chapter%209/catalogue-service/catalogue-k8s-deployment.yml#L34

Please use securityContext to fix this misconfiguration. We would like to hear if you agree to fix this misconfiguration or have fixed the misconfiguration.