How to implement DevSecOps in a Kubernetes cluster environment-Github Actions and Azure DevOps

Fig.1: Kubernetes Cluster Components
Fig. 2: Kubernetes Vulnerability trend diagram from
  1. To always upgrade/patch to the new version without using unsafe defaults
  2. Protect access with proper ACL’s and log all the events
  3. Implement standard security protection around encryption keys
  4. Harden configurations with CIS benchmarks
Fig. 3: Minikube setup
Fig. 4: Installed version of minikube
Fig. 5: Setting up Kubernetes cluster
Fig. 6: Configuring Kubectl and Kubernetes cluster
Fig. 7: Deploy and Expose nginx
Fig. 8: Running my-dep(nginx) application
Fig. 9: Kubernetes-goat Setup
Fig. 10: Running Kube-bench and Kubescape
Fig. 11: Successful run of the pipeline
Fig. 12: Sample Kubescape Results
Fig. 13: Sample Kubescape dashboard
Fig.14: Sample Kube-Bench Results
Fig. 15: Integration of Kube-bench and Kubescape in Azure DevOps pipeline


We saw why security is important in kubernetes environment and integrated tools to identify the potential vulnerabilities in a CI/CD pipeline itself. The tools used were Kube-bench and Kubescape with Github Actions and Azure DevOps as the CI/CD platform. As we all know, identifying the genuine issues is really important since we cannot blindly make the recommended changes as it is since that can hamper the functioning of the application. The tools can be any security tools which suits your requirement the best and the above implementation just gives a flavor of how it looks like if we do have kubernetes security tools in a CI/CD pipeline.


Happy Learning !!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sneha Sathyan

Sneha Sathyan

Security professional, being in love with application and cloud security, automation and DevSecOps!!