On an SELinux-enforcing host, you are about to launch a container that must write to the host directory /srv/secret, but no other containers must ever be able to read or write that directory. Which volume option supplied to podman or docker accomplishes this goal?
Run the container with the --privileged flag and no SELinux volume option.
Mount the directory as /srv/secret:/secret:z to share the SELinux label with other containers.
Mount the directory read-only with /srv/secret:/secret:ro so other containers cannot write to it.
Mount the directory as /srv/secret:/secret:Z so the volume receives a private SELinux label.
The uppercase :Z label on a bind-mount tells Docker or Podman to relabel the host directory with a private SELinux MCS label that matches only the current container's processes. Other containers are therefore denied access. The lowercase :z shares the label among containers, :ro merely makes the mount read-only, and --privileged does not modify SELinux labels and would in fact broaden access, not restrict it.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the :Z option do in SELinux context when used with Docker or Podman?
Open an interactive chat with Bash
How does the :z option differ from :Z when mounting volumes?
Open an interactive chat with Bash
What role do SELinux MCS labels play in container security?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .