Red Hat Bugzilla – Bug 1290008
[RFE] Implement a confirmation prompt and warning text for setenforce 0
Last modified: 2016-06-10 09:28:20 EDT
Description of problem:
Using `setenforce 0` became a common way to "fix" errors (Permission denied) caused by mislabeled files, bugs or missing rules in the policy, etc. Disabling SELinux policy enforcement as the only action to fix these issues is arguably not the best thing to do.
I would like to suggest adding a confirmation prompt and a warning/advice text to the setenforce command -- only when executed with the intention to disable policy enforcement.
No question and no warning message about the consequences of running setenforce 0.
A prompt asking for confirmation of the action (with a default "no" answer) and a warning message explaining what are the consequences of disabling policy enforcement (thus educating users who found this "solution" somewhere on the internet). Optionally, show a bit of advice how to debug the most common issues -- possibly with a redirection to a man page that explains the most common workflows to fix policy issues, mislabeling or creating better temporary workaround fixes that don't disable policy enforcement on the whole system).