Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: add policy to allow IAM user to read SSM /system_user/#user#/ path #117

Open
patlachance opened this issue Nov 10, 2021 · 1 comment

Comments

@patlachance
Copy link

Have a question? Please checkout our Slack Community or visit our Slack Archive.

Slack Community

Describe the Feature

AWS IAM user created when user_enabled is set to true should have access to the AWS SSM path '/system_user/$USER/*

Expected Behavior

One should be able to retrieve any parameters using the following command:

VALUE=$(aws ssm get-parameters --names  /system_user/$USER/$PARAMETER --with-decryption --query Parameters[0].Value | sed -e 's/^"//' -e 's/"$//' )

Or read credentials using the following commands:

AK=$(aws ssm get-parameters --names  /system_user/$USER/access_key_id --with-decryption --query Parameters[0].Value | sed -e 's/^"//' -e 's/"$//' )
SK=$(aws ssm get-parameters --names  /system_user/$USER/secret_access_key --with-decryption --query Parameters[0].Value | sed -e 's/^"//' -e 's/"$//' )

Use Case

Useful for example to implement credential rotation or read any other parameters stored under the path, such as environment variable definitions.

Describe Ideal Solution

Add an additional policy to the user created, allowing it to read the SSM path under which the credentials are created.

Alternatives Considered

Creating a specific SSM policy and attach it to the user, but it's overall automation gets more complex.

Additional Context

None

@nitrocode
Copy link
Member

nitrocode commented Nov 14, 2024

Is this already completed by PR

module "s3_user" {

ssm_enabled = var.store_access_key_in_ssm
ssm_base_path = var.ssm_base_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants