-
Notifications
You must be signed in to change notification settings - Fork 82
Add version 0.1.o of sysadmins: a way to add sudo users #116
Conversation
@@ -0,0 +1,7 @@ | |||
name 'sysadmins' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put one space between the method name and the first argument.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Give users a bash-shell by default: else they have no shell at all.
@@ -1,6 +1,6 @@ | |||
name 'base' | |||
description 'Base bootstrap for every box' | |||
run_list "recipe[sudo]", "recipe[apt]", "recipe[build-essential]" | |||
run_list "recipe[sysadmins]", "recipe[sudo]", "recipe[apt]", "recipe[build-essential]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [86/80]
One important issue to discuss is the default sudo-behaviour. As this PR piggybacks the sudo-file managed by the included sudo cookbook, it gets the behaviour for the "sysadmin group" from there. This means all sysadmins can I -personally- don't like that very much. But I cannot really think of an actual reason why it makes me uncomfortable. What do you think? |
Let me think on this a little bit. My first thought would be to double down on security and require a password. But since we're using SSH keys to connect this would seem a bit weird AND I don't want to put user's passwords in the Chef attributes. An alternative would be to require password, and have the user add a password when they log in with their SSH key for the first time. So until they choose a password, they can't sudo. This way we do have double-security for this. I'm not sure what the "best practice" is for this. Maybe we can find some pointers. I'll ask around too :) |
My gut-feeling says to go with what Ubuntu does by default, rather than what the "sudo" cookbook does by default. Ubuntu's (server) default sudo behaviour is:
The first user on the system automatically gets "admin" group. Any new users can get admin group. Here's what I -personally- would prefer for my servers:
I don't know all the ins- and outs, and I cannot oversee all the security-impacts of all alternatives. It might be more secure, but might also open some unintended security-hole: scio me nescire. In that case: please don't yet apply his PR. I will refactor and make sure that the sudo-cookbook behaves in the normal Ubuntu-way; I will assign the default "admin" group as used in Ubuntu, rather than a new "sysadmin" group. |
@berkes 100% agree with your comment about using Ubuntu's defaults and setting those things accordingly with our Chef recipes. Would be great if you can change this PR to make that work. Thanks! |
* Use a group called "admin" * Require a password for sudo. Requiring a password breaks Vagrant's provision and setup and as such, we don't require a password in Vagrant.
"include_sudoers_d" => true, | ||
"sudoers_default" => [ | ||
'env_reset', | ||
'mail_badpass', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
This should bring it in line with Ubuntu's default behaviour. |
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
@@ -0,0 +1,7 @@ | |||
name "backups" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put one space between the method name and the first argument.
Github is completely borking my rebase. Will re-open a proper PR in a sec. |
This is a first go at #79
It introduces a small cookbook "sysadmins" that takes sysadmins from the node json file and creates these on the server.
Please have a look and tell me what you think. If you like, I will add a commit that adds this cookbook to the base role and bump the version.
I could not find any tests in the main repo, but maybe I am looking wrong? Am I supposed to run/add tests? And if so, where?