CKS Exam Question 16

You are tasked with securing a Kubernetes cluster running kube-dns. You need to enforce the CIS Kubernetes Benchmark recommendations for kube-dns. One of the key recommendations is to disable the '-bind-address-0.0.0.0' parameter from the kube-dns deployment. This parameter allows kube-dns to listen on all network interfaces, potentially exposing the DNS service to unwanted access. How would you achieve this using a ConfigMap?

CKS Exam Question 17

You have a Kubernetes cluster with a service account named 'default. This service account is used by multiple applications within the cluster, each requiring different access levels. Currently, 'default' has broad permissions, granting it access to manage deployments, secrets, and even perform cluster-wide operations. This poses a security risk.
How would you implement a strategy to restrict 'default's access to a minimal set of permissions while maintaining functionality for existing applications? Ensure you are using a principle of least privilege approach and demonstrate how you would test your implementation.

CKS Exam Question 18

Your application requires access to specific network resources, but you want to restrict its communication to only these allowed ports and IP addresses. Explain how to achieve this using AppArmor profiles.

CKS Exam Question 19

You're tasked witn securing a Kubernetes cluster running on Google Kubernetes Engine (GKE). One of the key security objectives is to ensure that only authorized users can access the cluster's API server and that communication between components within the cluster is encrypted. You need to configure the clusters network policy and authentication mechanism to enforce these security controls. Explain step-by-step how you would configure GKE's network policies and authentication mechanisms to achieve these objectives.

CKS Exam Question 20

You have a development team that uses a private Docker registry to store container images. This registry is accessed by the team's CI/CD pipeline for building and deploying applications to Kubernetes. How would you secure the registry and ensure that only authorized users and services can access it? Explain the steps and provide example commands for each step.