Courseiva

CKS · domain

Minimize Microservice Vulnerabilities

Practise Certified Kubernetes Security Specialist CKS Minimize Microservice Vulnerabilities practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

175 questions43 easy88 medium44 hard

Focused practice

Practice Minimize Microservice Vulnerabilities questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Minimize Microservice Vulnerabilities

Minimize Microservice Vulnerabilities questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Minimize Microservice Vulnerabilities exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Question index

All Minimize Microservice Vulnerabilities questions (175)

Click any question to see the full explanation, or start a practice session above.

1

Which TWO of the following are valid approaches to manage secrets in a Kubernetes cluster?

Medium
2

A security admin wants to ensure that no container in a specific namespace runs as root. Which Gatekeeper ConstraintTemplate and Constraint configuration should be used?

Medium
3

You need to drop all Linux capabilities from a container. Which YAML snippet is correct?

Medium
4

A microservice running as a Deployment in a Kubernetes cluster needs to authenticate to a third-party API using a static API key. Which is the most secure way to store and inject this secret into the container?

Medium
5

You need to encrypt Kubernetes secrets at rest. Which resource should you configure?

Medium
6

A security engineer wants to encrypt secrets at rest in an existing Kubernetes cluster. The cluster is already running with the default encryption configuration. After creating an EncryptionConfiguration resource and updating the kube-apiserver manifest, which command should be used to ensure the new configuration is applied without restarting the API server?

Hard
7

You want to use an external secret management system like HashiCorp Vault to manage database credentials for your application. Which of the following are valid approaches to integrate Vault with Kubernetes?

Medium
8

Which field in a PodSecurityContext ensures that the container cannot gain privileges beyond its parent process?

Easy
9

Which TWO container sandboxing technologies are supported in Kubernetes via RuntimeClass? (Choose two)

Easy
10

A security engineer runs the following command to inspect a container's security context. What vulnerability does this configuration expose?

Medium
11

What is the primary benefit of using external secret managers (e.g., HashiCorp Vault) in Kubernetes?

Easy
12

Which TWO of the following are correct about container sandboxing technologies? (Select TWO)

Medium
13

Which of the following OPA Gatekeeper Rego policies would deny a pod that sets `securityContext.runAsUser: 0`?

Medium
14

A pod uses a Secret mounted as a volume. The Secret is updated. How can the pod consume the updated values without restarting?

Medium
15

An admin has deployed a ValidatingWebhookConfiguration that denies pods with `runAsNonRoot: false`. After creating a pod that does not set `runAsNonRoot` at all, the pod is created successfully. Why did the webhook not deny it?

Medium
16

An administrator needs to enforce that all pods in a namespace run with read-only root filesystem. Which Pod Security Standard should be applied?

Easy
17

Which ONE of the following is a valid Rego policy construct used in OPA Gatekeeper ConstraintTemplates to enforce security policies?

Hard
18

A cluster administrator wants to run some workloads in a sandboxed environment using gVisor. Which Kubernetes resource must be created first to allow pods to request the gVisor runtime?

Hard
19

Which admission controller is responsible for validating and mutating requests based on webhooks?

Easy
20

An administrator needs to encrypt secrets at rest in etcd. Which of the following steps is required?

Hard
21

Which TWO of the following are valid ways to enforce that a container runs as a non-root user?

Medium
22

An administrator wants to enforce mTLS between all services in the 'mesh' namespace using Istio. Which resource should be applied to require mutual TLS for all workloads in that namespace?

Medium
23

Which TWO of the following are valid ways to enforce that containers run with a read-only root filesystem?

Medium
24

Which TWO of the following are best practices for securing secrets in Kubernetes? (Select 2)

Medium
25

Which THREE of the following are best practices for securing a Kubernetes cluster using OPA Gatekeeper? (Choose three.)

Hard
26

Which TWO of the following are valid methods to enforce mTLS in an Istio service mesh? (Select 2)

