Courseiva
Cloud Application SecurityhardMultiple ChoiceObjective-mapped

CCSP Cloud Application Security Practice Question

A cloud application uses containers orchestrated by Kubernetes. The security team wants to enforce that containers cannot run as root and that file systems are read-only at runtime. Which Kubernetes security context configuration should be applied?

⚠ Common exam trap

Many exam-takers confuse image-level defaults (like a non-root user in a Dockerfile) with runtime enforcement via SecurityContext, or they think PodSecurityPolicy (a deprecated feature) is the only way to enforce these restrictions, when in fact SecurityContext is the direct and correct mechanism.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure a SecurityContext with runAsNonRoot: true and readOnlyRootFilesystem: true

Kubernetes SecurityContext allows fine-grained control over container permissions at the pod or container level. Setting `runAsNonRoot: true` ensures the container cannot run as UID 0, and `readOnlyRootFilesystem: true` mounts the container's root filesystem as read-only, preventing unauthorized writes at runtime. This directly satisfies the security team's requirements without relying on external policies or image-level configurations.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use a RuntimeClass that disables root capabilities

    Why it's wrong here

    RuntimeClass defines runtime configuration, not container-level user and filesystem settings.

  • Set the container's user to a non-root user in the Dockerfile

    Why it's wrong here

    This can be overridden at runtime; enforcing at Kubernetes level is more reliable.

  • Apply a PodSecurityPolicy that blocks privileged containers

    Why it's wrong here

    PodSecurityPolicy is deprecated and does not enforce read-only filesystem by default.

  • Configure a SecurityContext with runAsNonRoot: true and readOnlyRootFilesystem: true

    Why this is correct

    Directly sets the required properties in the container specification.

About these practice questions

This CCSP question is part of Courseiva's 964-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CCSP practice question is part of Courseiva's free ISC2 certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCSP exam.