Setting up Parameter Store
Before setting up parameters in Parameter Store, configure AWS Identity and Access Management (IAM) policies that provide principals in your account with permission to perform the actions you specify.
In this section, you learn how to manually configure these policies using the IAM console, and how to assign them to users and user groups. You can also create and assign policies to control which parameter actions can be run on a managed node.
This section also explains how to create Amazon EventBridge rules that let you receive notifications about changes to Systems Manager parameters. You can use EventBridge rules to invoke other actions in AWS based on changes in Parameter Store.
Contents
Managing access to Parameter Store parameters using IAM policies
The IAM principal that accesses AWS Systems Manager parameters must have permission to perform the required SSM actions. The principal can be an IAM user, IAM role, Amazon EC2 instance profile, Lambda execution role, Amazon ECS task role, CodeBuild service role, or another AWS service role.
The following table describes the IAM permissions required for different Parameter Store actions.
| Action | Required IAM privilege | Reference information |
|---|---|---|
| Create or update a parameter | ssm:PutParameter |
PutParameter |
| Retrieve one parameter | ssm:GetParameter |
GetParameter |
| Retrieve multiple named parameters | ssm:GetParameters |
GetParameters |
| Retrieve parameters under a path | ssm:GetParametersByPath |
GetParametersByPath |
| View parameter metadata | ssm:DescribeParameters |
DescribeParameters |
| View parameter version history | ssm:GetParameterHistory |
GetParameterHistory |
| Delete one parameter | ssm:DeleteParameter |
DeleteParameter |
| Delete multiple parameters | ssm:DeleteParameters |
DeleteParameters |
When using IAM policies to grant access to Systems Manager parameters, we recommend
that you create and use restrictive IAM
policies. For example, the following policy allows a principal to call the DescribeParameters and GetParameters API operations for a limited set of resources. The principal can get information about and use all parameters that begin with
prod-*.
Important
If a user has access to a path, then the user can access all levels of that
path. For example, if a user has permission to access path /a, then
the user can also access /a/b. Even if a principal has explicitly been
denied access in IAM for parameter /a/b, they can still call the
GetParametersByPath API operation recursively for
/a and view /a/b.
For trusted administrators, you can provide access to all Systems Manager parameter API
operations by using a policy similar to the following example. This policy gives the
user full access to all production parameters that begin with
dbserver-prod-*.
Denying permissions
Each API is unique and has distinct operations and permissions that you can allow or deny individually. An explicit deny in any policy overrides the allow.
Note
The default AWS Key Management Service (AWS KMS) key has Decrypt permission for
all IAM principals within the AWS account. If you want different
access levels to SecureString parameters in your account, we
don't recommend that you use the default key.
If you want all API operations retrieving parameter values to have the same
behavior, then you can use a pattern like GetParameter* in a
policy. The following example shows how to deny GetParameter,
GetParameters, GetParameterHistory, and
GetParametersByPath for all parameters beginning with
prod-*.
The following example shows how to deny some commands while allowing the user
to perform other commands on all parameters that begin with
prod-*.
Note
The parameter history includes all parameter versions, including the
current one. Therefore, if a user is denied permission for
GetParameter, GetParameters, and
GetParameterByPath but is allowed permission for
GetParameterHistory, they can see the current parameter,
including SecureString parameters, using
GetParameterHistory.
Encrypting and decrypting parameters using AWS KMS keys
Parameter Store SecureString parameters use AWS KMS keys for encryption. AWS KMS encrypts the value by using either
an AWS managed key or a customer managed key. For more information about AWS KMS and AWS KMS key, see the AWS Key Management Service Developer Guide.
All users within the customer account have access to the default AWS managed key. You can locate the Amazon Resource Name (ARN) of the default key
in the AWS KMS console on the AWS managed keysaws/ssm in the Alias column.
You might want to use the default key to encrypt SecureString parameters while preventing users from working
with SecureString parameters. In this case, the IAM policies must explicitly deny access to the default key, as demonstrated in the following policy example.
When using a customer managed key, the IAM policy that grants a principal access to a
parameter or parameter path must provide explicit kms:Encrypt
permissions for the key. For example, the following policy allows a principal to
create, update, and view SecureString parameters that begin with
prod- in the specified AWS Region and AWS account.
Note
The kms:GenerateDataKey permission is required for creating
encrypted advanced parameters using the specified customer managed key.
If you require fine-grained access control over the SecureString
parameters in your account, use a customer managed key to protect and restrict
access to these parameters. We also recommend using AWS CloudTrail to monitor
SecureString parameter activities.
For more information, see the following topics:
-
Policy evaluation logic in the IAM User Guide
-
Using key policies in AWS KMS in the AWS Key Management Service Developer Guide
-
Viewing events with CloudTrail Event history in the AWS CloudTrail User Guide
Allowing managed nodes to access specific parameters
To control which Parameter Store parameters a managed node can retrieve, you can attach an IAM policy to the instance role. If you
choose the SecureString parameter type when you create your parameter, Systems Manager uses AWS KMS to encrypt the parameter value.
You can view the AWS managed key by running the following command from the AWS CLI.
aws kms describe-key --key-id alias/aws/ssm
The following example allows nodes to get a parameter value only for
parameters that begin with prod-. If the parameter is a
SecureString parameter, then the node decrypts the string using
AWS KMS.
Note
Instance policies, like in the following example, are assigned to the instance role in IAM. For more information about configuring access to Systems Manager features, including how to assign policies to users and instances, see Managing EC2 instances with Systems Manager.