XK0-006 Security Practice Question
A Linux server has SELinux enforcing and a custom application needs to write to /var/log/app.log. The audit log shows 'avc: denied { write } for pid=1234'. After verifying that the application runs in the correct domain, which command should be used to allow the write access by generating a policy module?
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
✓
ausearch -m avc | audit2allow -M myapp
audit2allow reads audit messages and generates SELinux policy allow rules. ausearch can retrieve the specific denial, then audit2allow creates the module.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
ausearch -m avc | audit2allow -M myapp
Why this is correct
Correct: ausearch retrieves AVC messages, audit2allow creates policy module.
- ✗
chcon -t var_log_t /var/log/app.log
Why it's wrong here
chcon changes context, but may not persist; better to create policy.
- ✗
setsebool -P httpd_unified 1
Why it's wrong here
setsebool sets booleans; not applicable here.
- ✗
restorecon -v /var/log/app.log
Why it's wrong here
restorecon resets to default context, does not add permissions.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
Key term
Policy
A policy is a set of rules or guidelines that defines how an organization manages, secures, and operates its IT systems and services.
Key term
Linux
Linux is an open-source operating system that manages computer hardware and software, widely used in servers, desktops, and embedded systems.
About these practice questions
One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.