Hard
27

An administrator wants to use OPA Gatekeeper to enforce that all pods have a resource limits section defined. Which of the following is the correct combination to implement this policy?

Hard
28

You are implementing a policy to ensure all containers in a namespace run as non-root. Which of the following is the most appropriate approach to enforce this at the cluster level?

Medium
29

You need to create a NetworkPolicy that denies all ingress traffic to pods with label 'app: web' in the 'frontend' namespace, except for traffic from pods with label 'app: ingress' in the 'ingress' namespace. Which NetworkPolicy spec correctly achieves this?

Medium
30

Which command can be used to view the current set of admission webhooks in the cluster?

Easy
31

An administrator deploys a Pod with the following security context: securityContext: runAsNonRoot: true runAsUser: 1000 However, the Pod fails to start with an error: 'container has runAsNonRoot and image will run as root'. What is the most likely cause?

Medium
32

A security scanner reports that a microservice container image contains a critical vulnerability (CVE-2024-1234) in a system library. The team cannot immediately rebuild the image. What is the most effective temporary mitigation at the Kubernetes level?

Medium
33

A security engineer wants to enable mutual TLS (mTLS) between services in an Istio service mesh. Which Istio resource should be used to define the mTLS mode for the entire mesh?

Medium
34

A security best practice is to avoid storing sensitive data in environment variables. Instead, secrets should be mounted as volumes. Which of the following YAML snippets correctly mounts a Kubernetes Secret named 'db-secret' as a volume at /etc/secrets?

Medium
35

Which THREE of the following are characteristics of container sandboxing runtimes like gVisor and Kata Containers?

Hard
36

A cluster administrator has configured EncryptionConfiguration to encrypt secrets at rest using a local key. After applying the configuration, the administrator creates a new secret. How can they verify that the secret is encrypted at rest?

Medium
37

You are writing a Rego policy for OPA/Gatekeeper to deny pods that do not have runAsNonRoot set to true. Which Rego statement should the ConstraintTemplate contain?

Hard
38

Which kubectl command creates a validating webhook configuration that calls an external HTTPS endpoint for pod validation?

Easy
39

Which TWO of the following are secure practices for managing secrets in Kubernetes? (Select TWO.)

Medium
40

Which of the following is the correct kubectl command to view the OPA Gatekeeper ConstraintTemplates in the cluster?

Medium
41

You are using Open Policy Agent (OPA) Gatekeeper to enforce pod security. You want to create a constraint that denies pods unless they have readOnlyRootFilesystem set to true. Which Rego rule in a ConstraintTemplate correctly implements this?

Hard
42

Which of the following is a characteristic of Kata Containers compared to gVisor?

Easy
43

Which of the following is a best practice for storing sensitive information like database passwords in Kubernetes?

Medium
44

A DevOps engineer wants to ensure that all microservice containers run with a read-only root filesystem to prevent unauthorized writes. What is the simplest way to enforce this at the Pod level?

Easy
45

In an Istio service mesh, you want to enforce mutual TLS (mTLS) between services in a specific namespace. Which resource should you create to set the default mTLS mode to STRICT for all workloads in that namespace?

Medium
46

A cluster administrator needs to run a workload that uses gVisor (runsc) for container sandboxing. Which Kubernetes resource is required to enable this?

Medium
47

Which of the following commands creates a ValidatingWebhookConfiguration that uses an OPA Gatekeeper webhook?

Medium
48

To encrypt secrets at rest in Kubernetes, an administrator configures an EncryptionConfiguration. What is the correct flag to pass to the kube-apiserver to use this configuration?

Hard
49

An admin creates the following EncryptionConfiguration to encrypt secrets at rest. After applying it, what must the admin do to ensure existing secrets are encrypted?

Hard
50

An admin runs 'kubectl get pod web -o yaml' and sees the following security context. Which setting prevents privilege escalation?

Easy
51

Which field in a Pod's securityContext prevents privilege escalation by the container?

Easy
52

A pod fails to start with the error 'Container runtime network not ready', and the node uses Kata Containers (RuntimeClass: kata). What is the most likely cause?

Hard
53

Which TWO actions help minimize vulnerabilities in microservices by securing secrets? (Choose two)

Medium
54

Order the steps to configure and apply a NetworkPolicy to restrict pod-to-pod traffic.

Medium
55

Which ONE of the following is a valid method to restrict a container's filesystem to read-only in Kubernetes?

Medium
56

An admin has created an EncryptionConfiguration to encrypt secrets at rest in etcd. After applying the configuration and restarting the kube-apiserver, existing secrets are still stored in plaintext. What is the most likely reason?

Hard
57

A cluster administrator wants to ensure that all pods in a namespace run with the `seccomp` profile set to `RuntimeDefault`. Which OPA Gatekeeper ConstraintTemplate would achieve this?

Medium
58

A DevOps team deploys a microservice that needs to access a third-party API using credentials stored in a Kubernetes Secret. The team wants to minimize the risk of credential exposure. Which approach best achieves this goal while following security best practices?

Medium
59

Which of the following is a MutatingAdmissionWebhook that is built into Kubernetes and can automatically inject a sidecar proxy for service mesh?

Easy
60

Which TWO of the following are valid Pod Security Context settings to harden a container? (Select 2)

Medium
61

Which THREE of the following are valid approaches to enforce that all pods in a cluster run with a read-only root filesystem? (Select THREE)

Hard
62

Which TWO of the following are valid Rego keywords used in OPA policies for Gatekeeper? (Select TWO)

Medium
63

You want to run a container with gVisor for sandboxing. After installing gVisor and creating a RuntimeClass named 'gvisor', which Pod configuration enables it?

Hard
64

A security engineer needs to ensure that all containers in a cluster run as non-root users. Which Pod Security Context field should be set to enforce this requirement?

Easy
65

You have deployed a service mesh with Istio and want to enforce mutual TLS (mTLS) for all traffic between services in the 'mesh' namespace. Which resource should you create?

Hard
66

A cluster has EncryptionConfiguration with aescbc provider. After rotating the encryption key, what must be done to re-encrypt existing Secrets with the new key?

Hard
67

Which TWO of the following are valid ways to enable mTLS between services in a service mesh (e.g., Istio)?

Medium
68

What is the purpose of the `allowPrivilegeEscalation: false` setting in a container's security context?

Medium
69

Which TWO of the following are effective measures to minimize the impact of a compromised microservice container in a Kubernetes cluster? (Choose two.)

Medium
70

You are deploying a ValidatingWebhookConfiguration. The webhook server is running in the 'webhook' namespace, service name 'svc', port 443. Which clientConfig should you specify?

Hard
71

Which kubectl command creates a valid webhook configuration that validates pods against a policy?

Easy
72

Which THREE of the following are required to configure encryption of secrets at rest in Kubernetes?

Hard
73

Which command creates a ResourceQuota in the 'team-a' namespace?

Easy
74

You are configuring an Istio service mesh for mTLS between services. Which resource defines the TLS mode for traffic between services in a namespace?

Medium
75

Which TWO of the following are recommended practices for securing container images and runtime?

Medium
76

A security admin wants to ensure all pods in a cluster drop ALL Linux capabilities. Which of the following YAML snippets should be added to a PodSecurityPolicy (assuming PSP is enabled) or a pod spec?

Medium
77

You have an existing deployment that uses environment variables for secrets. Which kubectl command can be used to update the deployment to mount secrets as volumes without recreating the pods?

Medium
78

Which of the following is the best practice for injecting secrets into a pod?

Easy
79

Which kubectl command creates a secret named 'mysecret' from a file called 'credentials.json'?

Easy
80

