Skip to content

Add ssm-user to sudoers for passwordless sudo #248

Description

@akuzminsky

Problem

When connecting via AWS SSM Session Manager, ssm-user is prompted for a password when running sudo -i:

ssm-user@ip-10-1-101-9:/var/snap/amazon-ssm-agent/11797$ sudo -i
[sudo] password for ssm-user:

Proposed Solution

Add a sudoers entry for ssm-user in Hiera data (common.yaml) using the saz/sudo module:

sudo::configs:
  'ssm-user':
    'content'   : 'ssm-user ALL=(ALL) NOPASSWD: ALL'
    'priority'  : 10

This should be added to common.yaml in the relevant environments (development, sandbox, production).

Using a direct sudoers entry is preferred over adding to the admin group via accounts::user_list since ssm-user is created by the SSM agent, not by Puppet, and managing it through accounts might conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions