-
Notifications
You must be signed in to change notification settings - Fork 25
Add subsection with recommendations for using sudo #222
Copy link
Copy link
Closed
Labels
enhancementWill improve the guide but is not a bug or blocker.Will improve the guide but is not a bug or blocker.
Description
In an attempt to standardize how we use sudo across all courses, we've come up with the following (so far):
Using sudo in Training Courses
Need a useful intro here.
Assumptions
- Although security is important, it is more important to not have unnecessary classroom security distract from the immediate topic being taught.
General Recommendations
NOTE: These are recommendations, not rules. As with most things, consistency is important. Don't swap between different approaches without reason. Choose which approach works best for your situation and stick to it.
- In all cases, use the minimum privilege level required to achieve the task.
- In exercises, use
sudoandsudo -iand set this up to work throughout all relevant systems in the classroom. Do not usesu -without good cause. - When there are a scattered minority of privileged commands in a mostly unprivileged exercise, use
sudoon a per-command basis. - When the exercise is majority privileged, or has a significant number of privileged commands, use
sudo -ieither at the beginning of the exercise, or at an appropriate step where the privileged commands begin. - In the narrative, do not show the use of
suorsudo, but always show privileged commands with the correct prompt.
Exceptions
- Some courses are specifically designed to teach
sudoand its variations, the use of the related files, such as/etc/sudoersand so on. For these courses, use the required variation for the topic being taught.
Ansible Courses
- Ansible courses typically use a
devopsuser with passwordlesssudo ALL=ALL(ALL)access on managed nodes to enable the use ofbecomewithout abecomepassword as root to do anything. - As much as possible, leave the system-wide default as
become: falseorbecome: noand if a single task needs privileges, setbecome: trueorbecome: yeson that task. - If most tasks in a play needs privileges, set the entire play to
become: trueorbecome: yesand possibly selectively set individual tasks tobecome: falseorbecome: no.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementWill improve the guide but is not a bug or blocker.Will improve the guide but is not a bug or blocker.