View a markdown version of this page

Grant or deny a user permissions to update Session Manager preferences - AWS Systems Manager

Grant or deny a user permissions to update Session Manager preferences

Account preferences are stored as AWS Systems Manager (SSM) documents for each AWS Region. Before a user can update account preferences for sessions in your account, they must be granted the necessary permissions to access the type of SSM document where these preferences are stored. These permissions are granted through an AWS Identity and Access Management (IAM) policy.

Note

When you save preferences in the Session Manager console, the console deletes and re-creates the SSM-SessionManagerRunShell document instead of updating it, to avoid reaching the document version limit. This has the following effects:

  • CloudTrail records DeleteDocument and CreateDocument events for the save, not UpdateDocument.

  • Earlier versions of the document aren't kept, so you can't retrieve or compare previous preference settings.

To keep version history, update the preferences with the AWS CLI or API (update-document) instead of the console.

Administrator policy to allow preferences to be created and updated

An administrator can have the following policy to create and update preferences at any time. The following policy allows permission to access and update the SSM-SessionManagerRunShell document in the us-east-2 account 123456789012.

JSON
{ "Version":"2012-10-17", "Statement": [ { "Action": [ "ssm:CreateDocument", "ssm:GetDocument", "ssm:UpdateDocument", "ssm:DeleteDocument" ], "Effect": "Allow", "Resource": [ "arn:aws:ssm:us-east-1:111122223333:document/SSM-SessionManagerRunShell" ] } ] }
User policy to prevent preferences from being updated

Use the following policy to prevent end users in your account from updating or overriding any Session Manager preferences.

JSON
{ "Version":"2012-10-17", "Statement": [ { "Action": [ "ssm:CreateDocument", "ssm:GetDocument", "ssm:UpdateDocument", "ssm:DeleteDocument" ], "Effect": "Deny", "Resource": [ "arn:aws:ssm:us-east-1:111122223333:document/SSM-SessionManagerRunShell" ] } ] }