XK0-006 Security Practice Question
An administrator needs to configure SELinux to allow the Apache HTTP server to connect to a database server. Which SELinux boolean should be enabled?
⚠ Common exam trap
A common pitfall in SELinux configuration is confusing the general network connect boolean (`httpd_can_network_connect`) with the database-specific boolean (`httpd_can_network_connect_db`). In this scenario, the database-targeted boolean is required.
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
✓
httpd_can_network_connect_db
The SELinux boolean `httpd_can_network_connect_db` specifically allows the Apache HTTP server to make outbound TCP connections to database servers (e.g., MySQL, PostgreSQL). This is required when a web application needs to query a remote database. The other booleans control different aspects of httpd's behavior and do not grant network connectivity to databases.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
httpd_can_network_connect
Why it's wrong here
Enabling httpd_can_network_connect permits httpd outbound TCP connections generally, but the stem requires database access specifically; httpd_can_network_connect_db exists precisely to authorise httpd's connections to database ports. The broader boolean is tempting because it does enable network connectivity, and it would be correct when httpd must reach arbitrary remote services on non-database ports.
- ✗
httpd_enable_cgi
Why it's wrong here
httpd_enable_cgi permits the httpd service to execute CGI scripts, which governs script execution rather than outbound database connectivity. It tempts because CGI scripts often query databases, but the boolean itself does not authorise the network connection the scenario requires.
- ✗
httpd_use_nfs
Why it's wrong here
httpd_use_nfs permits the Apache process to access NFS-mounted files, which does nothing for outbound database connections. It tempts because it also concerns httpd network access, but it would be correct only when serving content stored on NFS shares.
- ✓
httpd_can_network_connect_db
Why this is correct
Enabling httpd_can_network_connect_db permits the httpd_t domain to open network sockets to database ports, directly satisfying the requirement that Apache connect to a database server. Other booleans govern unrelated access, such as outbound connections generally or specific database types, so this one precisely matches the stated constraint.
Visual reference
Go deeper
Related to this question
About these practice questions
This XK0-006 question is part of Courseiva's 781-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 XK0-006 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 XK0-006 exam.