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.

36 questions6 easy24 medium6 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 (36)

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

1

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

Medium
2

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
3

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

Medium
4

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

Medium
5

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

Medium
6

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

Hard
7

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
8

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
9

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

Medium
10

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

Medium
11

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
12

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
13

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
14

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
15

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
16

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
17

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
18

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
19

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

Easy
20

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

Easy
21

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

Easy
22

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
23

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

Medium
24

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

Medium
25

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
26

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

Medium
27

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

Easy
28

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
29

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
30

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
31

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
32

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

Medium
33

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
34

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

Easy
35

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
36

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

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 36 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.
cncf-cks CNCF-CKS cks microservice vuln Practice Questions