Ultimate CKS exam 2 - Q3, Q11 and Q13 issues

Q3

The service-account-audit namespace contains an overprivileged service account named overprivileged-sa and an insecure deployment called insecure-app .
• Is the deployment using security context with runAsNonRoot?

The checker doesn’t detect runAsNonRoot: true in the pod’s securityContext, the checks only work in container’s securityContext.


Q11

In the namespace vault , you need to implement secure secret management for the deployment secure-app .
• Is the container running as non-root user?

Similar to Q3 but the check is even more broken, it doesn’t react to anything, neither pod’s securityContext nor container’s. Even if I do more changes to harden it to use uid/gid 1001.


Q13

A vulnerable deployment has been identified in the security-scanning namespace. Your task is to utilize the pre-configured KubeLinter configuration located at /root/kube-linter-config.yaml to identify and rectify all security issues in this deployment.

Technically can’t be solved (at least not according to the solution). It requires nginx unprivileged image.
Non-root and unprivileged access with drop all on capabilities does not allow nginx to run on port 80 (not to mention some empty dirs for cache for example have to be created due to read only root fs).

nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
2026/07/21 10:16:47 [emerg] 1#1: bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

But the task passes even with these issues :thinking:. Maybe the question should state that the pod doesn’t need to run successfully. But my suggestion is to just change the default image in this template to nginx unprivileged.

I’ll take a look at these.

Meanwhile, did you check if the question required setting the securityContext in the containers block instead in the Pod spec?

Q3

Not stated if container or pod (it’s said deployment).

Requirements for the deployment modification:

  • Use the restricted-sa service account.
  • Disable automatic token mounting.
  • Configure the security context to run as a non-root user (UID 101).
  • Disable privilege escalation.
  • Drop all Linux capabilities.

Q11

Same thing here, just deployment

  1. Update the deployment to use the ServiceAccount and security context:
  • Run as non-root user (UID 1001)
  • Set allowPrivilegeEscalation: false

Noted.
Neither question mentions container, though solutions only accept securityContext defined in containers.

I’ll take note of this and ask the team to look into it.

The questions are updated. Now they explicitly state where the securityContext needs to be set.

1 Like