Which THREE of the following practices help protect microservice applications against supply chain attacks? (Choose three.)

Hard
81

Which TWO of the following are valid ways to securely manage secrets in Kubernetes? (Choose two.)

Medium
82

You need to ensure that all pods in a namespace have the label 'security: high' added automatically upon creation. Which admission controller should you use?

Hard
83

You are configuring encryption at rest for Kubernetes secrets. After creating an EncryptionConfiguration with aescbc provider, which additional step is required to enable encryption?

Hard
84

Which THREE of the following are features of container sandboxing solutions like gVisor or Kata Containers?

Medium
85

A pod runs with a service mesh sidecar (Istio). The team wants to enforce mutual TLS (mTLS) for all traffic between services in the 'production' namespace. Which resource should be applied?

Hard
86

You want to enable mutual TLS (mTLS) between services in a namespace using Istio. Which custom resource should you configure to enforce STRICT mTLS for all workloads in the namespace?

Medium
87

During a security audit, a team discovers that their microservice application, deployed on Kubernetes, is vulnerable to container breakout attacks. The containers run as root and have many Linux capabilities. Which set of Pod Security Standards (PSS) enforcement modes and policies would best mitigate this risk?

Hard
88

A security best practice is to avoid storing secrets in environment variables. Which is a secure alternative for injecting secrets into a pod?

Medium
89

An OPA/Gatekeeper ConstraintTemplate is defined with the following Rego rule: violation[{"msg": msg}] { container := input.review.object.spec.containers[_] container.securityContext.runAsNonRoot != true msg := "Container must run as non-root" } What happens when a pod is submitted with a container that has runAsNonRoot: true?

Hard
90

An administrator wants to use gVisor to sandbox containers in a Kubernetes cluster. Which resource must be created to enable this?

Medium
91

A team wants to use an external secret manager (HashiCorp Vault) to inject secrets into pods. Which approach is most aligned with Kubernetes best practices?

Medium
92

Which TWO of the following are valid ways to enforce that containers cannot run as root in a Kubernetes cluster? (Select TWO.)

Medium
93

Which THREE of the following are valid ways to enforce mTLS in an Istio service mesh? (Select 3)

Hard
94

You have created a ValidatingWebhookConfiguration to reject pods without resource limits. When you try to create a pod without limits, it is created successfully. What is the most likely reason?

Medium
95

Which kubectl command is used to create a Constraint object in OPA/Gatekeeper?

Easy
96

Which of the following is a best practice for storing sensitive data like passwords in Kubernetes?

Easy
97

A pod is configured with securityContext: runAsUser: 1000 runAsGroup: 3000 fsGroup: 2000 The volume mounted at /data is owned by user 1000 and group 2000. The container process inside the pod writes to /data. Which statement about file ownership is true?

Medium
98

Which of the following is the best practice for providing sensitive data like passwords to a pod?

Easy
99

Which TWO of the following are valid methods to securely manage secrets in Kubernetes?

Easy
100

An admin wants to enforce that all pods in a namespace use a read-only root filesystem except for a specific deployment that needs to write to a temporary directory. Which approach best meets this requirement?

Hard
101

Which command creates a validating webhook configuration that checks all pods in the cluster?

Easy
102

A security team wants to use OPA/Gatekeeper to enforce that all namespaces must have a label 'security-tier' with value 'high' or 'medium'. What is the correct approach?

Hard
103

An administrator wants to prevent pods from using secrets as environment variables and enforce that secrets are only mounted as volumes. Which admission controller could be used to achieve this?

Medium
104

You want to run a container with gVisor (runsc) runtime for sandboxing. Which resource is required to use a non-default runtime?

Medium
105

Given the following PodSecurityPolicy (PSP) snippet, which statement about the allowed containers is correct?

Easy
106

A ValidatingWebhookConfiguration is not working as expected. The webhook server is running and accessible. What is a common misconfiguration that would cause the webhook to not be called?

