CKS Certified Kubernetes Security Specialist (CKS) Exam

Loading demo links...

Showing 4–6 of 10 questions

Question 4

You can switch the cluster/configuration context using the following command:[desk@cli] $ kubectl config use-context stage Context:A PodSecurityPolicy shall prevent the creation of privileged Pods in a specific namespace.Task:1. Create a new PodSecurityPolcy named deny-policy, which prevents the creation of privileged Pods.2. Create a new ClusterRole name deny-access-role, which uses the newly created PodSecurityPolicy deny-policy.3. Create a new ServiceAccount named psd-denial-sa in the existing namespace development.Finally, create a new ClusterRoleBindind named restrict-access-bind, which binds the newly created ClusterRole deny-access-role to the newly created ServiceAccount psp-denial-sa

Answer is in the explanation below.

Question 5

Create a network policy named allow-np, that allows pod in the namespace staging to connect to port 80 of other pods in the same namespace.

Ensure that Network Policy:-

1. Does not allow access to pod not listening on port 80.

2. Does not allow access from Pods, not in namespace staging.

Answer is in the explanation below.

Question 6

On the Cluster worker node, enforce the prepared AppArmor profile

Edit the prepared manifest file to include the AppArmor profile.

Finally, apply the manifests files and create the Pod specified on it.

Verify: Try to make a file inside the directory which is restricted.

Answer is in the explanation below.