Question 1160
Original unofficial RHEL 10 RHCSA skill-check scenario: A custom application stores approved web assets under `/srv/appcontent`, and `restorecon` resets labels to the wrong default type. Which ongoing practice best prevents a recurrence?
Explanation
Correct Answer
In this RHEL 10 system administration case: A custom application stores approved web assets under `/srv/appcontent`, and `restorecon` resets labels to the wrong default type. Underlying reason: `restorecon` applies defined policy mappings; it does not invent mappings for custom paths. The most direct, approved resolution is: Define the intended persistent path-to-type mapping with `semanage fcontext`, then apply `restorecon`. Confirm it by checking: The custom path retains the intended label after repeated restoration. Sustain the fix by: Record permanent fcontext rules for nonstandard paths. This is the INTENDED response for the best ongoing operational safeguard. It is a knowledge-check explanation, not a verified hands-on Red Hat exam answer;
Incorrect Answers
Prefer persistent mapping changes for required custom paths. That is not sufficient for the reported RHEL task, because `restorecon` applies defined policy mappings; it does not invent mappings for custom paths.
Audit persistent enforcing status after emergency troubleshooting. That is not sufficient for the reported RHEL task, because `restorecon` applies defined policy mappings; it does not invent mappings for custom paths.
Test default modes for sensitive output paths. That is not sufficient for the reported RHEL task, because `restorecon` applies defined policy mappings; it does not invent mappings for custom paths.