Medium
107

You need to ensure that all pods in a namespace can only communicate via mTLS. In Istio, which resource should you apply?

Medium
108

You are tasked with creating a ConstraintTemplate in OPA/Gatekeeper that denies pods running with the 'latest' image tag. Which Rego rule should the ConstraintTemplate include?

Easy
109

Which THREE of the following are valid capabilities that should be dropped for a container running a typical non-privileged application to adhere to the principle of least privilege?

Hard
110

A pod's container tries to read environment variables that contain database credentials. The cluster has an external secrets manager (HashiCorp Vault) integrated via a sidecar. Which approach is MOST secure for exposing secrets to the container?

Medium
111

Arrange the steps to configure and use Trivy to scan container images for vulnerabilities in a CI/CD pipeline.

Medium
112

You need to encrypt secrets at rest in a Kubernetes cluster. What must be configured?

Medium
113

You want to drop all Linux capabilities from a container. Which securityContext field should you set?

Medium
114

Which flag enables the PodSecurity admission plugin in kube-apiserver?

Easy
115

An OPA Gatekeeper ConstraintTemplate uses a Rego rule that denies pods without a specific label. The Constraint is created but pods without the label are still being allowed. What is the MOST likely cause?

Medium
116

A pod manifests with securityContext: { runAsNonRoot: true, runAsUser: 1001 }. However, the container image expects to run as root (UID 0). What will happen when the pod is created?

Medium
117

You are asked to secure a set of microservices running in a Kubernetes cluster. Which TWO of the following practices help minimize vulnerabilities in microservices?

Easy
118

You are implementing a Gatekeeper policy to deny pods that run as root. Which Rego rule should you include in the ConstraintTemplate?

Medium
119

Which kubectl command would you use to create a ValidatingWebhookConfiguration from a YAML file?

Easy
120

Which kubectl command would you use to create a Secret from a file named 'db-password.txt'?

Easy
121

You need to set up a ValidatingWebhookConfiguration to deny pods that run as root. The webhook server is deployed in the 'webhook' namespace with service 'webhook-svc' on port 443. Which of the following is a correct snippet for the webhook configuration?

Medium
122

Which of the following is the correct way to drop all capabilities in a container's security context?

Easy
123

Which THREE of the following are valid ways to manage secrets in a Kubernetes environment? (Select THREE)

Hard
124

Match each Kubernetes network security concept to its definition.

Medium
125

Which TWO of the following are best practices for minimizing microservice vulnerabilities in a Kubernetes cluster?

Medium
126

Which TWO of the following are best practices for securing secrets in Kubernetes?

Medium
127

You run 'kubectl auth can-i create pods --as=system:serviceaccount:default:sa1 -n default' and get 'no'. What does this mean?

Medium
128

You need to enforce that no pod runs with privileged containers or runs as root. Which tool can define policies that block such pods at admission time?

Medium
129

You need to ensure that all pods in a cluster run with read-only root filesystems. Which Pod Security Standard (PSS) control field should be set to true?

Easy
130

A security team wants to enforce that containers in a specific namespace cannot gain new capabilities. Which Pod security context field is used to achieve this?

Medium
131

An admin runs 'kubectl run test-pod --image=busybox --command -- sleep 3600' and then executes 'kubectl exec test-pod -- cat /var/run/secrets/kubernetes.io/serviceaccount/token'. The admin wants to prevent such access to the service account token. What is the correct action?

Medium
132

A developer creates a Deployment with the following container spec: ```yaml containers: - name: app image: myapp:latest env: - name: DB_PASSWORD valueFrom: secretKeyRef: name: db-secret key: password ``` Which of the following is a security concern with this approach?

Medium
133

Which of the following is NOT a valid method to enforce pod security standards in a Kubernetes cluster?

Hard
134

