hardMultiple Choice
XK0-006 Practice Question: A server running Ubuntu 22.04 has AppArmor enabled
A server running Ubuntu 22.04 has AppArmor enabled. After installing a new application, the application is denied access to certain files even though the permissions are correct. The administrator checks the AppArmor profile and finds it is in enforce mode. Which command can be used to temporarily set the profile to complain mode to generate log entries for needed accesses?
⚠ Common exam trap
A common mix-up: candidates confuse `aa-complain` with `aa-enforce` or think that restarting the AppArmor service or reloading the profile will change the mode, when in fact only `aa-complain` or `aa-enforce` directly alter the profile's operational mode.
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
✓
aa-complain /usr/bin/application
`aa-complain /usr/bin/application`, is correct because it sets the specified AppArmor profile to complain mode, which logs policy violations without blocking access. This allows the administrator to identify which accesses the application needs by reviewing the generated log entries, typically in `/var/log/syslog` or via `ausearch`, while the application continues to run.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
systemctl restart apparmor
Why it's wrong here
Restarting the AppArmor service reloads profiles with their configured modes, leaving the profile in enforce mode, so access denials continue. It is tempting because restarting services often applies configuration changes, but the profile's mode is changed with aa-complain, not by restarting the daemon.
- ✗
aa-enforce /usr/bin/application
Why it's wrong here
aa-enforce sets a profile to enforce mode, which is the state already active, so denials persist and no complain-mode logs are generated. It is tempting because it is the counterpart mode command, but aa-complain is the tool that switches a profile to complain mode for logging.
- ✓
aa-complain /usr/bin/application
Why this is correct
Switches the AppArmor profile from enforce to complain mode, so denied file accesses are logged rather than blocked. This satisfies the requirement to generate audit entries revealing which paths the application needs, without permanently disabling confinement.
- ✗
apparmor_parser -r /etc/apparmor.d/usr.bin.application
Why it's wrong here
apparmor_parser -r reloads the existing profile from disk, keeping its enforce-mode setting, so denials continue and no complain-mode log entries appear. It is tempting because it manipulates profiles directly, but it is used to load or refresh policy files, not to change a profile's enforcement mode.
Go deeper
Related to this question
Learn chapter
File Permissions and Ownership
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
AppArmor
AppArmor is a Linux kernel security module that restricts programs to a predefined set of resources using mandatory access control (MAC) policies.
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.