Courseiva
easyMultiple Choice

CAS-004 Practice Question: A security analyst discovers that a containerized…

A security analyst discovers that a containerized application is running with root privileges. Which of the following is the best practice to reduce the attack surface?

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

✓

Run the container as a non-root user

Running a container as a non-root user directly reduces the attack surface by limiting the privileges available to an attacker if the container is compromised. Option A (minimal base image) reduces potential vulnerabilities but does not address the root privilege issue. Option B (disable network access) could break application functionality and does not affect privilege level. Option D (read-only root filesystem) prevents writing to the filesystem but still allows root-level access.

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 minimal base image

    Why it's wrong here

    A minimal base image reduces installed packages and libraries, but it does not remove the root user the process runs as, so privilege escalation risk persists. It is tempting because it shrinks the image attack surface, and would be correct alongside, not instead of, running the container as a non-root user.

  • ✗

    Disable network access for the container

    Why it's wrong here

    Disabling network access limits reachability but leaves the process running as root, so a local compromise or volume mount still yields full container privileges. It is tempting because it blocks remote exploitation, and would be correct for isolating a workload that genuinely needs no connectivity, not for fixing root execution.

  • ✓

    Run the container as a non-root user

    Why this is correct

    Running the container as a non-root user removes the ability to perform privileged operations inside the container. If the application is compromised, the attacker gains only the limited permissions of that unprivileged account, reducing the attack surface.

  • ✗

    Use a read-only root filesystem

    Why it's wrong here

    A read-only root filesystem blocks writes to the container image but does not remove the root user's privileges, so the process still runs as UID 0 and can exploit kernel or mounted-volume weaknesses. It suits immutable workloads needing tamper resistance, not privilege reduction; dropping capabilities or a non-root user addresses the actual risk.

About these practice questions

This CAS-005 question is part of Courseiva's 973-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 CAS-005 practice question is part of Courseiva's free CompTIA 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 CAS-005 exam.