You are deploying an application that needs to access a database password stored in a Kubernetes Secret. To minimize risk, you should mount the Secret as a volume rather than using environment variables. Which of the following is the primary security benefit of using mounted volumes over environment variables?

Medium
135

Which TWO of the following are valid Kubernetes RuntimeClass handlers for container sandboxing? (Choose two.)

Easy
136

You are using External Secrets Operator to sync secrets from HashiCorp Vault. The operator is deployed but secrets are not being created. Which resource defines the mapping between Vault secrets and Kubernetes secrets?

Hard
137

You are a platform engineer at a financial services company. The production cluster runs a set of microservices that handle sensitive customer data. The cluster has been configured with Pod Security Standards (PSS) enforced via OPA/Gatekeeper. Recently, the security team identified that a new deployment of the `payment-processing` microservice is running with the `seccomp` profile set to `Unconfined`. This violates the company policy that requires all containers to use a runtime default seccomp profile. The deployment YAML does not explicitly set any security context for seccomp. The cluster's nodes are running containerd 1.6 with default seccomp profile enabled. The OPA constraint template checks that `securityContext.seccompProfile.type` is set to `RuntimeDefault` or `Localhost`. However, the deployment passes the OPA validation. What is the most likely reason the deployment is not being rejected by OPA, and how should you fix it?

Hard
138

An administrator deploys a Gatekeeper ConstraintTemplate with the following Rego policy: package k8srequiredlabels deny[{"msg": msg}] { input.request.kind.kind == "Pod" not input.request.object.metadata.labels["security-tier"] msg := "Pod must have label 'security-tier'" } After creating the Constraint, a user creates a Pod without the 'security-tier' label. What is the expected behavior?

Medium
139

Which THREE of the following are true about Istio PeerAuthentication? (Select THREE.)

Hard
140

A cluster administrator wants to audit all pod creations and modifications using an admission webhook. Which resource type should be created to register the webhook?

Medium
141

In the context of service mesh (e.g., Istio), which resource is used to enforce mutual TLS (mTLS) between services in a specific namespace?

Easy
142

Which TWO of the following are valid arguments for the kubectl command to create a secret from a file? (Select TWO)

Medium
143

An OPA/Gatekeeper ConstraintTemplate is written to enforce that all Deployments have the label 'app.kubernetes.io/name'. However, the Constraint does not deny Deployments without the label. What is the most likely cause?

Hard
144

A cluster administrator wants to ensure that all Secrets are encrypted at rest using AES-CBC with a key managed by the local Kubernetes API server. Which configuration is required?

Hard
145

Which Kubernetes admission controller is responsible for mutating and validating pod requests based on policies defined by OPA Gatekeeper?

Medium
146

An administrator wants to enforce mutual TLS (mTLS) between all services in an Istio service mesh. Which resource should be configured?

Medium
147

You need to enforce that all containers in a namespace run with a read-only root filesystem. Which OPA Gatekeeper resource would you use to define the policy?

Easy
148

A developer wants to run a container that reads a secret from a mounted volume, not as an environment variable. Which volume type should they use?

Easy
149

Which THREE of the following are recommended practices for minimizing microservice vulnerabilities related to container security?

Hard
150

Which of the following is a valid way to drop all capabilities from a container?

Easy
151

A developer wants to ensure that all containers in a pod run with a read-only root filesystem except for a specific volume mounted for writing logs. Which container-level security context field should be set to true?

Medium
152

A pod is using a RuntimeClass that specifies gVisor (runsc). Which of the following scenarios is most likely to cause the pod to fail?

Hard
153

You are a Kubernetes administrator for a fintech company that runs a payment processing service in a production cluster. The service consists of multiple microservices that communicate over the network. Recently, a security audit revealed that a compromised pod could potentially send malicious requests to other services because there are no network restrictions between pods. The security team has mandated that all inter-service traffic must be encrypted and authenticated, and that only necessary traffic should be allowed. You need to implement a solution that meets these requirements with minimal changes to the application code and minimal operational overhead. Which approach should you take?

