Restricting access to specific parameters and paths
Use the following approach to restrict access to a parameter or a set of parameters. This approach reflects the authorization behavior described in How Parameter Store authorizes parameter retrieval.
To restrict access to specific parameters or paths
-
Prefer granting narrow access over denying broad access. Where you can, scope
Allowstatements to the smallest set of parameters a principal needs, rather than granting broad access and then subtracting from it. AnAllowstatement that never grants access to a parameter doesn't depend on you enumerating every action correctly. -
Separate sensitive parameters into their own path. Restricting access is simpler when sensitive parameters don't share a path with parameters that principals are allowed to read. For example, store restricted values under
/myapp/restricted/rather than alongside general configuration under/myapp/config/. For more information about organizing parameters, see Working with parameter hierarchies in Parameter Store. -
When you deny access, deny every action that can return the value. Include
ssm:GetParameter,ssm:GetParameters,ssm:GetParameterHistory, andssm:GetParametersByPath, or usessm:GetParameter*to match all four. -
For
GetParametersByPath, deny every ancestor path. A deny on the parameter's own ARN doesn't stop the parameter from being returned by a call against a path above it. To protect/myapp/restricted/db-password, denyssm:GetParametersByPathfor/myapp/restricted,/myapp, and/. -
For
SecureStringparameters, restrictkms:Decrypton the KMS key. Retrieving a decryptedSecureStringvalue requireskms:Decryptpermission on the key that encrypted it, regardless of which Parameter Store operation is used. Denyingkms:Decrypttherefore prevents decryption through every retrieval path. See Restricting decryption of SecureString parameter values. -
Verify the result. Test each retrieval operation as the restricted principal. Include a test of
GetParametersByPathagainst each ancestor path to confirm the policy behaves as you intend. You can also use the IAM policy simulator to evaluate a policy against specific actions and resources.
For more information about how IAM combines Allow and
Deny statements, see Policy
evaluation logic in the
IAM User Guide.