widdix / aws-ec2-ssh

Manage AWS EC2 SSH access with IAM

Home Page:https://cloudonaut.io/manage-aws-ec2-ssh-access-with-iam/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install fails if sudoers_group has no members

robertnosburn opened this issue · comments

Metadata:

  • Operating System: (Linux - AWS Linux)
  • Installation method: (install.sh)
  • AWS CLI Version: (exec aws --version and enter value here)

I added the installation of this as part of my launch configuration through Cloudformation. In the event that the suders_group is set, through the config file, but the group has no members, the installation fails.

While this is marked as a bug, I don't think it actually is.
In the import_users script, there's a check for an empty list. This check is there because it can also mean IAM api is down.
One might think it's as simple as removing this check. But if IAM actually IS down, and we dont error out on an empty list, sudo access will be removed from all users.
This is something we dont want, as it means nobody can run sudo anymore and the instance cannot be administered anymore.