AppArmor: Grant the Missing File Rule (Right Perms)
MediumLinux Security15-25 minAn app runs under an enforcing AppArmor profile that's missing a rule for a file it needs, so it's denied. Fix it the right way: add a path rule to the profile that grants the permissions the app requested. Don't just switch the profile to complain mode; that disables enforcement instead of fixing it.
The kernel's denial is in /root/case/denial.txt. Read the file it names and the requested_mask it asked for, then write the rule. AppArmor path rules look like <path> <perms>,, and the profile's existing rules are examples.
Grading first checks that the profile still compiles (apparmor_parser -Q -K, which you can run too), then reads its rules. Any rule that covers the file counts, an exact path or a glob. See /root/brief.txt.
- Read an AppArmor denial to find the path and access it wants
- Add a path rule to an AppArmor profile with the correct permissions
- Fix a denial by granting the specific access, not by disabling enforcement
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
