mediumMultiple ChoiceObjective-mapped
CAS-004 Practice Question: Is migrating a legacy application to a…
An organization is migrating a legacy application to a containerized environment. The application requires root privileges to bind to a low port (80). What is the most secure approach to handle this requirement?
⚠ Common exam trap
Many exam-takers assume host networking mode (Option D) is the simplest fix, but they overlook the severe security implications of bypassing network isolation, which violates the principle of least privilege emphasized in CompTIA CASP+ container security.
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
✓
Map port 80 to a non-privileged port and grant CAP_NET_BIND_SERVICE capability
It allows the container to bind to port 80 without running as root by mapping the container's port 80 to a non-privileged host port (e.g., 8080) and granting the CAP_NET_BIND_SERVICE capability. This capability enables the container process to bind to privileged ports (<1024) while running with a non-root user, adhering to the principle of least privilege. It avoids the security risks of full root access while satisfying the application's requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Map port 80 to a non-privileged port and grant CAP_NET_BIND_SERVICE capability
Why this is correct
Allows binding to low port without full root privileges.
- ✗
Change the application to use a high port (e.g., 8080)
Why it's wrong here
May not be possible without application changes.
- ✗
Run the container as root and bind to port 80
Why it's wrong here
Running as root violates least privilege principle.
- ✗
Use host networking mode
Why it's wrong here
Host networking reduces network isolation.
Go deeper
Related to this question
About these practice questions
This CAS-005 question is part of Courseiva's 968-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 →
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.