Easy
154

A pod is running with the following security context: ```yaml securityContext: allowPrivilegeEscalation: false runAsNonRoot: true seccompProfile: type: RuntimeDefault ``` The pod is in a CrashLoopBackOff. The logs show: "exec user process caused: operation not permitted". What is the most likely cause?

Hard
155

Which of the following is a valid approach to enforce that containers cannot escalate privileges?

Easy
156

An administrator creates a Pod with the following securityContext: securityContext: runAsUser: 1000 runAsGroup: 3000 fsGroup: 2000 The container image has a binary that requires read/write access to /data, which is an emptyDir volume mounted by the Pod. The container fails to start with 'Permission denied' when writing to /data. What is the most likely cause?

Medium
157

You need to enforce that all pods in the 'production' namespace run with read-only root filesystems. Which OPA Gatekeeper resource do you create first?

Medium
158

You need to ensure that all containers in a pod run as non-root. Which security context field should you set to enforce this?

Easy
159

Which kubectl command lists all MutatingWebhookConfigurations in the cluster?

Easy
160

A security policy requires that all pods drop ALL Linux capabilities and disable privilege escalation. Which YAML snippet correctly implements this in the pod's security context?

Medium
161

Which container runtime is specifically designed for sandboxing containers with a lightweight kernel?

Easy
162

In an Istio service mesh, you want to enforce mutual TLS (mTLS) between all services in the 'default' namespace. Which resource should you create?

Medium
163

What is the primary purpose of using a service mesh like Istio for microservices security?

Easy
164

Which command correctly creates a secret from a file named 'config.json'?

Easy
165

You need to run a container with a sandboxed runtime using gVisor (runsc). Which Kubernetes resource must be created first to enable this?

Medium
166

A security auditor requires that all pods in a cluster must not run as root. Which Pod Security Standard (PSS) and enforcement mode should be applied at the namespace level?

Medium
167

An administrator wants to enforce a policy that all containers must drop ALL capabilities and not allow privilege escalation. Which YAML snippet correctly implements this requirement in a PodSecurityPolicy-like manner using a security context? (Note: PodSecurityPolicy is deprecated; consider using a ValidatingAdmissionPolicy or OPA/Gatekeeper, but for this question choose the correct security context fields.)

Medium
168

You are deploying a microservice that must run as a non-root user and have a read-only root filesystem. Which two fields must be set in the PodSecurityContext or container SecurityContext?

Medium
169

An administrator wants to enforce that all containers in a Kubernetes cluster run as non-root and have read-only root filesystems using OPA/Gatekeeper. Which two resources must be created?

Medium
170

Which THREE of the following are capabilities that should typically be dropped from a container to minimize vulnerabilities?

Hard
171

To encrypt secrets at rest, which file must be modified on the control plane nodes?

Easy
172

A developer asks you to run a container with gVisor runtime. The cluster has a RuntimeClass named 'gvisor' defined. Which field must be added to the Pod spec to use gVisor?

Hard
173

Which Istio resource is used to enforce mutual TLS (mTLS) for all services in a namespace, ensuring that traffic between services is encrypted?

Hard
174

Match each Kubernetes object or feature to its primary security purpose.

Medium
175

A Gatekeeper Constraint is not blocking pods that violate the policy. The constraint references a ConstraintTemplate that has been successfully created. What is the most likely cause?

Hard

Frequently asked questions

What does the Minimize Microservice Vulnerabilities domain cover on the CKS exam?
Minimize Microservice Vulnerabilities questions test whether you can apply the concept in context, not just recognise a definition.
How many questions are in this domain?
This page lists all 175 Minimize Microservice Vulnerabilities questions in the CKS question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Minimize Microservice Vulnerabilities questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
Certified Kubernetes Security Specialist CKS Minimize Microservice Vulnerabilities Practice Questions