id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
systems-manager-automation-runbook-guide-198
systems-manager-automation-runbook-guide.pdf
198
runbook creates Amazon Virtual Private Cloud (Amazon VPC) Flow Logs for subnets, network interfaces, and VPCs in your AWS account. If you create a flow log for a subnet or VPC, each elastic network interface in that subnet or Amazon VPC is monitored. Flow log data is published to the Amazon CloudWatch Logs log group or the Amazon Simple Storage Service (Amazon S3) bucket you specify. For more information about flow logs, see VPC Flow Logs in the Amazon VPC User Guide . Important Data ingestion and archival charges for vended logs apply when you publish flow logs to CloudWatch Logs or to Amazon S3. For more information, see Flow Logs pricing Run this Automation (console) Note When selecting s3 as the log destination, ensure that the bucket policy allows the log delivery service access to the bucket. For more information see Amazon S3 bucket permissions for flow logs AWSSupport-EnableVPCFlowLogs 853 AWS Systems Manager Automation runbook reference User Guide Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • DeliverLogsPermissionArn Type: String Description: (Optional) The ARN for the IAM role that permits Amazon Elastic Compute Cloud (Amazon EC2) to publish flow logs to the CloudWatch Logs log group in your account. If you specify s3 for the LogDestinationType parameter, do not provide a value for this parameter. For more information, see Publish flow logs to CloudWatch Logs in the Amazon VPC User Guide . • LogDestinationARN Type: String Description: (Optional) The ARN of the resource to which the flow log data is published. If cloud-watch-logs is specified for the LogDestinationType parameter, provide the ARN of the CloudWatch Logs log group you want to publish flow log data to. Alternatively, use LogGroupName instead. If s3 is specified for the LogDestinationType parameter, you must specify the ARN of the Amazon S3 bucket you want to publish flow log data to for this parameter. You can also specify a folder in the bucket. AWSSupport-EnableVPCFlowLogs 854 AWS Systems Manager Automation runbook reference User Guide Important When choosing s3 as the LogDestinationType you should ensure that the bucket selected follows Amazon S3 Bucket security best practices, and that you follow the data privacy laws for your organisation and geographic region. • LogDestinationType Type: String Valid values: cloud-watch-logs | s3 Description: (Required) Determines where flow log data is published. If you specify LogDestinationType as s3 , do not specify DeliverLogsPermissionArn or LogGroupName . • LogFormat Type: String Description: (Optional) The fields to include in the flow log, and the order in which they should appear in the record. For a list of available fields, see Flow log records in the Amazon VPC User Guide . If you do not provide a value for this parameter, the flow log is created using the default format. If you specify this parameter, you must specify at least one field. • LogGroupName Type: String Description: (Optional) The name of the CloudWatch Logs log group where flow log data is published. If you specify s3 for the LogDestinationType parameter, do not provide a value for this parameter. • ResourceIds Type: StringList Description: (Required) A comma-separated list of the IDs for the subnets, elastic network interfaces, or VPC for which you want to create a flow log. • TrafficType AWSSupport-EnableVPCFlowLogs 855 AWS Systems Manager Automation runbook reference User Guide Type: String Valid values: ACCEPT | REJECT | ALL Description: (Required) The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:CreateFlowLogs • ec2:DeleteFlowLogs • ec2:DescribeFlowLogs • iam:AttachRolePolicy • iam:CreateRole • iam:CreatePolicy • iam:DeletePolicy • iam:DeleteRole • iam:DeleteRolePolicy • iam:GetPolicy • iam:GetRole • iam:TagRole • iam:PassRole • iam:PutRolePolicy • iam:UpdateRole • logs:CreateLogDelivery • logs:CreateLogGroup • logs:DeleteLogDelivery • logs:DeleteLogGroup AWSSupport-EnableVPCFlowLogs 856 AWS Systems Manager Automation runbook reference User Guide • logs:DescribeLogGroups • logs:DescribeLogStreams • s3:GetBucketLocation • s3:GetBucketAcl • s3:GetBucketPublicAccessBlock • s3:GetBucketPolicyStatus • s3:GetBucketAcl • s3:ListBucket • s3:PutObject Sample Policy { "Version": "2012-10-17", "Statement": [ { "Sid": "SSM Execution Permissions", "Effect": "Allow", "Action": [ "ssm:StartAutomationExecution", "ssm:GetAutomationExecution" ], "Resource": "*" }, { "Sid": "EC2 FlowLogs Permissions", "Effect": "Allow", "Action": [ "ec2:CreateFlowLogs", "ec2:DeleteFlowLogs", "ec2:DescribeFlowLogs" ], "Resource": "arn:{partition}:ec2:{region}:{account-id}:{instance| subnet|vpc|transit-gateway|transit-gateway-attachment}/{resource ID}" }, { "Sid": "IAM CreateRole Permissions", "Effect": "Allow", AWSSupport-EnableVPCFlowLogs 857 AWS Systems Manager Automation runbook reference User Guide "Action": [ "iam:AttachRolePolicy", "iam:CreateRole", "iam:CreatePolicy", "iam:DeletePolicy", "iam:DeleteRole", "iam:DeleteRolePolicy", "iam:GetPolicy", "iam:GetRole", "iam:TagRole", "iam:PassRole", "iam:PutRolePolicy", "iam:UpdateRole" ], "Resource": [ "arn:{partition}:iam::{account-id}:role/{role name}", "arn:{partition}:iam::{account-id}:role/ AWSSupportCreateFlowLogsRole" ] }, { "Sid": "CloudWatch Logs Permissions", "Effect": "Allow",
systems-manager-automation-runbook-guide-199
systems-manager-automation-runbook-guide.pdf
199
s3:GetBucketLocation • s3:GetBucketAcl • s3:GetBucketPublicAccessBlock • s3:GetBucketPolicyStatus • s3:GetBucketAcl • s3:ListBucket • s3:PutObject Sample Policy { "Version": "2012-10-17", "Statement": [ { "Sid": "SSM Execution Permissions", "Effect": "Allow", "Action": [ "ssm:StartAutomationExecution", "ssm:GetAutomationExecution" ], "Resource": "*" }, { "Sid": "EC2 FlowLogs Permissions", "Effect": "Allow", "Action": [ "ec2:CreateFlowLogs", "ec2:DeleteFlowLogs", "ec2:DescribeFlowLogs" ], "Resource": "arn:{partition}:ec2:{region}:{account-id}:{instance| subnet|vpc|transit-gateway|transit-gateway-attachment}/{resource ID}" }, { "Sid": "IAM CreateRole Permissions", "Effect": "Allow", AWSSupport-EnableVPCFlowLogs 857 AWS Systems Manager Automation runbook reference User Guide "Action": [ "iam:AttachRolePolicy", "iam:CreateRole", "iam:CreatePolicy", "iam:DeletePolicy", "iam:DeleteRole", "iam:DeleteRolePolicy", "iam:GetPolicy", "iam:GetRole", "iam:TagRole", "iam:PassRole", "iam:PutRolePolicy", "iam:UpdateRole" ], "Resource": [ "arn:{partition}:iam::{account-id}:role/{role name}", "arn:{partition}:iam::{account-id}:role/ AWSSupportCreateFlowLogsRole" ] }, { "Sid": "CloudWatch Logs Permissions", "Effect": "Allow", "Action": [ "logs:CreateLogDelivery", "logs:CreateLogGroup", "logs:DeleteLogDelivery", "logs:DeleteLogGroup", "logs:DescribeLogGroups", "logs:DescribeLogStreams" ], "Resource": [ "arn:{partition}:logs:{region}:{account-id}:log-group:{log group name}", "arn:{partition}:logs:{region}:{account-id}:log-group:{log group name}:*" ] }, { "Sid": "S3 Permissions", "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:GetBucketPublicAccessBlock", AWSSupport-EnableVPCFlowLogs 858 AWS Systems Manager Automation runbook reference User Guide "s3:GetAccountPublicAccessBlock", "s3:GetBucketPolicyStatus", "s3:GetBucketAcl", "s3:ListBucket", "s3:PutObject" ], "Resource": [ "arn:{partition}:s3:::{bucket name}", "arn:{partition}:s3:::{bucket name}/*" ] } ] } Document Steps • aws:branch - Branches based on the value specified for the LogDestinationType parameter. • aws:executeScript - Checks if the target Amazon Simple Storage Service (Amazon S3) potentially grants read or write public access to its objects. • aws:executeScript - Creates a log group if no value is specified for the LogDestinationARN parameter, and cloud-watch-logs is specified for the LogDestinationType parameter. • aws:executeScript - Creates flow logs based on the values specified in the runbook parameters. AWSConfigRemediation-EnableVPCFlowLogsToCloudWatch Description The AWSConfigRemediation-EnableVPCFlowLogsToCloudWatch runbook replaces an existing Amazon VPC flow log that publishes flow log data to Amazon Simple Storage Service (Amazon S3) with a flow log that publishes flow log data to the Amazon CloudWatch Logs (CloudWatch Logs) log group you specify. Run this Automation (console) Document type Automation Owner AWSConfigRemediation-EnableVPCFlowLogsToCloudWatch 859 AWS Systems Manager Automation runbook reference User Guide Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DestinationLogGroup Type: String Description: (Required) The name of the CloudWatch Logs log group you want to publish flow log data to. • DeliverLogsPermissionArn Type: String Description: (Required) The ARN of the AWS Identity and Access Management (IAM) role you want to use that provides Amazon Elastic Compute Cloud (Amazon EC2) the requisite permissions to publish flow log data to CloudWatch Logs. • FlowLogId Type: String Description: (Required) The ID of the flow log that publishes to Amazon S3 you want to replace. • MaxAggregationInterval Type: Integer Valid values: 60 | 600 Description: (Optional) The maximum interval of time, in seconds, during which a flow of packets is captured and aggregated into a flow log record. AWSConfigRemediation-EnableVPCFlowLogsToCloudWatch 860 AWS Systems Manager Automation runbook reference User Guide • TrafficType Type: String Valid values: ACCEPT | REJECT | ALL Description: (Required) The type of flow log data you want to record and publish. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:CreateFlowLogs • ec2:DeleteFlowLogs • ec2:DescribeFlowLogs Document Steps • aws:executeAwsApi - Gathers details about your VPC from the value you specify in the FlowLogId parameter. • aws:executeAwsApi - Creates a flow log based on the values you specify for the runbook parameters. • aws:assertAwsResourceProperty - Verifies the newly created flow log publishes to CloudWatch Logs. • aws:executeAwsApi - Deletes the flow log that publishes to Amazon S3. • aws:executeScript - Confirms the flow log that published to Amazon S3 was deleted. AWSConfigRemediation-EnableVPCFlowLogsToS3Bucket Description The AWSConfigRemediation-EnableVPCFlowLogsToS3Bucket runbook replaces an existing Amazon VPC flow log that publishes flow log data to Amazon CloudWatch Logs (CloudWatch Logs) AWSConfigRemediation-EnableVPCFlowLogsToS3Bucket 861 AWS Systems Manager Automation runbook reference User Guide with a flow log that publishes flow log data to the Amazon Simple Storage Service (Amazon S3) bucket you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DestinationS3BucketArn Type: String Description: (Required) The ARN of the Amazon S3 bucket you want to publish flow log data to. • FlowLogId Type: String Description: (Required) The ID of the flow log that publishes to CloudWatch Logs you want to replace. • MaxAggregationInterval Type: Integer Valid values: 60 | 600 AWSConfigRemediation-EnableVPCFlowLogsToS3Bucket 862 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The maximum interval of time, in seconds, during which a flow of packets is captured and aggregated into a flow log record. • TrafficType Type: String Valid values: ACCEPT | REJECT | ALL Description: (Required) The type of flow log data you want to record and publish. Required IAM permissions The AutomationAssumeRole parameter requires the
systems-manager-automation-runbook-guide-200
systems-manager-automation-runbook-guide.pdf
200
log data to. • FlowLogId Type: String Description: (Required) The ID of the flow log that publishes to CloudWatch Logs you want to replace. • MaxAggregationInterval Type: Integer Valid values: 60 | 600 AWSConfigRemediation-EnableVPCFlowLogsToS3Bucket 862 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The maximum interval of time, in seconds, during which a flow of packets is captured and aggregated into a flow log record. • TrafficType Type: String Valid values: ACCEPT | REJECT | ALL Description: (Required) The type of flow log data you want to record and publish. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:CreateFlowLogs • ec2:DeleteFlowLogs • ec2:DescribeFlowLogs Document Steps • aws:executeAwsApi - Gathers details about your VPC from the value you specify in the FlowLogId parameter. • aws:executeAwsApi - Creates a flow log based on the values you specify for the runbook parameters. • aws:assertAwsResourceProperty - Verifies the newly created flow log publishes to Amazon S3. • aws:executeAwsApi - Deletes the flow log that publishes to CloudWatch Logs. • aws:executeScript - Confirms the flow log that published to CloudWatch Logs was deleted. AWS-ReleaseElasticIP Description AWS-ReleaseElasticIP 863 AWS Systems Manager Automation runbook reference User Guide Release the specified Elastic IP address using the allocation ID. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AllocationId Type: String Description: (Required) The Allocation ID of the Elastic IP address. AWS-RemoveNetworkACLUnrestrictedSSHRDP Description The AWS-RemoveNetworkACLUnrestrictedSSHRDP runbook removes all network access control list (ACL) rules from the specified network ACL that allow ingress traffic from all source addresses to default SSH and RDP ports. Rules that include port ranges that overlap with the default SSH and RDP ports aren't removed. Run this Automation (console) AWS-RemoveNetworkACLUnrestrictedSSHRDP 864 AWS Systems Manager Automation runbook reference User Guide Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • NetworkAclId Type: String Description: (Required) The ID of the network ACL that you want to remove unrestricted rules that allow ingress traffic from all source addresses to default SSH and RDP ports. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DeleteNetworkAclEntry • ec2:DescribeNetworkAcls Document Steps AWS-RemoveNetworkACLUnrestrictedSSHRDP 865 AWS Systems Manager Automation runbook reference User Guide • aws:executeScript - Removes all ingress rules that allow traffic from all source addresses from the security group you specified in the SecurityGroupId parameter. Outputs RemoveNaclEntriesAndVerify.VerificationMessage - Verification messages of the successfully deleted network ACL rules. RemoveNaclEntriesAndVerify.RulesDeletedAndApiResponses - The network ACL rules that were deleted, and the DeleteNetworkAclEntry API operation responses. AWSConfigRemediation- RemoveUnrestrictedSourceIngressRules Description The AWSConfigRemediation-RemoveUnrestrictedSourceIngressRules runbook removes all ingress rules from the security group you specify that allow traffic from all source addresses. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. AWSConfigRemediation-RemoveUnrestrictedSourceIngressRules 866 AWS Systems Manager Automation runbook reference User Guide • SecurityGroupId Type: String Description: (Required) The ID of the security group that you want to remove ingress rules that allow traffic from all source addresses from. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DescribeSecurityGroups • ec2:RevokeSecurityGroupIngress Document Steps • aws:executeScript - Removes all ingress rules that allow traffic from all source addresses from the security group you specified in the SecurityGroupId parameter. AWSConfigRemediation-RemoveVPCDefaultSecurityGroupRules Description The AWSConfigRemediation-RemoveVPCDefaultSecurityGroupRules runbook removes all rules from the default security group of the virtual private cloud (VPC) you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms AWSConfigRemediation-RemoveVPCDefaultSecurityGroupRules 867 AWS Systems Manager Automation runbook reference User Guide Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • GroupId Type: String Description: (Required) The ID of the security group that you want to remove all rules from. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully.
systems-manager-automation-runbook-guide-201
systems-manager-automation-runbook-guide.pdf
201
group of the virtual private cloud (VPC) you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms AWSConfigRemediation-RemoveVPCDefaultSecurityGroupRules 867 AWS Systems Manager Automation runbook reference User Guide Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • GroupId Type: String Description: (Required) The ID of the security group that you want to remove all rules from. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • ec2:DescribeSecurityGroups • ec2:RevokeSecurityGroupEgress • ec2:RevokeSecurityGroupIngress Document Steps • aws:assertAwsResourceProperty - Confirms the security group you specified in the GroupId parameter is named default. • aws:executeScript - Removes all rules from the security group you specified in the GroupId parameter. AWSSupport-SetupIPMonitoringFromVPC Description AWSSupport-SetupIPMonitoringFromVPC 868 AWS Systems Manager Automation runbook reference User Guide AWSSupport-SetupIPMonitoringFromVPC creates an Amazon Elastic Compute Cloud (Amazon EC2) instance in the specified subnet and monitors selected target IPs (IPv4 or IPv6) by continuously running ping, MTR, traceroute and tracetcp tests. The results are stored in Amazon CloudWatch Logs logs, and metric filters are applied to quickly visualize latency and packet loss statistics in a CloudWatch dashboard. Additional Information The CloudWatch Logs data can be used for network troubleshooting and analysis of pattern/ trends. Additionally, you can configure CloudWatch alarms with Amazon SNS notifications when packet loss and/or latency reach a threshold. The data can also be used when opening a case with AWS Support, to help isolate an issue quickly and reduce time to resolution when investigating a network issue. Note To clean up resources created by AWSSupport-SetupIPMonitoringFromVPC, you can use the runbook AWSSupport-TerminateIPMonitoringFromVPC . For more information, see AWSSupport-TerminateIPMonitoringFromVPC . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWSSupport-SetupIPMonitoringFromVPC 869 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • CloudWatchLogGroupNamePrefix Type: String Default: /AWSSupport-SetupIPMonitoringFromVPC Description: (Optional) Prefix used for each CloudWatch log group created for the test results. • CloudWatchLogGroupRetentionInDays Type: String Valid values: 1 | 3 | 5 | 7 | 14 | 30 | 60 | 90 | 120 | 150 | 180 | 365 | 400 | 545 | 731 | 1827 | 3653 Default: 7 Description: (Optional) Number of days you want to keep the network monitoring results for. • InstanceType Type: String Valid values: t2.micro | t2.small | t2.medium | t2.large | t3.micro | t3.small | t3.medium | t3.large | t4g.micro | t4g.small | t4g.medium | t4g.large Default: t3.micro Description: (Optional) The EC2 instance type for the EC2Rescue instance. Recommended size: t3.micro. • SubnetId Type: String Description: (Required) The subnet ID for the monitor instance. Be aware that if you specify a private subnet, then you must make sure there is Internet access to allow the monitor instance to setup the test (meaning, install the CloudWatch Logs agent, interact with Systems Manager and CloudWatch). AWSSupport-SetupIPMonitoringFromVPC 870 AWS Systems Manager Automation runbook reference User Guide • TargetIPs Type: String Description: (Required) Comma separated list of IPv4s and/or IPv6s to monitor. No spaces allowed. Maximum size is 255 characters. Be aware that if you provide an invalid IP, then the automation will fail and rollback the test setup. • TestInstanceSecurityGroupId Type: String Description: (Optional) The security group ID for the test instance. If not specified, the automation creates one during the instance creation. Make sure the security group allows outbound access to the monitoring IPs. • TestInstanceProfileName Type: String Description: (Optional) The name of an existing IAM instance profile for the test instance. If not specified, the automation creates one during the instance creation. The role must have the following permissions: logs:CreateLogStream, logs:DescribeLogGroups, logs:DescribeLogStreams, and logs:PutLogEvents and the AWS Managed Policy AmazonSSMManagedInstanceCore. • TestInterval Type: String Description: (Optional) The number of minutes between test intervals. The default value is 1 minute and the maximum is 10 minutes. • RetainDashboardAndLogsOnDeletion Type: String Description: (Optional) Specify False to delete the Amazon CloudWatch dashboard and Logs when deleting the AWS CloudFormation stack. The default value is True. By default, the dashboard and logs are retained and will need to be manually deleted when they are no longer needed. Required IAM permissions AWSSupport-SetupIPMonitoringFromVPC 871 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. Warning It is recommended to pass TestInstanceProfileName parameter or ensure security guardrails in place to prevent misuse of mutable IAM permissions. It is
systems-manager-automation-runbook-guide-202
systems-manager-automation-runbook-guide.pdf
202
maximum is 10 minutes. • RetainDashboardAndLogsOnDeletion Type: String Description: (Optional) Specify False to delete the Amazon CloudWatch dashboard and Logs when deleting the AWS CloudFormation stack. The default value is True. By default, the dashboard and logs are retained and will need to be manually deleted when they are no longer needed. Required IAM permissions AWSSupport-SetupIPMonitoringFromVPC 871 AWS Systems Manager Automation runbook reference User Guide The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. Warning It is recommended to pass TestInstanceProfileName parameter or ensure security guardrails in place to prevent misuse of mutable IAM permissions. It is recommended that the user who runs the automation have the AmazonSSMAutomationRole IAM managed policy attached. In addition, the user must have the following policy attached to their user account, group, or role: { "Version": "2012-10-17", "Statement": [ { "Action": [ "iam:CreateRole", "iam:CreateInstanceProfile", "iam:GetRole", "iam:GetInstanceProfile", "iam:DetachRolePolicy", "iam:AttachRolePolicy", "iam:PassRole", "iam:AddRoleToInstanceProfile", "iam:GetRolePolicy", "iam:RemoveRoleFromInstanceProfile", "iam:DeleteRole", "iam:DeleteRolePolicy", "iam:DeleteInstanceProfile", "iam:PutRolePolicy", "iam:TagRole" ], "Resource": [ "arn:<partition>:iam::<account-id>:role/SetupIPMonitoringFromVPC*", "arn:<partition>:iam::<account-id>:instance-profile/ SetupIPMonitoringFromVPC*" ], "Effect": "Allow" }, AWSSupport-SetupIPMonitoringFromVPC 872 AWS Systems Manager Automation runbook reference User Guide { "Action": [ "cloudformation:CreateStack", "cloudformation:CreateChangeSet", "cloudformation:DeleteStack", "cloudformation:DescribeStacks", "cloudformation:DescribeStackEvents", "cloudwatch:PutDashboard", "cloudwatch:DeleteDashboards", "ec2:AuthorizeSecurityGroupEgress", "ec2:CreateSecurityGroup", "ec2:CreateLaunchTemplate", "ec2:DeleteSecurityGroup", "ec2:DescribeImages", "ec2:DescribeSubnets", "ec2:DescribeInstanceTypes", "ec2:DescribeVpcs", "ec2:DeleteLaunchTemplate", "ec2:DeleteSecurityGroup", "ec2:RunInstances", "ec2:TerminateInstances", "ec2:DescribeInstanceStatus", "ec2:CreateTags", "ec2:AssignIpv6Addresses", "ec2:DescribeTags", "ec2:DescribeInstances", "ec2:DescribeSecurityGroups", "ec2:DescribeLaunchTemplates", "ec2:RevokeSecurityGroupEgress", "logs:CreateLogGroup", "logs:DeleteLogGroup", "logs:PutMetricFilter", "logs:PutRetentionPolicy", "logs:TagResource", "ssm:DescribeInstanceInformation", "ssm:GetParameter", "ssm:GetParameters", "ssm:SendCommand", "ssm:ListCommands", "ssm:ListCommandInvocations" ], "Resource": [ "*" ], AWSSupport-SetupIPMonitoringFromVPC 873 AWS Systems Manager Automation runbook reference User Guide "Effect": "Allow" } ] } If the TestInstanceProfileName parameter is provided, the following IAM permissions are not required to execute the runbook: • iam:CreateRole • iam:CreateInstanceProfile • iam:DetachRolePolicy • iam:AttachRolePolicy • iam:AddRoleToInstanceProfile • iam:RemoveRoleFromInstanceProfile • iam:DeleteRole • iam:DeleteRolePolicy • iam:DeleteInstanceProfile Document Steps 1. aws:executeAwsApi - describe the provided subnet. 2. aws:branch - evaluate the TargetIPs input. (IPv6) If TargetIPs contains an IPv6: aws:assertAwsResourceProperty - check the provided subnet has an IPv6 pool associated 3. aws:executeScript - get the architecture of instance type and public parameter path for latest Amazon Linux 2 AMI. 4. aws:executeAwsApi - get the latest Amazon Linux 2 AMI from Parameter Store. 5. aws:executeAwsApi - create a security group for the test in the subnet's VPC. (Cleanup) If the security group creation fails: aws:executeAwsApi - delete the security group created by the automation, if it exists. 6. aws:executeAwsApi - allow all outbound traffic in the test security group. AWSSupport-SetupIPMonitoringFromVPC 874 AWS Systems Manager Automation runbook reference User Guide (Cleanup) If the security group egress rule creation fails: aws:executeAwsApi - delete the security group created by the automation, if it exists. 7. aws:executeAwsApi - create an IAM role for the test EC2 instance (Cleanup) If the role creation fails: a. aws:executeAwsApi - delete the IAM role created by the automation, if it exists. b. aws:executeAwsApi - delete the security group created by the automation, if it exists. 8. aws:executeAwsApi - attach the AmazonSSMManagedInstanceCore managed policy (Cleanup) If the policy attachment fails: a. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation, if attached. b. aws:executeAwsApi - delete the IAM role created by the automation. c. aws:executeAwsApi - delete the security group created by the automation, if it exists. 9. aws:executeAwsApi - attach an inline policy to allow setting CloudWatch log group retentions and creating a CloudWatch dashboard (Cleanup) If the inline policy attachment fails: a. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation, if created. b. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. c. aws:executeAwsApi - delete the IAM role created by the automation. d. aws:executeAwsApi - delete the security group created by the automation, if it exists. 10.aws:executeAwsApi - create an IAM instance profile. (Cleanup) If the instance profile creation fails: a. aws:executeAwsApi - delete the IAM instance profile created by the automation, if it exists. b. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. c. aws:executeAwsApi - delete the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. AWSSupport-SetupIPMonitoringFromVPC 875 AWS Systems Manager Automation runbook reference User Guide d. aws:executeAwsApi - delete the IAM role created by the automation. e. aws:executeAwsApi - delete the security group created by the automation, if it exists. 11.aws:executeAwsApi - associate the IAM instance profile to the IAM role. (Cleanup) If the instance profile and role association fails: a. aws:executeAwsApi - remove the IAM instance profile from the role, if associated. b. aws:executeAwsApi - delete the IAM instance profile created by the automation. c. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. d. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. e. aws:executeAwsApi - delete the IAM role created by the automation. f. aws:executeAwsApi - delete the security group created by the automation, if it exists. 12.aws:sleep - wait for the instance profile
systems-manager-automation-runbook-guide-203
systems-manager-automation-runbook-guide.pdf
203
to the IAM role. (Cleanup) If the instance profile and role association fails: a. aws:executeAwsApi - remove the IAM instance profile from the role, if associated. b. aws:executeAwsApi - delete the IAM instance profile created by the automation. c. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. d. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. e. aws:executeAwsApi - delete the IAM role created by the automation. f. aws:executeAwsApi - delete the security group created by the automation, if it exists. 12.aws:sleep - wait for the instance profile to become available. 13.aws:runInstances - create the test instance in the specified subnet, and with the instance profile created earlier attached. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 14.aws:branch - evaluate the TargetIPs input. (IPv6) If TargetIPs contains an IPv6: aws:executeAwsApi - assign an IPv6 to the test instance. 15.aws:waitForAwsResourceProperty - wait for the test instance to become a managed instance. AWSSupport-SetupIPMonitoringFromVPC 876 AWS Systems Manager Automation runbook reference User Guide (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 16.aws:runCommand - install test pre-requisites: (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 17.aws:runCommand - validate the provided IPs are syntactically correct IPv4 and/or IPv6 addresses: (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. AWSSupport-SetupIPMonitoringFromVPC 877 AWS Systems Manager Automation runbook reference User Guide e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 18.aws:runCommand - define the MTR test for each of the provided IPs. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 19.aws:runCommand - define the first ping test for each of the provided IPs. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 20.aws:runCommand - define the second ping test for each of the provided IPs. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. AWSSupport-SetupIPMonitoringFromVPC b. aws:executeAwsApi - remove the IAM instance profile from the role. 878 AWS Systems Manager Automation runbook
systems-manager-automation-runbook-guide-204
systems-manager-automation-runbook-guide.pdf
204
the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 20.aws:runCommand - define the second ping test for each of the provided IPs. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. AWSSupport-SetupIPMonitoringFromVPC b. aws:executeAwsApi - remove the IAM instance profile from the role. 878 AWS Systems Manager Automation runbook reference User Guide c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 21.aws:runCommand - define the tracepath test for each of the provided IPs. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 22.aws:runCommand - define the traceroute test for each of the provided IPs. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 23.aws:runCommand - configure CloudWatch logs. AWSSupport-SetupIPMonitoringFromVPC 879 AWS Systems Manager Automation runbook reference User Guide (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 24.aws:runCommand - schedule cronjobs to run each test every minute. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 25.aws:sleep - wait for the tests to generate some data. 26.aws:runCommand - set the desired CloudWatch log group retentions. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. AWSSupport-SetupIPMonitoringFromVPC 880 AWS Systems Manager Automation runbook reference User Guide e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 27.aws:runCommand - set the CloudWatch log group metric filters. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 28.aws:runCommand - create
systems-manager-automation-runbook-guide-205
systems-manager-automation-runbook-guide.pdf
205
set the CloudWatch log group metric filters. (Cleanup) If the step fails: a. aws:changeInstanceState - terminate the test instance. b. aws:executeAwsApi - remove the IAM instance profile from the role. c. aws:executeAwsApi - delete the IAM instance profile created by the automation. d. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. e. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. f. aws:executeAwsApi - delete the IAM role created by the automation. g. aws:executeAwsApi - delete the security group created by the automation, if it exists. 28.aws:runCommand - create the CloudWatch dashboard. (Cleanup) If the step fails: a. aws:executeAwsApi - delete the CloudWatch dashboard, if it exists. b. aws:changeInstanceState - terminate the test instance. c. aws:executeAwsApi - remove the IAM instance profile from the role. d. aws:executeAwsApi - delete the IAM instance profile created by the automation. e. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. f. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. g. aws:executeAwsApi - delete the IAM role created by the automation. h. aws:executeAwsApi - delete the security group created by the automation, if it exists. Outputs AWSSupport-SetupIPMonitoringFromVPC createCloudWatchDashboards.Output - the URL of the CloudWatch dashboard. 881 AWS Systems Manager Automation runbook reference User Guide createManagedInstance.InstanceIds - the test instance ID. AWSSupport-TerminateIPMonitoringFromVPC Description AWSSupport-TerminateIPMonitoringFromVPC terminates an IP monitoring test previously started by AWSSupport-SetupIPMonitoringFromVPC . Data related to the specified test ID will be deleted. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • AutomationExecutionId Type: String Description: (Required) The automation execution ID from when you previously ran the AWSSupport-SetupIPMonitoringFromVPC runbook. All resources associated with this execution ID are deleted. AWSSupport-TerminateIPMonitoringFromVPC 882 AWS Systems Manager Automation runbook reference User Guide • InstanceId Type: String Description: (Required) The instance ID for the monitor instance. • SubnetId Type: String Description: (Required) The subnet ID for the monitor instance. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. It is recommended that the user who runs the automation have the AmazonSSMAutomationRole IAM managed policy attached. In addition, the user must have the following policy attached to their user, group, or role: { "Version": "2012-10-17", "Statement": [ { "Action": [ "iam:DetachRolePolicy", "iam:RemoveRoleFromInstanceProfile", "iam:DeleteRole", "iam:DeleteInstanceProfile", "iam:DeleteRolePolicy" ], "Resource": [ "arn:aws:iam::An-AWS-Account-ID:role/AWSSupport/ SetupIPMonitoringFromVPC_*", "arn:aws:iam::An-AWS-Account-ID:instance-profile/AWSSupport/ SetupIPMonitoringFromVPC_*" ], "Effect": "Allow" }, { "Action": [ "iam:DetachRolePolicy" AWSSupport-TerminateIPMonitoringFromVPC 883 AWS Systems Manager Automation runbook reference User Guide ], "Resource": [ "arn:aws:iam::aws:policy/service-role/AmazonSSMManagedInstanceCore" ], "Effect": "Allow" }, { "Action": [ "cloudwatch:DeleteDashboards" ], "Resource": [ "*" ], "Effect": "Allow" }, { "Action": [ "ec2:DescribeTags", "ec2:DescribeInstances", "ec2:DescribeSecurityGroups", "ec2:DeleteSecurityGroup", "ec2:TerminateInstances", "ec2:DescribeInstanceStatus" ], "Resource": [ "*" ], "Effect": "Allow" ] } Document Steps 1. aws:assertAwsResourceProperty - check AutomationExecutionId and InstanceId are related to the same test. 2. aws:assertAwsResourceProperty - check SubnetId and InstanceId are related to the same test. 3. aws:executeAwsApi - retrieve the test security group. 4. aws:executeAwsApi - delete the CloudWatch dashboard. 5. aws:changeInstanceState - terminate the test instance. 6. aws:executeAwsApi - remove the IAM instance profile from the role. AWSSupport-TerminateIPMonitoringFromVPC 884 AWS Systems Manager Automation runbook reference User Guide 7. aws:executeAwsApi - delete the IAM instance profile created by the automation. 8. aws:executeAwsApi - delete the CloudWatch inline policy from the role created by the automation. 9. aws:executeAwsApi - detach the AmazonSSMManagedInstanceCore managed policy from the role created by the automation. 10.aws:executeAwsApi - delete the IAM role created by the automation. 11.aws:executeAwsApi - delete the security group created by the automation, if it exists. Outputs None AWS WAF AWS Systems Manager Automation provides predefined runbooks for AWS WAF. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-AddWAFRegionalRuleToRuleGroup • AWS-AddWAFRegionalRuleToWebAcl • AWSConfigRemediation-EnableWAFClassicLogging • AWSConfigRemediation-EnableWAFClassicRegionalLogging • AWSConfigRemediation-EnableWAFV2Logging AWS-AddWAFRegionalRuleToRuleGroup Description The AWS-AddWAFRegionalRuleToRuleGroup runbook adds an existing AWS WAF regional rule to a AWS WAF regional rule group. Only AWS WAF Classic regional rule groups are supported. AWS WAF Classic regional rule groups can have a maximum of 10 rules. Run this Automation (console) Document type AWS WAF 885 AWS Systems Manager Automation runbook reference User Guide Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook.
systems-manager-automation-runbook-guide-206
systems-manager-automation-runbook-guide.pdf
206
regional rule group. Only AWS WAF Classic regional rule groups are supported. AWS WAF Classic regional rule groups can have a maximum of 10 rules. Run this Automation (console) Document type AWS WAF 885 AWS Systems Manager Automation runbook reference User Guide Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • RuleGroupId Type: String Description: (Required) The ID of the rule group that you want to update. • RulePriority Type: Integer Description: (Required) The priority for the new rule. Rule priority determines the order in which rules in a regional group are evaluated. Rules with a lower value have higher priority than rules with a higher value. The value must be a unique integer. If you add multiple rules to a regional rule group, the values don't have to be consecutive. • RuleId Type: String Description: (Required) The ID for the rule that you want to add to your regional rule group. • RuleAction Type: String AWS-AddWAFRegionalRuleToRuleGroup 886 AWS Systems Manager Automation runbook reference User Guide Description: (Required) Specifies the action that AWS WAF takes when a web request matches the conditions of the rule. Valid values: ALLOW | BLOCK | COUNT Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • waf-regional:GetChangeToken • waf-regional:GetChangeTokenStatus • waf-regional:ListActivatedRulesInRuleGroup • waf-regional:UpdateRuleGroup Document Steps • GetWAFChangeToken (aws:executeAwsApi) - Retrieves a AWS WAF change token to ensure the runbook doesn't submit conflicting requests to the service. • AddWAFRuleToWAFRegionalRuleGroup (aws:executeScript) - Adds the specified rule to the AWS WAF regional rule group. • VerifyChangeTokenPropagating (aws:waitForAwsResourceProperty) - Verifies the change token has a status of PENDING or INSYNC. • VerifyRuleAddedToRuleGroup (aws:executeScript) - Verifies the specified AWS WAF rule was added to the target regional rule group. Outputs • VerifyRuleAddedToRuleGroup.VerifyRuleAddedToRuleGroupResponse - Output of the step verifying that the new rule was aded to the regional rule group. • VerifyRuleAddedToRuleGroup.ListActivatedRulesInRuleGroupResponse - Output of the ListActivatedRulesInRuleGroup API operation. AWS-AddWAFRegionalRuleToRuleGroup 887 AWS Systems Manager Automation runbook reference User Guide AWS-AddWAFRegionalRuleToWebAcl Description The AWS-AddWAFRegionalRuleToWebAcl runbook adds an existing AWS WAF regional rule, rule group or rate-based rule to a AWS WAF Classic regional web access control list (ACL). This runbook doesn't update existing AWS WAF Classic regional web ACL’s that are managed by AWS Firewall Manager. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • WebACLId Type: String Description: (Required) The ID of the web ACL that you want to update. • ActivatedRulePriority Type: Integer AWS-AddWAFRegionalRuleToWebAcl 888 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The priority for the new rule. Rule priority determines the order in which rules in a web ACL are evaluated. Rules with a lower value have higher priority than rules with a higher value. The value must be a unique integer. If you add multiple rules to a regional web ACL, the values don't have to be consecutive. • ActivatedRuleRuleId Type: String Description: (Required) The ID for the regular rule, rate-based rule, or group you want to add to the web ACL. • ActivatedRuleAction Type: String Valid values: ALLOW | BLOCK | COUNT Description: (Optional) Specifies the action that AWS WAF takes when a web request matches the conditions of the rule. • ActivatedRuleType Type: String Valid values: REGULAR | RATE_BASED | GROUP Default: REGULAR Description: (Optional) The rule type you're adding to the web ACL. Although this field is optional, note that if you try to add a RATE_BASED rule to a web ACL without setting the type, the request fails because the request defaults to a REGULAR rule. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • waf-regional:GetChangeToken AWS-AddWAFRegionalRuleToWebAcl 889 AWS Systems Manager Automation runbook reference User Guide • waf-regional:GetWebACL • waf-regional:UpdateWebACL Document Steps • DetermineWebACLNotInFMSAndRulePriority (aws:executeScript) - Verifies if the AWS WAF web ACL is in a Firewall Manager security policy and verifies the priority ID doesn't conflict with an existing ACL. • AddRuleOrRuleGroupToWebACL (aws:executeScript) - Adds the specified rule to the AWS WAF web ACL. • VerifyRuleOrRuleGroupAddedToWebAcl (aws:executeScript) - Verifies the specified AWS WAF rule was added to the target web ACL. Outputs • DetermineWebACLNotInFMSAndRulePriority.PrereqResponse: Output from the DetermineWebACLNotInFMSAndRulePriority step. • VerifyRuleOrRuleGroupAddedToWebAcl.VerifyRuleOrRuleGroupAddedToWebACLResponse: Output
systems-manager-automation-runbook-guide-207
systems-manager-automation-runbook-guide.pdf
207
following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • waf-regional:GetChangeToken AWS-AddWAFRegionalRuleToWebAcl 889 AWS Systems Manager Automation runbook reference User Guide • waf-regional:GetWebACL • waf-regional:UpdateWebACL Document Steps • DetermineWebACLNotInFMSAndRulePriority (aws:executeScript) - Verifies if the AWS WAF web ACL is in a Firewall Manager security policy and verifies the priority ID doesn't conflict with an existing ACL. • AddRuleOrRuleGroupToWebACL (aws:executeScript) - Adds the specified rule to the AWS WAF web ACL. • VerifyRuleOrRuleGroupAddedToWebAcl (aws:executeScript) - Verifies the specified AWS WAF rule was added to the target web ACL. Outputs • DetermineWebACLNotInFMSAndRulePriority.PrereqResponse: Output from the DetermineWebACLNotInFMSAndRulePriority step. • VerifyRuleOrRuleGroupAddedToWebAcl.VerifyRuleOrRuleGroupAddedToWebACLResponse: Output from the AddRuleOrRuleGroupToWebACL step. • VerifyRuleOrRuleGroupAddedToWebAcl.ListActivatedRulesOrRuleGroupsInWebACLResponse: Output of the VerifyRuleOrRuleGroupAddedToWebAcl step. AWSConfigRemediation-EnableWAFClassicLogging Description The AWSConfigRemediation-EnableWAFClassicLogging runbook enables logging to Amazon Data Firehose (Firehose) for the AWS WAF web access control list (web ACL) you specify. Run this Automation (console) Document type Automation Owner AWSConfigRemediation-EnableWAFClassicLogging 890 AWS Systems Manager Automation runbook reference User Guide Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • DeliveryStreamName Type: String Description: (Required) The name of the Firehose delivery stream that you want to send logs to. • WebACLId Type: String Description: (Required) The ID of the AWS WAF web ACL that you want to enable logging on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:CreateServiceLinkedRole • waf:GetLoggingConfiguration • waf:GetWebAcl • waf:PutLoggingConfiguration Document Steps AWSConfigRemediation-EnableWAFClassicLogging 891 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Confirms the delivery stream you specify in the DeliveryStreamName exists. • aws:executeAwsApi - Gathers the ARN of the AWS WAF web ACL specified in the WebACLId parameter. • aws:executeAwsApi - Enables logging for the web ACL. • aws:assertAwsResourceProperty - Verifies logging has been enabled on the AWS WAF web ACL. AWSConfigRemediation-EnableWAFClassicRegionalLogging Description The AWSConfigRemediation-EnableWAFClassicRegionalLogging runbook enables logging to Amazon Data Firehose (Firehose) for the AWS WAF web access control list (ACL) you specify. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LogDestinationConfigs Type: String AWSConfigRemediation-EnableWAFClassicRegionalLogging 892 AWS Systems Manager Automation runbook reference User Guide Description: (Required) The Amazon Resource Name (ARN) of the Firehose delivery stream that you want to send logs to. • WebACLId Type: String Description: (Required) The ID of the AWS WAF web ACL that you want to enable logging on. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • iam:CreateServiceLinkedRole • waf-regional:GetLoggingConfiguration • waf-regional:GetWebAcl • waf-regional:PutLoggingConfiguration Document Steps • aws:executeAwsApi - Gathers the ARN of the AWS WAF web ACL specified in the WebACLId parameter. • aws:executeAwsApi - Enables logging for the web ACL. • aws:assertAwsResourceProperty - Verifies logging has been enabled on the AWS WAF web ACL. AWSConfigRemediation-EnableWAFV2Logging Description The AWSConfigRemediation-EnableWAFV2Logging runbook enables logging for an AWS WAF (AWS WAFV2) web access control list (web ACL) with the specified Amazon Data Firehose (Firehose) delivery stream. AWSConfigRemediation-EnableWAFV2Logging 893 AWS Systems Manager Automation runbook reference User Guide Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. • LogDestinationConfigs Type: String Description: (Required) The Firehose delivery stream ARN that you want to associate with the web ACL. Note The Firehose delivery stream ARN must begin with the prefix aws-waf-logs- . For example, aws-waf-logs-us-east-2-analytics . For more information, see Amazon Data Firehose . • WebAclArn Type: String Description: (Required) ARN of the web ACL for which logging will be enabled. AWSConfigRemediation-EnableWAFV2Logging 894 AWS Systems Manager Automation runbook reference User Guide Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • firehose:DescribeDeliveryStream • wafv2:PutLoggingConfiguration • wafv2:GetLoggingConfiguration Document Steps • aws:executeScript - Enables logging for the AWS WAFV2 web ACL and verifies that the logging has the specified configuration. Amazon WorkSpaces AWS Systems Manager Automation provides predefined runbooks for Amazon WorkSpaces. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-CreateWorkSpace • AWSSupport-RecoverWorkSpace AWS-CreateWorkSpace Description The AWS-CreateWorkSpace runbook creates a new Amazon WorkSpaces virtual desktop, known as a WorkSpace, based on the values that you specify for the input parameters. For information about WorkSpaces, see What is Amazon WorkSpaces? in the Amazon WorkSpaces Administration Guide. Run
systems-manager-automation-runbook-guide-208
systems-manager-automation-runbook-guide.pdf
208
aws:executeScript - Enables logging for the AWS WAFV2 web ACL and verifies that the logging has the specified configuration. Amazon WorkSpaces AWS Systems Manager Automation provides predefined runbooks for Amazon WorkSpaces. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWS-CreateWorkSpace • AWSSupport-RecoverWorkSpace AWS-CreateWorkSpace Description The AWS-CreateWorkSpace runbook creates a new Amazon WorkSpaces virtual desktop, known as a WorkSpace, based on the values that you specify for the input parameters. For information about WorkSpaces, see What is Amazon WorkSpaces? in the Amazon WorkSpaces Administration Guide. Run this Automation (console) Amazon WorkSpaces 895 AWS Systems Manager Automation runbook reference User Guide Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • BundleId Type: String Description: (Required) The ID of the bundle to use for the WorkSpace. • ComputeTypeName Type: String Valid values: VALUE | STANDARD | PERFORMANCE | POWER | GRAPHICS | POWERPRO | GRAPHICSPRO Description: (Optional) The compute type for your WorkSpace. • DirectoryId Type: String Description: (Required) The ID of the directory to add your WorkSpace to. • RootVolumeEncryptionEnabled AWS-CreateWorkSpace 896 AWS Systems Manager Automation runbook reference User Guide Type: Boolean Valid values: true | false Default: false Description: (Optional) Determines whether the root volume of the WorkSpace is encrypted. • RootVolumeSizeGib Type: Integer Description: (Required) The size of the root volume for the WorkSpace. • RunningMode Type: String Valid values: ALWAYS_ON | AUTO_STOP Description: (Required) The running mode of the WorkSpace. • RunningModeAutoStopTimeoutInMinutes Type: Integer Description: (Optional) The time after a user logs off when the WorkSpaces stops. Specify a value in 60-minute intervals. • Tags Type: String Description: (Optional) Tags that you want to apply to the WorkSpace. • UserName Type: String Description: (Required) The user name to associate with the WorkSpace. • UserVolumeEncryptionEnabled Type: Boolean Valid values: true | false AWS-CreateWorkSpace 897 AWS Systems Manager Automation runbook reference User Guide Default: false Description: (Optional) Determines whether the user volume of the WorkSpace is encrypted. • UserVolumeSizeGib Type: Integer Description: (Required) The size of the user volume for the WorkSpace. • VolumeEncryptionKey Type: String Description: (Optional) The symmetric AWS Key Management Service key that you want to use to encrypt data stored on your WorkSpace. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • workspaces:CreateWorkspaces • workspaces:DescribeWorkspaces Document Steps • aws:executeScript - Creates a WorkSpace based on the values that you specify for the input parameters. • aws:waitForAwsResourceProperty - Verifies the state of the WorkSpace is AVAILABLE. Outputs CreateWorkspace.WorkspaceId AWSSupport-RecoverWorkSpace Description AWSSupport-RecoverWorkSpace 898 AWS Systems Manager Automation runbook reference User Guide The AWSSupport-RecoverWorkSpace runbook performs recovery steps on the Amazon WorkSpaces virtual desktop, known as a WorkSpace, you specify. The runbook reboots the WorkSpace, and if the state is still UNHEALTHY , restores or rebuilds the WorkSpace based on the values you specify for the input parameters. Before using this runbook we recommend reviewing Troubleshooting WorkSpaces Issues in the Amazon WorkSpaces Administration Guide . Important Restoring or rebuilding a WorkSpace is a potentially destructive action that can result in the loss of data. This is because the WorkSpace is restored from the last available snapshot and data recovered from snapshots can be as old as 12 hours. The restore option recreates both the root volume and user volume based on the most recent snapshots. The rebuild option recreates the user volume from the most recent snapshot and recreates the WorkSpace from the image associated with the bundle the WorkSpace was created from. Applications that were installed or system settings that were changed after the WorkSpace was created are lost. For more information about restoring and rebuilding WorkSpaces, see Restore a WorkSpace and Rebuild a WorkSpace in the Amazon WorkSpaces Administration Guide . Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String AWSSupport-RecoverWorkSpace 899 AWS Systems Manager Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Acknowledge Type: String Valid values: Yes Description: (Required) Entering yes means that you understand the restore and rebuild actions will try to recover the WorkSpace from the most recent snapshot, and that data restored from these snapshots can be as old as 12 hours. • Reboot Type: String
systems-manager-automation-runbook-guide-209
systems-manager-automation-runbook-guide.pdf
209
Automation runbook reference User Guide Description: (Optional) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook. • Acknowledge Type: String Valid values: Yes Description: (Required) Entering yes means that you understand the restore and rebuild actions will try to recover the WorkSpace from the most recent snapshot, and that data restored from these snapshots can be as old as 12 hours. • Reboot Type: String Valid values: Yes | No Default: Yes Description: (Required) Determines whether the WorkSpace is rebooted. • Rebuild Type: String Valid values: Yes | No Default: No Description: (Required) Determines whether the WorkSpace is rebuilt. • Restore Type: String Valid values: Yes | No Default: No Description: (Required) Determines whether the WorkSpace is restored. AWSSupport-RecoverWorkSpace 900 AWS Systems Manager Automation runbook reference User Guide • WorkspaceId Type: String Description: (Required) The ID of the WorkSpace you want to recover. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • workspaces:DescribeWorkspaces • workspaces:DescribeWorkspaceSnapshots • workspaces:RebootWorkspaces • workspaces:RebuildWorkspaces • workspaces:RestoreWorkspace • workspaces:StartWorkspaces Document Steps • aws:executeAwsApi - Gathers the state of the WorkSpace you specify in the WorkspaceId parameter. • aws:assertAwsResourceProperty - Verifies the state of the WorkSpace is AVAILABLE , ERROR , IMPAIRED , STOPPED , or UNHEALTHY . • aws:branch - Branches based on the state of the WorkSpace. • aws:executeAwsApi - Starts the WorkSpace. • aws:branch - Branches based on the value you specify for the Action parameter. • aws:waitForAwsResourceProperty - Waits for the WorkSpace status after being started. • aws:waitForAwsResourceProperty - Waits for the WorkSpace state to change to AVAILABLE , ERROR , IMPAIRED , or UNHEALTHY after being started. • aws:executeAwsApi - Gathers the state of the WorkSpace after being started. • aws:branch - Branches based on the state of the WorkSpace after being started. AWSSupport-RecoverWorkSpace 901 AWS Systems Manager Automation runbook reference User Guide • aws:executeAwsApi - Gathers the available snapshots for restoring or rebuilding the WorkSpace. • aws:branch - Branches based on the value you specify for the Reboot parameter. • aws:executeAwsApi - Reboots the WorkSpace. • aws:executeAwsApi - Gathers the state of the WorkSpace after being started. • aws:waitForAwsResourceProperty - Waits for the state of the WorkSpace to change to REBOOTING . • aws:waitForAwsResourceProperty - Waits for the WorkSpace state to change to AVAILABLE , ERROR , or UNHEALTHY after being rebooted. • aws:executeAwsApi - Gathers the state of the WorkSpace after being rebooted. • aws:branch - Branches based on the state of the WorkSpace after rebooting. • aws:branch - Branches based on the value you specify for the Restore parameter. • aws:executeAwsApi - Restores the WorkSpace. If the restore fails, the runbook tries to rebuild the WorkSpace. • aws:waitForAwsResourceProperty - Waits for the state of the WorkSpace to change to RESTORING . • aws:waitForAwsResourceProperty - Waits for the WorkSpace state to change to AVAILABLE , ERROR , or UNHEALTHY after being restored. • aws:executeAwsApi - Gathers the state of the WorkSpace after being restored. • aws:branch - Branches based on the state of the WorkSpace after restoring. • aws:branch - Branches based on the value you specify for the Rebuild parameter. • aws:executeAwsApi - Rebuilds the WorkSpace. • aws:waitForAwsResourceProperty - Waits for the state of the WorkSpace to change to REBUILDING . • aws:waitForAwsResourceProperty - Waits for the WorkSpace state to change to AVAILABLE , ERROR , or UNHEALTHY after being rebuilt. • aws:executeAwsApi - Gathers the state of the WorkSpace after being rebuilt. • aws:assertAwsResourceProperty - Confirms the state of the WorkSpace is AVAILABLE . AWSSupport-RecoverWorkSpace 902 AWS Systems Manager Automation runbook reference User Guide X-Ray AWS Systems Manager Automation provides predefined runbooks for AWS X-Ray. For more information about runbooks, see Working with runbooks. For information about how to view runbook content, see View runbook content. Topics • AWSConfigRemediation-UpdateXRayKMSKey AWSConfigRemediation-UpdateXRayKMSKey Description The AWSConfigRemediation-UpdateXRayKMSKey runbook enables encryption on your AWS X-Ray data using an AWS Key Management Service (AWS KMS) key. This runbook should only be used as a baseline to ensure that your AWS X-Ray data is encrypted according to minimum recommended security best practices. We recommend encrypting multiple sets of data with different KMS keys. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. X-Ray 903 AWS Systems Manager Automation runbook reference User Guide • KeyId Type: String Description: (Required) The Amazon Resource Name (ARN), key ID, or the key alias of the KMS
systems-manager-automation-runbook-guide-210
systems-manager-automation-runbook-guide.pdf
210
your AWS X-Ray data is encrypted according to minimum recommended security best practices. We recommend encrypting multiple sets of data with different KMS keys. Run this Automation (console) Document type Automation Owner Amazon Platforms Linux, macOS, Windows Parameters • AutomationAssumeRole Type: String Description: (Required) The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. X-Ray 903 AWS Systems Manager Automation runbook reference User Guide • KeyId Type: String Description: (Required) The Amazon Resource Name (ARN), key ID, or the key alias of the KMS key you want AWS X-Ray to use to encrypt data. Required IAM permissions The AutomationAssumeRole parameter requires the following actions to use the runbook successfully. • ssm:StartAutomationExecution • ssm:GetAutomationExecution • kms:DescribeKey • xray:GetEncryptionConfig • xray:PutEncryptionConfig Document Steps • aws:executeAwsApi - Enables encryption on your X-Ray data using the KMS key you specify in the KeyId parameter. • aws:waitForAwsResourceProperty - Waits for the encryption configuration status of your X-Ray to be ACTIVE . • aws:executeAwsApi - Gathers the ARN of the key you specify in the KeyId parameter. • aws:assertAwsResourceProperty - Verifies encryption has been enabled on your X-Ray. AWSConfigRemediation-UpdateXRayKMSKey 904
systems-manager-ug-001
systems-manager-ug.pdf
1
User Guide AWS Systems Manager Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. AWS Systems Manager User Guide AWS Systems Manager: User Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. AWS Systems Manager Table of Contents User Guide What is AWS Systems Manager? ..................................................................................................... 1 How can Systems Manager benefit my operations? ............................................................................. 1 Who should use Systems Manager? ......................................................................................................... 2 What are the main features of Systems Manager? ............................................................................... 3 Supported AWS Regions ............................................................................................................................. 3 Accessing Systems Manager ....................................................................................................................... 4 Systems Manager service name history .................................................................................................. 5 Supported operating systems and machine types ................................................................................ 6 Supported operating systems for Systems Manager ....................................................................... 6 Supported machine types in hybrid and multicloud environments ........................................... 13 What is the unified console? ................................................................................................................... 13 Setting up managed nodes for AWS Systems Manager .............................................................. 16 Managing EC2 instances with Systems Manager ................................................................................. 16 Configure instance permissions required for Systems Manager ................................................. 17 Improve the security of EC2 instances by using VPC endpoints for Systems Manager ........... 28 Managing nodes in hybrid and multicloud environments with Systems Manager ........................ 32 Create the IAM service role required for Systems Manager in hybrid and multicloud environments ......................................................................................................................................... 35 Create a hybrid activation to register nodes with Systems Manager ......................................... 43 Install SSM Agent on hybrid Linux nodes ........................................................................................ 49 Install SSM Agent on hybrid Windows Server nodes .................................................................... 56 Managing edge devices with Systems Manager .................................................................................. 60 Create an IAM service role for your edge devices .......................................................................... 61 Configure your edge devices for AWS IoT Greengrass .................................................................. 67 Update the AWS IoT Greengrass token exchange role and install SSM Agent on your edge devices ..................................................................................................................................................... 68 Creating an AWS Organizations delegated administrator for Systems Manager .......................... 68 Using a delegated administrator with Change Manager .............................................................. 69 Using a delegated administrator with Explorer ............................................................................. 69 Using a delegated administrator with OpsCenter ......................................................................... 70 Using a delegated administrator with Quick Setup ...................................................................... 70 General setup .............................................................................................................................................. 70 Sign up for an AWS account .............................................................................................................. 70 Create a user with administrative access ......................................................................................... 71 iii AWS Systems Manager User Guide Setting up AWS Systems Manager ............................................................................................... 73 Setting up Systems Manager console access ....................................................................................... 73 Systems Manager onboarding policy ................................................................................................ 73 AWS Systems Manager console operator policy ............................................................................ 79 AWS Systems Manager console operator read-only policy .......................................................... 83 Setting up Systems Manager unified console for an organization .................................................. 85 Prerequisites ........................................................................................................................................... 86 Unified console resources ................................................................................................................... 86 Set up the unified console ................................................................................................................. 89 Setting up Systems Manager unified console for a single account and Region ............................ 91 Unified console resources ................................................................................................................... 91 Set up the unified console ................................................................................................................. 93 Disabling the Systems Manager unified console ................................................................................. 94 Performing node management tasks ........................................................................................... 96 Reviewing node insights ........................................................................................................................... 96 Adding or removing widgets .............................................................................................................. 99 Rearranging widgets .......................................................................................................................... 100 Exploring nodes ........................................................................................................................................ 100 Exploring nodes using console filters ............................................................................................ 101 Exploring nodes using text prompts in Amazon Q ..................................................................... 107 Viewing individual node details and taking action on a node .................................................. 113 Downloading or exporting a managed node report ................................................................... 115 Managing node report content and appearance ......................................................................... 119 Just-in-time node access using Systems Manager ............................................................................ 120 Setting up just-in-time access with Systems Manager ............................................................... 121 Start a just-in-time node access session ....................................................................................... 165 Managing just-in-time access requests .......................................................................................... 167 Moving to just-in-time node access from Session Manager ...................................................... 169 Disabling just-in-time access with Systems Manager ................................................................. 173 FAQ ........................................................................................................................................................ 174 Diagnosing and remediating ................................................................................................................. 175 Diagnosing and remediating failed deployments ........................................................................ 177 Diagnosing and remediating drifted configurations ................................................................... 177 Diagnosing and remediating unmanaged Amazon EC2 instances ............................................ 178 Remediation impact types of runbook actions ............................................................................ 186 Viewing execution history details for remediations .................................................................... 188 iv AWS Systems Manager User Guide Adjusting Systems Manager settings ................................................................................................... 189 Account setup settings ...................................................................................................................... 189 Organizational setup settings .......................................................................................................... 190 Diagnose and remediate settings ................................................................................................... 190 Working with Amazon S3 buckets and bucket policies for Systems Manager ....................... 192 Using AWS Systems Manager tools ............................................................................................ 201 Node tools ................................................................................................................................................. 201 Change Management tools .................................................................................................................... 203 Application tools ...................................................................................................................................... 205 Operations tools ...................................................................................................................................... 205 Perform a node task with Systems Manager ..................................................................................... 207 Prerequisites ........................................................................................................................................ 207 Launch an instance using an AMI with SSM Agent preinstalled ............................................... 207 Connect to your managed instance using Systems Manager .................................................... 208 Clean up your instance ...................................................................................................................... 209 Node tools ................................................................................................................................................. 209 Compliance ........................................................................................................................................... 210 Distributor ............................................................................................................................................ 228 Fleet
systems-manager-ug-002
systems-manager-ug.pdf
2
189 Organizational setup settings .......................................................................................................... 190 Diagnose and remediate settings ................................................................................................... 190 Working with Amazon S3 buckets and bucket policies for Systems Manager ....................... 192 Using AWS Systems Manager tools ............................................................................................ 201 Node tools ................................................................................................................................................. 201 Change Management tools .................................................................................................................... 203 Application tools ...................................................................................................................................... 205 Operations tools ...................................................................................................................................... 205 Perform a node task with Systems Manager ..................................................................................... 207 Prerequisites ........................................................................................................................................ 207 Launch an instance using an AMI with SSM Agent preinstalled ............................................... 207 Connect to your managed instance using Systems Manager .................................................... 208 Clean up your instance ...................................................................................................................... 209 Node tools ................................................................................................................................................. 209 Compliance ........................................................................................................................................... 210 Distributor ............................................................................................................................................ 228 Fleet Manager ..................................................................................................................................... 281 Hybrid Activations .............................................................................................................................. 365 Inventory .............................................................................................................................................. 366 Patch Manager .................................................................................................................................... 460 Run Command ..................................................................................................................................... 760 Session Manager ................................................................................................................................. 826 State Manager ..................................................................................................................................... 972 Change management tools ................................................................................................................. 1070 Automation ........................................................................................................................................ 1070 Change Calendar .............................................................................................................................. 1531 Change Manager .............................................................................................................................. 1550 Documents ......................................................................................................................................... 1633 Maintenance Windows .................................................................................................................... 1764 Quick Setup ....................................................................................................................................... 1894 Application tools ...................................................................................................................................... 205 AWS AppConfig ................................................................................................................................ 1942 Application Manager ........................................................................................................................ 1943 Parameter Store ............................................................................................................................... 1988 v AWS Systems Manager User Guide Operations tools .................................................................................................................................... 2142 Incident Manager ............................................................................................................................. 2142 Explorer .............................................................................................................................................. 2143 OpsCenter .......................................................................................................................................... 2179 CloudWatch Dashboards ................................................................................................................. 2265 Working with SSM Agent .......................................................................................................... 2266 Learn technical details about the SSM Agent ................................................................................. 2266 SSM Agent version 3.2.x.x credential behavior .......................................................................... 2267 SSM Agent credentials precedence .............................................................................................. 2267 Configuring SSM Agent for use with the Federal Information Processing Standard (FIPS) 2269 About the local ssm-user account ................................................................................................ 2271 SSM Agent and the Instance Metadata Service (IMDS) ............................................................ 2272 Keeping SSM Agent up-to-date .................................................................................................... 2272 Ensuring that the SSM Agent installation directory is not modified, moved, or deleted ... 2272 SSM Agent rolling updates by AWS Regions .............................................................................. 2273 SSM Agent communications with AWS managed S3 buckets ................................................. 2273 Find AMIs with the SSM Agent preinstalled ................................................................................... 2280 Verify the status of SSM Agent .................................................................................................... 2281 Working with SSM Agent on EC2 instances for Linux ................................................................... 2285 Verifying the signature of SSM Agent ......................................................................................... 2286 Manually installing and uninstalling SSM Agent on EC2 instances for Linux ....................... 2300 Configuring SSM Agent to use a proxy on Linux nodes ........................................................... 2358 Working with SSM Agent on EC2 instances for macOS ................................................................ 2363 Manually installing and uninstalling SSM Agent on EC2 instances for macOS .................... 2364 Working with SSM Agent on EC2 instances for Windows Server ................................................ 2366 Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server .... 2367 Configure SSM Agent to use a proxy for Windows Server instances ..................................... 2369 Checking SSM Agent status and starting the agent ...................................................................... 2373 Checking the SSM Agent version number ........................................................................................ 2376 Viewing SSM Agent logs ...................................................................................................................... 2380 Allowing SSM Agent debug logging ............................................................................................ 2381 Restricting access to root-level commands through SSM Agent ................................................. 2383 Automating updates to SSM Agent ................................................................................................... 2384 Automatically updating SSM Agent ............................................................................................. 2386 Subscribing to SSM Agent notifications ........................................................................................... 2387 Troubleshooting SSM Agent ................................................................................................................ 2388 vi AWS Systems Manager User Guide SSM Agent is out of date ............................................................................................................... 2389 Troubleshoot issues using SSM Agent log files ......................................................................... 2389 Agent log files don't rotate (Windows) ....................................................................................... 2390 Unable to connect to SSM endpoints .......................................................................................... 2390 Verify your VPC configuration ....................................................................................................... 2391 Verify your VPC DNS-related attributes ...................................................................................... 2392 Verify ingress rules on endpoint security groups ...................................................................... 2392 Use ssm-cli to troubleshoot managed node availability ...................................................... 2392 Security ...................................................................................................................................... 2394 Data protection ...................................................................................................................................... 2395 Data encryption ................................................................................................................................ 2396 Internetwork traffic privacy ........................................................................................................... 2398 Identity and access management ...................................................................................................... 2399 Audience ............................................................................................................................................. 2399 Authenticating with identities ....................................................................................................... 2400 Managing access using policies ..................................................................................................... 2403 How AWS Systems Manager works with IAM ............................................................................. 2407 Identity-based policy examples ..................................................................................................... 2417 AWS managed policies .................................................................................................................... 2428 Troubleshooting ................................................................................................................................ 2476 Using service-linked roles .................................................................................................................... 2478 Inventory and Explorer data role .................................................................................................. 2479 OpsCenter and Explorer account discovery role ........................................................................ 2482 OpsData and OpsItems creation role ........................................................................................... 2485 Operational insights creation role ................................................................................................ 2489 Quick Setup deployment health-check role ............................................................................... 2492 Export OpsData service role .......................................................................................................... 2495 Just-in-time node access service role .......................................................................................... 2497 Just-in-time node access request notifications service role .................................................... 2501 Logging and monitoring ...................................................................................................................... 2505 Compliance validation .......................................................................................................................... 2507 Resilience ................................................................................................................................................. 2508 Infrastructure security .......................................................................................................................... 2508 Configuration and vulnerability analysis .......................................................................................... 2509 Security best practices ......................................................................................................................... 2509 Systems Manager preventative security best practices ............................................................ 2509 vii AWS Systems Manager User Guide Systems Manager monitoring and auditing best practices ..................................................... 2513 Code examples ........................................................................................................................... 2516 Basics ........................................................................................................................................................ 2523 Hello Systems Manager .................................................................................................................. 2527 Learn the basics ................................................................................................................................ 2531 Actions ................................................................................................................................................ 2582 Logging and monitoring ........................................................................................................... 2855 Monitoring tools .................................................................................................................................... 2856 Sending node logs to unified CloudWatch Logs (CloudWatch agent) ........................................ 2856 Migrate Windows Server node log collection to the CloudWatch agent .............................. 2858 Store CloudWatch agent configuration settings in Parameter Store .................................... 2868 Rolling back to log collection with SSM Agent ......................................................................... 2869 Sending SSM Agent logs to CloudWatch
systems-manager-ug-003
systems-manager-ug.pdf
3
Manager preventative security best practices ............................................................ 2509 vii AWS Systems Manager User Guide Systems Manager monitoring and auditing best practices ..................................................... 2513 Code examples ........................................................................................................................... 2516 Basics ........................................................................................................................................................ 2523 Hello Systems Manager .................................................................................................................. 2527 Learn the basics ................................................................................................................................ 2531 Actions ................................................................................................................................................ 2582 Logging and monitoring ........................................................................................................... 2855 Monitoring tools .................................................................................................................................... 2856 Sending node logs to unified CloudWatch Logs (CloudWatch agent) ........................................ 2856 Migrate Windows Server node log collection to the CloudWatch agent .............................. 2858 Store CloudWatch agent configuration settings in Parameter Store .................................... 2868 Rolling back to log collection with SSM Agent ......................................................................... 2869 Sending SSM Agent logs to CloudWatch Logs ................................................................................ 2872 Monitoring your change request events ........................................................................................... 2875 Monitoring your automations ............................................................................................................. 2878 Automation metrics ......................................................................................................................... 2879 Monitoring Run Command metrics using Amazon CloudWatch .................................................. 2879 Systems Manager Run Command metrics and dimensions ..................................................... 2880 Logging AWS Systems Manager API calls with AWS CloudTrail .................................................. 2881 Systems Manager data events in CloudTrail .............................................................................. 2883 Systems Manager management events in CloudTrail ............................................................... 2884 Systems Manager event examples ............................................................................................... 2885 Logging Automation action output with CloudWatch Logs ......................................................... 2890 Configuring Amazon CloudWatch Logs for Run Command .......................................................... 2894 Specifying CloudWatch Logs when you send commands ........................................................ 2895 Viewing command output in CloudWatch Logs ........................................................................ 2896 Monitoring with Amazon EventBridge .............................................................................................. 2896 Configuring EventBridge for Systems Manager events ............................................................ 2898 Amazon EventBridge event examples for Systems Manager .................................................. 2901 Sample scenarios: Systems Manager targets in Amazon EventBridge rules ......................... 2916 Monitoring Systems Manager status changes using Amazon SNS notifications ....................... 2917 Configure Amazon SNS notifications for AWS Systems Manager .......................................... 2918 Example Amazon SNS notifications for AWS Systems Manager ............................................ 2929 Use Run Command to send a command that returns status notifications ........................... 2931 Use a maintenance window to send a command that returns status notifications ............. 2934 Product and service integrations ............................................................................................. 2940 viii AWS Systems Manager User Guide Integration with AWS services ............................................................................................................ 2940 Compute ............................................................................................................................................. 2940 Internet of Things (IoT) .................................................................................................................. 2943 Storage ............................................................................................................................................... 2944 Developer Tools ................................................................................................................................ 2945 Security, Identity, and Compliance ............................................................................................... 2946 Cryptography and PKI ..................................................................................................................... 2949 Management and Governance ....................................................................................................... 2949 Networking and Content Delivery ................................................................................................ 2954 Analytics ............................................................................................................................................. 2955 Application Integration ................................................................................................................... 2957 AWS Management Console ............................................................................................................ 2957 Running scripts from Amazon S3 ................................................................................................. 2958 Referencing AWS Secrets Manager secrets from Parameter Store parameters ................... 2962 AWS KMS encryption for Parameter Store SecureString parameters .................................... 2968 Use AWS Secrets Manager secrets in Amazon Elastic Kubernetes Service ........................... 2981 Using Parameter Store parameters in AWS Lambda functions .............................................. 3000 Integration with other products and services ................................................................................. 3023 Running scripts from GitHub ......................................................................................................... 3027 Using Chef InSpec profiles with Systems Manager Compliance ............................................. 3035 Integrating with ServiceNow ......................................................................................................... 3040 AWS Systems Manager reference ............................................................................................. 3042 Working with AWS SDKs ...................................................................................................................... 3043 Amazon S3 buckets for patching operations .................................................................................. 3044 Buckets containing SSM Command documents for patching operations (Linux and Windows Server) ............................................................................................................................... 3045 Buckets containing SSM Command documents for patching operations (macOS) ............. 3048 Buckets containing AWS managed patch baseline snapshots ................................................ 3051 EventBridge event patterns and types for Systems Manager ...................................................... 3053 Event type: Automation .................................................................................................................. 3054 Event type: Change Calendar ........................................................................................................ 3055 Event type: Change Manager ........................................................................................................ 3056 Event type: Configuration Compliance ........................................................................................ 3056 Event type: Inventory ...................................................................................................................... 3056 Event type: Maintenance Window ................................................................................................ 3057 Event type: OpsCenter .................................................................................................................... 3060 ix AWS Systems Manager User Guide Event type: Parameter Store ......................................................................................................... 3060 Event type: Run Command ............................................................................................................ 3061 Event type: State Manager ............................................................................................................ 3062 Cron and rate expressions ................................................................................................................... 3062 General information about cron and rate expressions ............................................................. 3063 Cron and rate expressions for associations ................................................................................ 3068 Cron and rate expressions for maintenance windows .............................................................. 3071 ec2messages, ssmmessages, and other API operations ................................................................ 3073 Agent-related API operations (ssmmessages and ec2messages endpoints) .................... 3074 ssm:* namespace instance-related API operations ................................................................. 3076 ssm:* namespace other API operations ....................................................................................... 3077 Date and time string formats for Systems Manager ...................................................................... 3078 Formatting date and time strings for Systems Manager ......................................................... 3078 Creating custom date and time strings for Systems Manager ................................................ 3079 Use cases and best practices .................................................................................................... 3082 Deleting Systems Manager resources and artifacts ....................................................................... 3085 Choosing between State Manager and Maintenance Windows ................................................... 3090 State Manager and Maintenance Windows: Key use cases ...................................................... 3090 Related information .................................................................................................................. 3097 Document history ...................................................................................................................... 3099 Updates prior to June 2018 ................................................................................................................ 3285 Document conventions .............................................................................................................. 3304 x AWS Systems Manager User Guide What is AWS Systems Manager? AWS Systems Manager helps you centrally view, manage, and operate nodes at scale in AWS, on- premises, and multicloud environments. With the launch of a unified console experience, Systems Manager consolidates various tools to help you complete common node tasks across AWS accounts and AWS Regions. To use Systems Manager, nodes must be managed, which means SSM Agent is installed on the machine and the agent can communicate with the Systems
systems-manager-ug-004
systems-manager-ug.pdf
4
information .................................................................................................................. 3097 Document history ...................................................................................................................... 3099 Updates prior to June 2018 ................................................................................................................ 3285 Document conventions .............................................................................................................. 3304 x AWS Systems Manager User Guide What is AWS Systems Manager? AWS Systems Manager helps you centrally view, manage, and operate nodes at scale in AWS, on- premises, and multicloud environments. With the launch of a unified console experience, Systems Manager consolidates various tools to help you complete common node tasks across AWS accounts and AWS Regions. To use Systems Manager, nodes must be managed, which means SSM Agent is installed on the machine and the agent can communicate with the Systems Manager service. To help you identify why nodes aren't reporting as managed, Systems Manager offers a one-click agent issue diagnosis and remediation runbook that you can configure to run automatically according to a schedule you define. This feature helps identify why nodes can't connect to Systems Manager, including networking misconfigurations. This feature also provides recommended runbooks for remediating networking issues and other problems preventing nodes from being configured as managed nodes. The unified console experience also includes a dashboard that provides a high-level overview of your nodes. You can drill down for more specific node insights such as which nodes are running outdated operating system (OS) software. You can also use filters for granular views based on instance metadata like OSs and OS versions, AWS Regions, AWS accounts, and SSM Agent versions. These filters help you retrieve relevant information at a specific account level or application level across your entire organization. Topics • How can Systems Manager benefit my operations? • Who should use Systems Manager? • What are the main features of Systems Manager? • Supported AWS Regions • Accessing Systems Manager • Systems Manager service name history • Supported operating systems and machine types • What is the unified console? How can Systems Manager benefit my operations? Benefits of Systems Manager include the following: How can Systems Manager benefit my operations? 1 AWS Systems Manager User Guide • Enhance visibility across your entire infrastructure Systems Manager provides a centralized view of nodes across your organization's accounts and Regions. Quickly access instance information such as ID, name, OS details, and installed agents. Use Amazon Q Developer to query instance metadata using natural language, helping you identify issues and take action faster. • Boost operational efficiency with automation Automate common operational tasks and reduce time and effort required to maintain your systems. Systems Manager provides safe and secure remote management of your nodes at scale without logging into your servers. You no longer need to use bastion hosts, SSH, or remote PowerShell. Systems Manager also provides a simple way of automating common administrative tasks across groups of nodes such as registry edits, user management, and software and patch installations. • Simplify node management at scale in any environment Systems Manager helps you manage nodes across AWS, on-premises, and multicloud environments. Schedule automated diagnoses to identify SSM Agent issues and remediate them with one-click runbooks. After your nodes are configured as managed nodes, you can execute critical operational tasks such as applying security patches, initiating logged sessions, and running commands remotely. Who should use Systems Manager? Systems Manager is used by IT operations managers and operators, DevOps engineers, security and compliance managers, and IT directors and CIOs. Broadly speaking, Systems Manager is appropriate for the following: • Organizations that want to improve the management and security of their nodes at scale. • Organizations that want to increase visibility and operational agility when managing their infrastructure. • Organizations that want to increase operational efficiency at scale. Who should use Systems Manager? 2 AWS Systems Manager User Guide What are the main features of Systems Manager? The primary features of Systems Manager are shared between the unified console and the individual tools Systems Manager provides to help you manage nodes at scale. Unified console The unified console provides a centralized experience to view and manage your nodes. This console leverages several Systems Manager tools and more to provide you with the following: • Centralized views of your nodes • Detailed node insights • Automated diagnosis and remediation of common node issues For more information about the unified console, see What is the unified console?. Tools Tools consist of the individual capabilities of Systems Manager and their features such as Run Command, Session Manager, Automation, and Parameter Store. With Systems Manager tools you can do the following: • Patch nodes at scale • Securely connect to nodes without opening inbound ports • Run commands remotely on nodes • Securely store data referenced by applications • Automate common systems administration tasks For more information about Systems Manager tools, see Using AWS Systems Manager tools. Supported AWS Regions For a list of AWS Regions that support Systems Manager tools, see Systems Manager service endpoints in the
systems-manager-ug-005
systems-manager-ug.pdf
5
console?. Tools Tools consist of the individual capabilities of Systems Manager and their features such as Run Command, Session Manager, Automation, and Parameter Store. With Systems Manager tools you can do the following: • Patch nodes at scale • Securely connect to nodes without opening inbound ports • Run commands remotely on nodes • Securely store data referenced by applications • Automate common systems administration tasks For more information about Systems Manager tools, see Using AWS Systems Manager tools. Supported AWS Regions For a list of AWS Regions that support Systems Manager tools, see Systems Manager service endpoints in the Amazon Web Services General Reference. The unified Systems Manager console, released on November 21, 2024, is available in the following AWS Regions: What are the main features of Systems Manager? 3 User Guide AWS Systems Manager • US East (N. Virginia) Region • US East (Ohio) Region • US West (N. California) Region • US West (Oregon) Region • Canada (Central) Region • South America (São Paulo) Region • Asia Pacific (Mumbai) Region • Asia Pacific (Tokyo) Region • Asia Pacific (Seoul) Region • Asia Pacific (Singapore) Region • Asia Pacific (Sydney) Region • Europe (Frankfurt) Region • Europe (Stockholm) Region • Europe (Ireland) Region • Europe (London) Region • Europe (Paris) Region Accessing Systems Manager You can work with Systems Manager in any of the following ways: Systems Manager console The Systems Manager console is a browser-based interface to access and use Systems Manager. AWS IoT Greengrass V2 console You can view and manage edge devices that are configured for AWS IoT Greengrass in the Greengrass console. AWS command line tools By using the AWS command line tools, you can issue commands at your system's command line to perform Systems Manager and other AWS tasks. The tools are supported on Linux, macOS, and Windows. Using the AWS Command Line Interface (AWS CLI) can be faster and Accessing Systems Manager 4 AWS Systems Manager User Guide more convenient than using the console. The command line tools also are useful if you want to build scripts that perform AWS tasks. AWS provides two sets of command line tools: the AWS Command Line Interface and the AWS Tools for Windows PowerShell. For information about installing and using the AWS CLI, see the AWS Command Line Interface User Guide. For information about installing and using the Tools for Windows PowerShell, see the AWS Tools for Windows PowerShell User Guide. Note On your Windows Server instances, Windows PowerShell 3.0 or later is required to run certain SSM documents (for example, the legacy AWS-ApplyPatchBaseline document). Verify that your Windows Server instances are running Windows Management Framework 3.0 or later. The framework includes Windows PowerShell. AWS SDKs AWS provides software development kits (SDKs) that consist of libraries and sample code for various programming languages and platforms (for example, Java, Python, Ruby, .NET, iOS and Android, and others). The SDKs provide a convenient way to grant programmatic access to Systems Manager. For information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services. Systems Manager service name history AWS Systems Manager (Systems Manager) was formerly known as "Amazon Simple Systems Manager (SSM)" and "Amazon EC2 Systems Manager (SSM)". The original abbreviated name of the service, "SSM", is still reflected in various AWS resources, including a few other service consoles. Some examples: • Systems Manager Agent: SSM Agent • Systems Manager parameters: SSM parameters • Systems Manager service endpoints: ssm.region.amazonaws.com • AWS CloudFormation resource types: AWS::SSM::Document • AWS Config rule identifier: EC2_INSTANCE_MANAGED_BY_SSM • AWS Command Line Interface (AWS CLI) commands: aws ssm describe-patch-baselines Systems Manager service name history 5 AWS Systems Manager User Guide • AWS Identity and Access Management (IAM) managed policy names: AmazonSSMReadOnlyAccess • Systems Manager resource ARNs: arn:aws:ssm:region:account-id:patchbaseline/ pb-07d8884178EXAMPLE Supported operating systems and machine types Before working with Systems Manager, verify that your operating system (OS), OS version, and machine type are supported as managed nodes. Topics • Supported operating systems for Systems Manager • Supported machine types in hybrid and multicloud environments Supported operating systems for Systems Manager The following sections list the OSs and OS versions supported by Systems Manager. Note If you plan to manage and configure AWS IoT Greengrass core devices by using Systems Manager, those devices must meet the requirements for AWS IoT Greengrass. For more information, see Setting up AWS IoT Greengrass core devices in the AWS IoT Greengrass Version 2 Developer Guide. If you plan to manage and configure AWS IoT and non-AWS edge devices, those devices must meet the requirements listed here and be configured as on-premises managed nodes for Systems Manager. For more information, see Managing edge devices with Systems Manager. Important Patch Manager, a tool in Systems Manager, might not support all the OS versions listed in this
systems-manager-ug-006
systems-manager-ug.pdf
6
and configure AWS IoT Greengrass core devices by using Systems Manager, those devices must meet the requirements for AWS IoT Greengrass. For more information, see Setting up AWS IoT Greengrass core devices in the AWS IoT Greengrass Version 2 Developer Guide. If you plan to manage and configure AWS IoT and non-AWS edge devices, those devices must meet the requirements listed here and be configured as on-premises managed nodes for Systems Manager. For more information, see Managing edge devices with Systems Manager. Important Patch Manager, a tool in Systems Manager, might not support all the OS versions listed in this topic. For a list of OS versions supported by Patch Manager, see Patch Manager prerequisites. Supported operating systems and machine types 6 AWS Systems Manager Operating system types • Linux • macOS (Amazon EC2 instances only) • Raspberry Pi OS (formerly Raspbian) • Windows Server User Guide Select an OS platform to see the supported major and minor versions. Linux AlmaLinux Versions 8.3–8.10 9.x x86 x86_64 ARM64 ✓ ✓ ✓ ✓ Amazon Linux 1 Versions 2012.03–2018.03 x86 ✓ Note x86_64 ARM64 ✓ Beginning with version 2015.03, Amazon Linux 1 was released in x86_64 versions. Amazon Linux 1 reached the end of its standard support on December 31, 2020, and reached end of life on December 31, 2023, as announced in Update on Amazon Linux AMI end-of-life on the AWS News Blog. AWS no longer provides Amazon Machine Images (AMIs) for this operating system. AWS Systems Manager continues to provide support, however, for existing Amazon Linux 1 instances. Supported operating systems for Systems Manager 7 AWS Systems Manager Amazon Linux 2 Versions x86 2.0 and all later versions Amazon Linux 2023 Versions x86 2023.0.20230315.0 and all later versions Bottlerocket User Guide x86_64 ✓ x86_64 ✓ ARM64 ✓ ARM64 ✓ Versions x86_64 1.0.0 and all later versions ✓ ARM64 ✓ CentOS Versions 6.x¹ 7.1 and later 7.x versions 8.x x86 ✓ x86_64 ARM64 ✓ ✓ ✓ ✓ ✓ ¹ To use these versions, you must use a 3.0.x version of the SSM Agent. We recommend using the latest available 3.0.x version of the SSM Agent. Later SSM Agent versions (3.1 or later) are not supported. Supported operating systems for Systems Manager 8 AWS Systems Manager CentOS Stream User Guide Versions x86 x86_64 ARM64 8 9 Debian Server Versions Jessie (8) Stretch (9) Buster (10) Bullseye (11) Bookworm (12) Oracle Linux Versions 7.5–7.8 8.x 9.x ✓ ✓ ✓ ✓ x86 x86_64 ARM64 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ x86 x86_64 ARM64 ✓ ✓ ✓ Red Hat Enterprise Linux (RHEL) Versions 6.x¹ 7.0–7.5 x86 ✓ x86_64 ARM64 ✓ ✓ Supported operating systems for Systems Manager 9 AWS Systems Manager User Guide Versions 7.6–8.x 9.x x86 x86_64 ARM64 ✓ ✓ ✓ ✓ ¹ To use these versions, you must use a 3.0.x version of the SSM Agent. We recommend using the latest available 3.0.x version of the SSM Agent. Later SSM Agent versions (3.1 or later) are not supported. Rocky Linux Versions x86 x86_64 ARM64 8.x 9.x ✓ ✓ ✓ ✓ SUSE Linux Enterprise Server (SLES) Versions x86 x86_64 ARM64 12 and later 12.x versions 15.x Ubuntu Server Versions 12.04 LTS and 14.04 LTS 16.04 LTS and 18.04 LTS x86 ✓ ✓ ✓ ✓ x86_64 ARM64 ✓ ✓ ✓ Supported operating systems for Systems Manager 10 AWS Systems Manager User Guide Versions x86 x86_64 ARM64 20.04 LTS and 20.10 STR 22.04 LTS 23.04, 23.10 24.04 LTS 24.10 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ macOS (Amazon EC2 instances only) Version x86 x86_64 Mac with Apple silicon 10.14.x (Mojave) 10.15.x (Catalina) 11.x (Big Sur) 12.x (Monterey) 13.x (Ventura) 14.x (Sonoma) 15.x (Sequoia) Note ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ macOS is not supported in all AWS Regions. For more information about Amazon EC2 support for macOS, see Amazon EC2 Mac instances in the Amazon EC2 User Guide. Supported operating systems for Systems Manager 11 AWS Systems Manager User Guide Raspberry Pi OS (formerly Raspbian) Version 8 (Jessie) 9 (Stretch) More info ARM32 ✓ ✓ • Manage Raspberry Pi devices using AWS Systems Manager Windows Server SSM Agent requires Windows PowerShell 3.0 or later to run certain AWS Systems Manager documents (SSM documents) on Windows Server instances (for example, the legacy AWS- ApplyPatchBaseline document). Verify that your Windows Server instances are running Windows Management Framework 3.0 or later. This framework includes Windows PowerShell. For more information, see Windows Management Framework 3.0. x86 ✓ Version 2008¹ 2008 R2¹ 2012 and 2012 R2² 2016 2019 2022 2025 x86_64 ARM64 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ¹ Windows Server 2008 and 2008 R2 support: As of January 14, 2020, Windows Server 2008 is no longer supported for feature or security updates from Microsoft. Legacy Amazon Machine Images
systems-manager-ug-007
systems-manager-ug.pdf
7
run certain AWS Systems Manager documents (SSM documents) on Windows Server instances (for example, the legacy AWS- ApplyPatchBaseline document). Verify that your Windows Server instances are running Windows Management Framework 3.0 or later. This framework includes Windows PowerShell. For more information, see Windows Management Framework 3.0. x86 ✓ Version 2008¹ 2008 R2¹ 2012 and 2012 R2² 2016 2019 2022 2025 x86_64 ARM64 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ¹ Windows Server 2008 and 2008 R2 support: As of January 14, 2020, Windows Server 2008 is no longer supported for feature or security updates from Microsoft. Legacy Amazon Machine Images Supported operating systems for Systems Manager 12 AWS Systems Manager User Guide (AMIs) for Windows Server 2008 and 2008 R2 still include version 2 of SSM Agent preinstalled, but Systems Manager no longer officially supports 2008 versions and no longer updates the agent for these versions of Windows Server. In addition, SSM Agent version 3 might not be compatible with all operations on Windows Server 2008 and 2008 R2. The final officially supported version of SSM Agent for Windows Server 2008 versions is 2.3.1644.0. ² Windows Server 2012 and 2012 R2 support: Windows Server 2012 and 2012 R2 reached end of support on October 10, 2023. To use SSM Agent with these versions, we recommend using Extended Security Updates (ESUs) from Microsoft. For more information, see Windows Server 2012 and 2012 R2 reaching end of support on the Microsoft website. Supported machine types in hybrid and multicloud environments Systems Manager supports a number of machine types as managed nodes. A managed node is any machine configured to work with Systems Manager. This user guide uses the term hybrid and multicloud to refer to an environment that contains any combination of the following machine types: • Amazon Elastic Compute Cloud (Amazon EC2) instances • Servers on your own premises (on-premises servers) • AWS IoT Greengrass core devices • AWS IoT and non-AWS edge devices • Virtual machines (VMs), including VMs in other cloud environments For information about AWS support for hybrid and multicloud environments, see AWS Solutions for Hybrid and Multicloud. What is the unified console? The unified Systems Manager console is a consolidated experience that combines various tools to help you complete common node tasks across multiple AWS accounts and AWS Regions in an AWS Organizations organization, or a single account and Region. Nodes can be EC2 instances, hybrid servers, or servers running in a multicloud environment. In the unified console, you're provided with detailed insights to your nodes. You can generate reports for your nodes, diagnose and remediate common issues that prevent nodes from reporting as managed by Systems Manager, like Supported machine types in hybrid and multicloud environments 13 AWS Systems Manager User Guide connectivity issues. In addition to summaries about your nodes, you can view specific details about a node like software inventory and patching status. What is the unified console? 14 AWS Systems Manager User Guide Whether you have nodes in multiple accounts and Regions in an organization, or nodes in a single account and Region, we recommend using the unified console. Systems Manager continues to add the ability to complete more node tasks to the unified console. To learn about the node tasks you can perform now using the unified console, see Performing node management tasks with AWS Systems Manager. Proceed to the next topics to set up your nodes to be managed by Systems Manager. To learn more about setting up your nodes for Systems Manager, see Setting up managed nodes for AWS Systems Manager. After you've set up your nodes, you can set up Systems Manager and the unified console. To learn more about setting up Systems Manager, see Setting up AWS Systems Manager. What is the unified console? 15 AWS Systems Manager User Guide Setting up managed nodes for AWS Systems Manager Complete the tasks in this section to set up and configure roles, user accounts, permissions, and initial resources for using AWS Systems Manager tools. The tasks described in this section are typically performed by AWS account and systems administrators. After these steps are complete, users in your organization can use Systems Manager to configure, manage, and access your managed nodes. A managed node is any machine configured for use with Systems Manager in a hybrid and multicloud environment. Note If you plan to use Amazon EC2 instances and your own computing resources in a hybrid and multicloud environment, follow the steps in Managing EC2 instances with Systems Manager. That topic presents steps in the best order for completing Systems Manager setup for EC2 instances and non-EC2 machines. If you already use other AWS services, you have completed some of these steps. However, other steps are specific to Systems Manager. Therefore, we recommend reviewing this entire section to ensure that you're
systems-manager-ug-008
systems-manager-ug.pdf
8
A managed node is any machine configured for use with Systems Manager in a hybrid and multicloud environment. Note If you plan to use Amazon EC2 instances and your own computing resources in a hybrid and multicloud environment, follow the steps in Managing EC2 instances with Systems Manager. That topic presents steps in the best order for completing Systems Manager setup for EC2 instances and non-EC2 machines. If you already use other AWS services, you have completed some of these steps. However, other steps are specific to Systems Manager. Therefore, we recommend reviewing this entire section to ensure that you're ready to use all Systems Manager tools. Topics • Managing EC2 instances with Systems Manager • Managing nodes in hybrid and multicloud environments with Systems Manager • Managing edge devices with Systems Manager • Creating an AWS Organizations delegated administrator for Systems Manager • General setup for AWS Systems Manager Managing EC2 instances with Systems Manager Complete the tasks in this section to set up and configure roles, permissions, and initial resources for AWS Systems Manager. The tasks described in this section are typically performed by AWS account and systems administrators. After these steps are complete, users in your organization can use Systems Manager to configure, manage, and access Amazon Elastic Compute Cloud (Amazon EC2) instances. Managing EC2 instances with Systems Manager 16 AWS Systems Manager Note User Guide If you plan to use Systems Manager to manage and configure on-premises machines, follow the setup steps in Managing nodes in hybrid and multicloud environments with Systems Manager. If you plan to use both Amazon EC2 instances and non-EC2 machines in a hybrid and multicloud environment, follow the steps here first. This section presents steps in the recommended order for configuring the roles, users, permissions, and initial resources to use in your Systems Manager operations. If you already use other AWS services, you have completed some of these steps. However, other steps are specific to Systems Manager. Therefore, we recommend reviewing this entire section to ensure that you're ready to use all Systems Manager tools. Contents • Configure instance permissions required for Systems Manager • Improve the security of EC2 instances by using VPC endpoints for Systems Manager Configure instance permissions required for Systems Manager By default, AWS Systems Manager doesn't have permission to perform actions on your instances. You can provide instance permissions at the account level using an AWS Identity and Access Management (IAM) role, or at the instance level using an instance profile. If your use case allows, we recommend granting access at the account level using the Default Host Management Configuration. Note You can skip this step and allow Systems Manager to apply the required permissions to your instances for you when setting up the unified console. For more information, see Setting up AWS Systems Manager. Recommended configuration for EC2 instance permissions Default Host Management Configuration allows Systems Manager to manage your Amazon EC2 instances automatically. After you've turned on this setting, all instances using Instance Configure instance permissions required for Systems Manager 17 AWS Systems Manager User Guide Metadata Service Version 2 (IMDSv2) in the AWS Region and AWS account with SSM Agent version 3.2.582.0 or later installed automatically become managed instances. Default Host Management Configuration doesn't support Instance Metadata Service Version 1. For information about transitioning to IMDSv2, see Transition to using Instance Metadata Service Version 2 in the Amazon EC2 User Guide. For information about checking the version of the SSM Agent installed on your instance, see Checking the SSM Agent version number. For information about updating the SSM Agent, see Automatically updating SSM Agent. Benefits of managed instances include the following: • Connect to your instances securely using Session Manager. • Perform automated patch scans using Patch Manager. • View detailed information about your instances using Systems Manager Inventory. • Track and manage instances using Fleet Manager. • Keep the SSM Agent up to date automatically. Fleet Manager, Inventory, Patch Manager, and Session Manager are tools in AWS Systems Manager. Default Host Management Configuration allows instance management without the use of instance profiles and ensures that Systems Manager has permissions to manage all instances in the Region and account. If the permissions provided aren't sufficient for your use case, you can also add policies to the default IAM role created by the Default Host Management Configuration. Alternatively, if you don't need permissions for all of the capabilities provided by the default IAM role, you can create your own custom role and policies. Any changes made to the IAM role you choose for Default Host Management Configuration applies to all managed Amazon EC2 instances in the Region and account. For more information about the policy used by Default Host Management Configuration, see AWS managed policy: AmazonSSMManagedEC2InstanceDefaultPolicy.For more information about the Default Host Management Configuration,
systems-manager-ug-009
systems-manager-ug.pdf
9
aren't sufficient for your use case, you can also add policies to the default IAM role created by the Default Host Management Configuration. Alternatively, if you don't need permissions for all of the capabilities provided by the default IAM role, you can create your own custom role and policies. Any changes made to the IAM role you choose for Default Host Management Configuration applies to all managed Amazon EC2 instances in the Region and account. For more information about the policy used by Default Host Management Configuration, see AWS managed policy: AmazonSSMManagedEC2InstanceDefaultPolicy.For more information about the Default Host Management Configuration, see Managing EC2 instances automatically with Default Host Management Configuration. Important Instances registered using Default Host Management Configuration store registration information locally in the /lib/amazon/ssm or C:\ProgramData\Amazon directories. Removing these directories or their files will prevent the instance from acquiring the necessary credentials to connect to Systems Manager using Default Host Management Configure instance permissions required for Systems Manager 18 AWS Systems Manager User Guide Configuration. In these cases, you must use an instance profile to provide the required permissions to your instance, or recreate the instance. Note This procedure is intended to be performed only by administrators. Implement least privilege access when allowing individuals to configure or modify the Default Host Management Configuration. You must turn on the Default Host Management Configuration in each AWS Region you wish to automatically manage your Amazon EC2 instances. To turn on the Default Host Management Configuration setting You can turn on the Default Host Management Configuration from the Fleet Manager console. To successfully complete this procedure using either the AWS Management Console or your preferred command line tool, you must have permissions for the GetServiceSetting, ResetServiceSetting, and UpdateServiceSetting API operations. Additionally, you must have permissions for the iam:PassRole permission for the AWSSystemsManagerDefaultEC2InstanceManagementRole IAM role. The following is an example policy. Replace each example resource placeholder with your own information. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting", "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], "Resource": "arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role" }, { "Effect": "Allow", "Action": [ "iam:PassRole" ], Configure instance permissions required for Systems Manager 19 AWS Systems Manager User Guide "Resource": "arn:aws:iam::account-id:role/service-role/ AWSSystemsManagerDefaultEC2InstanceManagementRole", "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com" ] } } } ] } Before you begin, if you have instance profiles attached to your Amazon EC2 instances, remove any permissions that allow the ssm:UpdateInstanceInformation operation. The SSM Agent attempts to use instance profile permissions before using the Default Host Management Configuration permissions. If you allow the ssm:UpdateInstanceInformation operation in your instance profiles, the instance will not use the Default Host Management Configuration permissions. 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. 3. Choose Configure Default Host Management Configuration under the Account management dropdown. 4. Turn on Enable Default Host Management Configuration. 5. Choose the IAM role used to enable Systems Manager tools for your instances. We recommend using the default role provided by Default Host Management Configuration. It contains the minimum set of permissions necessary to manage your Amazon EC2 instances using Systems Manager. If you prefer to use a custom role, the role's trust policy must allow Systems Manager as a trusted entity. 6. Choose Configure to complete setup. After turning on the Default Host Management Configuration, it might take up 30 minutes for your instances to use the credentials of the role you chose. You must turn on the Default Host Management Configuration in each Region you wish to automatically manage your Amazon EC2 instances. Configure instance permissions required for Systems Manager 20 AWS Systems Manager User Guide Alternative configuration for EC2 instance permissions You can grant access at the individual instance level by using an AWS Identity and Access Management (IAM) instance profile. An instance profile is a container that passes IAM role information to an Amazon Elastic Compute Cloud (Amazon EC2) instance at launch. You can create an instance profile for Systems Manager by attaching one or more IAM policies that define the necessary permissions to a new role or to a role you already created. Note You can use Quick Setup, a tool in AWS Systems Manager, to quickly configure an instance profile on all instances in your AWS account. Quick Setup also creates an IAM service role (or assume role), which allows Systems Manager to securely run commands on your instances on your behalf. By using Quick Setup, you can skip this step (Step 3) and Step 4. For more information, see AWS Systems Manager Quick Setup. Note the following details about creating an IAM instance profile: • If you're configuring non-EC2 machines in a hybrid and multicloud environment for Systems Manager, you don't need to create an instance profile for them. Instead, configure your servers and VMs to use an IAM service role. For more
systems-manager-ug-010
systems-manager-ug.pdf
10
your AWS account. Quick Setup also creates an IAM service role (or assume role), which allows Systems Manager to securely run commands on your instances on your behalf. By using Quick Setup, you can skip this step (Step 3) and Step 4. For more information, see AWS Systems Manager Quick Setup. Note the following details about creating an IAM instance profile: • If you're configuring non-EC2 machines in a hybrid and multicloud environment for Systems Manager, you don't need to create an instance profile for them. Instead, configure your servers and VMs to use an IAM service role. For more information, see Create the IAM service role required for Systems Manager in hybrid and multicloud environments. • If you change the IAM instance profile, it might take some time for the instance credentials to refresh. SSM Agent won't process requests until this happens. To speed up the refresh process, you can restart SSM Agent or restart the instance. Depending on whether you're creating a new role for your instance profile or adding the necessary permissions to an existing role, use one of the following procedures. To create an instance profile for Systems Manager managed instances (console) 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. 3. 4. In the navigation pane, choose Roles, and then choose Create role. For Trusted entity type, choose AWS service. Immediately under Use case, choose EC2, and then choose Next. 5. On the Add permissions page, do the following: Configure instance permissions required for Systems Manager 21 AWS Systems Manager User Guide • Use the Search field to locate the AmazonSSMManagedInstanceCore policy. Select the check box next to its name, as shown in the following illustration. The console retains your selection even if you search for other policies. • If you created a custom S3 bucket policy in the previous procedure, (Optional) Create a custom policy for S3 bucket access, search for it and select the check box next to its name. • If you plan to join instances to an Active Directory managed by AWS Directory Service, search for AmazonSSMDirectoryServiceAccess and select the check box next to its name. • If you plan to use EventBridge or CloudWatch Logs to manage or monitor your instance, search for CloudWatchAgentServerPolicy and select the check box next to its name. 6. Choose Next. 7. For Role name, enter a name for your new instance profile, such as SSMInstanceProfile. Note Make a note of the role name. You will choose this role when you create new instances that you want to manage by using Systems Manager. 8. 9. (Optional) For Description, update the description for this instance profile. (Optional) For Tags, add one or more tag-key value pairs to organize, track, or control access for this role, and then choose Create role. The system returns you to the Roles page. To add instance profile permissions for Systems Manager to an existing role (console) 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Roles, and then choose the existing role you want to associate with an instance profile for Systems Manager operations. 3. On the Permissions tab, choose Add permissions, Attach policies. 4. On the Attach policy page, do the following: Configure instance permissions required for Systems Manager 22 AWS Systems Manager User Guide • Use the Search field to locate the AmazonSSMManagedInstanceCore policy. Select the check box next to its name. • If you have created a custom S3 bucket policy, search for it and select the check box next to its name. For information about custom S3 bucket policies for an instance profile, see (Optional) Create a custom policy for S3 bucket access. • If you plan to join instances to an Active Directory managed by AWS Directory Service, search for AmazonSSMDirectoryServiceAccess and select the check box next to its name. • If you plan to use EventBridge or CloudWatch Logs to manage or monitor your instance, search for CloudWatchAgentServerPolicy and select the check box next to its name. 5. Choose Attach policies. For information about how to update a role to include a trusted entity or further restrict access, see Modifying a role in the IAM User Guide. (Optional) Create a custom policy for S3 bucket access Creating a custom policy for Amazon S3 access is required only if you're using a VPC endpoint or using an S3 bucket of your own in your Systems Manager operations. You can attach this policy to the default IAM role created by the Default Host Management Configuration, or an instance profile you created in the previous procedure. For information about the AWS managed S3 buckets you provide access to in the following policy, see SSM Agent communications with AWS managed S3 buckets. 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Policies,
systems-manager-ug-011
systems-manager-ug.pdf
11
for S3 bucket access Creating a custom policy for Amazon S3 access is required only if you're using a VPC endpoint or using an S3 bucket of your own in your Systems Manager operations. You can attach this policy to the default IAM role created by the Default Host Management Configuration, or an instance profile you created in the previous procedure. For information about the AWS managed S3 buckets you provide access to in the following policy, see SSM Agent communications with AWS managed S3 buckets. 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Policies, and then choose Create policy. 3. Choose the JSON tab, and replace the default text with the following. { "Version": "2012-10-17", "Statement": [ "Effect": "Allow", "Action": "s3:GetObject", "Resource": [ "arn:aws:s3:::aws-ssm-region/*", { Configure instance permissions required for Systems Manager 23 AWS Systems Manager User Guide "arn:aws:s3:::aws-windows-downloads-region/*", "arn:aws:s3:::amazon-ssm-region/*", "arn:aws:s3:::amazon-ssm-packages-region/*", "arn:aws:s3:::region-birdwatcher-prod/*", "arn:aws:s3:::aws-ssm-distributor-file-region/*", "arn:aws:s3:::aws-ssm-document-attachments-region/*", "arn:aws:s3:::patch-baseline-snapshot-region/*" { ] }, "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:PutObjectAcl", "s3:GetEncryptionConfiguration" ], "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket/*", "arn:aws:s3:::amzn-s3-demo- bucket" ] } ] } 1 The first Statement element is required only if you're using a VPC endpoint. 2 The second Statement element is required only if you're using an S3 bucket that you created to use in your Systems Manager operations. 3 The PutObjectAcl access control list permission is required only if you plan to support cross-account access to S3 buckets in other accounts. 4 The GetEncryptionConfiguration element is required if your S3 bucket is configured to use encryption. Configure instance permissions required for Systems Manager 24 AWS Systems Manager User Guide 5 If your S3 bucket is configured to use encryption, then the S3 bucket root (for example, arn:aws:s3:::amzn-s3-demo-bucket) must be listed in the Resource section. Your user, group, or role must be configured with access to the root bucket. 4. If you're using a VPC endpoint in your operations, do the following: In the first Statement element, replace each region placeholder with the identifier of the AWS Region this policy will be used in. For example, use us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Important We recommend that you avoid using wildcard characters (*) in place of specific Regions in this policy. For example, use arn:aws:s3:::aws-ssm-us-east-2/* and do not use arn:aws:s3:::aws-ssm-*/*. Using wildcards could provide access to S3 buckets that you don’t intend to grant access to. If you want to use the instance profile for more than one Region, we recommend repeating the first Statement element for each Region. -or- If you aren't using a VPC endpoint in your operations, you can delete the first Statement element. 5. If you're using an S3 bucket of your own in your Systems Manager operations, do the following: In the second Statement element, replace amzn-s3-demo-bucket with the name of an S3 bucket in your account. You will use this bucket for your Systems Manager operations. It provides permission for objects in the bucket, using "arn:aws:s3:::my-bucket-name/*" as the resource. For more information about providing permissions for buckets or objects in buckets, see the topic Amazon S3 actions in the Amazon Simple Storage Service User Guide and the AWS blog post IAM Policies and Bucket Policies and ACLs! Oh, My! (Controlling Access to S3 Resources). Configure instance permissions required for Systems Manager 25 AWS Systems Manager Note User Guide If you use more than one bucket, provide the ARN for each one. See the following example for permissions on buckets. "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket1/*", "arn:aws:s3:::amzn-s3-demo-bucket2/*" ] -or- If you aren't using an S3 bucket of your own in your Systems Manager operations, you can delete the second Statement element. 6. Choose Next: Tags. 7. (Optional) Add tags by choosing Add tag, and entering the preferred tags for the policy. 8. Choose Next: Review. 9. For Name, enter a name to identify this policy, such as SSMInstanceProfileS3Policy. 10. Choose Create policy. Additional policy considerations for managed instances This section describes some of the policies you can add to the default IAM role created by the Default Host Management Configuration, or your instance profiles for AWS Systems Manager. To provide permissions for communication between instances and the Systems Manager API, we recommend creating custom policies that reflect your system needs and security requirements. Depending on your operations plan, you might need permissions represented in one or more of the other policies. Policy: AmazonSSMDirectoryServiceAccess Required only if you plan to join Amazon EC2 instances for Windows Server to a Microsoft AD directory. Configure instance permissions required for Systems Manager 26 AWS Systems Manager User Guide This AWS managed policy allows SSM Agent to access AWS Directory Service on your behalf for requests to join the domain by the managed instance. For more information, see
systems-manager-ug-012
systems-manager-ug.pdf
12
between instances and the Systems Manager API, we recommend creating custom policies that reflect your system needs and security requirements. Depending on your operations plan, you might need permissions represented in one or more of the other policies. Policy: AmazonSSMDirectoryServiceAccess Required only if you plan to join Amazon EC2 instances for Windows Server to a Microsoft AD directory. Configure instance permissions required for Systems Manager 26 AWS Systems Manager User Guide This AWS managed policy allows SSM Agent to access AWS Directory Service on your behalf for requests to join the domain by the managed instance. For more information, see Seamlessly join a Windows EC2 Instance in the AWS Directory Service Administration Guide. Policy: CloudWatchAgentServerPolicy Required only if you plan to install and run the CloudWatch agent on your instances to read metric and log data on an instance and write it to Amazon CloudWatch. These help you monitor, analyze, and quickly respond to issues or changes to your AWS resources. Your default IAM role created by the Default Host Management Configuration or instance profile needs this policy only if you will use features such as Amazon EventBridge or Amazon CloudWatch Logs. (You can also create a more restrictive policy that, for example, limits writing access to a specific CloudWatch Logs log stream.) Note Using EventBridge and CloudWatch Logs features is optional. However, we recommend setting them up at the beginning of your Systems Manager configuration process if you have decided to use them. For more information, see the Amazon EventBridge User Guide and the Amazon CloudWatch Logs User Guide. To create IAM policies with permissions for additional Systems Manager tools, see the following resources: • Restricting access to Parameter Store parameters using IAM policies • Setting up Automation • Step 2: Verify or add instance permissions for Session Manager Attach the Systems Manager instance profile to an instance (console) The following procedure describes how to attach an IAM instance profile to an Amazon EC2 instance using the Amazon EC2 console. 1. Sign in to the AWS Management Console and open the Amazon EC2 console at https:// console.aws.amazon.com/ec2/. 2. In the navigation pane, under Instances, choose Instances. Configure instance permissions required for Systems Manager 27 AWS Systems Manager User Guide 3. Navigate to and choose your EC2 instance from the list. 4. 5. In the Actions menu, choose Security, Modify IAM role. For IAM role, select the instance profile you created using the procedure in Alternative configuration for EC2 instance permissions. 6. Choose Update IAM role. For more information about attaching IAM roles to instances, choose one of the following, depending on your selected operating system type: • Attach an IAM role to an instance in the Amazon EC2 User Guide • Attach an IAM role to an instance in the Amazon EC2 User Guide Continue to Improve the security of EC2 instances by using VPC endpoints for Systems Manager. Improve the security of EC2 instances by using VPC endpoints for Systems Manager You can improve the security posture of your managed nodes (including non-EC2 machines in a hybrid and multicloud environment) by configuring AWS Systems Manager to use an interface VPC endpoint in Amazon Virtual Private Cloud (Amazon VPC). By using an interface VPC endpoint (interface endpoint), you can connect to services powered by AWS PrivateLink. AWS PrivateLink is a technology that allows you to privately access Amazon Elastic Compute Cloud (Amazon EC2) and Systems Manager APIs by using private IP addresses. AWS PrivateLink restricts all network traffic between your managed instances, Systems Manager, and Amazon EC2 to the Amazon network. This means that your managed instances don't have access to the Internet. If you use AWS PrivateLink, you don't need an internet gateway, a NAT device, or a virtual private gateway. You aren't required to configure AWS PrivateLink, but it's recommended. For more information about AWS PrivateLink and VPC endpoints, see AWS PrivateLink and VPC endpoints. Note The alternative to using a VPC endpoint is to allow outbound internet access on your managed instances. In this case, the managed instances must also allow HTTPS (port 443) outbound traffic to the following endpoints: Improve the security of EC2 instances by using VPC endpoints for Systems Manager 28 AWS Systems Manager User Guide • ssm.region.amazonaws.com • ssmmessages.region.amazonaws.com • ec2messages.region.amazonaws.com SSM Agent initiates all connections to the Systems Manager service in the cloud. For this reason, you don't need to configure your firewall to allow inbound traffic to your instances for Systems Manager. For more information about calls to these endpoints, see Reference: ec2messages, ssmmessages, and other API operations. About Amazon VPC You can use Amazon Virtual Private Cloud (Amazon VPC) to define a virtual network in your own logically isolated area within the AWS Cloud, known as a virtual private cloud (VPC). You can launch your AWS resources, such as
systems-manager-ug-013
systems-manager-ug.pdf
13
Manager User Guide • ssm.region.amazonaws.com • ssmmessages.region.amazonaws.com • ec2messages.region.amazonaws.com SSM Agent initiates all connections to the Systems Manager service in the cloud. For this reason, you don't need to configure your firewall to allow inbound traffic to your instances for Systems Manager. For more information about calls to these endpoints, see Reference: ec2messages, ssmmessages, and other API operations. About Amazon VPC You can use Amazon Virtual Private Cloud (Amazon VPC) to define a virtual network in your own logically isolated area within the AWS Cloud, known as a virtual private cloud (VPC). You can launch your AWS resources, such as instances, into your VPC. Your VPC closely resembles a traditional network that you might operate in your own data center, with the benefits of using the scalable infrastructure of AWS. You can configure your VPC; you can select its IP address range, create subnets, and configure route tables, network gateways, and security settings. You can connect instances in your VPC to the internet. You can connect your VPC to your own corporate data center, making the AWS Cloud an extension of your data center. To protect the resources in each subnet, you can use multiple layers of security, including security groups and network access control lists. For more information, see the Amazon VPC User Guide. Topics • VPC endpoint restrictions and limitations • Creating VPC endpoints for Systems Manager • Create an interface VPC endpoint policy VPC endpoint restrictions and limitations Before you configure VPC endpoints for Systems Manager, be aware of the following restrictions and limitations. VPC peering connections Improve the security of EC2 instances by using VPC endpoints for Systems Manager 29 AWS Systems Manager User Guide VPC interface endpoints can be accessed through both intra-Region and inter-Region VPC peering connections. For more information about VPC peering connection requests for VPC interface endpoints, see VPC peering connections (Quotas) in the Amazon Virtual Private Cloud User Guide. VPC gateway endpoint connections can't be extended out of a VPC. Resources on the other side of a VPC peering connection in your VPC can't use the gateway endpoint to communicate with resources in the gateway endpoint service. For more information about VPC peering connection requests for VPC gateway endpoints, see VPC endpoints (Quotas) in the Amazon Virtual Private Cloud User Guide Incoming connections The security group attached to the VPC endpoint must allow incoming connections on port 443 from the private subnet of the managed instance. If incoming connections aren't allowed, then the managed instance can't connect to the SSM and EC2 endpoints. DNS resolution If you use a custom DNS server, you must add a conditional forwarder for any queries to the amazonaws.com domain to the Amazon DNS server for your VPC. S3 buckets Your VPC endpoint policy must allow access to at least the Amazon S3 buckets listed in SSM Agent communications with AWS managed S3 buckets. Note If you use an on-premises firewall and plan to use Patch Manager, that firewall must also allow access to the appropriate patch baseline endpoint. Amazon CloudWatch Logs If you don't allow your instances to access the internet, create a VPC endpoint for CloudWatch Logs to use features that send logs to CloudWatch Logs. For more information about creating an endpoint for CloudWatch Logs, see Creating a VPC endpoint for CloudWatch Logs in the Amazon CloudWatch Logs User Guide. DNS in hybrid and multicloud environment Improve the security of EC2 instances by using VPC endpoints for Systems Manager 30 AWS Systems Manager User Guide For information about configuring DNS to work with AWS PrivateLink endpoints in hybrid and multicloud environments, see Private DNS for interface endpoints in the Amazon VPC User Guide. If you want to use your own DNS, you can use Route 53 Resolver. For more information, see Resolving DNS queries between VPCs and your network in the Amazon Route 53 Developer Guide. Creating VPC endpoints for Systems Manager Use the following information to create VPC interface endpoints for AWS Systems Manager. This topic links to procedures in the Amazon VPC User Guide. Note region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Follow the steps in Create an interface endpoint to create the following interface endpoints: • com.amazonaws.region.ssm – The endpoint for the Systems Manager service. • com.amazonaws.region.ec2messages – Systems Manager uses this endpoint to make calls from SSM Agent to the Systems Manager service. Beginning with version 3.3.40.0 of SSM Agent, Systems Manager began using the ssmmessages:* endpoint (Amazon Message Gateway Service) whenever available instead of the ec2messages:* endpoint (Amazon Message Delivery Service). • com.amazonaws.region.ec2 – If you're using Systems Manager to
systems-manager-ug-014
systems-manager-ug.pdf
14
supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Follow the steps in Create an interface endpoint to create the following interface endpoints: • com.amazonaws.region.ssm – The endpoint for the Systems Manager service. • com.amazonaws.region.ec2messages – Systems Manager uses this endpoint to make calls from SSM Agent to the Systems Manager service. Beginning with version 3.3.40.0 of SSM Agent, Systems Manager began using the ssmmessages:* endpoint (Amazon Message Gateway Service) whenever available instead of the ec2messages:* endpoint (Amazon Message Delivery Service). • com.amazonaws.region.ec2 – If you're using Systems Manager to create VSS-enabled snapshots, you need to ensure that you have an endpoint to the EC2 service. Without the EC2 endpoint defined, a call to enumerate attached Amazon EBS volumes fails, which causes the Systems Manager command to fail. • com.amazonaws.region.s3 – Systems Manager uses this endpoint to update SSM Agent. Systems Manager also uses this endpoint if, optionally, you choose to retrieve scripts or other files stored in buckets or upload output logs to a bucket. If the security group associated with your instances restricts outbound traffic, you must add a rule to allow traffic to the prefix list for Amazon S3. For more information, see Modify your security group in the AWS PrivateLink Guide. • com.amazonaws.region.ssmmessages – This endpoint is required for SSM Agent to communicate with the Systems Manager service, for Run Command, and if you're connecting to Improve the security of EC2 instances by using VPC endpoints for Systems Manager 31 AWS Systems Manager User Guide your instances through a secure data channel using Session Manager. For more information, see AWS Systems Manager Session Manager and Reference: ec2messages, ssmmessages, and other API operations. • (Optional) com.amazonaws.region.kms – Create this endpoint if you want to use AWS Key Management Service (AWS KMS) encryption for Session Manager or Parameter Store parameters. • (Optional) com.amazonaws.region.logs – Create this endpoint if you want to use Amazon CloudWatch Logs (CloudWatch Logs) for Session Manager, Run Command, or SSM Agent logs. For information about the AWS managed S3 buckets that SSM Agent must be able to access, see SSM Agent communications with AWS managed S3 buckets. If you're using a virtual private cloud (VPC) endpoint in your Systems Manager operations, you must provide explicit permission in an EC2 instance profile for Systems Manager, or in a service role for non-EC2 managed nodes in a hybrid and multicloud environment. Create an interface VPC endpoint policy You can create policies for VPC interface endpoints for AWS Systems Manager in which you can specify: • The principal that can perform actions • The actions that can be performed • The resources that can have actions performed on them For more information, see Control access to services with VPC endpoints in the Amazon VPC User Guide. Managing nodes in hybrid and multicloud environments with Systems Manager You can use AWS Systems Manager to manage both Amazon Elastic Compute Cloud (EC2) instances and a number of non-EC2 machine types. This section describes the setup tasks that account and system administrators perform to manage non-EC2 machines using Systems Manager in a hybrid and multicloud environment. After these steps are complete, users who have been granted permissions by the AWS account administrator can use Systems Manager to configure and manage their organization's non-EC2 machines. Managing nodes in hybrid and multicloud environments with Systems Manager 32 AWS Systems Manager User Guide Any machine that has been configured for use with Systems Manager is called a managed node. Note • You can register edge devices as managed nodes using the same hybrid-activation steps used for other non-EC2 machines. These types of edge devices include both AWS IoT devices and devices other than AWS IoT devices. Use the process described in this section to set up these types of edge devices. Systems Manager also supports edge devices that use AWS IoT Greengrass Core software. The setup process and requirements for AWS IoT Greengrass core devices are different from those for AWS IoT and edge devices other than AWS edge devices. For information about registering AWS IoT Greengrass devices for use with Systems Manager, see Managing edge devices with Systems Manager. • Non-EC2 macOS machines aren't supported for Systems Manager hybrid and multicloud environments. If you plan to use Systems Manager to manage Amazon Elastic Compute Cloud (Amazon EC2) instances, or to use both Amazon EC2 instances and non-EC2 machines in hybrid and multicloud environment, follow the steps in Managing EC2 instances with Systems Manager first. After configuring your hybrid and multicloud environment for Systems Manager, you can do the following: • Create a consistent and secure way to remotely manage your hybrid and multicloud workloads from one location using the same tools or scripts. • Centralize access control for actions that can be
systems-manager-ug-015
systems-manager-ug.pdf
15
machines aren't supported for Systems Manager hybrid and multicloud environments. If you plan to use Systems Manager to manage Amazon Elastic Compute Cloud (Amazon EC2) instances, or to use both Amazon EC2 instances and non-EC2 machines in hybrid and multicloud environment, follow the steps in Managing EC2 instances with Systems Manager first. After configuring your hybrid and multicloud environment for Systems Manager, you can do the following: • Create a consistent and secure way to remotely manage your hybrid and multicloud workloads from one location using the same tools or scripts. • Centralize access control for actions that can be performed on your machines by using AWS Identity and Access Management (IAM). • Centralize auditing of the operations performed on your machines by viewing the API activity recorded in AWS CloudTrail. For information about using CloudTrail to monitor Systems Manager actions, see Logging AWS Systems Manager API calls with AWS CloudTrail. • Centralize monitoring by configuring Amazon EventBridge and Amazon Simple Notification Service (Amazon SNS) to send notifications about service execution success. Managing nodes in hybrid and multicloud environments with Systems Manager 33 AWS Systems Manager User Guide For information about using EventBridge to monitor Systems Manager events, see Monitoring Systems Manager events with Amazon EventBridge. About managed nodes After you finish configuring your non-EC2 machines for Systems Manager as described in this section, your hybrid-activated machines are listed in the AWS Management Console and described as managed nodes. In the console, the IDs of your hybrid-activated managed nodes are distinguished from Amazon EC2 instances with the prefix "mi-". Amazon EC2 instance IDs use the prefix "i-". A managed node is any machine configured for Systems Manager. Previously, managed nodes were all referred to as managed instances. The term instance now refers to EC2 instances only. The deregister-managed-instance command was named before this terminology change. For more information, see Working with managed nodes. About instance tiers Systems Manager offers a standard-instances tier and an advanced-instances tier for non-EC2 managed nodes in your hybrid and multicloud environment. The standard-instances tier allows you to register a maximum of 1,000 hybrid-activated machines per AWS account per AWS Region. If you need to register more than 1,000 non-EC2 machines in a single account and Region, then use the advanced-instances tier. Advanced instances also allow you to connect to your non-EC2 machines by using AWS Systems Manager Session Manager. Session Manager provides interactive shell access to your managed nodes. For more information, see Configuring instance tiers. Topics • Create the IAM service role required for Systems Manager in hybrid and multicloud environments • Create a hybrid activation to register nodes with Systems Manager • Install SSM Agent on hybrid Linux nodes • Install SSM Agent on hybrid Windows Server nodes Managing nodes in hybrid and multicloud environments with Systems Manager 34 AWS Systems Manager User Guide Create the IAM service role required for Systems Manager in hybrid and multicloud environments Non-EC2 (Amazon Elastic Compute Cloud) machines in a hybrid and multicloud environment require an AWS Identity and Access Management (IAM) service role to communicate with the AWS Systems Manager service. The role grants AWS Security Token Service (AWS STS) AssumeRole trust to the Systems Manager service. You only need to create a service role for a hybrid and multicloud environment once for each AWS account. However, you might choose to create multiple service roles for different hybrid activations if machines in your hybrid and multicloud environment require different permissions. The following procedures describe how to create the required service role using the Systems Manager console or your preferred command line tool. Using the AWS Management Console to create an IAM service role for Systems Manager hybrid activations Use the following procedure to create a service role for hybrid activation. This procedure uses the AmazonSSMManagedInstanceCore policy for Systems Manager core functionality. Depending on your use case, you might need to add additional policies to your service role for your on-premises machines to be able to access other Systems Manager tools or AWS services. For example, without access to the required AWS managed Amazon Simple Storage Service (Amazon S3) buckets, Patch Manager patching operations fail. To create a service role (console) 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. 3. In the navigation pane, choose Roles, and then choose Create role. For Select trusted entity, make the following choices: 1. For Trusted entity type, choose AWS service. 2. For Use cases for other AWS services, choose Systems Manager. 3. Choose Systems Manager. The following image highlights the location of the Systems Manager option. Create the IAM service role required for Systems Manager in hybrid and multicloud environments 35 AWS Systems Manager User Guide 4. Choose Next. 5. On the Add permissions page, do the following: • Use the Search field to locate the AmazonSSMManagedInstanceCore policy. Select the
systems-manager-ug-016
systems-manager-ug.pdf
16
https://console.aws.amazon.com/iam/. 2. 3. In the navigation pane, choose Roles, and then choose Create role. For Select trusted entity, make the following choices: 1. For Trusted entity type, choose AWS service. 2. For Use cases for other AWS services, choose Systems Manager. 3. Choose Systems Manager. The following image highlights the location of the Systems Manager option. Create the IAM service role required for Systems Manager in hybrid and multicloud environments 35 AWS Systems Manager User Guide 4. Choose Next. 5. On the Add permissions page, do the following: • Use the Search field to locate the AmazonSSMManagedInstanceCore policy. Select the check box next to its name, as shown in the following illustration. Note The console retains your selection even if you search for other policies. • If you created a custom S3 bucket policy in the procedure (Optional) Create a custom policy for S3 bucket access, search for it and select the check box next to its name. • If you plan to join non-EC2 machines to an Active Directory managed by AWS Directory Service, search for AmazonSSMDirectoryServiceAccess and select the check box next to its name. • If you plan to use EventBridge or CloudWatch Logs to manage or monitor your managed node, search for CloudWatchAgentServerPolicy and select the check box next to its name. 6. Choose Next. 7. For Role name, enter a name for your new IAM server role, such as SSMServerRole. Create the IAM service role required for Systems Manager in hybrid and multicloud environments 36 AWS Systems Manager Note User Guide Make a note of the role name. You will choose this role when you register new machines that you want to manage by using Systems Manager. 8. 9. (Optional) For Description, update the description for this IAM server role. (Optional) For Tags, add one or more tag-key value pairs to organize, track, or control access for this role. 10. Choose Create role. The system returns you to the Roles page. Using the AWS CLI to create an IAM service role for Systems Manager hybrid activations Use the following procedure to create a service role for hybrid activation. This procedure uses the AmazonSSMManagedInstanceCore policy Systems Manager core functionality. Depending on your use case, you might need to add additional policies to your service role for your non-EC2 machines in a hybrid and multicloud environment to be able to access other tools or AWS services. S3 bucket policy requirement If either of the following cases are true, you must create a custom IAM permission policy for Amazon Simple Storage Service (Amazon S3) buckets before completing this procedure: • Case 1 – You're using a VPC endpoint to privately connect your VPC to supported AWS services and VPC endpoint services powered by AWS PrivateLink. • Case 2 – You plan to use an Amazon S3 bucket that you create as part of your Systems Manager operations, such as for storing output for Run Command commands or Session Manager sessions to an S3 bucket. Before proceeding, follow the steps in Create a custom S3 bucket policy for an instance profile. The information about S3 bucket policies in that topic also applies to your service role. AWS CLI To create an IAM service role for a hybrid and multicloud environment (AWS CLI) 1. Install and configure the AWS Command Line Interface (AWS CLI), if you haven't already. Create the IAM service role required for Systems Manager in hybrid and multicloud environments 37 AWS Systems Manager User Guide For information, see Installing or updating the latest version of the AWS CLI. 2. On your local machine, create a text file with a name such as SSMService-Trust.json with the following trust policy. Make sure to save the file with the .json file extension. Be sure to specify your AWS account and the AWS Region in the ARN where you created your hybrid activation. Replace the placeholder values for account ID and Region with your own information. { "Version":"2012-10-17", "Statement":[ { "Sid":"", "Effect":"Allow", "Principal":{ "Service":"ssm.amazonaws.com" }, "Action":"sts:AssumeRole", "Condition":{ "StringEquals":{ "aws:SourceAccount":"123456789012" }, "ArnEquals":{ "aws:SourceArn":"arn:aws:ssm:us-east-2:123456789012:*" } } } ] } 3. Open the AWS CLI, and in the directory where you created the JSON file, run the create-role command to create the service role. This example creates a role named SSMServiceRole. You can choose another name if you prefer. Linux & macOS aws iam create-role \ --role-name SSMServiceRole \ --assume-role-policy-document file://SSMService-Trust.json Create the IAM service role required for Systems Manager in hybrid and multicloud environments 38 AWS Systems Manager Windows User Guide aws iam create-role ^ --role-name SSMServiceRole ^ --assume-role-policy-document file://SSMService-Trust.json 4. Run the attach-role-policy command as follows to allow the service role you just created to create a session token. The session token gives your managed node permission to run commands using Systems Manager. Note The policies you add for a service profile
systems-manager-ug-017
systems-manager-ug.pdf
17
This example creates a role named SSMServiceRole. You can choose another name if you prefer. Linux & macOS aws iam create-role \ --role-name SSMServiceRole \ --assume-role-policy-document file://SSMService-Trust.json Create the IAM service role required for Systems Manager in hybrid and multicloud environments 38 AWS Systems Manager Windows User Guide aws iam create-role ^ --role-name SSMServiceRole ^ --assume-role-policy-document file://SSMService-Trust.json 4. Run the attach-role-policy command as follows to allow the service role you just created to create a session token. The session token gives your managed node permission to run commands using Systems Manager. Note The policies you add for a service profile for managed nodes in a hybrid and multicloud environment are the same policies used to create an instance profile for Amazon Elastic Compute Cloud (Amazon EC2) instances. For more information about the AWS policies used in the following commands, see Configure instance permissions required for Systems Manager. (Required) Run the following command to allow a managed node to use AWS Systems Manager service core functionality. Linux & macOS aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore Windows aws iam attach-role-policy ^ --role-name SSMServiceRole ^ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore If you created a custom S3 bucket policy for your service role, run the following command to allow AWS Systems Manager Agent (SSM Agent) to access the buckets you specified in the policy. Replace account-id and amzn-s3-demo-bucket with your AWS account ID and your bucket name. Create the IAM service role required for Systems Manager in hybrid and multicloud environments 39 AWS Systems Manager Linux & macOS User Guide aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::account-id:policy/amzn-s3-demo-bucket Windows aws iam attach-role-policy ^ --role-name SSMServiceRole ^ --policy-arn arn:aws:iam::account-id:policy/amzn-s3-demo-bucket (Optional) Run the following command to allow SSM Agent to access AWS Directory Service on your behalf for requests to join the domain by the managed node. Your service role needs this policy only if you join your nodes to a Microsoft AD directory. Linux & macOS aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::aws:policy/AmazonSSMDirectoryServiceAccess Windows aws iam attach-role-policy ^ --role-name SSMServiceRole ^ --policy-arn arn:aws:iam::aws:policy/AmazonSSMDirectoryServiceAccess (Optional) Run the following command to allow the CloudWatch agent to run on your managed nodes. This command makes it possible to read information on a node and write it to CloudWatch. Your service profile needs this policy only if you will use services such as Amazon EventBridge or Amazon CloudWatch Logs. aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy Create the IAM service role required for Systems Manager in hybrid and multicloud environments 40 AWS Systems Manager Tools for PowerShell User Guide To create an IAM service role for a hybrid and multicloud environment (AWS Tools for Windows PowerShell) 1. Install and configure the AWS Tools for PowerShell (Tools for Windows PowerShell), if you haven't already. For information, see Installing the AWS Tools for PowerShell. 2. On your local machine, create a text file with a name such as SSMService-Trust.json with the following trust policy. Make sure to save the file with the .json file extension. Be sure to specify your AWS account and the AWS Region in the ARN where you created your hybrid activation. { "Version":"2012-10-17", "Statement":[ { "Sid":"", "Effect":"Allow", "Principal":{ "Service":"ssm.amazonaws.com" }, "Action":"sts:AssumeRole", "Condition":{ "StringEquals":{ "aws:SourceAccount":"123456789012" }, "ArnEquals":{ "aws:SourceArn":"arn:aws:ssm:region:123456789012:*" } } } ] } 3. Open PowerShell in administrative mode, and in the directory where you created the JSON file, run New-IAMRole as follows to create a service role. This example creates a role named SSMServiceRole. You can choose another name if you prefer. New-IAMRole ` Create the IAM service role required for Systems Manager in hybrid and multicloud environments 41 AWS Systems Manager User Guide -RoleName SSMServiceRole ` -AssumeRolePolicyDocument (Get-Content -raw SSMService-Trust.json) 4. Use Register-IAMRolePolicy as follows to allow the service role you created to create a session token. The session token gives your managed node permission to run commands using Systems Manager. Note The policies you add for a service profile for managed nodes in a hybrid and multicloud environment are the same policies used to create an instance profile for EC2 instances. For more information about the AWS policies used in the following commands, see Configure instance permissions required for Systems Manager. (Required) Run the following command to allow a managed node to use AWS Systems Manager service core functionality. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore If you created a custom S3 bucket policy for your service role, run the following command to allow SSM Agent to access the buckets you specified in the policy. Replace account-id and my-bucket-policy-name with your AWS account ID and your bucket name. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::account-id:policy/my-bucket-policy-name (Optional) Run the following command to allow SSM Agent to access AWS Directory Service on your behalf for requests to join the domain by the managed node. Your server role needs this policy only if
systems-manager-ug-018
systems-manager-ug.pdf
18
node to use AWS Systems Manager service core functionality. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore If you created a custom S3 bucket policy for your service role, run the following command to allow SSM Agent to access the buckets you specified in the policy. Replace account-id and my-bucket-policy-name with your AWS account ID and your bucket name. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::account-id:policy/my-bucket-policy-name (Optional) Run the following command to allow SSM Agent to access AWS Directory Service on your behalf for requests to join the domain by the managed node. Your server role needs this policy only if you join your nodes to a Microsoft AD directory. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::aws:policy/AmazonSSMDirectoryServiceAccess Create the IAM service role required for Systems Manager in hybrid and multicloud environments 42 AWS Systems Manager User Guide (Optional) Run the following command to allow the CloudWatch agent to run on your managed nodes. This command makes it possible to read information on a node and write it to CloudWatch. Your service profile needs this policy only if you will use services such as Amazon EventBridge or Amazon CloudWatch Logs. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy Continue to Create a hybrid activation to register nodes with Systems Manager. Create a hybrid activation to register nodes with Systems Manager To set up machines other than Amazon Elastic Compute Cloud (EC2) instances as managed nodes for a hybrid and multicloud environment, you create and apply a hybrid activation. After you successfully complete the activation, you immediately receive an Activation Code and Activation ID at the top of the console page. You specify this Code and ID combination when you install AWS Systems Manager SSM Agent on non-EC2 machines for your hybrid and multicloud environment. The Code and ID provide secure access to the Systems Manager service from your managed nodes. Important Systems Manager immediately returns the Activation Code and ID to the console or the command window, depending on how you created the activation. Copy this information and store it in a safe place. If you navigate away from the console or close the command window, you might lose this information. If you lose it, you must create a new activation. About activation expirations An activation expiration is a window of time when you can register on-premises machines with Systems Manager. An expired activation has no impact on your servers or VMs that you previously registered with Systems Manager. If an activation expires then you can’t register more servers or VMs with Systems Manager by using that specific activation. You simply need to create a new one. Every on-premises server and VM you previously registered remains registered as a Systems Manager managed node until you explicitly deregister it. You can deregister a non-EC2 managed node in the following ways: Create a hybrid activation to register nodes with Systems Manager 43 AWS Systems Manager User Guide • Use the Managed nodes tab in Fleet Manager in the Systems Manager console • Use the AWS CLI command deregister-managed-instance • Use the API action DeregisterManagedInstance. For more information, see the following topics • Deregister and reregister a managed node (Linux) • Deregister and reregister a managed node (Windows Server) About managed nodes A managed node is any machine configured for AWS Systems Manager. AWS Systems Manager supports Amazon Elastic Compute Cloud (Amazon EC2) instances, edge devices, and on-premises servers or VMs, including VMs in other cloud environments. Previously, managed nodes were all referred to as managed instances. The term instance now refers to EC2 instances only. The deregister-managed-instance command was named before this terminology change. About activation tags If you create an activation by using either the AWS Command Line Interface (AWS CLI) or AWS Tools for Windows PowerShell, you can specify tags. Tags are optional metadata that you assign to a resource. Tags allow you to categorize a resource in different ways, such as by purpose, owner, or environment. Here is an AWS CLI sample command to run in the US East (Ohio) Region on a local Linux machine that includes optional tags. aws ssm create-activation \ --default-instance-name MyWebServers \ --description "Activation for Finance department webservers" \ --iam-role service-role/AmazonEC2RunCommandRoleForManagedInstances \ --registration-limit 10 \ --region us-east-2 \ --tags "Key=Department,Value=Finance" If you specify tags when you create an activation, then those tags are automatically assigned to your managed nodes when you activate them. You can't add tags to or delete tags from an existing activation. If you don't want to automatically assign tags to your on-premises servers and VMs using an activation, then you can add tags to them later. More specifically, you can tag your on-premises servers and VMs after they connect to Create a hybrid activation to register nodes with Systems Manager 44 AWS Systems Manager User Guide Systems Manager for the first time. After
systems-manager-ug-019
systems-manager-ug.pdf
19
\ --tags "Key=Department,Value=Finance" If you specify tags when you create an activation, then those tags are automatically assigned to your managed nodes when you activate them. You can't add tags to or delete tags from an existing activation. If you don't want to automatically assign tags to your on-premises servers and VMs using an activation, then you can add tags to them later. More specifically, you can tag your on-premises servers and VMs after they connect to Create a hybrid activation to register nodes with Systems Manager 44 AWS Systems Manager User Guide Systems Manager for the first time. After they connect, they're assigned a managed node ID and listed in the Systems Manager console with an ID that is prefixed with "mi-". Note You can't assign tags to an activation if you create it by using the Systems Manager console. You must create it by using either the AWS CLI or Tools for Windows PowerShell. If you no longer want to manage an on-premises server or virtual machine (VM) by using Systems Manager, you can deregister it. For information, see Deregistering managed nodes in a hybrid and multicloud environment. Topics • Using the AWS Management Console to create an activation for registering managed nodes with Systems Manager • Using the command line to create an activation for registering managed nodes with Systems Manager Using the AWS Management Console to create an activation for registering managed nodes with Systems Manager To create a managed-node activation 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Hybrid Activations. 3. Choose Create activation. -or- If you are accessing Hybrid Activations for the first time in the current AWS Region, choose Create an Activation. 4. 5. (Optional) For Activation description, enter a description for this activation. We recommend entering a description if you plan to activate large numbers of servers and VMs. For Instance limit, specify the total number of nodes that you want to register with AWS as part of this activation. The default value is 1 instance. Create a hybrid activation to register nodes with Systems Manager 45 AWS Systems Manager User Guide 6. For IAM role, choose a service role option that allows your servers and VMs to communicate with AWS Systems Manager in the cloud: • Option 1: Choose Use the default role created by the system to use a role and managed policy provided by AWS. • Option 2: Choose Select an existing custom IAM role that has the required permissions to use the optional custom role you created earlier. This role must have a trust relationship policy that specifies "Service": "ssm.amazonaws.com". If your IAM role doesn't specify this principle in a trust relationship policy, you receive the following error: An error occurred (ValidationException) when calling the CreateActivation operation: Not existing role: arn:aws:iam::<accountid>:role/SSMRole For more information about creating this role, see Create the IAM service role required for Systems Manager in hybrid and multicloud environments. 7. For Activation expiry date, specify an expiration date for the activation. The expiry date must be in the future, and not more than 30 days into the future. The default value is 24 hours. Note If you want to register additional managed nodes after the expiry date, you must create a new activation. The expiry date has no impact on registered and running nodes. 8. (Optional) For Default instance name field, specify an identifying name value to be displayed for all managed nodes associated with this activation. 9. Choose Create activation. Systems Manager immediately returns the Activation Code and ID to the console. Using the command line to create an activation for registering managed nodes with Systems Manager The following procedure describes how to use the AWS Command Line Interface (AWS CLI) (on Linux or Windows Server) or AWS Tools for PowerShell to create a managed node activation. Create a hybrid activation to register nodes with Systems Manager 46 AWS Systems Manager To create an activation User Guide 1. Install and configure the AWS CLI or the AWS Tools for PowerShell, if you haven't already. For information, see Installing or updating the latest version of the AWS CLI and Installing the AWS Tools for PowerShell. 2. Run the following command to create an activation. Note • In the following command, replace region with your own information. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. • The role you specify for the iam-role parameter must have a trust relationship policy that specifies "Service": "ssm.amazonaws.com". If your AWS Identity and Access Management (IAM) role doesn't specify this principle in a trust relationship policy, you receive the following error: An error occurred (ValidationException) when calling the CreateActivation operation: Not existing role: arn:aws:iam::<accountid>:role/SSMRole For more
systems-manager-ug-020
systems-manager-ug.pdf
20
Run the following command to create an activation. Note • In the following command, replace region with your own information. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. • The role you specify for the iam-role parameter must have a trust relationship policy that specifies "Service": "ssm.amazonaws.com". If your AWS Identity and Access Management (IAM) role doesn't specify this principle in a trust relationship policy, you receive the following error: An error occurred (ValidationException) when calling the CreateActivation operation: Not existing role: arn:aws:iam::<accountid>:role/SSMRole For more information about creating this role, see Create the IAM service role required for Systems Manager in hybrid and multicloud environments. • For --expiration-date, provide a date in timestamp format, such as "2021-07-07T00:00:00", for when the activation code expires. You can specify a date up to 30 days in advance. If you don't provide an expiration date, the activation code expires in 24 hours. Linux & macOS aws ssm create-activation \ --default-instance-name name \ --iam-role iam-service-role-name \ --registration-limit number-of-managed-instances \ --region region \ --expiration-date "timestamp" \\ Create a hybrid activation to register nodes with Systems Manager 47 AWS Systems Manager User Guide --tags "Key=key-name-1,Value=key-value-1" "Key=key-name-2,Value=key-value-2" Windows aws ssm create-activation ^ --default-instance-name name ^ --iam-role iam-service-role-name ^ --registration-limit number-of-managed-instances ^ --region region ^ --expiration-date "timestamp" ^ --tags "Key=key-name-1,Value=key-value-1" "Key=key-name-2,Value=key-value-2" PowerShell New-SSMActivation -DefaultInstanceName name ` -IamRole iam-service-role-name ` -RegistrationLimit number-of-managed-instances ` –Region region ` -ExpirationDate "timestamp" ` -Tag @{"Key"="key-name-1";"Value"="key-value-1"},@{"Key"="key- name-2";"Value"="key-value-2"} Here is an example. Linux & macOS aws ssm create-activation \ --default-instance-name MyWebServers \ --iam-role service-role/AmazonEC2RunCommandRoleForManagedInstances \ --registration-limit 10 \ --region us-east-2 \ --expiration-date "2021-07-07T00:00:00" \ --tags "Key=Environment,Value=Production" "Key=Department,Value=Finance" Windows aws ssm create-activation ^ --default-instance-name MyWebServers ^ --iam-role service-role/AmazonEC2RunCommandRoleForManagedInstances ^ --registration-limit 10 ^ Create a hybrid activation to register nodes with Systems Manager 48 AWS Systems Manager User Guide --region us-east-2 ^ --expiration-date "2021-07-07T00:00:00" ^ --tags "Key=Environment,Value=Production" "Key=Department,Value=Finance" PowerShell New-SSMActivation -DefaultInstanceName MyWebServers ` -IamRole service-role/AmazonEC2RunCommandRoleForManagedInstances ` -RegistrationLimit 10 ` –Region us-east-2 ` -ExpirationDate "2021-07-07T00:00:00" ` -Tag @{"Key"="Environment";"Value"="Production"},@{"Key"="Department";"Value"="Finance"} If the activation is created successfully, the system immediately returns an Activation Code and ID. Install SSM Agent on hybrid Linux nodes This topic describes how to install AWS Systems Manager SSM Agent on non-EC2 (Amazon Elastic Compute Cloud) Linux machines in a hybrid and multicloud environment. For information about installing SSM Agent on EC2 instances for Linux, see Manually installing and uninstalling SSM Agent on EC2 instances for Linux. Before you begin, locate the Activation Code and Activation ID that were generated during the hybrid activation process, as described in Create a hybrid activation to register nodes with Systems Manager. You specify the Code and ID in the following procedure. To install SSM Agent on non-EC2 machines in a hybrid and multicloud environment 1. 2. Log on to a server or VM in your hybrid and multicloud environment. If you use an HTTP or HTTPS proxy, you must set the http_proxy or https_proxy environment variables in the current shell session. If you aren't using a proxy, you can skip this step. For an HTTP proxy server, enter the following commands at the command line: export http_proxy=http://hostname:port Install SSM Agent on hybrid Linux nodes 49 AWS Systems Manager User Guide export https_proxy=http://hostname:port For an HTTPS proxy server, enter the following commands at the command line: export http_proxy=http://hostname:port export https_proxy=https://hostname:port 3. Copy and paste one of the following command blocks into SSH. Replace the placeholder values with the Activation Code and Activation ID generated during the hybrid activation process and with the identifier of the AWS Region you want to download SSM Agent from, then press Enter. Important Note the following important details: • Using ssm-setup-cli for non-EC2 installations maximizes the security of your Systems Manager installation and configuration. • sudo isn't necessary if you're a root user. • Download ssm-setup-cli from the same AWS Region as where your hybrid activation was created. • ssm-setup-cli supports a manifest-url option that determines the source where the agent is downloaded from. Don't specify a value for this option unless required by your organization. • When registering instances, only use the provided download link provided for ssm- setup-cli. ssm-setup-cli shouldn’t be stored separately for future use. • You can use the script provided here to validate the signature of ssm-setup-cli. region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Additionally, ssm-setup-cli includes the following options: • version - Valid values are latest and stable. Install SSM Agent on hybrid Linux nodes 50 AWS Systems Manager User Guide • downgrade - Allows the SSM Agent to be downgraded to an earlier version. Specify true to
systems-manager-ug-021
systems-manager-ug.pdf
21
the script provided here to validate the signature of ssm-setup-cli. region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Additionally, ssm-setup-cli includes the following options: • version - Valid values are latest and stable. Install SSM Agent on hybrid Linux nodes 50 AWS Systems Manager User Guide • downgrade - Allows the SSM Agent to be downgraded to an earlier version. Specify true to install an earlier version of the agent. • skip-signature-validation - Skips the signature validation during the download and installation of the agent. RHEL 6.x, and CentOS 6.x mkdir /tmp/ssm curl https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/3.0.1479.0/linux_amd64/ amazon-ssm-agent.rpm -o /tmp/ssm/amazon-ssm-agent.rpm sudo yum install -y /tmp/ssm/amazon-ssm-agent.rpm sudo stop amazon-ssm-agent sudo -E amazon-ssm-agent -register -code "activation-code" -id "activation-id" -region "region" sudo start amazon-ssm-agent Amazon Linux 1 mkdir /tmp/ssm curl https://amazon-ssm-region.s3.region.amazonaws.com/latest/linux_amd64/ssm-setup-cli -o /tmp/ssm/ssm-setup-cli sudo chmod +x /tmp/ssm/ssm-setup-cli sudo /tmp/ssm/ssm-setup-cli -register -activation-code "activation-code" -id "activation-id" -region "region" Amazon Linux 2, RHEL 7.x, Oracle Linux, CentOS 7.x, and SLES mkdir /tmp/ssm curl https://amazon-ssm-region.s3.region.amazonaws.com/latest/linux_amd64/ssm-setup-cli -o /tmp/ssm/ssm-setup-cli sudo chmod +x /tmp/ssm/ssm-setup-cli sudo /tmp/ssm/ssm-setup-cli -register -activation-code "activation-code" -activation-id "activation-id" -region "region" RHEL 8.x and CentOS 8.x mkdir /tmp/ssm curl https://amazon-ssm-region.s3.region.amazonaws.com/latest/linux_amd64/ssm-setup-cli -o /tmp/ssm/ssm-setup-cli Install SSM Agent on hybrid Linux nodes 51 AWS Systems Manager User Guide sudo chmod +x /tmp/ssm/ssm-setup-cli sudo /tmp/ssm/ssm-setup-cli -register -activation-code "activation-code" -activation-id "activation-id" -region "region" Debian Server mkdir /tmp/ssm curl https://amazon-ssm-region.s3.region.amazonaws.com/latest/debian_amd64/ssm-setup- cli -o /tmp/ssm/ssm-setup-cli sudo chmod +x /tmp/ssm/ssm-setup-cli sudo /tmp/ssm/ssm-setup-cli -register -activation-code "activation-code" -activation-id "activation-id" -region "region" Raspberry Pi OS (formerly Raspbian) mkdir /tmp/ssm curl https://amazon-ssm-region.s3.region.amazonaws.com/latest/debian_arm/ssm-setup-cli -o /tmp/ssm/ssm-setup-cli sudo chmod +x /tmp/ssm/ssm-setup-cli sudo /tmp/ssm/ssm-setup-cli -register -activation-code "activation-code" -activation-id "activation-id" -region "region" Ubuntu Server • Using .deb packages mkdir /tmp/ssm curl https://amazon-ssm-region.s3.region.amazonaws.com/latest/debian_amd64/ssm-setup- cli -o /tmp/ssm/ssm-setup-cli sudo chmod +x /tmp/ssm/ssm-setup-cli sudo /tmp/ssm/ssm-setup-cli -register -activation-code "activation-code" -activation- id "activation-id" -region "region" • Using Snap packages You don't need to specify a URL for the download, because the snap command automatically downloads the agent from the Snap app store at https://snapcraft.io. On Ubuntu Server 20.10 STR & 20.04, 18.04, and 16.04 LTS, SSM Agent installer files, including agent binaries and config files, are stored in the following directory: /snap/amazon-ssm- agent/current/. If you make changes to any configuration files in this directory, then you Install SSM Agent on hybrid Linux nodes 52 AWS Systems Manager User Guide must copy these files from the /snap directory to the /etc/amazon/ssm/ directory. Log and library files haven't changed (/var/lib/amazon/ssm, /var/log/amazon/ssm). sudo snap install amazon-ssm-agent --classic sudo systemctl stop snap.amazon-ssm-agent.amazon-ssm-agent.service sudo /snap/amazon-ssm-agent/current/amazon-ssm-agent -register -code "activation- code" -id "activation-id" -region "region" sudo systemctl start snap.amazon-ssm-agent.amazon-ssm-agent.service Important The candidate channel in the Snap store contains the latest version of SSM Agent; not the stable channel. If you want to track SSM Agent version information on the candidate channel, run the following command on your Ubuntu Server 18.04 and 16.04 LTS 64-bit managed nodes. sudo snap switch --channel=candidate amazon-ssm-agent The command downloads and installs SSM Agent onto the hybrid-activated machine in your hybrid and multicloud environment. The command stops SSM Agent, and then registers the machine with the Systems Manager service. The machine is now a managed node. Amazon EC2 instances configured for Systems Manager are also managed nodes. In the Systems Manager console, however, your hybrid-activated nodes are distinguished from Amazon EC2 instances with the prefix "mi-". Continue to Install SSM Agent on hybrid Windows Server nodes. Setting up private key auto rotation To strengthen your security posture, you can configure AWS Systems Manager Agent (SSM Agent) to automatically rotate the private key for your hybrid and multicloud environment. You can access this feature using SSM Agent version 3.0.1031.0 or later. Turn on this feature using the following procedure. To configure SSM Agent to rotate the private key for a hybrid and multicloud environment 1. Navigate to /etc/amazon/ssm/ on a Linux machine or C:\Program Files\Amazon\SSM for a Windows machine. Install SSM Agent on hybrid Linux nodes 53 AWS Systems Manager User Guide 2. Copy the contents of amazon-ssm-agent.json.template to a new file named amazon- ssm-agent.json. Save amazon-ssm-agent.json in the same directory where amazon- ssm-agent.json.template is located. 3. Find Profile, KeyAutoRotateDays. Enter the number of days that you want between automatic private key rotations. 4. Restart SSM Agent. Every time you change the configuration, restart SSM Agent. You can customize other features of SSM Agent using the same procedure. For an up-to-date list of the available configuration properties and their default values, see Config Property Definitions. Deregister and reregister a managed node (Linux) You can deregister a hybrid-activated managed node by calling the DeregisterManagedInstance API operation from either the AWS CLI or Tools for Windows PowerShell. Here's an example CLI command: aws ssm deregister-managed-instance --instance-id "mi-1234567890" To remove the remaining registration information for
systems-manager-ug-022
systems-manager-ug.pdf
22
number of days that you want between automatic private key rotations. 4. Restart SSM Agent. Every time you change the configuration, restart SSM Agent. You can customize other features of SSM Agent using the same procedure. For an up-to-date list of the available configuration properties and their default values, see Config Property Definitions. Deregister and reregister a managed node (Linux) You can deregister a hybrid-activated managed node by calling the DeregisterManagedInstance API operation from either the AWS CLI or Tools for Windows PowerShell. Here's an example CLI command: aws ssm deregister-managed-instance --instance-id "mi-1234567890" To remove the remaining registration information for the agent, remove the IdentityConsumptionOrder key in the amazon-ssm-agent.json file. Then, depending on your installation type, run one of the following commands. On Ubuntu Server nodes where SSM Agent was installed using Snap packages: sudo /snap/amazon-ssm-agent/current/amazon-ssm-agent -register -clear On all other Linux installations: amazon-ssm-agent -register -clear To reregister a managed node on a non-EC2 Linux machine You can reregister a machine after you deregister it. However, you must use a different Activation Code and Activation ID than were used previously to register the machine. 1. Connect to your machine. Install SSM Agent on hybrid Linux nodes 54 AWS Systems Manager User Guide 2. Run the following command. Be sure to replace the placeholder values with the Activation Code and Activation ID generated when you create a managed-node activation, and with the identifier of the Region you want to download the SSM Agent from. echo "yes" | sudo /tmp/ssm/ssm-setup-cli -register -activation-code "activation- code" -activation-id "activation-id" -region "region Troubleshooting SSM Agent installation on non-EC2 Linux machines Use the following information to help you troubleshoot problems installing SSM Agent on hybrid- activated Linux machines in a hybrid and multicloud environment. You receive DeliveryTimedOut error Problem: While configuring a machine in one AWS account as a managed node for a separate AWS account, you receive DeliveryTimedOut after running the commands to install SSM Agent on the target machine. Solution: DeliveryTimedOut is the expected response code for this scenario. The command to install SSM Agent on the target node changes the node ID of the source node. Because the node ID has changed, the source node isn't able to reply to the target node that the command failed, completed, or timed out while executing. Unable to load node associations Problem: After running the install commands, you see the following error in the SSM Agent error logs: Unable to load instance associations, unable to retrieve associations unable to retrieve associations error occurred in RequestManagedInstanceRoleToken: MachineFingerprintDoesNotMatch: Fingerprint doesn't match You see this error when the machine ID doesn't persist after a reboot. Solution: To solve this problem, run the following command. This command forces the machine ID to persist after a reboot. umount /etc/machine-id systemd-machine-id-setup Install SSM Agent on hybrid Linux nodes 55 AWS Systems Manager User Guide Install SSM Agent on hybrid Windows Server nodes This topic describes how to install AWS Systems Manager SSM Agent on Windows Server machines in a hybrid and multicloud environment. For information about installing SSM Agent on EC2 instances for Windows Server, see Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server. Before you begin, locate the Activation Code and Activation ID that were generated during the hybrid activation process, as described in Create a hybrid activation to register nodes with Systems Manager. You specify the Code and ID in the following procedure. To install SSM Agent on non-EC2 Windows Server machines in a hybrid and multicloud environment 1. 2. Log on to a server or VM in your hybrid and multicloud environment. If you use an HTTP or HTTPS proxy, you must set the http_proxy or https_proxy environment variables in the current shell session. If you aren't using a proxy, you can skip this step. For an HTTP proxy server, set this variable: http_proxy=http://hostname:port https_proxy=http://hostname:port For an HTTPS proxy server, set this variable: http_proxy=http://hostname:port https_proxy=https://hostname:port 3. Open Windows PowerShell in elevated (administrative) mode. 4. Copy and paste the following command block into Windows PowerShell. Replace each example resource placeholder with your own information. For example, the Activation Code and Activation ID generated when you create a hybrid activation, and with the identifier of the AWS Region you want to download SSM Agent from. Important Note the following important details: Install SSM Agent on hybrid Windows Server nodes 56 AWS Systems Manager User Guide • Using ssm-setup-cli for non-EC2 installations maximizes the security of your Systems Manager installation and configuration. • ssm-setup-cli supports a manifest-url option that determines the source where the agent is downloaded from. Don't specify a value for this option unless required by your organization. • You can use the script provided here to validate the signature of ssm-setup-cli. • When registering instances, only use the provided download link provided for ssm- setup-cli. ssm-setup-cli
systems-manager-ug-023
systems-manager-ug.pdf
23
you want to download SSM Agent from. Important Note the following important details: Install SSM Agent on hybrid Windows Server nodes 56 AWS Systems Manager User Guide • Using ssm-setup-cli for non-EC2 installations maximizes the security of your Systems Manager installation and configuration. • ssm-setup-cli supports a manifest-url option that determines the source where the agent is downloaded from. Don't specify a value for this option unless required by your organization. • You can use the script provided here to validate the signature of ssm-setup-cli. • When registering instances, only use the provided download link provided for ssm- setup-cli. ssm-setup-cli shouldn’t be stored separately for future use. region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. Additionally, ssm-setup-cli includes the following options: • version - Valid values are latest and stable. • downgrade - Reverts the agent to an earlier version. • skip-signature-validation - Skips the signature validation during the download and installation of the agent. 64-bit [System.Net.ServicePointManager]::SecurityProtocol = 'TLS12' $code = "activation-code" $id = "activation-id" $region = "us-east-1" $dir = $env:TEMP + "\ssm" New-Item -ItemType directory -Path $dir -Force cd $dir (New-Object System.Net.WebClient).DownloadFile("https://amazon-ssm-$region.s3. $region.amazonaws.com/latest/windows_amd64/ssm-setup-cli.exe", $dir + "\ssm- setup-cli.exe") ./ssm-setup-cli.exe -register -activation-code="$code" -activation-id="$id" - region="$region" Get-Content ($env:ProgramData + "\Amazon\SSM\InstanceData\registration") Install SSM Agent on hybrid Windows Server nodes 57 AWS Systems Manager User Guide Get-Service -Name "AmazonSSMAgent" 32-bit "[System.Net.ServicePointManager]::SecurityProtocol = 'TLS12'" $code = "activation-code" $id = "activation-id" $region = "us-east-1" $dir = $env:TEMP + "\ssm" New-Item -ItemType directory -Path $dir -Force cd $dir (New-Object System.Net.WebClient).DownloadFile("https://amazon-ssm-$region.s3. $region.amazonaws.com/latest/windows_386/ssm-setup-cli.exe", $dir + "\ssm-setup- cli.exe") ./ssm-setup-cli.exe -register -activation-code="$code" -activation-id="$id" - region="$region" Get-Content ($env:ProgramData + "\Amazon\SSM\InstanceData\registration") Get-Service -Name "AmazonSSMAgent" 5. Press Enter. Note If the command fails, verify that you are running the latest version of AWS Tools for PowerShell. The command does the following: • Downloads and installs SSM Agent onto the machine. • Registers the machine with the Systems Manager service. • Returns a response to the request similar to the following: Directory: C:\Users\ADMINI~1\AppData\Local\Temp\2 Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 07/07/2018 8:07 PM ssm Install SSM Agent on hybrid Windows Server nodes 58 AWS Systems Manager User Guide {"ManagedInstanceID":"mi-008d36be46EXAMPLE","Region":"us-east-2"} Status : Running Name : AmazonSSMAgent DisplayName : Amazon SSM Agent The machine is now a managed node. These managed nodes are now identified with the prefix "mi-". You can view managed nodes on the Managed node page in Fleet Manager, by using the AWS CLI command describe-instance-information, or by using the API command DescribeInstanceInformation. Setting up private key auto rotation To strengthen your security posture, you can configure AWS Systems Manager Agent (SSM Agent) to automatically rotate the private key for a hybrid and multicloud environment. You can access this feature using SSM Agent version 3.0.1031.0 or later. Turn on this feature using the following procedure. To configure SSM Agent to rotate the private key for a hybrid and multicloud environment 1. Navigate to /etc/amazon/ssm/ on a Linux machine or C:\Program Files\Amazon\SSM for a Windows Server machine. 2. Copy the contents of amazon-ssm-agent.json.template to a new file named amazon- ssm-agent.json. Save amazon-ssm-agent.json in the same directory where amazon- ssm-agent.json.template is located. 3. Find Profile, KeyAutoRotateDays. Enter the number of days that you want between automatic private key rotations. 4. Restart SSM Agent. Every time you change the configuration, restart SSM Agent. You can customize other features of SSM Agent using the same procedure. For an up-to-date list of the available configuration properties and their default values, see Config Property Definitions. Deregister and reregister a managed node (Windows Server) You can deregister a managed node by calling the DeregisterManagedInstance API operation from either the AWS CLI or Tools for Windows PowerShell. Here's an example CLI command: Install SSM Agent on hybrid Windows Server nodes 59 AWS Systems Manager User Guide aws ssm deregister-managed-instance --instance-id "mi-1234567890" To remove the remaining registration information for the agent, remove the IdentityConsumptionOrder key in the amazon-ssm-agent.json file. Then run the following command: amazon-ssm-agent -register -clear To reregister a managed node on a Windows Server hybrid machine You can reregister a machine after you deregister it. However, you must use a different Activation Code and Activation ID than were used previously to register the machine. 1. Connect to your machine. 2. Run the following command. Be sure to replace the placeholder values with the Activation Code and Activation ID generated when you create a hybrid activation, and with the identifier of the Region you want to download the SSM Agent from. 'yes' | & Start-Process ./ssm-setup-cli.exe -ArgumentList @("-register", "- activation-code=$code", "-activation-id=$id", "-region=$region") -Wait Get-Content ($env:ProgramData + "\Amazon\SSM\InstanceData\registration") Get-Service -Name "AmazonSSMAgent" Managing edge devices with Systems Manager This section describes the setup tasks that
systems-manager-ug-024
systems-manager-ug.pdf
24
you deregister it. However, you must use a different Activation Code and Activation ID than were used previously to register the machine. 1. Connect to your machine. 2. Run the following command. Be sure to replace the placeholder values with the Activation Code and Activation ID generated when you create a hybrid activation, and with the identifier of the Region you want to download the SSM Agent from. 'yes' | & Start-Process ./ssm-setup-cli.exe -ArgumentList @("-register", "- activation-code=$code", "-activation-id=$id", "-region=$region") -Wait Get-Content ($env:ProgramData + "\Amazon\SSM\InstanceData\registration") Get-Service -Name "AmazonSSMAgent" Managing edge devices with Systems Manager This section describes the setup tasks that account and system administrators perform to enable configuration and management of AWS IoT Greengrass core devices. After you complete these tasks, users who have been granted permissions by the AWS account administrator can use AWS Systems Manager to configure and manage their organization's AWS IoT Greengrass core devices. Note • SSM Agent for AWS IoT Greengrass isn't supported on macOS and Windows 10. You can't use Systems Manager tools to manage and configure edge devices that use these operating systems. • Systems Manager also supports edge devices that aren't configured as AWS IoT Greengrass core devices. To use Systems Manager to manage AWS IoT Core devices and non-AWS edge devices, you must configure them using a hybrid activation. For more Managing edge devices with Systems Manager 60 AWS Systems Manager User Guide information, see Managing nodes in hybrid and multicloud environments with Systems Manager. • To use Session Manager and Microsoft application patching with your edge devices, you must enable the advanced-instances tier. For more information, see Turning on the advanced-instances tier. Before you begin Verify that your edge devices meet the following requirements. • Your edge devices must meet the requirements to be configured as AWS IoT Greengrass core devices. For more information, see Setting up AWS IoT Greengrass core devices in the AWS IoT Greengrass Version 2 Developer Guide. • Your edge devices must be compatible with AWS Systems Manager Agent (SSM Agent). For more information, see Supported operating systems for Systems Manager. • Your edge devices must be able to communicate with the Systems Manager service in the cloud. Systems Manager doesn't support disconnected edge devices. About setting up edge devices Setting up AWS IoT Greengrass devices for Systems Manager involves the following processes. Note For information about uninstalling SSM Agent from an edge device, see Uninstall the AWS Systems Manager Agent in the AWS IoT Greengrass Version 2 Developer Guide. Create an IAM service role for your edge devices AWS IoT Greengrass core devices require an AWS Identity and Access Management (IAM) service role to communicate with AWS Systems Manager. The role grants AWS Security Token Service (AWS STS) AssumeRole trust to the Systems Manager service. You only need to create the service role once for each AWS account. You will specify this role for the RegistrationRole parameter when you configure and deploy the SSM Agent component to your AWS IoT Greengrass devices. If you already created this role while setting up non-EC2 nodes for a hybrid and multicloud environment, you can skip this step. Create an IAM service role for your edge devices 61 AWS Systems Manager Note User Guide Users in your company or organization who will use Systems Manager on your edge devices must be granted permission in IAM to call the Systems Manager API. S3 bucket policy requirement If either of the following cases are true, you must create a custom IAM permission policy for Amazon Simple Storage Service (Amazon S3) buckets before completing this procedure: • Case 1: You're using a VPC endpoint to privately connect your VPC to supported AWS services and VPC endpoint services powered by AWS PrivateLink. • Case 2: You plan to use an S3 bucket that you create as part of your Systems Manager operations, such as for storing output for Run Command commands or Session Manager sessions to an S3 bucket. Before proceeding, follow the steps in Create a custom S3 bucket policy for an instance profile. The information about S3 bucket policies in that topic also applies to your service role. Note If your devices are protected by a firewall and you plan to use Patch Manager, the firewall must allow access to the patch baseline endpoint arn:aws:s3:::patch-baseline- snapshot-region/*. region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. AWS CLI To create an IAM service role for an AWS IoT Greengrass environment (AWS CLI) 1. Install and configure the AWS Command Line Interface (AWS CLI), if you haven't already. For information, see Installing or updating the latest version
systems-manager-ug-025
systems-manager-ug.pdf
25
use Patch Manager, the firewall must allow access to the patch baseline endpoint arn:aws:s3:::patch-baseline- snapshot-region/*. region represents the identifier for an AWS Region supported by AWS Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference. AWS CLI To create an IAM service role for an AWS IoT Greengrass environment (AWS CLI) 1. Install and configure the AWS Command Line Interface (AWS CLI), if you haven't already. For information, see Installing or updating the latest version of the AWS CLI. Create an IAM service role for your edge devices 62 AWS Systems Manager User Guide 2. On your local machine, create a text file with a name such as SSMService-Trust.json with the following trust policy. Make sure to save the file with the .json file extension. Note Make a note of the name. You will specify it when you deploy SSM Agent to your AWS IoT Greengrass core devices. { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } } 3. Open the AWS CLI, and in the directory where you created the JSON file, run the create- role command to create the service role. Replace each example resource placeholder with your own information. Linux & macOS aws iam create-role \ --role-name SSMServiceRole \ --assume-role-policy-document file://SSMService-Trust.json Windows aws iam create-role ^ --role-name SSMServiceRole ^ --assume-role-policy-document file://SSMService-Trust.json 4. Run the attach-role-policy command as follows to allow the service role you just created to create a session token. The session token gives your edge devices permission to run commands using Systems Manager. Create an IAM service role for your edge devices 63 AWS Systems Manager User Guide Note The policies you add for a service profile for edge devices are the same policies used to create an instance profile for Amazon Elastic Compute Cloud (Amazon EC2) instances. For more information about the IAM policies used in the following commands, see Configure instance permissions required for Systems Manager. (Required) Run the following command to allow an edge device to use AWS Systems Manager service core functionality. Linux & macOS aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore Windows aws iam attach-role-policy ^ --role-name SSMServiceRole ^ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore If you created a custom S3 bucket policy for your service role, run the following command to allow AWS Systems Manager Agent (SSM Agent) to access the buckets you specified in the policy. Replace account_ID and my_bucket_policy_name with your AWS account ID and your bucket name. Linux & macOS aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::account_ID:policy/my_bucket_policy_name Windows aws iam attach-role-policy ^ --role-name SSMServiceRole ^ Create an IAM service role for your edge devices 64 AWS Systems Manager User Guide --policy-arn arn:aws:iam::account_id:policy/my_bucket_policy_name (Optional) Run the following command to allow SSM Agent to access AWS Directory Service on your behalf for requests to join the domain from edge devices. The service role needs this policy only if you join your edge devices to a Microsoft AD directory. Linux & macOS aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::aws:policy/AmazonSSMDirectoryServiceAccess Windows aws iam attach-role-policy ^ --role-name SSMServiceRole ^ --policy-arn arn:aws:iam::aws:policy/AmazonSSMDirectoryServiceAccess (Optional) Run the following command to allow the CloudWatch agent to run on your edge devices. This command makes it possible to read information on a device and write it to CloudWatch. Your service role needs this policy only if you will use services such as Amazon EventBridge or Amazon CloudWatch Logs. aws iam attach-role-policy \ --role-name SSMServiceRole \ --policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy Tools for PowerShell To create an IAM service role for an AWS IoT Greengrass environment (AWS Tools for Windows PowerShell) 1. Install and configure the AWS Tools for PowerShell (Tools for Windows PowerShell), if you haven't already. For information, see Installing the AWS Tools for PowerShell. 2. On your local machine, create a text file with a name such as SSMService-Trust.json with the following trust policy. Make sure to save the file with the .json file extension. Create an IAM service role for your edge devices 65 AWS Systems Manager User Guide Note Make a note of the name. You will specify it when you deploy SSM Agent to your AWS IoT Greengrass core devices. { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } } 3. Open PowerShell in administrative mode, and in the directory where you created the JSON file, run New-IAMRole as follows to create a service role. New-IAMRole ` -RoleName SSMServiceRole ` -AssumeRolePolicyDocument (Get-Content -raw SSMService-Trust.json) 4. Use Register-IAMRolePolicy as follows to allow the service role you created to create a session token. The session token gives your edge devices permission to run commands using Systems Manager. Note The policies you add for a service role for
systems-manager-ug-026
systems-manager-ug.pdf
26
SSM Agent to your AWS IoT Greengrass core devices. { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole" } } 3. Open PowerShell in administrative mode, and in the directory where you created the JSON file, run New-IAMRole as follows to create a service role. New-IAMRole ` -RoleName SSMServiceRole ` -AssumeRolePolicyDocument (Get-Content -raw SSMService-Trust.json) 4. Use Register-IAMRolePolicy as follows to allow the service role you created to create a session token. The session token gives your edge devices permission to run commands using Systems Manager. Note The policies you add for a service role for edge devices in an AWS IoT Greengrass environment are the same policies used to create an instance profile for EC2 instances. For more information about the AWS policies used in the following commands, see Configure instance permissions required for Systems Manager. (Required) Run the following command to allow an edge device to use AWS Systems Manager service core functionality. Create an IAM service role for your edge devices 66 AWS Systems Manager User Guide Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore If you created a custom S3 bucket policy for your service role, run the following command to allow SSM Agent to access the buckets you specified in the policy. Replace account_ID and my_bucket_policy_name with your AWS account ID and your bucket name. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::account_ID:policy/my_bucket_policy_name (Optional) Run the following command to allow SSM Agent to access AWS Directory Service on your behalf for requests to join the domain from edge devices. The service role needs this policy only if you join your edge devices to a Microsoft AD directory. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::aws:policy/AmazonSSMDirectoryServiceAccess (Optional) Run the following command to allow the CloudWatch agent to run on your edge devices. This command makes it possible to read information on a device and write it to CloudWatch. Your service role needs this policy only if you will use services such as Amazon EventBridge or Amazon CloudWatch Logs. Register-IAMRolePolicy ` -RoleName SSMServiceRole ` -PolicyArn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy Configure your edge devices for AWS IoT Greengrass Set up your edge devices as AWS IoT Greengrass core devices. The setup process involves verifying supported operating systems and system requirements, as well as installing and configuring the AWS IoT Greengrass Core software on your devices. For more information, see Setting up AWS IoT Greengrass core devices in the AWS IoT Greengrass Version 2 Developer Guide. Configure your edge devices for AWS IoT Greengrass 67 AWS Systems Manager User Guide Update the AWS IoT Greengrass token exchange role and install SSM Agent on your edge devices The final step for setting up and configuring your AWS IoT Greengrass core devices for Systems Manager requires you to update the AWS IoT Greengrass AWS Identity and Access Management (IAM) device service role, also called the token exchange role, and deploy AWS Systems Manager Agent (SSM Agent) to your AWS IoT Greengrass devices. For information about these processes, see Install the AWS Systems Manager Agent in the AWS IoT Greengrass Version 2 Developer Guide. After you deploy SSM Agent to your devices, AWS IoT Greengrass automatically registers your devices with Systems Manager. No additional registration is necessary. You can begin using Systems Manager tools to access, manage, and configure your AWS IoT Greengrass devices. Note Your edge devices must be able to communicate with the Systems Manager service in the cloud. Systems Manager doesn't support disconnected edge devices. Creating an AWS Organizations delegated administrator for Systems Manager When you set up an organization in AWS Organizations, you assign a management account to perform all administrative tasks for all AWS services. The management account user can assign a delegated administrator account only for Systems Manager to perform administrative tasks for Change Manager, Explorer, and OpsCenter. AWS Organizations is an account management service that you can use to create an organization and assign AWS accounts to manage these accounts centrally. For information about AWS Organizations, see AWS Organizations in the AWS Organizations User Guide. Change Manager, Explorer, and OpsCenter, tools in AWS Systems Manager, work with AWS Organizations to perform tasks on all member accounts of your organization. You can assign only one delegated administrator for all Systems Manager tools. The delegated administrator account must be a member of the organization to which it's assigned. Topics • Using a delegated administrator with Change Manager Update the AWS IoT Greengrass token exchange role and install SSM Agent on your edge devices 68 AWS Systems Manager User Guide • Using a delegated administrator with Explorer • Using a delegated administrator with OpsCenter • Using a delegated administrator with Quick Setup Using a delegated administrator with Change Manager Change Manager is an enterprise change management framework for requesting, approving, implementing, and reporting on operational changes to your application configuration
systems-manager-ug-027
systems-manager-ug.pdf
27
all Systems Manager tools. The delegated administrator account must be a member of the organization to which it's assigned. Topics • Using a delegated administrator with Change Manager Update the AWS IoT Greengrass token exchange role and install SSM Agent on your edge devices 68 AWS Systems Manager User Guide • Using a delegated administrator with Explorer • Using a delegated administrator with OpsCenter • Using a delegated administrator with Quick Setup Using a delegated administrator with Change Manager Change Manager is an enterprise change management framework for requesting, approving, implementing, and reporting on operational changes to your application configuration and infrastructure. If you use Change Manager across an organization, assign a delegated administrator account to manage change templates, approvals, and reporting for all member accounts. Using Quick Setup, you can set up Change Manager to use with an organization and select the delegated administrator account. If you use Change Manager with a single AWS account, the delegated administrator account isn't required. By default, Change Manager displays all change-related tasks in the delegated administrator account. For instructions on configuring a delegated administrator while setting up Change Manager for an organization, see Setting up Change Manager for an organization (management account). Important If you use Change Manager across an organization, we recommend always making changes from the delegated administrator account. Although you can make changes from other accounts in the organization, those changes won't be reported in or viewable from the delegated administrator account. Using a delegated administrator with Explorer Explorer is a customizable operations dashboard that reports aggregated view of operations data (OpsData) for your AWS accounts, across AWS Regions. You can configure a delegated administrator account for Systems Manager to aggregate Explorer data from multiple Regions and accounts by using resource data sync with AWS Organizations. A delegated administrator can search, filter, and aggregate Explorer data using the AWS Using a delegated administrator with Change Manager 69 AWS Systems Manager User Guide Management Console, the AWS Command Line Interface (AWS CLI), or AWS Tools for Windows PowerShell. When you use a delegated administrator account for Explorer, you limit the number of administrators who can create or delete multi-account and Region resource data syncs to an individual AWS account. You can synchronize operations data across all AWS accounts in your organization by using Explorer. For information on how to assign a delegated administrator from Explorer, see Configuring a delegated administrator for Explorer. Using a delegated administrator with OpsCenter OpsCenter provides a central location where operations engineers and IT professionals can manage operational work items (OpsItems) related to AWS resources. If you want to use OpsCenter to manage OpsItems centrally across accounts, you must set up the organization in AWS Organizations. Using Quick Setup for OpsCenter, you can assign a delegated administrator account and configure OpsCenter to manage OpsItems centrally. For more information, see (Optional) Configure OpsCenter to manage OpsItems across accounts by using Quick Setup. Using a delegated administrator with Quick Setup Quick Setup is a tool in Systems Manager that helps you to quickly configure frequently used AWS services and features with recommended best practices. You can configure a delegated administrator account for Quick Setup to help you deploy and manage configurations across accounts and Regions using AWS Organizations. A delegated administrator for Quick Setup can create, update, view, and delete configuration manager resources in your organization. Systems Manager registers a delegated administrator for Quick Setup as part of the setup process for the integrated console experience. For more information, see Setting up Systems Manager unified console for an organization. General setup for AWS Systems Manager If you haven't already done so, sign up for an AWS account and create an administrative user. Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. Using a delegated administrator with OpsCenter 70 AWS Systems Manager To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. User Guide Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so
systems-manager-ug-028
systems-manager-ug.pdf
28
access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks. Secure your AWS account root user 1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password. For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide. 2. Turn on multi-factor authentication (MFA) for your root user. For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide. Create a user with administrative access 1. Enable IAM Identity Center. Create a user with administrative access 71 AWS Systems Manager User Guide For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide. 2. In IAM Identity Center, grant administrative access to a user. For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide. Sign in as the user with administrative access • To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user. For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide. Assign access to additional users 1. In IAM Identity Center, create a permission set that follows the best practice of applying least- privilege permissions. For instructions, see Create a permission set in the AWS IAM Identity Center User Guide. 2. Assign users to a group, and then assign single sign-on access to the group. For instructions, see Add groups in the AWS IAM Identity Center User Guide. Create a user with administrative access 72 AWS Systems Manager User Guide Setting up AWS Systems Manager The following topics describe how to set up the unified AWS Systems Manager console for AWS Organizations organizations and single AWS accounts. Topics • Setting up Systems Manager console access • Setting up Systems Manager unified console for an organization • Setting up Systems Manager unified console for a single account and Region • Disabling the Systems Manager unified console Setting up Systems Manager console access To use AWS Systems Manager in the AWS Management Console, you must have the correct permissions configured. For more information about how to create AWS Identity and Access Management policies and attach them to IAM identities, see Create IAM policies in the IAM User Guide Systems Manager onboarding policy You can create an IAM policy like the one shown in the following example, and attach the policy to your IAM identities. This policy grants full access to onboard to and configure Systems Manager. Permissions details This policy includes the following permissions. • ssm-quicksetup – Allows principals to access all AWS Systems Manager Quick Setup actions. • ssm – Allows principals access to Systems Manager Automation and Resource Explorer. • organizations – Allows principals to read an organization's structure in AWS Organizations, and manage delegated administrators when they are onboarding to Systems Manager as an organization. • cloudformation – Allows principals to manage their Quick Setup stacks. • iam – Allows principals to manage IAM roles and policies that are required for Systems Manager onboarding. Setting up Systems Manager console access 73 AWS Systems Manager User Guide { "Version": "2012-10-17", "Statement": [ { "Sid": "QuickSetupActions", "Effect": "Allow", "Action": [ "ssm-quicksetup:*" ], "Resource": "*" }, { "Sid": "SsmReadOnly", "Effect": "Allow", "Action": [ "ssm:DescribeAutomationExecutions", "ssm:GetAutomationExecution", "ssm:ListAssociations", "ssm:DescribeAssociation", "ssm:ListDocuments", "ssm:ListResourceDataSync", "ssm:DescribePatchBaselines", "ssm:GetPatchBaseline", "ssm:DescribeMaintenanceWindows", "ssm:DescribeMaintenanceWindowTasks" ], "Resource": "*" }, { "Sid": "SsmDocument", "Effect": "Allow", "Action": [ "ssm:GetDocument", "ssm:DescribeDocument" ], "Resource": [ "arn:aws:ssm:*:*:document/AWSQuickSetupType-*", "arn:aws:ssm:*:*:document/AWS-EnableExplorer" ] }, { "Sid": "SsmEnableExplorer", Systems Manager onboarding policy 74 AWS Systems Manager "Effect": "Allow", User Guide "Action": "ssm:StartAutomationExecution", "Resource": "arn:aws:ssm:*:*:automation-definition/AWS-EnableExplorer:*" }, { "Sid": "SsmExplorerRds", "Effect": "Allow", "Action": [ "ssm:GetOpsSummary", "ssm:CreateResourceDataSync", "ssm:UpdateResourceDataSync" ], "Resource": "arn:aws:ssm:*:*:resource-data-sync/AWS-QuickSetup-*" }, { "Sid": "OrgsReadOnly", "Effect": "Allow", "Action": [ "organizations:DescribeAccount", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators", "organizations:ListRoots", "organizations:ListParents", "organizations:ListOrganizationalUnitsForParent", "organizations:DescribeOrganizationalUnit", "organizations:ListAWSServiceAccessForOrganization" ], "Resource": "*" }, { "Sid": "OrgsAdministration", "Effect": "Allow", "Action": [ "organizations:EnableAWSServiceAccess", "organizations:RegisterDelegatedAdministrator", "organizations:DeregisterDelegatedAdministrator" ], "Resource": "*", "Condition": { "StringEquals":
systems-manager-ug-029
systems-manager-ug.pdf
29
[ "ssm:DescribeAutomationExecutions", "ssm:GetAutomationExecution", "ssm:ListAssociations", "ssm:DescribeAssociation", "ssm:ListDocuments", "ssm:ListResourceDataSync", "ssm:DescribePatchBaselines", "ssm:GetPatchBaseline", "ssm:DescribeMaintenanceWindows", "ssm:DescribeMaintenanceWindowTasks" ], "Resource": "*" }, { "Sid": "SsmDocument", "Effect": "Allow", "Action": [ "ssm:GetDocument", "ssm:DescribeDocument" ], "Resource": [ "arn:aws:ssm:*:*:document/AWSQuickSetupType-*", "arn:aws:ssm:*:*:document/AWS-EnableExplorer" ] }, { "Sid": "SsmEnableExplorer", Systems Manager onboarding policy 74 AWS Systems Manager "Effect": "Allow", User Guide "Action": "ssm:StartAutomationExecution", "Resource": "arn:aws:ssm:*:*:automation-definition/AWS-EnableExplorer:*" }, { "Sid": "SsmExplorerRds", "Effect": "Allow", "Action": [ "ssm:GetOpsSummary", "ssm:CreateResourceDataSync", "ssm:UpdateResourceDataSync" ], "Resource": "arn:aws:ssm:*:*:resource-data-sync/AWS-QuickSetup-*" }, { "Sid": "OrgsReadOnly", "Effect": "Allow", "Action": [ "organizations:DescribeAccount", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators", "organizations:ListRoots", "organizations:ListParents", "organizations:ListOrganizationalUnitsForParent", "organizations:DescribeOrganizationalUnit", "organizations:ListAWSServiceAccessForOrganization" ], "Resource": "*" }, { "Sid": "OrgsAdministration", "Effect": "Allow", "Action": [ "organizations:EnableAWSServiceAccess", "organizations:RegisterDelegatedAdministrator", "organizations:DeregisterDelegatedAdministrator" ], "Resource": "*", "Condition": { "StringEquals": { "organizations:ServicePrincipal": [ "ssm.amazonaws.com", "ssm-quicksetup.amazonaws.com", "member.org.stacksets.cloudformation.amazonaws.com", Systems Manager onboarding policy 75 AWS Systems Manager User Guide "resource-explorer-2.amazonaws.com" ] } } }, { "Sid": "CfnReadOnly", "Effect": "Allow", "Action": [ "cloudformation:ListStacks", "cloudformation:DescribeStacks", "cloudformation:ListStackSets", "cloudformation:DescribeOrganizationsAccess" ], "Resource": "*" }, { "Sid": "OrgCfnAccess", "Effect": "Allow", "Action": [ "cloudformation:ActivateOrganizationsAccess" ], "Resource": "*" }, { "Sid": "CfnStackActions", "Effect": "Allow", "Action": [ "cloudformation:CreateStack", "cloudformation:DeleteStack", "cloudformation:DescribeStackResources", "cloudformation:DescribeStackEvents", "cloudformation:GetTemplate", "cloudformation:RollbackStack", "cloudformation:TagResource", "cloudformation:UntagResource", "cloudformation:UpdateStack" ], "Resource": [ "arn:aws:cloudformation:*:*:stack/StackSet-AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:stack/AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:type/resource/*" ] }, Systems Manager onboarding policy 76 User Guide AWS Systems Manager { "Sid": "CfnStackSetActions", "Effect": "Allow", "Action": [ "cloudformation:CreateStackInstances", "cloudformation:CreateStackSet", "cloudformation:DeleteStackInstances", "cloudformation:DeleteStackSet", "cloudformation:DescribeStackInstance", "cloudformation:DetectStackSetDrift", "cloudformation:ListStackInstanceResourceDrifts", "cloudformation:DescribeStackSet", "cloudformation:DescribeStackSetOperation", "cloudformation:ListStackInstances", "cloudformation:ListStackSetOperations", "cloudformation:ListStackSetOperationResults", "cloudformation:TagResource", "cloudformation:UntagResource", "cloudformation:UpdateStackSet" ], "Resource": [ "arn:aws:cloudformation:*:*:stackset/AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:type/resource/*", "arn:aws:cloudformation:*:*:stackset-target/AWS-QuickSetup-*:*" ] }, { "Sid": "ValidationReadonlyActions", "Effect": "Allow", "Action": [ "iam:ListRoles", "iam:GetRole" ], "Resource": "*" }, { "Sid": "IamRolesMgmt", "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:DeleteRole", "iam:GetRole", "iam:AttachRolePolicy", "iam:DetachRolePolicy", Systems Manager onboarding policy 77 AWS Systems Manager User Guide "iam:GetRolePolicy", "iam:ListRolePolicies" ], "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-*" ] }, { "Sid": "IamPassRole", "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-*" ], "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com", "ssm-quicksetup.amazonaws.com", "cloudformation.amazonaws.com" ] } } }, { "Sid": "IamRolesPoliciesMgmt", "Effect": "Allow", "Action": [ "iam:AttachRolePolicy", "iam:DetachRolePolicy" ], "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-*" ], "Condition": { "ArnEquals": { "iam:PolicyARN": [ "arn:aws:iam::aws:policy/AWSSystemsManagerEnableExplorerExecutionPolicy", "arn:aws:iam::aws:policy/AWSQuickSetupSSMDeploymentRolePolicy" Systems Manager onboarding policy 78 User Guide AWS Systems Manager ] } } }, { "Sid": "CfnStackSetsSLR", "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole" ], "Resource": [ "arn:aws:iam::*:role/aws-service-role/stacksets.cloudformation.amazonaws.com/ AWSServiceRoleForCloudFormationStackSetsOrgAdmin", "arn:aws:iam::*:role/aws-service-role/ssm.amazonaws.com/ AWSServiceRoleForAmazonSSM", "arn:aws:iam::*:role/aws-service-role/accountdiscovery.ssm.amazonaws.com/ AWSServiceRoleForAmazonSSM_AccountDiscovery", "arn:aws:iam::*:role/aws-service-role/ssm-quicksetup.amazonaws.com/ AWSServiceRoleForSSMQuickSetup", "arn:aws:iam::*:role/aws-service-role/resource-explorer-2.amazonaws.com/ AWSServiceRoleForResourceExplorer" ] } ] } AWS Systems Manager console operator policy You can create an IAM policy like the one shown in the following example, and attach the policy to your IAM identities. This policy grants full access to operate Systems Manager, and allow Systems Manager to run Automation documents for diagnosis and remediation. Permissions details This policy includes the following permissions. • ssm – Allows principals to access all Systems Manager APIs. • ssm-quicksetup – Allows principals to manage their Quick Setup configurations. • ec2 – Allows Systems Manager to determine your enabled AWS Regions and Amazon EC2 instance status. • cloudformation – Allows principals to read their Quick Setup stacks. AWS Systems Manager console operator policy 79 AWS Systems Manager User Guide • organizations – Allows principals to read an organization's structure in AWS Organizations, and manage delegated administrators when they are onboarding to Systems Manager as an organization. • s3 – Allows principals to list and get objects in an Amazon S3 bucket for diagnosis, which is created during the Systems Manager onboarding process. • iam:PassRole – Allows principals to pass roles to be assumed to Systems Manager when they run automations for diagnosis and remediation of unmanaged nodes. • iam:GetRole – Allows principals to get specific role information for Quick Setup roles when they are working in Systems Manager. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:*", "ssm-quicksetup:*" ], "Resource": "*" }, { "Sid": "AllowEC2DescribeActions", "Effect": "Allow", "Action": [ "ec2:DescribeInstanceStatus", "ec2:DescribeInstances", "ec2:DescribeRegions" ], "Resource": "*" }, { "Sid": "CfnAccess", "Effect": "Allow", "Action": [ "cloudformation:ListStacks", "cloudformation:ListStackSets", "cloudformation:ListStackInstances", "cloudformation:ListStackSetOperations", "cloudformation:ListStackSetOperationResults", AWS Systems Manager console operator policy 80 AWS Systems Manager User Guide "cloudformation:DescribeStacks", "cloudformation:DescribeStackSet", "cloudformation:DescribeStackSetOperation", "cloudformation:DescribeOrganizationsAccess", "cloudformation:DescribeStackInstance", "cloudformation:DetectStackSetDrift", "cloudformation:ListStackInstanceResourceDrifts" ], "Resource": "*" }, { "Sid": "OrgsReadOnly", "Effect": "Allow", "Action": [ "organizations:DescribeAccount", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators", "organizations:ListRoots", "organizations:ListParents", "organizations:ListOrganizationalUnitsForParent", "organizations:DescribeOrganizationalUnit", "organizations:ListAWSServiceAccessForOrganization" ], "Resource": "*" }, { "Sid": "AllowKMSOperations", "Effect": "Allow", "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": "arn:aws:kms:*:*:key/*", "Condition": { "StringEquals": { "aws:ResourceTag/SystemsManagerManaged": "true" }, "ArnLike": { "kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::do-not-delete-ssm- diagnosis-*" }, "StringLike": { "kms:ViaService": "s3.*.amazonaws.com" }, AWS Systems Manager console operator policy 81 User Guide AWS Systems Manager "Bool": { "aws:ViaAWSService": "true" } } }, { "Sid": "AllowReadS3BucketFromOrganization", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::do-not-delete-ssm-diagnosis*", "Condition": { "StringEquals": { "aws:ResourceOrgId": "${aws:PrincipalOrgId}" } } }, { "Sid": "AllowReadS3BucketFromSingleAccount", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::do-not-delete-ssm-diagnosis*", "Condition": { "StringEquals": { "aws:ResourceAccount": "${aws:PrincipalAccount}" } } }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": [ "arn:aws:iam::*:role/AWS-SSM-DiagnosisAdminRole*", "arn:aws:iam::*:role/AWS-SSM-DiagnosisExecutionRole*", "arn:aws:iam::*:role/AWS-SSM-RemediationAdminRole*", "arn:aws:iam::*:role/AWS-SSM-RemediationExecutionRole*" ], "Condition": { "StringEquals": { AWS Systems Manager console operator policy 82 AWS Systems Manager User Guide "iam:PassedToService": "ssm.amazonaws.com" } } }, { "Sid": "IamReadOnly", "Effect": "Allow", "Action": "iam:GetRole", "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-*" ] } ] } AWS Systems Manager console operator read-only policy You can create an IAM policy like
systems-manager-ug-030
systems-manager-ug.pdf
30
"Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::do-not-delete-ssm-diagnosis*", "Condition": { "StringEquals": { "aws:ResourceOrgId": "${aws:PrincipalOrgId}" } } }, { "Sid": "AllowReadS3BucketFromSingleAccount", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::do-not-delete-ssm-diagnosis*", "Condition": { "StringEquals": { "aws:ResourceAccount": "${aws:PrincipalAccount}" } } }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": [ "arn:aws:iam::*:role/AWS-SSM-DiagnosisAdminRole*", "arn:aws:iam::*:role/AWS-SSM-DiagnosisExecutionRole*", "arn:aws:iam::*:role/AWS-SSM-RemediationAdminRole*", "arn:aws:iam::*:role/AWS-SSM-RemediationExecutionRole*" ], "Condition": { "StringEquals": { AWS Systems Manager console operator policy 82 AWS Systems Manager User Guide "iam:PassedToService": "ssm.amazonaws.com" } } }, { "Sid": "IamReadOnly", "Effect": "Allow", "Action": "iam:GetRole", "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-*" ] } ] } AWS Systems Manager console operator read-only policy You can create an IAM policy like the one shown in the following example, and attach the policy to your IAM identities. This policy grants read-only access to use Systems Manager. • ssm – Allows principals access to Systems Manager read-only APIs. • ssm-quicksetup – Allows principals to read their Quick Setup configurations. • cloudformation – Allows principals to read their Quick Setup stacks. • iam:GetRole – Allows principals to get specific role information for Quick Setup roles when they are using Systems Manager. • ec2:DescribeRegions – Allows Systems Manager to determine your enabled AWS Regions. • organizations – Allows principals to read an organization's structure in AWS Organizations when they are onboarding to Systems Manager as an organization. • s3 – Allows principals to list and get objects in an Amazon S3 bucket that is created during the Systems Manager onboarding process. Permissions details This policy includes the following permissions. { "Version": "2012-10-17", "Statement": [ AWS Systems Manager console operator read-only policy 83 User Guide AWS Systems Manager { "Effect": "Allow", "Action": [ "ssm:Describe*", "ssm:Get*", "ssm:List*", "ssm-quicksetup:List*", "ssm-quicksetup:Get*", "cloudformation:Describe*", "cloudformation:Get*", "cloudformation:List*", "iam:GetRole", "ec2:DescribeRegions", "organizations:Describe*", "organizations:List*" ], "Resource": "*" }, { "Sid": "AllowKMSOperations", "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": "arn:aws:kms:*:*:key/*", "Condition": { "StringEquals": { "aws:ResourceTag/SystemsManagerManaged": "true" }, "ArnLike": { "kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::do-not-delete-ssm- diagnosis-*" }, "StringLike": { "kms:ViaService": "s3.*.amazonaws.com" }, "Bool": { "aws:ViaAWSService": "true" } } }, { "Effect": "Allow", "Action": [ AWS Systems Manager console operator read-only policy 84 AWS Systems Manager "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::do-not-delete-ssm-diagnosis*", "Condition": { "StringEquals": { "aws:ResourceOrgId": "${aws:PrincipalOrgId}" User Guide } } }, { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": "arn:aws:s3:::do-not-delete-ssm-diagnosis*", "Condition": { "StringEquals": { "aws:ResourceAccount": "${aws:PrincipalAccount}" } } } ] } Setting up Systems Manager unified console for an organization The setup process for the Systems Manager unified console experience is completed from the AWS Management Console with just a few clicks. To set up Systems Manager for an AWS Organizations organization, you must have access to the management account for your organization and another account in your organization to use as a delegated administrator. Access to the management account is only required to enable or disable Systems Manager. To manage your nodes, you'll use the delegated administrator account. Setting up Systems Manager unified console for an organization 85 AWS Systems Manager Prerequisites User Guide When managing nodes across an organization, Systems Manager uses various dependent services to set up and enhance the functionality of the unified console. As a result, Systems Manager must enable trusted access and register a delegated administrator account for the following services: • AWS CloudFormation - Deploys resources required for Systems Manager to your accounts. • AWS Resource Explorer - Searching and filtering EC2 instances in your accounts. • AWS Systems Manager Explorer - Monitoring and troubleshooting the health of resources deployed for Systems Manager in your accounts. • AWS Systems Manager Quick Setup - Deploys Quick Setup configurations required for Systems Manager to your accounts. Before you begin, make sure you're not already over the quota for delegated administrators for any of these dependent services. Otherwise, you won't be able to register the delegated administrator accounts necessary to enable Systems Manager. When you enable Systems Manager for an organization, every account in your organization is included. At this time, there is no provision for excluding accounts from the setting up process. When you enable Systems Manager, you can choose the AWS Regions you want to include. Only Regions that currently support the Systems Manager unified console can be selected. To learn more about the Regions where the console experience is available, see Supported AWS Regions. Unified console resources The setup process for the Systems Manager unified console completes many prerequisite tasks for you. Depending on the features you choose to configure, this includes enabling Default Host Management Configuration to provide the required IAM permissions to your nodes and more. The following is a detailed list of the resources created by Systems Manager for the unified console. Depending on the features you choose to configure, some resources might not be created. AWS Resource Explorer managed views • AWSManagedViewForSSM – Allows Systems Manager to access resource information indexed by Resource Explorer for your organization. These managed views can only be updated or deleted by Systems
systems-manager-ug-031
systems-manager-ug.pdf
31
Systems Manager unified console completes many prerequisite tasks for you. Depending on the features you choose to configure, this includes enabling Default Host Management Configuration to provide the required IAM permissions to your nodes and more. The following is a detailed list of the resources created by Systems Manager for the unified console. Depending on the features you choose to configure, some resources might not be created. AWS Resource Explorer managed views • AWSManagedViewForSSM – Allows Systems Manager to access resource information indexed by Resource Explorer for your organization. These managed views can only be updated or deleted by Systems Manager. This means that if you want to delete the managed views, or turn off Resource Explorer, you must disable the unified console. For more information about disabling Prerequisites 86 AWS Systems Manager User Guide the unified console, see Disabling the Systems Manager unified console. For more information about managed views, see AWS Managed Views in the Resource Explorer User Guide. Note If you've created an aggregator index for Resource Explorer in a Region different than your home Region, Systems Manager demotes the current index. Then, Systems Manager promotes the local index in your home Region as the new aggregator index. During this time, only nodes for your home Region are displayed. This process can take up to 24 hours to complete. IAM roles • RoleForOnboardingAutomation – Allows Systems Manager to manage resources during the setting up process. For more information about the policy, see AWSQuickSetupSSMManageResourcesExecutionPolicy. • RoleForLifecycleManagement – Allows Lambda to manage the lifecycle of resources created by the setting up process. For more information about the policy, see AWSQuickSetupSSMLifecycleManagementExecutionPolicy. • RoleForAutomation – A service role for Systems Manager Automation to assume to execute runbooks. For more information, see Create the service roles for Automation using the console. • AWSSSMDiagnosisAdminRole – An adminsitrative role used to start automations that use diagnosis runbooks. For more information about the policies, see AWS-SSM- DiagnosisAutomation-AdministrationRolePolicy, AWS-SSM-Automation-DiagnosisBucketPolicy, and AWS-SSM-DiagnosisAutomation-OperationalAccountAdministrationRolePolicy. • AWSSSMDiagnosisExecutionRole – An automation execution role for the diagnosis runbook. For more information about the policies, see AWS-SSM-DiagnosisAutomation- ExecutionRolePolicy and AWS-SSM-Automation-DiagnosisBucketPolicy. • AWSSSMRemediationAdminRole – An adminsitrative role used to start automations that use remediation runbooks. For more information about the policies, see AWS-SSM-RemediationAutomation-AdministrationRolePolicy, AWS-SSM- Automation-DiagnosisBucketPolicy, and AWS-SSM-RemediationAutomation- OperationalAccountAdministrationRolePolicy. Unified console resources 87 AWS Systems Manager User Guide • AWSSSMRemediationExecutionRole – An automation execution role for the remediation runbook. For more information about the policies, see AWS-SSM-RemediationAutomation- ExecutionRolePolicy and AWS-SSM-Automation-DiagnosisBucketPolicy. • ManagedInstanceCrossAccountManagementRole – Allows Systems Manager to gather managed node information across accounts. State Manager associations • EnableDHMCAssociation – Runs daily and ensures Default Host Management Configuration is enabled. • SystemAssociationForEnablingExplorer – Runs daily and ensures Explorer is enabled. Explorer is used to sync data from your managed nodes. • EnableAREXAssociation – Runs daily and ensures AWS Resource Explorer is enabled. Resource Explorer is used to determine which Amazon EC2 instances in your organization aren't managed by Systems Manager. • SSMAgentUpdateAssociation – Runs every 14 days and ensures the latest available version of SSM Agent is installed on your managed nodes. • SystemAssociationForInventoryCollection – Runs every 12 hours and collects inventory data from your managed nodes. S3 buckets • DiagnosisBucket – Stores data collected from the diagnosis runbook execution. Lambda functions • SSMLifecycleOperatorLambda – Allows principals to access all AWS Systems Manager Quick Setup actions. • SSMLifecycleResource – Custom resource to help manage the lifecycle of resources created by the setting up process. Additionally, after the setup process completes you can select the Diagnose and remediate node task to automatically apply fixes to nodes that aren't reporting as managed by Systems Manager. This can include identifying issues such as network connectivity issues to the Systems Manager endpoints, and more. For more information, see Diagnosing and remediating. Unified console resources 88 AWS Systems Manager User Guide Set up the unified console To set up Systems Manager for an organization 1. Log in to the management account for your organization. 2. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 3. Enter the ID of the account you want to register as a delegated administrator. 4. After the delegated administrator account is successfully registered, log in to the delegated administrator account you just registered and return to the Systems Manager console to finish 5. 6. 7. 8. setting up Systems Manager. Select Enable Systems Manager. In the Home Region section, you determine a Region where you want Systems Manager to aggregate your node data. By default, Systems Manager selects the Region you're currently using. To choose a different home Region, change the console to the Region you want to use before you set up Systems Manager. Node data is replicated across accounts and Regions for your organization and stored in the home Region. The Region you choose can't be changed after Systems Manager is set up. To
systems-manager-ug-032
systems-manager-ug.pdf
32
the Systems Manager console to finish 5. 6. 7. 8. setting up Systems Manager. Select Enable Systems Manager. In the Home Region section, you determine a Region where you want Systems Manager to aggregate your node data. By default, Systems Manager selects the Region you're currently using. To choose a different home Region, change the console to the Region you want to use before you set up Systems Manager. Node data is replicated across accounts and Regions for your organization and stored in the home Region. The Region you choose can't be changed after Systems Manager is set up. To use a different Region as the home Region for your organization, you must disable the unified console and complete the setup process again. If your organization uses IAM Identity Center, you must select the same Region where you set up IAM Identity Center as your home Region. In the Regions section, select the Regions where you want to enable Systems Manager. In the Feature configurations section, choose the options that you want to enable for your configuration: Enable Default Host Management Configuration (DHMC) Allows Systems Manager to configure DHMC. This feature allows Systems Manager to use an IAM role to ensure that all Amazon EC2 instances in the account and Region have the permissions necessary to be managed by Systems Manager. You can also specify the frequency of drift remediation. Configuration drift occurs whenever a user makes any change to a service or feature that conflicts with the selections made through your configuration. Systems Manager checks for configuration drift and attempts to remediate it based on the frequency you specify. You must specify a value between 1 and 31 days. If you've already configured DHMC in a Region, Systems Manager doesn't change the IAM role Set up the unified console 89 AWS Systems Manager User Guide you previously selected. For more information about DHMC, see Managing EC2 instances automatically with Default Host Management Configuration. DHMC makes it possible to manage Amazon EC2 instances without your having to manually create an AWS Identity and Access Management (IAM) instance profile. We encourage you to choose this option to ensure that your EC2 instances have the permissions necessary to be managed by Systems Manager. Enable inventory metadata collection Enables Systems Manager to configure collection of the following types of metadata from your nodes: • AWS components – EC2 driver, agents, versions, and more. • Applications – Application names, publishers, versions, and more. • Node details – System name, operating system (OS) name, OS version, last boot, DNS, domain, work group, OS architecture, and more. • Network configuration – IP address, MAC address, DNS, gateway, subnet mask, and more. • Services – Name, display name, status, dependent services, service type, start type, and more (Windows Server nodes only). • Windows roles – Name, display name, path, feature type, installed state, and more (Windows Server nodes only). • Windows updates – Hotfix ID, installed by, installed date, and more (Windows Server nodes only). Specify the frequency at which inventory is collected. You must specify a value between 1 and 744 hours. For more information about Inventory, a tool in AWS Systems Manager, see AWS Systems Manager Inventory. Enable automatic Systems Manager (SSM) Agent updates Enables Systems Manager to check for a new version of the agent at the frequency you specify. The value for the frequency must be between 1 and 31 days. If there is a new version, then Systems Manager automatically updates the agent on your managed node to the latest released version. Systems Manager doesn't install the agent on instances where it's not already present. For information about which AMIs have SSM Agent preinstalled, see Find AMIs with the SSM Agent preinstalled. Set up the unified console 90 AWS Systems Manager User Guide We encourage you to choose this option to ensure that your nodes are always running the most up-to-date version of SSM Agent. For more information about SSM Agent, including information about how to manually install the agent, see Working with SSM Agent. 9. Choose Submit. Depending on the size of your organization, it can take an extended amount of time to set up the Systems Manager unified console experience. Setting up Systems Manager unified console for a single account and Region To set up the Systems Manager unified console experience for a single AWS account and AWS Region you don't need to use Organizations or register a delegated administrator account. The setup process for the Systems Manager console experience completes many prerequisite tasks for you. Depending on the features you choose to configure, this includes enabling Default Host Management Configuration to provide the required IAM permissions to your nodes and more. The following is a detailed list of the resources created by Systems Manager for the unified console. Unified
systems-manager-ug-033
systems-manager-ug.pdf
33
Setting up Systems Manager unified console for a single account and Region To set up the Systems Manager unified console experience for a single AWS account and AWS Region you don't need to use Organizations or register a delegated administrator account. The setup process for the Systems Manager console experience completes many prerequisite tasks for you. Depending on the features you choose to configure, this includes enabling Default Host Management Configuration to provide the required IAM permissions to your nodes and more. The following is a detailed list of the resources created by Systems Manager for the unified console. Unified console resources Depending on the features you choose to configure, some resources might not be created. IAM roles • RoleForOnboardingAutomation – Allows Systems Manager to manage resources during the setting up process. For more information about the policy, see AWSQuickSetupSSMManageResourcesExecutionPolicy. • RoleForLifecycleManagement – Allows Lambda to manage the lifecycle of resources created by the setting up process. For more information about the policy, see AWSQuickSetupSSMLifecycleManagementExecutionPolicy. • RoleForAutomation – A service role for Systems Manager Automation to assume to execute runbooks. For more information, see Create the service roles for Automation using the console. • AWSSSMDiagnosisAdminRole – An automation execution role for the diagnosis runbook. For more information about the policies, see AWS-SSM-DiagnosisAutomation- AdministrationRolePolicy, AWS-SSM-Automation-DiagnosisBucketPolicy, and AWS-SSM- DiagnosisAutomation-OperationalAccountAdministrationRolePolicy. Setting up Systems Manager unified console for a single account and Region 91 AWS Systems Manager User Guide • AWSSSMRemediationAdminRole – An automation execution role for the remediation runbook. For more information about the policies, see AWS-SSM-RemediationAutomation- AdministrationRolePolicy, AWS-SSM-Automation-DiagnosisBucketPolicy, and AWS-SSM- RemediationAutomation-OperationalAccountAdministrationRolePolicy. • ManagedInstanceCrossAccountManagementRole – Allows Systems Manager to gather managed node information across accounts. State Manager associations • EnableDHMCAssociation – Runs daily and ensures Default Host Management Configuration is enabled. • SystemAssociationForEnablingExplorer – Runs daily and ensures Explorer is enabled. Explorer is used to sync data from your managed nodes. • EnableAREXAssociation – Runs daily and ensures AWS Resource Explorer is enabled. Resource Explorer is used to determine which Amazon EC2 instances in your organization aren't managed by Systems Manager. • SSMAgentUpdateAssociation – Runs every 14 days and ensures the latest available version of SSM Agent is installed on your managed nodes. • SystemAssociationForInventoryCollection – Runs every 12 hours and collects inventory data from your managed nodes. S3 buckets • DiagnosisBucket – Stores data collected from the diagnosis runbook execution. Lambda functions • SSMLifecycleOperatorLambda – Allows principals to access all AWS Systems Manager Quick Setup actions. • SSMLifecycleResource – Custom resource to help manage the lifecycle of resources created by the setting up process. Additionally, after the setup process completes you can select the Diagnose and remediate node task to automatically apply fixes to nodes that aren't reporting as managed by Systems Manager. Unified console resources 92 AWS Systems Manager User Guide This can include identifying issues such as network connectivity issues to the Systems Manager endpoints, and more. Set up the unified console To set up Systems Manager for a single account and Region 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. Select Enable Systems Manager. In the Feature configurations section, choose the options that you want to enable for your configuration: Enable Default Host Management Configuration (DHMC) Allows Systems Manager to configure DHMC. This feature allows Systems Manager to use an IAM role to ensure that all Amazon EC2 instances in the account and Region have the permissions necessary to be managed by Systems Manager. You can also specify the frequency of drift remediation. Configuration drift occurs whenever a user makes any change to a service or feature that conflicts with the selections made through your configuration. Systems Manager checks for configuration drift and attempts to remediate it based on the frequency you specify. You must specify a value between 1 and 31 days. If you've already configured DHMC in a Region, Systems Manager doesn't change the IAM role you previously selected. For more information about DHMC, see Managing EC2 instances automatically with Default Host Management Configuration. DHMC makes it possible to manage Amazon EC2 instances without your having to manually create an AWS Identity and Access Management (IAM) instance profile. We encourage you to choose this option to ensure that your EC2 instances have the permissions necessary to be managed by Systems Manager. Enable inventory metadata collection Enables Systems Manager to configure collection of the following types of metadata from your nodes: • AWS components – EC2 driver, agents, versions, and more. • Applications – Application names, publishers, versions, and more. Set up the unified console 93 AWS Systems Manager User Guide • Node details – System name, operating system (OS) name, OS version, last boot, DNS, domain, work group, OS architecture, and more. • Network configuration – IP address, MAC address, DNS, gateway, subnet mask, and more. • Services – Name, display name, status,
systems-manager-ug-034
systems-manager-ug.pdf
34
permissions necessary to be managed by Systems Manager. Enable inventory metadata collection Enables Systems Manager to configure collection of the following types of metadata from your nodes: • AWS components – EC2 driver, agents, versions, and more. • Applications – Application names, publishers, versions, and more. Set up the unified console 93 AWS Systems Manager User Guide • Node details – System name, operating system (OS) name, OS version, last boot, DNS, domain, work group, OS architecture, and more. • Network configuration – IP address, MAC address, DNS, gateway, subnet mask, and more. • Services – Name, display name, status, dependent services, service type, start type, and more (Windows Server nodes only). • Windows roles – Name, display name, path, feature type, installed state, and more (Windows Server nodes only). • Windows updates – Hotfix ID, installed by, installed date, and more (Windows Server nodes only). Specify the frequency at which inventory is collected. You must specify a value between 1 and 744 hours. For more information about Inventory, a tool in AWS Systems Manager, see AWS Systems Manager Inventory. Enable automatic Systems Manager (SSM) Agent updates Enables Systems Manager to check for a new version of the agent at the frequency you specify. The value for the frequency must be between 1 and 31 days. If there is a new version, then Systems Manager automatically updates the agent on your managed node to the latest released version. Systems Manager doesn't install the agent on instances where it's not already present. For information about which AMIs have SSM Agent preinstalled, see Find AMIs with the SSM Agent preinstalled. We encourage you to choose this option to ensure that your nodes are always running the most up-to-date version of SSM Agent. For more information about SSM Agent, including information about how to manually install the agent, see Working with SSM Agent. 4. Choose Submit. Disabling the Systems Manager unified console To disable the Systems Manager unified console for an organization, you'll need access to the account you registered as a delegated administrator for Systems Manager. After logging in to the delegated administrator account for your organization, you can disable the setup for your organization in the Settings section of the unified console. When you disable the unified console setup for your organization, Systems Manager deletes the resources created, including Resource Explorer managed views, during the setting up process. Disabling the setup for your organization Disabling the Systems Manager unified console 94 AWS Systems Manager User Guide doesn't revoke trusted access or deregister the delegated administrator accounts for dependent services. The following procedure describes how to disable the setup for the unified console. To disable the setup for the Systems Manager unified console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. Select Settings in the navigation pane. Select Disable. You must confirm that you want to disable the setup for your organization. This action deletes the resources created for the unified console and can't be undone. If you're unable to access the delegated administrator account for Systems Manager and want to disable the setup for the unified console, you can also do so from the management account for your organization. Using the AWS CLI or SDK, call the DeleteConfigurationManager API operation and pass the ManagerArn value for the organization setup in your account. The format for the manager ARN used to set up the unified console is as follows: arn:aws:ssm-quicksetup:account-id:configuration-manager/configuration- manager-id. Note If you don't know the value for configuration-manager-id, call the ListConfigurationManagers API action and filter the results using the AWSQuickSetupType-SSM type. Disabling the Systems Manager unified console 95 AWS Systems Manager User Guide Performing node management tasks with AWS Systems Manager The following topics describe how to complete common node tasks using the unified AWS Systems Manager console for an AWS Organizations organization and single AWS accounts. Topics • Reviewing node insights • Exploring nodes • Just-in-time node access using Systems Manager • Diagnosing and remediating • Adjusting Systems Manager settings Reviewing node insights You can gain insights into the overall status of managed nodes and unmanaged EC2 instances in your organization or account by using the unified Systems Manager console. Systems Manager provides a visual overview into your managed nodes and EC2 instances that are not yet managed by Systems Manager. (A managed node is any machine configured for use with Systems Manager in hybrid and multicloud environments. For information about supported machine types, see Supported machine types in hybrid and multicloud environments.) This overview is provided through individual report boxes, called widgets, which feature interactive pie charts and other graphics. Before you begin In order to review node insights, you must first onboard your organization or account to the unified Systems Manager console. For more information, see Setting up AWS Systems Manager. After onboarding,
systems-manager-ug-035
systems-manager-ug.pdf
35
overview into your managed nodes and EC2 instances that are not yet managed by Systems Manager. (A managed node is any machine configured for use with Systems Manager in hybrid and multicloud environments. For information about supported machine types, see Supported machine types in hybrid and multicloud environments.) This overview is provided through individual report boxes, called widgets, which feature interactive pie charts and other graphics. Before you begin In order to review node insights, you must first onboard your organization or account to the unified Systems Manager console. For more information, see Setting up AWS Systems Manager. After onboarding, open the Systems Manager console and choose Review node insights. The following image shows the individual report boxes, called widgets, which are available on the Review node insights page. Reviewing node insights 96 AWS Systems Manager User Guide The display supports widgets that provide you with the following information. Node summary Indicates how many EC2 instances in your organization or account aren't currently managed nodes, and how many managed nodes are in your organization's or account's fleet. What is an unmanaged instance? When you stop a managed EC2 instance, it is reported as "Unmanaged" in the Systems Manager console. This is expected behavior because SSM Agent doesn't have an active connection to the service. Note This is different from how AWS Config defines an instance as unmanaged. If an instance is currently stopped, AWS Config reports what the status of the instance was the last Reviewing node insights 97 AWS Systems Manager User Guide time a "heartbeat" connection was made between SSM Agent on the instance and the Systems Manager service. When the instance restarts, it automatically reconnects to the Systems Manager service, and its status in the unified console is restored to "Managed" within five minutes. No manual intervention is required, and all Systems Manager configurations for the instance are preserved during the Stop/Start cycle. However, if the instance is still not reported as "Managed" several minutes after starting, the instance is likely not properly configured for Systems Manager management. In this case, we recommend running a diagnosis to identify why the instance remains in an unmanaged state. For more information, see Diagnosing and remediating unmanaged Amazon EC2 instances in Systems Manager. If the diagnostic scan is not able to determine the issue, refer to the following topics to verify that the requirements for SSM Agent, AWS Identity and Access Management (IAM) roles, and Systems Manager prerequisites have all been met: • Troubleshooting SSM Agent • Configure instance permissions required for Systems Manager • Troubleshooting managed node availability Managed node types Indicates how many managed nodes in your fleet are EC2 instances and how many are other server types, including servers on your own premises (on-premises servers), AWS IoT Greengrass core devices, AWS IoT and non-AWS edge devices, and virtual machines (VMs), including VMs in other cloud environments. You can hover over the Node types graphic to access links to more details in the Explore nodes page. For more information about AWS support for hybrid and multicloud environments, see AWS Solutions for Hybrid and Multicloud. SSM Agent versions Provides information about installations of AWS Systems Manager Agent (SSM Agent) in your fleet. SSM Agent is Amazon software that runs on your managed nodes. SSM Agent makes it possible for Systems Manager to update, manage, and configure these resources. The agent processes requests from the Systems Manager service in the AWS Cloud, and then runs them as specified in the request. Reviewing node insights 98 AWS Systems Manager User Guide For managed nodes in your fleet, this widget reports on the SSM Agent versions in your fleet, from newest to oldest. You can hover over the SSM Agent versions graphic to access links to more details in the Explore nodes page. For more information about SSM Agent, see Working with SSM Agent. Managed node operating systems Provides a breakdown of the percentage of each operating system on managed nodes in your fleet. You can hover over the Managed nodes by operating systems graphic to access links to more details in the Explore nodes page. You can customize widget layout on the Review node insights page by using a drag-and-drop capability, and by removing and adding widgets to the display. Use information in the following topics to help you work with the Systems Manager node insights widgets. Topics • Adding or removing widgets from the Review node insights page • Rearranging widgets in the Review node insights page Adding or removing widgets from the Review node insights page You can customize the layout in the Systems Manager Review node insights page by adding and removing widgets. Note By default, the page displays all available widgets. To add or remove widgets from the Review node insights page 1. Open the AWS Systems
systems-manager-ug-036
systems-manager-ug.pdf
36
and by removing and adding widgets to the display. Use information in the following topics to help you work with the Systems Manager node insights widgets. Topics • Adding or removing widgets from the Review node insights page • Rearranging widgets in the Review node insights page Adding or removing widgets from the Review node insights page You can customize the layout in the Systems Manager Review node insights page by adding and removing widgets. Note By default, the page displays all available widgets. To add or remove widgets from the Review node insights page 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the left navigation, choose Review node insights. To remove a widget from the display, do the following: Adding or removing widgets 99 ) ) ) AWS Systems Manager User Guide a. Choose the More options menu ( for the widget. b. Choose Remove widget. 4. To add a widget to the display, do the following: a. b. Choose Add widgets. In the Add widgets pane, click and hold the drag handle ( of the widget to add to the display. c. Drag the widget and drop it into the main pane. Rearranging widgets in the Review node insights page You can customize the layout in the Review node insights page by rearranging widgets. To rearrange widgets in the Review node insights page 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Review node insights. To customize the widget layout, choose a widget that you want to move. Click and hold the 2. 3. drag handle ( of the widget and then drag it to its new location. 4. Repeat this process for each widget that you want to reposition. If you decide that you don't like the new layout, choose Reset to default layout to move all widgets back to their original location. Exploring nodes You can use the Explore nodes page in Systems Manager to review details of managed nodes in your organization or account according to the criteria you specify in filters. You can also use Rearranging widgets 100 AWS Systems Manager User Guide Systems Manager integration with Amazon Q Developer (Amazon Q), an AWS generative AI solution, to search using text prompts. Before you begin In order to use the Explore nodes feature, you must first onboard your organization or account to the unified Systems Manager console. For more information, see Setting up Systems Manager unified console for an organization. After onboarding, open the Systems Manager console and choose Explore nodes. Note If you've created an aggregator index for Resource Explorer in a Region different than your home Region, Systems Manager demotes the current index. Then, Systems Manager promotes the local index in your home Region as the new aggregator index. During this time, only nodes for your home Region are displayed. This process can take up to 24 hours to complete. Topics • Exploring nodes using console filters • Exploring nodes using text prompts in Amazon Q • Viewing individual node details and taking action on a node • Downloading or exporting a managed node report • Managing node report content and appearance Exploring nodes using console filters In the Systems Manager console, you can then group your managed nodes according to the following views: All nodes (No filter) Lists all managed nodes in your organization or account. Exploring nodes using console filters 101 AWS Systems Manager User Guide Node types Provides tabs for viewing data separately for Amazon Elastic Compute Cloud (Amazon EC2) instances and other machine types, including servers on your own premises (on-premises servers), AWS IoT Greengrass core devices, AWS IoT and non-AWS edge devices, and virtual machines (VMs), including VMs in other cloud environments. Exploring nodes using console filters 102 AWS Systems Manager User Guide Operating systems Provides a tab for each operating system type in your organization or account, such as Amazon Linux and Microsoft Windows Server 2022 Datacenter. On each tab, you can further filter the list by selecting only specific versions of the operating systems, such as Amazon Linux 2 and Amazon Linux 2023. Exploring nodes using console filters 103 AWS Systems Manager User Guide SSM Agent versions Provides a tab for each version of SSM Agent installed on managed nodes in your fleet. On each tab, you can further filter the list by selecting only specific operating systems, such as Amazon Linux and Microsoft Windows Server 2022 Datacenter. Exploring nodes using console filters 104 AWS Systems Manager User Guide In addition, for each of these views, you can further refine the list of nodes reported by choosing to view only nodes for a certain property, such as node status, AWS account ID, organization unit ID, and more. You can customize the report display by
systems-manager-ug-037
systems-manager-ug.pdf
37
SSM Agent versions Provides a tab for each version of SSM Agent installed on managed nodes in your fleet. On each tab, you can further filter the list by selecting only specific operating systems, such as Amazon Linux and Microsoft Windows Server 2022 Datacenter. Exploring nodes using console filters 104 AWS Systems Manager User Guide In addition, for each of these views, you can further refine the list of nodes reported by choosing to view only nodes for a certain property, such as node status, AWS account ID, organization unit ID, and more. You can customize the report display by choosing which of the available data columns are displayed in the Explore nodes page. You can also download reports in CSV or JSON formats, or export reports to Amazon S3 in CSV format. Topics • Choosing a filter view for managed node summaries Exploring nodes using console filters 105 AWS Systems Manager User Guide Choosing a filter view for managed node summaries The Explore nodes page in Systems Manager lets you view aggregated data about your fleet according to a number of available filter views. To choose a filter view for managed node summaries 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Explore nodes. For Filter view, select one of the filter options and optionally further refine the report: • Managed nodes – In the search ( box, you can select a property and delimiter, such as Node type = Managed EC2 instances. • Operating systems – In the Filter Operating system versions list, you can select an OS version number. In the search ( box, you can select a property and delimiter, such as Node type = Managed EC2 instances. • SSM Agent versions – In the Filter Operating systems list, you can select an OS name. In the search ( box, you can select a property and delimiter, such as Node type = Managed EC2 instances. • Node types – In the Filter Operating systems list, you can select an OS name. In the search ( box, you can select a property and delimiter, such as Node type = Managed EC2 instances. ) ) ) ) After optionally filtering the list, you can view details about a specific managed node by choosing its ID in the Node ID column. From that detailed view, you can perform a number of actions on the node. Exploring nodes using console filters 106 AWS Systems Manager User Guide Exploring nodes using text prompts in Amazon Q Using Systems Manager integration with Amazon Q Developer, you can use text prompts to view information created by generative AI about your managed nodes. Amazon Q Developer is a generative AI-powered conversational assistant that can help you to understand, build, extend, and operate AWS applications. To accelerate your building on AWS, the model that powers Amazon Q is augmented with high-quality AWS content to produce more complete, actionable, and referenced answers. For more information, see What is Amazon Q Developer? in the Amazon Q Developer User Guide. The integration between Systems Manager and Amazon Q lets you quickly get visibility and control over large, distributed environments across multiple AWS accounts and Regions. You can use natural language querying to quickly search node data, and then identify issues and take action faster. When you ask a natural language question about managed nodes or managed instances, Amazon Q uses the Systems Manager ListNodes action and creates filters based on your textual input to retrieve results. For example, say that you give Amazon Q the following prompt: List my managed nodes running Red Hat Enterprise Linux 9.2 Amazon Q determines what filters to include in a request, and then runs a query similar to the following: aws ssm list-nodes \ --filters Key=PlatformName,Values='Red Hat Enterprise Linux',Type=Equal Key=PlatformVersion,Values=9.2,Type=Equal Amazon Q then generates a report about Red Hat Enterprise Linux instances in your account, listing information such as the number of instances, their IDs, and their Regions. You can also view a JSON summary of each instance's details, as well open a link to view the entire lists of EC2 instances or managed nodes in the Systems Manager Explore nodes page. The Explore nodes displays results that match the filter criteria you included in your prompt. From there, you can change or refine the filters for your request, as described in Exploring nodes. Topics Exploring nodes using text prompts in Amazon Q 107 AWS Systems Manager User Guide • Learning to craft effective prompts to ask Amazon Q about your fleet • Exploring managed nodes using Amazon Q Learning to craft effective prompts to ask Amazon Q about your fleet The better quality of the question, or the prompt, that you give to Amazon Q, the better the result it provides you with.
systems-manager-ug-038
systems-manager-ug.pdf
38
nodes displays results that match the filter criteria you included in your prompt. From there, you can change or refine the filters for your request, as described in Exploring nodes. Topics Exploring nodes using text prompts in Amazon Q 107 AWS Systems Manager User Guide • Learning to craft effective prompts to ask Amazon Q about your fleet • Exploring managed nodes using Amazon Q Learning to craft effective prompts to ask Amazon Q about your fleet The better quality of the question, or the prompt, that you give to Amazon Q, the better the result it provides you with. Tips for query prompts Keep in mind the following tips when querying Amazon Q about your fleet: 1. To help improve the accuracy of your results, use the terms "managed nodes" and "managed instances" in your prompts instead of just "nodes" and "instances". 2. To query for results across multiple accounts that are part of an organization, as configured in AWS Organizations, you must be logged into the delegated administrator account in the designated home Region. 3. In the delegated administrator account, use terms to help Amazon Q understand that you are asking about nodes and instances across the organization by specifically using terms such as "in my organization" or "in my account 123456789012". Topics • Sample questions for Amazon Q • Supported operating system names and versions for prompts Sample questions for Amazon Q In the following table, we provide sample questions demonstrate some ways you can create queries of Amazon Q that lead to better results. We also provide examples of the filters Amazon Q will apply when running the ListNodes command, which are generated from the content of your prompt. Sample natural language question Amazon Q applied filters Show me my Windows managed nodes. PlatformType = Windows Exploring nodes using text prompts in Amazon Q 108 AWS Systems Manager User Guide Sample natural language question Amazon Q applied filters List my managed instances in account 123456789012. AccountId = 123456789012 Show me all managed nodes running Amazon Linux 1 across my organizat PlatformName = Amazon Linux PlatformVersion = 1 ion. Show me all managed instances running Microsoft Windows Server 2019 Datacenter in my organizat ion. PlatformName = Microsoft Windows Server 2019 Datacenter Can you show me all managed nodes with SSM Agent version 3.3.1142.0? AgentType = amazon-ssm-agent AgentVersion = 3.3.1142.0 List all Amazon Linux 2 managed instances in account 123456789 PlatformName = Amazon Linux PlatformVersion = 2 012 that have SSM Agent version AccountId = 123456789012 3.3.1230.0. AgentType = amazon-ssm-agent AgentVersion = 3.3.1230.0 What Microsoft Windows Server 2008 R2 Enterprise managed nodes are PlatformName = Microsoft Windows Server 2008 R2 Enterprise running in the eu-central-1 region Region = eu-central-1 across my entire organization? Show me all managed instances running CentOS Linux 7 in ou-d6ty-g xdma6vm. PlatformName = CentOS Linux PlatformVersion = 7 OrganizationalUnitId = ou-d6ty-g xdma6vm What Ubuntu managed instances are in account 123456789012? PlatformName = Ubuntu AccountId = 123456789012 Exploring nodes using text prompts in Amazon Q 109 AWS Systems Manager User Guide Sample natural language question Amazon Q applied filters List my Linux managed instances. PlatformType = Linux Find my macOS managed nodes. PlatformType = macOS Show me all Amazon Linux managed nodes in my org. PlatformName = Amazon Linux List managed nodes running Amazon Linux 2 . PlatformName = Amazon Linux PlatformVersion = 2 List the managed nodes with Ubuntu 16.04 in account 123456789012. PlatformName = Ubuntu PlatformVersion = 16.04 AccountId = 123456789012 Find all managed nodes that have an SSM Agent version that is not AgentType = amazon-ssm-agent AgentVersion != 3.3.987.0 3.3.987.0. List all managed instances that are not running a Linux operating PlatformType != Linux system. Supported operating system names and versions for prompts When you are asking Amazon Q about the managed nodes in your account, it's helpful to provide the name of an operating system as its labeled in Systems Manager. You can also provide version numbers to further narrow down your results. For example, as represented in the following tables, you could ask for results specifically about macOS 14.5, Microsoft Windows Server 2019 Datacenter, and AlmaLinux 9.2 through 9.4, to name just a few examples. These lists might not be exhaustive and are offered as examples only. Exploring nodes using text prompts in Amazon Q 110 AWS Systems Manager macOS Platform name macOS Windows Releases User Guide Version numbers 11.6.7, 11.7.10, 12.6.6, 12.7.6, 13.2, 13.4, 13.7, 14.1, 14.5, 14.6.1, 15.0 Version numbers Microsoft Windows Server 2008 Enterprise 6.0.6003 Microsoft Windows Server 2008 R2 Datacenter 6.1.7601 Microsoft Windows Server 2008 R2 Enterprise 6.1.7601 Microsoft Windows Server 2008 R2 Standard 6.1.7601 Microsoft Windows Server 2012 R2 Datacenter 6.3.9600 Microsoft Windows Server 2012 R2 Standard 6.3.9600 Microsoft Windows Server 2012 Standard 6.2.9200 Microsoft Windows Server 2016 Datacenter N/A Microsoft Windows Server 2016 Standard
systems-manager-ug-039
systems-manager-ug.pdf
39
exhaustive and are offered as examples only. Exploring nodes using text prompts in Amazon Q 110 AWS Systems Manager macOS Platform name macOS Windows Releases User Guide Version numbers 11.6.7, 11.7.10, 12.6.6, 12.7.6, 13.2, 13.4, 13.7, 14.1, 14.5, 14.6.1, 15.0 Version numbers Microsoft Windows Server 2008 Enterprise 6.0.6003 Microsoft Windows Server 2008 R2 Datacenter 6.1.7601 Microsoft Windows Server 2008 R2 Enterprise 6.1.7601 Microsoft Windows Server 2008 R2 Standard 6.1.7601 Microsoft Windows Server 2012 R2 Datacenter 6.3.9600 Microsoft Windows Server 2012 R2 Standard 6.3.9600 Microsoft Windows Server 2012 Standard 6.2.9200 Microsoft Windows Server 2016 Datacenter N/A Microsoft Windows Server 2016 Standard 10.0.14393 Microsoft Windows Server 2019 Datacenter Microsoft Windows Server 2019 Standard Microsoft Windows Server 2022 Datacenter N/A N/A N/A Microsoft Windows Server 2022 Standard 10.0.20348 Exploring nodes using text prompts in Amazon Q 111 AWS Systems Manager Linux Platform names AlmaLinux Amazon Linux 2 User Guide Version numbers 8.10, 9.2, 9.3, 9.4 2.0 and greater Amazon Linux 2023 2023.0.20230315.0 and greater Amazon Linux BottleRocket CentOS CentOS Linux 2015.03, 2015.09, 2016.03, 2016.09, 2017.03, 2017.09, 2018.03 1.14.3, 1.16.1, 1.18.0, 1.19.1, 1.19.2, 1.19.5, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.20.5, 1.21.1, 1.23.0, 1.24.0, 1.24.1, 1.25.0, 1.26.1, 6.7, 6.8, 6.9 (Final), 6.10, 6.10 (Final) 7, 7.2.1511, 7.2.1511 (Core), 7.3.1611, 7.3.1611 (Core), 7.4.1708, 7.5.1804, 7.5.1804 (Core), 7.6.1810, 7.7.1908, 7.8.2003, 7.9.2009, 7.9.2009 (Core), 8.2.2004, 8.5.2111 CentOS Stream Debian GNU/Linux 8, 9 8-12 Oracle Linux Server 7.8, 8.2, 8.3, 8.8, 8.9, 8.10, 9.4 Red Hat Enterprise Linux Red Hat Enterprise Linux Server Rocky Linux SLES Ubuntu 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9, 8.10, 9.2, 9.3, 9.4 6.9 (Santiago), 6.10 (Santiago), 7.3, 7.6, 7.7, 7.8,7.9 8.6, 8.7, 8.8, 8.9, 8.10, 9.1, 9.2, 9.3, 9.4 12.4, 15, 15.1, 15.2, 15.3, 15.4, 15.5 14.04, 16.04, 18.04, 20.04, 22.04, 24.04 Exploring nodes using text prompts in Amazon Q 112 AWS Systems Manager User Guide Exploring managed nodes using Amazon Q Systems Manager integration with Amazon Q Developer lets you ask questions about managed nodes in your fleet from anywhere in the AWS Management Console where the Amazon Q interface is available. For more information about interacting with Amazon Q, see Chatting with Amazon Q Developer about AWS in the Amazon Q Developer User Guide. To explore managed nodes using Amazon Q 1. From anywhere in the AWS Management Console, choose the Amazon Q icon ( ). 2. In the prompt field at the bottom of the Amazon Q pane, ask a question about managed nodes in your account or organization. Tip For tips on creating effective prompts, review the information in Learning to craft effective prompts to ask Amazon Q about your fleet . 3. Examine information about specific nodes, or choose Open AWS Systems Manager console to continue exploring. Viewing individual node details and taking action on a node From a list in the Explore nodes page in Systems Manager, you can select an individual node in order to view comprehensive details about the machine or perform a variety of actions on the node. The General page in the detail page presents comprehensive information about the node. To view individual node details and take action on a node 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Explore nodes. (Optional) Follow the steps in Choosing a filter view for managed node summaries to refine the list of managed nodes displayed for your organization or account. 4. In the Node ID column, choose the linked ID of a node. Viewing individual node details and taking action on a node 113 AWS Systems Manager User Guide 5. To view more details about the node, in the left navigation, in the Properties list, choose a property to view more information about: • Tags – View a list of tags applied to the node. You can also add or remove tags. • Inventory – Choose an inventory type, such as AWS:Application or AWS:Network, to view inventory details for the node. • Associations – View details about all State Manager associations applied to the node, including details such as status and associated SSM document name. • Patches – View summary information about patches and patch status for the node. • Configuration compliance – View compliance details for the node, such as compliance status and compliance issue severity. 6. To take actions on the node, use the following options in the Node actions menu: Note These actions are available only for managed nodes in the AWS account and Region you are currently working in. For managed nodes you might have access to in other accounts or Regions, you can instead access a Properties list. • Connect, Start terminal session – Connect to the node using AWS Systems Manager Session Manager. • Tools • View file system – Browse the contents of the node's directory structure. Add, rename, and
systems-manager-ug-040
systems-manager-ug.pdf
40
the node, such as compliance status and compliance issue severity. 6. To take actions on the node, use the following options in the Node actions menu: Note These actions are available only for managed nodes in the AWS account and Region you are currently working in. For managed nodes you might have access to in other accounts or Regions, you can instead access a Properties list. • Connect, Start terminal session – Connect to the node using AWS Systems Manager Session Manager. • Tools • View file system – Browse the contents of the node's directory structure. Add, rename, and remove directories. Cut or copy and paste files. • View performance counters – View performance information about the node such as CPU utilization, network traffic, and other utilization types. • Managed processes – View information about resource usage on the node. Start or stop processes on the node. • Manage users and groups – View, add, or delete user accounts and user groups on the node. • Execute run command – Use AWS Systems Manager Run Command to manage the configuration of the node. Run Command uses Systems Manager documents to perform on-demand changes such as updating applications or running Linux shell scripts and Windows PowerShell commands. Viewing individual node details and taking action on a node 114 AWS Systems Manager User Guide • Patch nodes – Use the Patch now feature in AWS Systems Manager Patch Manager to run an on-demand patching operation on the node from the console. Note The preceding tasks can also be initiated from the Tools menu in the left navigation. • Node settings • Add tags – Apply additional tag key-value pairs to the node. • Reset node user password – Set a new password for a specified user on the node. • Modify IAM role – Change the IAM role that's associated with the node. Create a new IAM role to attach to the node. Downloading or exporting a managed node report You can use the Systems Manager Explore nodes feature to view filtered or unfiltered lists of managed nodes for your AWS organization or account in the Systems Manager console. For cases where you want to view the data offline or process it in another application, you can save the report as a CSV or JSON file. Depending on the size of the report, you're prompted to download the report to your local machine or export it to an Amazon S3 bucket. Reports are saved to S3 buckets in CSV format only. To download or export a managed node report 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Explore nodes. (Optional) Follow the steps in Choosing a filter view for managed node summaries to refine the list of managed nodes displayed for your organization or account. 4. Choose Report ( 5. If the Download report dialog box is displayed, do the following: Downloading or exporting a managed node report ). 115 AWS Systems Manager User Guide a. For File name, enter a name for the file. We recommend specifying a name that represents the scope of the report, such as all-organization-nodes or ec2- instances-out-of-date-agent. b. For Included columns, specify whether to include columns for all available node details, or only those you've selected for your current display. Tip For information about managing the columns in your report display, see Managing node report content and appearance. c. d. For File format, select CSV or JSON, depending on how you will use the file. For Spreadsheet heading, to include a column headings row in a CSV file, select Include row of column names. e. Choose Download. The report is saved to the default download location according to your browser's settings. 6. If the Export to Amazon S3 dialog box is displayed, do the following: a. For S3 URI, enter the URI for the bucket to export the report to. Tip To view a list of your buckets in the Amazon S3 console, choose View. To select from a list of buckets in your account, choose Browse S3. b. For Authorization method, specify the service role to use to provide permissions for exporting the report to the bucket. If you choose to let Systems Manager create the role for you, it provides all needed permissions and trust statements for the operation. If you want to use or create your own role, the role must include the required permissions and trust statements. For information about creating this role, see Creating a custom service role to export diagnosis reports to S3. c. Choose Submit. Downloading or exporting a managed node report 116 AWS Systems Manager User Guide Creating a custom service role to export diagnosis reports to S3 When you are viewing filtered or unfiltered lists of managed
systems-manager-ug-041
systems-manager-ug.pdf
41
the bucket. If you choose to let Systems Manager create the role for you, it provides all needed permissions and trust statements for the operation. If you want to use or create your own role, the role must include the required permissions and trust statements. For information about creating this role, see Creating a custom service role to export diagnosis reports to S3. c. Choose Submit. Downloading or exporting a managed node report 116 AWS Systems Manager User Guide Creating a custom service role to export diagnosis reports to S3 When you are viewing filtered or unfiltered lists of managed nodes for your AWS organization or account in the Systems Manager Explore nodes page, you can export the list as a report to an Amazon S3 bucket as a CSV file. To do so, you must specify a service role with the necessary permissions and trust policy for the operation. You can choose for Systems Manager to create the role for you during the process of downloading the report. Optionally, you can create the role and its required policy yourself. To create a custom service role to export diagnosis reports to S3 1. Follow the steps in Creating policies using the JSON editor in the IAM User Guide. • Use the following for the policy content, making sure to replace the placeholder values with your own information. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject" ], "Resource": "arn:aws:s3:::s3-bucket-name/*", "Condition": { "StringEquals": { "aws:ResourceAccount": "account-id" } } }, { "Effect": "Allow", "Action": [ "s3:GetBucketAcl", "s3:ListBucket", "s3:PutLifecycleConfiguration", "s3:GetLifecycleConfiguration" ], "Resource": "arn:aws:s3:::s3-bucket-name", "Condition": { Downloading or exporting a managed node report 117 AWS Systems Manager User Guide "StringEquals": { "aws:ResourceAccount": "account-id" } } }, { "Effect": "Allow", "Action": [ "ssm:ListNodes" ], "Resource": "*" } ] } • Give the policy a name to help you recognize it easily in the next step. 2. Follow the steps in Creating an IAM role using a custom trust policy (console) in the IAM User Guide. • For step 4, enter the following trust policy, making sure to replace the placeholder values with your own information. { "Version": "2012-10-17", "Statement": [ { "Sid": "SSMAssumeRole", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "account-id" } } } ] } 3. For step 10, choose Step 2: Add permissions and select the name of the policy you created in the previous step. Downloading or exporting a managed node report 118 AWS Systems Manager User Guide After you create the role, you can select it when following the steps in Downloading or exporting a managed node report. Managing node report content and appearance You can use the Systems Manager Explore nodes feature to view filtered or unfiltered lists of managed nodes for your AWS organization or account in the Systems Manager console. You can choose from over a dozen fields to include in your lists of nodes, such as Node ID, Operating system name, Region, and more. You can also reorder the columns for your lists and reports and change how the list is displayed in the console. To manage node report content and appearance 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Explore nodes. In the Nodes area, choose the preferences gear icon ( 4. In the Preferences dialog box, do the following: a. b. c. For Page size, choose how many rows are included in each console view display, 10, 25, or 50. For Wrap lines, select the box to display all content of a cell in the available column width. For Striped rows, select the box to display alternating rows of clear and shaded backgrounds. d. For Select visible content, do the following: • Turn on or off individual columns for your list display and reports. • To change the order of columns, click and hold the drag handle ( of a column name and drag it up or down in the list. 5. Choose Confirm. ). ) Managing node report content and appearance 119 AWS Systems Manager User Guide Just-in-time node access using Systems Manager Systems Manager helps you to improve the security of your nodes by supporting just-in-time access. Just-in-time node access allows users to request temporary, time-bound access to nodes that you can approve only when access is truly needed. This removes the need to provide long standing access to nodes managed by IAM policies. Additionally, Systems Manager provides session recording for RDP sessions to Windows Server nodes to help you meet compliance requirements, perform root cause analysis, and more. To use just-in-time node access, you must set up the unified Systems Manager console. With just-in-time node access, you create granular IAM policies to ensure only the users you permit can submit access requests to
systems-manager-ug-042
systems-manager-ug.pdf
42
supporting just-in-time access. Just-in-time node access allows users to request temporary, time-bound access to nodes that you can approve only when access is truly needed. This removes the need to provide long standing access to nodes managed by IAM policies. Additionally, Systems Manager provides session recording for RDP sessions to Windows Server nodes to help you meet compliance requirements, perform root cause analysis, and more. To use just-in-time node access, you must set up the unified Systems Manager console. With just-in-time node access, you create granular IAM policies to ensure only the users you permit can submit access requests to your nodes. Then you create approval policies which define the approvals required to connect to your nodes. For just-in-time node access, there are auto- approval policies and manual approval policies. An auto-approval policy defines which nodes users can connect to automatically. Manual approval policies define the number and levels of manual approvals that must be provided to access the nodes you specify. Also, you can create a deny-access policy. A deny-access policy explicitly prevents the auto-approval of access requests to the nodes you specify. A deny-access policy applies to all accounts in an AWS Organizations organization. Auto-approval and manual approval policies apply only to the AWS accounts and AWS Regions where they're created. When a user attempts to connect to a node, they're prompted to enter a reason for accessing the node. Then your approval policies are evaluated. Depending on your policies, users either connect automatically to the target node or Systems Manager automatically creates a manual approval request on the requester's behalf. The approvers specified in the manual approval policy that applies to the node are then notified of the access request, and can approve or deny the request. Approvers and requesters can be notified by email, or through Amazon Q Developer in chat applications integration with Slack or Microsoft Teams. Systems Manager only grants access to requested nodes when the specified approvers provide all required approvals. Once all of the required approvals are received, the user can start as many sessions to the node as needed for the duration of the access window specified in the approval policy. Systems Manager doesn't automatically terminate just-in-time node access sessions. As a best practice, specify values for the maximum session duration and idle session timeout session preferences. These preferences prevent users from staying connected to nodes beyond their approved access window. We recommend using a combination of approval policies to help you secure nodes with more critical data while allowing users to connect to less critical nodes without intervention. For Just-in-time node access using Systems Manager 120 AWS Systems Manager User Guide example, you can require manual approvals for access requests to database nodes, and auto- approve sessions to non-persistent presentation tier nodes. Systems Manager supports just-in-time node access for users federated with IAM Identity Center or IAM. When a federated user submits an access request, they specify the target node, and the reason for needing to connect to the node. Systems Manager compares the user's identity to the parameters defined in your organization's approval policies. When the auto-approval policy conditions are met, or approvers manually provide approvals, the requester is able to connect to the target node. When a user attempts to connect to an approved node, Systems Manager creates and uses a temporary token to establish the session. Since the Systems Manager service handles the authentication for access requests and establishing sessions, you don't have to use IAM policies to manage access to your nodes. By using just-in-time node access, Systems Manager helps your organization move closer to zero standing privileges since you only need to allow users to create access requests instead of allowing them to start sessions with persistent permissions to your nodes. To help you meet compliance requirements, Systems Manager retains all access requests for 1 year. Systems Manager also emits EventBridge events for just-in-time node access for failed access requests and status updates to access requests for manual approvals. For more information see, Monitoring Systems Manager events with Amazon EventBridge. Topics • Setting up just-in-time access with Systems Manager • Start a just-in-time node access session • Managing just-in-time access requests • Moving to just-in-time node access from Session Manager • Disabling just-in-time access with Systems Manager • Just-in-time node access frequently asked questions Setting up just-in-time access with Systems Manager Setting up just-in-time node access with Systems Manager involved multiple steps. First, you choose the targets where you want to set up just-in-time node access. Targets consist of AWS Organizations organizational units (OUs) and AWS Regions. By default, the same targets you chose when setting up the unified Systems Manager console are selected for just-in-time node access. You can choose to set up just-in-time node access for all of the same targets, or a
systems-manager-ug-043
systems-manager-ug.pdf
43
node access from Session Manager • Disabling just-in-time access with Systems Manager • Just-in-time node access frequently asked questions Setting up just-in-time access with Systems Manager Setting up just-in-time node access with Systems Manager involved multiple steps. First, you choose the targets where you want to set up just-in-time node access. Targets consist of AWS Organizations organizational units (OUs) and AWS Regions. By default, the same targets you chose when setting up the unified Systems Manager console are selected for just-in-time node access. You can choose to set up just-in-time node access for all of the same targets, or a subset of the Setting up just-in-time access with Systems Manager 121 AWS Systems Manager User Guide targets you specified when setting up the unified Systems Manager console. Adding new targets that weren't selected when you set up the unified Systems Manager console isn't supported. Next you'll create approval policies to determine when node connections require manual approval and are automatically approved. Approval policies are managed by each account in your organization. You can also share a policy from the delgated administrator account to explicitly deny the automatic approval of connections to specific nodes. Note Setting up just-in-time node access doesn't affect existing IAM policies or preferences you've configured for Session Manager. You must remove permissions to Session Manager actions such as StartSession from your IAM policies to ensure that only just-in-time node access is used when users attempt to connect to your nodes. After you set up just-in- time node access, we recommend testing your approval policies with a subset of users and nodes to verify your policies are working as desired before removing permissions to Session Manager. The following IAM policies outline the permissions needed to administer and allow users to create just-in-time node access requests to nodes with Systems Manager. After verifying you have the required permissions to use just-in-time node access with Systems Manager, you can continue the setting up process. Replace each example resource placeholder with your own information. IAM policy for enabling just-in-time node access { "Version": "2012-10-17", "Statement": [ { "Sid": "QuickSetupConfigurationManagers", "Effect": "Allow", "Action": [ "ssm-quicksetup:CreateConfigurationManager", "ssm-quicksetup:DeleteConfigurationManager", "ssm-quicksetup:GetConfiguration", "ssm-quicksetup:GetConfigurationManager", "ssm-quicksetup:GetServiceSettings", "ssm-quicksetup:ListConfigurationManagers", "ssm-quicksetup:ListConfigurations", "ssm-quicksetup:ListQuickSetupTypes", Setting up just-in-time access with Systems Manager 122 AWS Systems Manager User Guide "ssm-quicksetup:ListTagsForResource", "ssm-quicksetup:TagResource", "ssm-quicksetup:UntagResource", "ssm-quicksetup:UpdateConfigurationDefinition", "ssm-quicksetup:UpdateConfigurationManager", "ssm-quicksetup:UpdateServiceSettings" ], "Resource": "*" }, { "Sid": "QuickSetupDeployments", "Effect": "Allow", "Action": [ "cloudformation:DescribeStackSetOperation", "cloudformation:ListStacks", "cloudformation:DescribeStacks", "cloudformation:DescribeStackResources", "cloudformation:ListStackSetOperations", "cloudformation:ListStackInstances", "cloudformation:DescribeStackSet", "cloudformation:ListStackSets", "cloudformation:DescribeStackInstance", "cloudformation:DescribeOrganizationsAccess", "cloudformation:ActivateOrganizationsAccess", "cloudformation:GetTemplate", "cloudformation:ListStackSetOperationResults", "cloudformation:DescribeStackEvents", "cloudformation:UntagResource", "ssm:DescribeAutomationExecutions", "ssm:GetAutomationExecution", "ssm:ListAssociations", "ssm:DescribeAssociation", "ssm:GetDocument", "ssm:ListDocuments", "ssm:DescribeDocument", "ssm:GetOpsSummary", "organizations:DeregisterDelegatedAdministrator", "organizations:DescribeAccount", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators", "organizations:ListRoots", "organizations:ListParents", "organizations:ListOrganizationalUnitsForParent", "organizations:DescribeOrganizationalUnit", Setting up just-in-time access with Systems Manager 123 AWS Systems Manager User Guide "organizations:ListAWSServiceAccessForOrganization", "iam:ListRoles", "iam:ListRolePolicies", "iam:GetRole", "iam:CreatePolicy", "cloudformation:TagResource" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "cloudformation:RollbackStack", "cloudformation:CreateStack", "cloudformation:UpdateStack", "cloudformation:DeleteStack" ], "Resource": [ "arn:aws:cloudformation:*:*:stack/StackSet-AWS-QuickSetup-JITNA*", "arn:aws:cloudformation:*:*:stack/AWS-QuickSetup-*", "arn:aws:cloudformation:*:*:type/resource/*", "arn:aws:cloudformation:*:*:stack/StackSet-SSMQuickSetup" ] }, { "Sid": "StackSetOperations", "Effect": "Allow", "Action": [ "cloudformation:CreateStackSet", "cloudformation:UpdateStackSet", "cloudformation:DeleteStackSet", "cloudformation:DeleteStackInstances", "cloudformation:CreateStackInstances", "cloudformation:StopStackSetOperation" ], "Resource": [ "arn:aws:cloudformation:*:*:stackset/AWS-QuickSetup-JITNA*", "arn:aws:cloudformation:*:*:type/resource/*", "arn:aws:cloudformation:*:*:stackset-target/AWS-QuickSetup-JITNA*:*" ] }, { "Sid": "IamRolesMgmt", "Effect": "Allow", Setting up just-in-time access with Systems Manager 124 AWS Systems Manager User Guide "Action": [ "iam:CreateRole", "iam:DeleteRole", "iam:GetRole", "iam:AttachRolePolicy", "iam:PutRolePolicy", "iam:DetachRolePolicy", "iam:GetRolePolicy", "iam:ListRolePolicies" ], "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-JITNA*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-JITNA*" ] }, { "Sid": "IamPassRole", "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": [ "arn:aws:iam::*:role/AWS-QuickSetup-JITNA*", "arn:aws:iam::*:role/service-role/AWS-QuickSetup-JITNA*" ], "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com", "ssm-quicksetup.amazonaws.com", "cloudformation.amazonaws.com" ] } } }, { "Sid": "SSMAutomationExecution", "Effect": "Allow", "Action": "ssm:StartAutomationExecution", "Resource": "arn:aws:ssm:region:account id:automation-definition/AWS- EnableExplorer:*" }, { "Sid": "SSMAssociationPermissions", Setting up just-in-time access with Systems Manager 125 AWS Systems Manager User Guide "Effect": "Allow", "Action": [ "ssm:DeleteAssociation", "ssm:CreateAssociation", "ssm:StartAssociationsOnce" ], "Resource": "arn:aws:ssm:region:account id:association/*" }, { "Sid": "SSMResourceDataSync", "Effect": "Allow", "Action": [ "ssm:CreateResourceDataSync", "ssm:UpdateResourceDataSync" ], "Resource": "arn:aws:ssm:region:account-id:resource-data-sync/AWS- QuickSetup-*" }, { "Sid": "ListResourceDataSync", "Effect": "Allow", "Action": [ "ssm:ListResourceDataSync" ], "Resource": "*" }, { "Sid": "CreateServiceLinkedRoles", "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole" ], "Condition": { "StringEquals": { "iam:AWSServiceName": [ "accountdiscovery.ssm.amazonaws.com", "ssm.amazonaws.com", "ssm-quicksetup.amazonaws.com", "stacksets.cloudformation.amazonaws.com" ] } }, "Resource": "*" }, Setting up just-in-time access with Systems Manager 126 AWS Systems Manager { User Guide "Sid": "CreateStackSetsServiceLinkedRole", "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole" ], "Resource": "arn:aws:iam::*:role/aws-service-role/ stacksets.cloudformation.amazonaws.com/ AWSServiceRoleForCloudFormationStackSetsOrgAdmin" }, { "Sid": "AllowSsmJitnaPoliciesCrudOperations", "Effect": "Allow", "Action": [ "ssm:CreateDocument", "ssm:UpdateDocument", "ssm:UpdateDocumentDefaultVersion", "ssm:GetDocument", "ssm:DescribeDocument", "ssm:DeleteDocument" ], "Resource": [ "arn:aws:ssm:region:account id:document/SSM- JustInTimeAccessDenyAccessOrgPolicy" ], "Condition": { "StringEquals": { "ssm:DocumentType": [ "AutoApprovalPolicy" ] } } }, { "Sid": "AllowAccessRequestOpsItemOperations", "Effect": "Allow", "Action": [ "ssm:GetOpsItem", "ssm:DescribeOpsItems", "ssm:GetOpsSummary", "ssm:DeleteOpsItem", "ssm:ListOpsItemEvents" ], "Resource": "*" Setting up just-in-time access with Systems Manager 127 User Guide AWS Systems Manager }, { "Sid": "IdentityCenterPermissions", "Effect": "Allow", "Action": [ "sso:DescribeRegisteredRegions", "sso:ListDirectoryAssociations", "identitystore:GetUserId", "identitystore:DescribeUser", "identitystore:DescribeGroup", "identitystore:ListGroupMembershipsForMember" ], "Resource": "*" } ] } IAM policy for configuring just-in-time node access { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowSsmJitnaPoliciesCrudOperations", "Effect": "Allow", "Action": [ "ssm:CreateDocument", "ssm:UpdateDocument", "ssm:UpdateDocumentDefaultVersion", "ssm:GetDocument", "ssm:DescribeDocument", "ssm:DeleteDocument" ], "Resource": [ "arn:aws:ssm:region:account id:document/*" ], "Condition": { "StringEquals": { "ssm:DocumentType": [ "ManualApprovalPolicy", "AutoApprovalPolicy" ] } Setting up just-in-time access with Systems Manager 128 User Guide AWS Systems Manager } }, { "Sid":
systems-manager-ug-044
systems-manager-ug.pdf
44
[ "ssm:GetOpsItem", "ssm:DescribeOpsItems", "ssm:GetOpsSummary", "ssm:DeleteOpsItem", "ssm:ListOpsItemEvents" ], "Resource": "*" Setting up just-in-time access with Systems Manager 127 User Guide AWS Systems Manager }, { "Sid": "IdentityCenterPermissions", "Effect": "Allow", "Action": [ "sso:DescribeRegisteredRegions", "sso:ListDirectoryAssociations", "identitystore:GetUserId", "identitystore:DescribeUser", "identitystore:DescribeGroup", "identitystore:ListGroupMembershipsForMember" ], "Resource": "*" } ] } IAM policy for configuring just-in-time node access { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowSsmJitnaPoliciesCrudOperations", "Effect": "Allow", "Action": [ "ssm:CreateDocument", "ssm:UpdateDocument", "ssm:UpdateDocumentDefaultVersion", "ssm:GetDocument", "ssm:DescribeDocument", "ssm:DeleteDocument" ], "Resource": [ "arn:aws:ssm:region:account id:document/*" ], "Condition": { "StringEquals": { "ssm:DocumentType": [ "ManualApprovalPolicy", "AutoApprovalPolicy" ] } Setting up just-in-time access with Systems Manager 128 User Guide AWS Systems Manager } }, { "Sid": "AllowSsmJitnaPoliciesListOperations", "Effect": "Allow", "Action": [ "ssm:ListDocuments", "ssm:ListDocumentVersions" ], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::account id:role/SSM-JustInTimeAccessTokenRole", "Condition": { "StringEquals": { "iam:PassedToService": [ "justintimeaccess.ssm.amazonaws.com" ] } } }, { "Sid": "AllowAccessRequestOpsItemOperations", "Effect": "Allow", "Action": [ "ssm:GetOpsItem", "ssm:DescribeOpsItems", "ssm:GetOpsSummary", "ssm:DeleteOpsItem", "ssm:ListOpsItemEvents" ], "Resource": "*" }, { "Sid": "AllowSessionManagerPreferencesOperation", "Effect": "Allow", "Action": [ "ssm:CreateDocument", "ssm:GetDocument", "ssm:DescribeDocument", "ssm:UpdateDocument", "ssm:DeleteDocument" Setting up just-in-time access with Systems Manager 129 AWS Systems Manager ], "Resource": "arn:aws:ssm:region:account id:document/SSM- SessionManagerRunShell", "Condition": { "StringEquals": { "ssm:DocumentType": "Session" User Guide } } }, { "Sid": "AllowSessionManagerOperations", "Effect": "Allow", "Action": [ "ssm:DescribeSessions", "ssm:GetConnectionStatus", "ssm:TerminateSession" ], "Resource": "*" }, { "Sid": "AllowRDPConnectionRecordingOperations", "Effect": "Allow", "Action": [ "ssm-guiconnect:UpdateConnectionRecordingPreferences", "ssm-guiconnect:GetConnectionRecordingPreferences", "ssm-guiconnect:DeleteConnectionRecordingPreferences" ], "Resource": "*" }, { "Sid": "AllowRDPConnectionRecordingKmsOperation", "Effect": "Allow", "Action": [ "kms:CreateGrant" ], "Resource": "arn:aws:kms:region:account id:key/*", "Condition": { "StringEquals": { "aws:ResourceTag/SystemsManagerJustInTimeNodeAccessManaged": "true" }, "StringLike": { "kms:ViaService": "ssm-guiconnect.*.amazonaws.com" }, "Bool": { Setting up just-in-time access with Systems Manager 130 AWS Systems Manager User Guide "aws:ViaAWSService": "true" } } }, { "Sid": "AllowFleetManagerOperations", "Effect": "Allow", "Action": [ "ssm-guiconnect:GetConnection", "ssm-guiconnect:ListConnections" ], "Resource": "*" }, { "Sid": "SNSTopicManagement", "Effect": "Allow", "Action": [ "sns:CreateTopic", "sns:SetTopicAttributes" ], "Resource": [ "arn:aws:sns:region:account id:SSM-JITNA*" ] }, { "Sid": "SNSListTopics", "Effect": "Allow", "Action": [ "sns:ListTopics" ], "Resource": "*" }, { "Sid": "EventBridgeRuleManagement", "Effect": "Allow", "Action": [ "events:PutRule", "events:PutTargets" ], "Resource": [ "arn:aws:events:region:account id:rule/SSM-JITNA*" ] }, { Setting up just-in-time access with Systems Manager 131 AWS Systems Manager User Guide "Sid": "ChatbotSlackManagement", "Effect": "Allow", "Action": [ "chatbot:CreateSlackChannelConfiguration", "chatbot:UpdateSlackChannelConfiguration", "chatbot:DescribeSlackChannelConfigurations", "chatbot:DescribeSlackWorkspaces", "chatbot:DeleteSlackChannelConfiguration", "chatbot:RedeemSlackOauthCode", "chatbot:DeleteSlackWorkspaceAuthorization", "chatbot:GetSlackOauthParameters" ], "Resource": "*" }, { "Sid": "ChatbotTeamsManagement", "Effect": "Allow", "Action": [ "chatbot:ListMicrosoftTeamsChannelConfigurations", "chatbot:CreateMicrosoftTeamsChannelConfiguration", "chatbot:UpdateMicrosoftTeamsChannelConfiguration", "chatbot:ListMicrosoftTeamsConfiguredTeams", "chatbot:DeleteMicrosoftTeamsChannelConfiguration", "chatbot:RedeemMicrosoftTeamsOauthCode", "chatbot:DeleteMicrosoftTeamsConfiguredTeam", "chatbot:GetMicrosoftTeamsOauthParameters", "chatbot:TagResource" ], "Resource": "*" }, { "Sid": "SSMEmailSettings", "Effect": "Allow", "Action": [ "ssm:UpdateServiceSetting", "ssm:GetServiceSetting" ], "Resource": [ "arn:aws:ssm:region:account id:servicesetting/ssm/access-request/email- role-mapping", "arn:aws:ssm:region:account id:servicesetting/ssm/access-request/ enabled-email-notifications" ] Setting up just-in-time access with Systems Manager 132 User Guide AWS Systems Manager }, { "Sid": "AllowViewingJitnaCloudWatchMetrics", "Effect": "Allow", "Action": [ "cloudwatch:GetMetricData", "cloudwatch:GetMetricStatistics", "cloudwatch:ListMetrics" ], "Resource": "*", "Condition": { "StringEquals": { "cloudwatch:namespace": "AWS/SSM/JustInTimeAccess" } } }, { "Sid": "QuickSetupConfigurationManagers", "Effect": "Allow", "Action": [ "ssm-quicksetup:ListConfigurationManagers", "ssm-quicksetup:ListConfigurations", "ssm-quicksetup:ListQuickSetupTypes", "ssm-quicksetup:GetConfiguration", "ssm-quicksetup:GetConfigurationManager" ], "Resource": "*" }, { "Sid": "QuickSetupDeployments", "Effect": "Allow", "Action": [ "cloudformation:ListStacks", "cloudformation:DescribeStacks", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators" ], "Resource": "*" }, { "Sid": "ManualPolicy", "Effect": "Allow", "Action": [ "sso:DescribeRegisteredRegions", Setting up just-in-time access with Systems Manager 133 AWS Systems Manager User Guide "ssm:GetServiceSetting", "iam:ListRoles" ], "Resource": "*" }, { "Sid": "SessionPreference", "Effect": "Allow", "Action": [ "s3:ListAllMyBuckets" ], "Resource": "*" }, { "Sid": "AllowIamListForKMS", "Effect": "Allow", "Action": [ "iam:ListUsers" ], "Resource": "arn:aws:iam::account id:user/*" }, { "Sid": "KMSPermission", "Effect": "Allow", "Action": [ "kms:TagResource", "kms:ListAliases", "kms:CreateAlias" ], "Resource": "*" }, { "Sid": "KMSCreateKey", "Effect": "Allow", "Action": [ "kms:CreateKey" ], "Resource": "*", "Condition": { "StringEquals": { "aws:RequestTag/SystemsManagerJustInTimeNodeAccessManaged": "true" }, "ForAllValues:StringEquals": { "aws:TagKeys": [ Setting up just-in-time access with Systems Manager 134 AWS Systems Manager User Guide "SystemsManagerJustInTimeNodeAccessManaged" ] } } }, { "Sid": "AllowIamRoleForChatbotAction", "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": "arn:aws:iam::account id:role/role name", "Condition": { "StringEquals": { "iam:PassedToService": [ "chatbot.amazonaws.com" ] } } }, { "Sid": "AllowIamServiceRoleForChat", "Effect": "Allow", "Action": [ "iam:CreateServiceLinkedRole" ], "Resource": "arn:aws:iam::account id:role/aws-service-role/ management.chatbot.amazonaws.com/AWSServiceRoleForAWSChatbot" }, { "Sid": "CloudWatchLogs", "Effect": "Allow", "Action": [ "logs:DescribeLogGroups" ], "Resource": "arn:aws:logs:*:account id:log-group::log-stream:" }, { "Sid": "IdentityStorePermissions", "Effect": "Allow", "Action": [ "sso:ListDirectoryAssociations", "identitystore:GetUserId", "sso-directory:SearchUsers", Setting up just-in-time access with Systems Manager 135 AWS Systems Manager User Guide "sso-directory:SearchGroups", "identitystore:DescribeGroup", "identitystore:DescribeUser" ], "Resource": "*" } ] } IAM policy for access request approvers { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowAccessRequestDescriptions", "Effect": "Allow", "Action": [ "ssm:DescribeOpsItems", "ssm:GetOpsSummary", "ssm:ListOpsItemEvents" ], "Resource": "*" }, { "Sid": "AllowGetSpecificAccessRequest", "Effect": "Allow", "Action": [ "ssm:GetOpsItem" ], "Resource": "arn:aws:ssm:region:account id:opsitem/*" }, { "Sid": "AllowApprovalRejectionSignal", "Effect": "Allow", "Action": [ "ssm:SendAutomationSignal" ], "Resource": "arn:aws:ssm:*:*:automation-execution/*", "Condition": { "StringEquals": { "aws:ResourceTag/SystemsManagerJustInTimeNodeAccessManaged": "true" } Setting up just-in-time access with Systems Manager 136 User Guide AWS Systems Manager } }, { "Sid": "QuickSetupConfigurationManagers", "Effect": "Allow", "Action": [ "ssm-quicksetup:ListConfigurationManagers", "ssm-quicksetup:ListConfigurations", "ssm-quicksetup:GetConfigurationManager", "ssm-quicksetup:ListQuickSetupTypes", "ssm-quicksetup:GetConfiguration" ], "Resource": "*" }, { "Sid": "QuickSetupDeployments", "Effect": "Allow", "Action": [ "cloudformation:ListStacks", "cloudformation:DescribeStacks", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators" ], "Resource": "*" }, { "Sid": "AllowSsmJitnaPoliciesCrudOperations", "Effect": "Allow", "Action": [ "ssm:GetDocument", "ssm:DescribeDocument" ], "Resource": [ "arn:aws:ssm:region:account id:document/*" ], "Condition": { "StringEquals": { "ssm:DocumentType": [ "ManualApprovalPolicy", "AutoApprovalPolicy" ] } } }, Setting up just-in-time access with Systems Manager 137 AWS Systems Manager { "Sid": "AllowSsmJitnaPoliciesListOperations", "Effect": "Allow", User Guide "Action": [ "ssm:ListDocuments", "ssm:ListDocumentVersions" ], "Resource": "*" }, { "Sid": "IDCPermissions", "Effect":
systems-manager-ug-045
systems-manager-ug.pdf
45
access with Systems Manager 136 User Guide AWS Systems Manager } }, { "Sid": "QuickSetupConfigurationManagers", "Effect": "Allow", "Action": [ "ssm-quicksetup:ListConfigurationManagers", "ssm-quicksetup:ListConfigurations", "ssm-quicksetup:GetConfigurationManager", "ssm-quicksetup:ListQuickSetupTypes", "ssm-quicksetup:GetConfiguration" ], "Resource": "*" }, { "Sid": "QuickSetupDeployments", "Effect": "Allow", "Action": [ "cloudformation:ListStacks", "cloudformation:DescribeStacks", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators" ], "Resource": "*" }, { "Sid": "AllowSsmJitnaPoliciesCrudOperations", "Effect": "Allow", "Action": [ "ssm:GetDocument", "ssm:DescribeDocument" ], "Resource": [ "arn:aws:ssm:region:account id:document/*" ], "Condition": { "StringEquals": { "ssm:DocumentType": [ "ManualApprovalPolicy", "AutoApprovalPolicy" ] } } }, Setting up just-in-time access with Systems Manager 137 AWS Systems Manager { "Sid": "AllowSsmJitnaPoliciesListOperations", "Effect": "Allow", User Guide "Action": [ "ssm:ListDocuments", "ssm:ListDocumentVersions" ], "Resource": "*" }, { "Sid": "IDCPermissions", "Effect": "Allow", "Action": [ "sso:DescribeRegisteredRegions", "sso:ListDirectoryAssociations", "identitystore:GetUserId", "identitystore:DescribeUser", "identitystore:DescribeGroup", "identitystore:ListGroupMembershipsForMember" ], "Resource": "*" } ] } IAM policy for just-in-time node access users { "Version": "2012-10-17", "Statement": [{ "Sid": "AllowJITNAOperations", "Effect": "Allow", "Action": [ "ssm:StartAccessRequest", "ssm:GetAccessToken" ], "Resource": "*" }, { "Sid": "AllowOpsItemCreationAndRetrieval", "Effect": "Allow", "Action": [ "ssm:CreateOpsItem", Setting up just-in-time access with Systems Manager 138 AWS Systems Manager User Guide "ssm:GetOpsItem" ], "Resource": "arn:aws:ssm:*:*:opsitem/*" }, { "Sid": "AllowListAccessRequests", "Effect": "Allow", "Action": [ "ssm:DescribeOpsItems", "ssm:GetOpsSummary", "ssm:ListOpsItemEvents", "ssm:DescribeSessions" ], "Resource": "*" }, { "Sid": "RequestManualApprovals", "Action": "ssm:StartAutomationExecution", "Effect": "Allow", "Resource": "arn:aws:ssm:*:*:document/*", "Condition": { "StringEquals": { "ssm:DocumentType": "ManualApprovalPolicy" } } }, { "Sid": "StartManualApprovalsAutomationExecution", "Effect": "Allow", "Action": "ssm:StartAutomationExecution", "Resource": "arn:aws:ssm:*:*:automation-execution/*" }, { "Sid": "AllowManualApprovalAutomationExecutionTagging", "Effect": "Allow", "Action": [ "ssm:AddTagsToResource" ], "Resource": [ "arn:aws:ssm:*:*:automation-execution/*" ], "Condition": { "StringEquals": { Setting up just-in-time access with Systems Manager 139 AWS Systems Manager User Guide "aws:RequestTag/SystemsManagerJustInTimeNodeAccessManaged": "true" }, "ForAllValues:StringEquals": { "aws:TagKeys": [ "SystemsManagerJustInTimeNodeAccessManaged" ] } } }, { "Sid": "CancelAccessRequestManualApproval", "Effect": "Allow", "Action": "ssm:StopAutomationExecution", "Resource": "arn:aws:ssm:*:*:automation-execution/*", "Condition": { "StringEquals": { "aws:ResourceTag/SystemsManagerJustInTimeNodeAccessManaged": "true" } } }, { "Sid": "DescribeEC2Instances", "Effect": "Allow", "Action": [ "ec2:DescribeInstances", "ec2:DescribeTags", "ec2:GetPasswordData" ], "Resource": "*" }, { "Sid": "AllowListSSMManagedNodesAndTags", "Effect": "Allow", "Action": [ "ssm:DescribeInstanceInformation", "ssm:ListTagsForResource" ], "Resource": "*" }, { "Sid": "QuickSetupConfigurationManagers", "Effect": "Allow", "Action": [ "ssm-quicksetup:ListConfigurationManagers", Setting up just-in-time access with Systems Manager 140 AWS Systems Manager User Guide "ssm-quicksetup:GetConfigurationManager", "ssm-quicksetup:ListConfigurations", "ssm-quicksetup:ListQuickSetupTypes", "ssm-quicksetup:GetConfiguration" ], "Resource": "*" }, { "Sid": "AllowSessionManagerOperations", "Effect": "Allow", "Action": [ "ssm:DescribeSessions", "ssm:GetConnectionStatus" ], "Resource": "*" }, { "Sid": "AllowRDPOperations", "Effect": "Allow", "Action": [ "ssm-guiconnect:ListConnections", "ssm:GetConnectionStatus" ], "Resource": "*" }, { "Sid": "QuickSetupDeployments", "Effect": "Allow", "Action": [ "cloudformation:ListStacks", "cloudformation:DescribeStacks", "organizations:DescribeOrganization", "organizations:ListDelegatedAdministrators" ], "Resource": "*" }, { "Sid": "AllowSsmJitnaPoliciesReadOnly", "Effect": "Allow", "Action": [ "ssm:GetDocument", "ssm:DescribeDocument" ], "Resource": [ Setting up just-in-time access with Systems Manager 141 AWS Systems Manager User Guide "arn:aws:ssm:*:account id:document/*" ], "Condition": { "StringEquals": { "ssm:DocumentType": [ "ManualApprovalPolicy", "AutoApprovalPolicy" ] } } }, { "Sid": "AllowSsmJitnaPoliciesListOperations", "Effect": "Allow", "Action": [ "ssm:ListDocuments", "ssm:ListDocumentVersions" ], "Resource": "*" }, { "Sid": "ExploreNodes", "Effect": "Allow", "Action": [ "ssm:ListNodesSummary", "ssm:ListNodes", "ssm:DescribeInstanceProperties" ], "Resource": "*" }, { "Sid": "IdentityStorePermissions", "Effect": "Allow", "Action": [ "sso:DescribeRegisteredRegions", "sso:ListDirectoryAssociations", "identitystore:GetUserId", "identitystore:DescribeUser", "identitystore:DescribeGroup" ], "Resource": "*" } ] Setting up just-in-time access with Systems Manager 142 AWS Systems Manager } Note User Guide To restrict access to API operations that create, update, or delete approval policies, use the ssm:DocumentType condition key for the AutoApprovalPolicy and ManualApprovalPolicy document types. The StartAccessRequest and GetAccessToken API operations don't support the following global context keys: • aws:ViaAwsService • aws:MultiFactorAuthPresent • aws:SourceVpce • aws:UserAgent For more information about condition context keys for Systems Manager, see Condition keys for AWS Systems Manager in the Service Authorization Reference. The following procedure describes how to complete the first set up step for just-in-time node access. To set up just-in-time node access 1. Log in to the Systems Manager delegated administrator account for your organization. 2. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 3. 4. Select Just-in-time node access in the navigation pane. Select Enable the new experience. 5. Choose the Regions where you want to enable just-in-time node access. By default, the same Regions you chose when setting up the unified Systems Manager console are selected for just- in-time node access. Choosing new Regions that weren't selected when you set up the unified Systems Manager console isn't supported. 6. Select Enable just-in-time node access. Setting up just-in-time access with Systems Manager 143 AWS Systems Manager User Guide There is no charge to use just-in-time node access for 30 days after enabling the feature. After the 30 day trial period, there is a charge to use just-in-time node access. For more information, see AWS Systems Manager Pricing. Create approval policies for your nodes Approval policies define what approvals users need to access a node. Since just-in-time node access removes the need for long standing permissions to nodes through IAM policies, you must create approval policies to allow access to your nodes. If there are no approval policies that apply to a node, users are unable to request access to the node. In just-in-time node access, there are three types of policies. The policy types are auto-approval, deny-access, and manual approval. Just-in-time node access policy types • An auto-approval policy defines which nodes users can connect to
systems-manager-ug-046
systems-manager-ug.pdf
46
Pricing. Create approval policies for your nodes Approval policies define what approvals users need to access a node. Since just-in-time node access removes the need for long standing permissions to nodes through IAM policies, you must create approval policies to allow access to your nodes. If there are no approval policies that apply to a node, users are unable to request access to the node. In just-in-time node access, there are three types of policies. The policy types are auto-approval, deny-access, and manual approval. Just-in-time node access policy types • An auto-approval policy defines which nodes users can connect to automatically. • Manual approval policies define the number and levels of manual approvals that must be provided to access the nodes you specify. • A deny-access policy explicitly prevents the auto-approval of access requests to the nodes you specify. A deny-access policy applies to all accounts in an AWS Organizations organization. For example, you could explicitly deny auto-approvals for the Intern group to nodes tagged with the Production key. Auto-approval and manual approval policies apply only to the AWS accounts and AWS Regions where they're created. Each member account in your organization manages their own approval policies. Approval policies are evaluated in the following order: 1. Deny-access 2. Auto-approval 3. Manual While you can only have one deny-access policy per organization, and one auto-approval policy per account and Region, you'll likely have several manual approval policies in an account. When evaluating manual approval policies, just-in-time node access always favors the more specific policy for a node. Manual approval policies are evaluated in the following order: 1. Tag specific target Setting up just-in-time access with Systems Manager 144 AWS Systems Manager 2. All nodes target User Guide For example, you have a node tagged with the Demo key. In the same account, you have a manual approval policy that targets all nodes and requires one approval from one level. You also have a manual approval policy that requires two approvals from two levels for nodes tagged with the Demo key. Systems Manager applies the policy that targets the Demo tag to the node since it's more specific than the policy that targets all nodes. This allows you to create a general policy for all nodes in your account, ensuring users can submit access requests while enabling you to create more granular policies as needed. Depending on your organization, there might be multiple tags applied to your nodes. In this scenario, if multiple manual approval policies apply to a node, access requests fail. For example, a node is tagged with the Production and Database keys. In the same account, you have a manual approval policy that applies to nodes tagged with the Production key and another manual approval policy that applies to nodes tagged with the Database key. This results in a conflict for the node tagged with both keys and access requests fail. Systems Manager redirects the user to the failed request. There, they can view details about the conflicting policies and tags so they can make the necessary adjustments if they have the required permissions. Otherwise, they can notify a colleague in their organization with the required permissions to modify the policies. Policy conflicts resulting in failed access requests emit EventBridge events allowing you flexibility in building your own response workflows. Additionally, Systems Manager sends email notifications for policy conflicts resulting in failed access requests to the recipients you specify. For more information about configuring email notifications for policy conflicts, see Configure notifications for just-in- time access requests. In a deny-access policy, you use the Cedar policy language to define which nodes users explicitly can't automatically connect to in your organization. This policy is created and shared from the delegated administrator account for your organization. The deny-access policy supercedes all auto- approval policies. You can only have one deny-access policy per organization. In an auto-approval policy, you use the Cedar policy language to define which users can automatically connect to the specified nodes without manual approval. The access duration for an access request that is automatically approved is 1 hour. This value can't be changed. You can only have one auto-approval policy per account and Region. In a manual approval policy, you specify the access duration, how many levels of approvals are required, the number of approvers required per level, and the nodes they can approve just-in-time access requests to. The access duration for a manual approval policy must be between 1 and 336 Setting up just-in-time access with Systems Manager 145 AWS Systems Manager User Guide hours. If you specify multiple levels of approvals, the approvals for the access request process one level at a time. This means all approvals you require for one level must be provided before the approval process moves to subsequent levels. If you specify
systems-manager-ug-047
systems-manager-ug.pdf
47
policy, you specify the access duration, how many levels of approvals are required, the number of approvers required per level, and the nodes they can approve just-in-time access requests to. The access duration for a manual approval policy must be between 1 and 336 Setting up just-in-time access with Systems Manager 145 AWS Systems Manager User Guide hours. If you specify multiple levels of approvals, the approvals for the access request process one level at a time. This means all approvals you require for one level must be provided before the approval process moves to subsequent levels. If you specify multiple tags in a manual approval policy, they are evaluated as or statements not and statements. For example, if you create a manual approval policy that includes the tags Application, Web, and Test, the policy applies to any node that is tagged with one of those keys. The policy doesn't apply only to nodes that are tagged with all three keys. We recommend using a combination of manual policies with your auto-approval policy to help you secure nodes with more critical data while allowing users to connect to less critical nodes without intervention. For example, you can require manual approvals for access requests to database nodes, and auto-approve sessions to non-persistent presentation tier nodes. The following procedures describe how to create approval policies for just-in-time node access. Topics • Create manual approval policies for just-in-time node access • Statement structure and built-in operators for auto-approval and deny-access policies • Create an auto-approval policy for just-in-time node access • Create a deny-access policy for just-in-time node access • Create approval policies for just-in-time node access with Amazon Q Create manual approval policies for just-in-time node access The following procedure describes how to create manual approval policies. Systems Manager allows you to create up to 50 manual approval policies per AWS account and AWS Region. To create a manual approval policy 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. manager/. Select Manage node access in the navigation pane. In the Policy details section of the Create manual approval policy step, enter a name and description for the approval policy. Enter a value for the Access duration. This is the maximum amount of time a user can start sessions to a node after an access request is approved. The value must be between 1 and 336 hours. Setting up just-in-time access with Systems Manager 146 AWS Systems Manager User Guide 5. 6. In the Node targets section, enter tag key-value pairs associated with the nodes you want the policy to apply to. If none of the tags specified in the policy are associated with a node, the policy isn't applied to the node. In the Access request approvers section, enter the users or groups you want to be able to approve access requests to the node targets in the policy. Access request approvers can be IAM Identity Center users and groups or IAM users. You can specify up to 5 approvers per level, and up to 5 levels of approvers. 7. Select Create manual approval policy. Statement structure and built-in operators for auto-approval and deny-access policies The following table shows the structure of auto-approval and deny-access policies. Component Syntax effect scope condition clause Policy components permit | forbid (principal, action, resource) when { principal or resource has attribute name }; An auto-approval or deny-access policy contains the following components: • Effect – Either permit (allow) or forbid (deny) access. • Scope – The principals, actions, and resources to which the effect applies. You can leave the scope in Cedar undefined by not identifying specific principals, actions, or resources. In this case, the policy applies to all possible principals, actions, and resources. For just-in-time node access, the action is always AWS::SSM::Action::"getTokenForInstanceAccess". • Condition clause – The context in which the effect applies. Setting up just-in-time access with Systems Manager 147 AWS Systems Manager Comments User Guide You can include comments in your policies. Comments are defined as a line starting with // and ending with a newline character. The following example shows comments in a policy. // Allows users in the Engineering group from the Platform org to automatically connect to nodes tagged with Engineering and Production keys. permit ( principal in AWS::IdentityStore::Group::"d4q81745-r081-7079-d789-14da1EXAMPLE", action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { principal has organization && resource.hasTag("Engineering") && resource.hasTag("Production") && principal.organization == "Platform" }; Multiple clauses You can use more than one condition clause in a policy statement using the && operator. // Allow access if node has tag where the tag key is Environment // & tag value is Development permit(principal, action == AWS::SSM::getTokenForInstanceAccess, resource) when { resource.hasTag("Environment") && resource.getTag("Environment") == "Development" }; Reserved characters The following example shows how to write a policy if a context property uses a :
systems-manager-ug-048
systems-manager-ug.pdf
48
to nodes tagged with Engineering and Production keys. permit ( principal in AWS::IdentityStore::Group::"d4q81745-r081-7079-d789-14da1EXAMPLE", action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { principal has organization && resource.hasTag("Engineering") && resource.hasTag("Production") && principal.organization == "Platform" }; Multiple clauses You can use more than one condition clause in a policy statement using the && operator. // Allow access if node has tag where the tag key is Environment // & tag value is Development permit(principal, action == AWS::SSM::getTokenForInstanceAccess, resource) when { resource.hasTag("Environment") && resource.getTag("Environment") == "Development" }; Reserved characters The following example shows how to write a policy if a context property uses a : (semicolon), which is a reserved character in the policy language. permit ( principal, action == AWS::SSM::Action::"getTokenForInstanceAccess", resource Setting up just-in-time access with Systems Manager 148 AWS Systems Manager ) User Guide when { principal has employeeNumber && principal.employeeNumber like "E-1*" && resource.hasTag("Purpose") && resource.getTag("Purpose") == "Testing" } For additional examples, see Example policy statements. Just-in-time node access schema The following is the Cedar schema for just-in-time node access. namespace AWS::EC2 { entity Instance tags String; } namespace AWS::IdentityStore { entity Group; entity User in [Group] { employeeNumber?: String, costCenter?: String, organization?: String, division?: String, }; } namespace AWS::IAM { entity Role; type AuthorizationContext = { principalTags: PrincipalTags, }; entity PrincipalTags tags String; } namespace AWS::SSM { Setting up just-in-time access with Systems Manager 149 AWS Systems Manager User Guide entity ManagedInstance tags String; action "getTokenForInstanceAccess" appliesTo { principal: [AWS::IdentityStore::User], resource: [AWS::EC2::Instance, AWS::SSM::ManagedInstance], context: { "iam": AWS::IAM::AuthorizationContext } }; } Built-in operators When creating the context of an auto-approval or deny-access policy using various conditions, you can use the && operator to add additional conditions. There are also many other built-in operators that you can use to add additional expressive power to your policy conditions. The following table contains all the built-in operators for reference. Operator Types and overloads Description ! == != < <= > >= Boolean → Boolean Logical not. any → any any → any Equality. Works on arguments of any type, even if the types don't match. Values of different types are never equal to each other. Inequality; the exact inverse of equality (see above). (long, long) → Boolean Long integer less-than. (long, long) → Boolean Long integer less-than-or- equal-to. (long, long) → Boolean Long integer greater-than. (long, long) → Boolean Long integer greater-than-or- equal-to. Setting up just-in-time access with Systems Manager 150 AWS Systems Manager Operator in && || .exists() has Types and overloads Description User Guide (entity, entity) → Boolean (entity, set(entity)) → Boolean Hierarchy membership (reflexive: A in A is always true). Hierarchy membership: A in [B, C, ...] is true if (A and B) || (A in C) || … error if the set contains a non-entity. (Boolean, Boolean) → Boolean Logical and (short-circuiting). (Boolean, Boolean) → Boolean Logical or (short-circuiting). entity → Boolean Entity existence. (entity, attribute) → Boolean Infix operator. e has f tests if the record or entity e has a binding for the attribute f. Returns false if e does not exist or if e does exist but doesn't have the attribute f. Attributes can be expressed as identifiers or string literals. Infix operator. t like p checks if the text t matches the pattern p, which may include wildcard characters * that match 0 or more of any character. In order to match a literal star character in t, you can use the special escaped character sequence \* in p. Checks if entity has the specified tag applied. like (string, string) → Boolean .hasTag() (entity, string) → Boolean Setting up just-in-time access with Systems Manager 151 AWS Systems Manager Operator .getTag() Types and overloads Description User Guide (entity, string) → Boolean Returns the value of the specified tag key. Set membership (is B an element of A). Tests if set A contains all of the elements in set B. Tests if set A contains any of the elements in set B. .contains() (set, any) → Boolean .containsAll() (set, set) → Boolean .containsAny() (set, set) → Boolean Example policy statements The following are policy statement examples. // Users assuming IAM roles with a principal tag of "Elevated" can automatically access nodes tagged with the "Environment" key when the value equals "prod" permit(principal, action == AWS::SSM::getTokenForInstanceAccess, resource) when { // Verify IAM role principal tag context.iam.principalTags.getTag("AccessLevel") == "Elevated" && // Verify the node has a tag with "Environment" tag key and a tag value of "prod" resource.hasTag("Environment") && resource.getTag("Environment") == "prod" }; // Identity Center users in the "Contractor" division can automatically access nodes tagged with the "Environment" key when the value equals "dev" permit(principal, action == AWS::SSM::getTokenForInstanceAccess, resource) when { // Verify that the user is part of the "Contractor" division principal.division == "Contractor" && // Verify the node has a tag with "Environment" tag key and a tag
systems-manager-ug-049
systems-manager-ug.pdf
49
equals "prod" permit(principal, action == AWS::SSM::getTokenForInstanceAccess, resource) when { // Verify IAM role principal tag context.iam.principalTags.getTag("AccessLevel") == "Elevated" && // Verify the node has a tag with "Environment" tag key and a tag value of "prod" resource.hasTag("Environment") && resource.getTag("Environment") == "prod" }; // Identity Center users in the "Contractor" division can automatically access nodes tagged with the "Environment" key when the value equals "dev" permit(principal, action == AWS::SSM::getTokenForInstanceAccess, resource) when { // Verify that the user is part of the "Contractor" division principal.division == "Contractor" && // Verify the node has a tag with "Environment" tag key and a tag value of "dev" resource.hasTag("Environment") && resource.getTag("Environment") == "dev" Setting up just-in-time access with Systems Manager 152 AWS Systems Manager }; User Guide // Identity Center users in a specified group can automatically access nodes tagged with the "Environment" key when the value equals "Production" permit(principal in AWS::IdentityStore::Group::"d4q81745-r081-7079-d789-14da1EXAMPLE", action == AWS::SSM::getTokenForInstanceAccess, resource) when { resource.hasTag("Environment") && resource.getTag("Environment") == "Production" }; Create an auto-approval policy for just-in-time node access Auto-approval policies use the Cedar policy language to define which users can automatically connect to the specified nodes without manual approval. An auto-approval policy contains multiple permit statements specifying the principal and resource. Each statement includes a when clause defining the conditions for automatic approval. The following is an example auto-approval policy. permit ( principal in AWS::IdentityStore::Group::"e8c17310-e011-7089-d989-10da1EXAMPLE", action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { principal has costCenter && resource.hasTag("CostCenter") && principal.costCenter == resource.getTag("CostCenter") }; permit ( principal in AWS::IdentityStore::Group::"d4q81745-r081-7079-d789-14da1EXAMPLE", action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { principal has organization && resource.hasTag("Engineering") && resource.hasTag("Production") && principal.organization == "Platform" }; Setting up just-in-time access with Systems Manager 153 AWS Systems Manager permit ( principal, action == AWS::SSM::Action::"getTokenForInstanceAccess", User Guide resource ) when { principal has employeeNumber && principal.employeeNumber like "E-1*" && resource.hasTag("Purpose") && resource.getTag("Purpose") == "Testing" }; The following procedure describes how to create an auto-approval policy for just-in-time node acces. The access duration for an access request that is automatically approved is 1 hour. This value can't be changed. You can only have one auto-approval policy per AWS account and AWS Region. For more information about how to construct policy statements, see Statement structure and built- in operators for auto-approval and deny-access policies. To create an auto-approval policy 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. manager/. Select Manage node access in the navigation pane. In the Approval policies tab, select Create an auto-approval policy. Enter your policy statement for the auto-approval policy in the Policy statement section. You can use the Sample statements provided to help you create your policy. 5. Select Create auto-approval policy. Create a deny-access policy for just-in-time node access Deny-access policies use the Cedar policy language to define which nodes users can't automatically connect to without manual approval. A deny-access policy contains multiple forbid statements specifying the principal and resource. Each statement includes a when clause defining the conditions for explicitly denying automatic approval. The following is an example deny-access policy. forbid ( principal in AWS::IdentityStore::Group::"e8c17310-e011-7089-d989-10da1EXAMPLE", action == AWS::SSM::Action::"getTokenForInstanceAccess", Setting up just-in-time access with Systems Manager 154 AWS Systems Manager resource ) when { User Guide resource.hasTag("Environment") && resource.getTag("Environment") == "Production" }; forbid ( principal, action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { principal has division && principal.division != "Finance" && resource.hasTag("DataClassification") && resource.getTag("DataClassification") == "Financial" }; forbid ( principal, action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { principal has employeeNumber && principal.employeeNumber like "TEMP-*" && resource.hasTag("Criticality") && resource.getTag("Criticality") == "High" }; The following procedure describes how to create a deny-access policy for just-in-time node access. For more information about how to construct policy statements, see Statement structure and built- in operators for auto-approval and deny-access policies. Note Note the following information. • You can create deny-access policies while logged into the AWS Management account or the delegated administrator account. Your AWS Organizations organization can have only one deny-access policy. • Just-in-time node access uses AWS Resource Access Manager (AWS RAM) to share your deny-access policy with member accounts in your organization. If you would like to Setting up just-in-time access with Systems Manager 155 AWS Systems Manager User Guide share your deny-access policy with the member accounts in your organization, resource sharing must be enabled from the management account of your organization. For more information, see Enable resource sharing within AWS Organizations in the AWS RAM User Guide. To create a deny-access policy 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. manager/. Select Manage node access in the navigation pane. In the Approval policies tab, select Create a deny-access policy. Enter your policy statement for the deny-access policy in the Policy statement section. You can use the Sample statements provided to help you create your policy. 5. Select Create deny-access policy. Create approval policies for just-in-time node access with Amazon Q Using
systems-manager-ug-050
systems-manager-ug.pdf
50
the management account of your organization. For more information, see Enable resource sharing within AWS Organizations in the AWS RAM User Guide. To create a deny-access policy 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. manager/. Select Manage node access in the navigation pane. In the Approval policies tab, select Create a deny-access policy. Enter your policy statement for the deny-access policy in the Policy statement section. You can use the Sample statements provided to help you create your policy. 5. Select Create deny-access policy. Create approval policies for just-in-time node access with Amazon Q Using Amazon Q Developer for command line provides guidance and support across various aspects of software development. For just-in-time node access, Amazon Q helps you create approval policies by generating and updating the code for the policies, analyzing policy statements, and more. The following information describes how to create approval policies using Amazon Q for command line. Identify your use case The first step in creating approval policies is clearly defining your use case. For example, in your organization you might want to automatically approve access requests to nodes with an Environment:Testing tag. You might also want to explicitly deny auto-approvals to nodes with an Environment:Production tag if an employee ID begins with TEMP. For nodes with a Tier:Database tag, you might want to require two levels of manual approvals. In any given scenario, you might prefer one policy or condition, over another. Therefore, we recommend that you clearly define the policy behaviors you want to determine which statements best fit your use case and preferences. Setting up just-in-time access with Systems Manager 156 AWS Systems Manager User Guide Set up your development environment Install Amazon Q for command line where you want to develop your approval policies. For information about installing Amazon Q for the command line, see Installing Amazon Q for command line in the Amazon Q Developer User Guide. We also recommend installing the MCP server for AWS documentation. This MCP server connects Amazon Q for command line to the most current documentation resources. For information about using MCP with Amazon Q for the command line, see Using MCP with Amazon Q Developer in the Amazon Q Developer User Guide. For more information about the AWS Documentation MCP server see AWS Documentation MCP Server. Install and configure the AWS CLI, if you have not already. For information, see Installing or updating the latest version of the AWS CLI. Develop approval policy content With your use case identified and environment set up, you're ready to develop the content for your policies. Your use case and preferences will largely dictate the types of approval policies and statements you use. If you're unsure how to use a particular policy or need more information about the schema for a policy, see Create approval policies for your nodes and the subsequent topics. These topics explain in detail how policies are evaluated and provide working example statements. The following procedure describes how to create approval policies with Amazon Q for command line. Note Amazon Q Developer uses generative AI. You may need to verify responses. See the AWS Responsible AI Policy. To create a approval policies using Amazon Q for command line 1. Open your terminal and start a session with Amazon Q. Setting up just-in-time access with Systems Manager 157 AWS Systems Manager $ q chat User Guide 2. Enter a prompt and describe what kind of policy statement you want to create. For example, using the earlier scenario for an approval policy, you could enter the following prompt: Create a Cedar policy statement that allows a principal to use the “getTokenForInstanceAccess" action for a resource that has a tag key “Environment” and tag value of “Testing”. Use the following example statement for reference to verify the syntax. permit ( principal in AWS::IdentityStore::Group::"e8c17310-e011-7089-d989-10da1EXAMPLE", action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { principal has organization && resource.hasTag("Engineering") && resource.hasTag("Production") && principal.organization == "Platform" }; The Cedar policy statement you create must be valid. Validate the Cedar statement using the AWS documentation provided for just-in-time node access policy statement structure and make sure you abide by the schema. 3. Entering this example prompt resulted in the following output: Based on the AWS documentation for Cedar policy statements and the examples provided, I'll create a valid Cedar policy statement that allows a principal to use the "getTokenForInstanceAccess" action for resources with the tag key "Environment" and tag value "Testing". Here's the Cedar policy statement: permit ( principal, action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { resource.hasTag("Environment") && resource.getTag("Environment") == "Testing" }; Setting up just-in-time access with Systems Manager 158 AWS Systems Manager User Guide This policy statement: 1. Uses the permit effect to allow access 2. Applies to any principal (since no specific principal is defined) 3. Specifically
systems-manager-ug-051
systems-manager-ug.pdf
51
following output: Based on the AWS documentation for Cedar policy statements and the examples provided, I'll create a valid Cedar policy statement that allows a principal to use the "getTokenForInstanceAccess" action for resources with the tag key "Environment" and tag value "Testing". Here's the Cedar policy statement: permit ( principal, action == AWS::SSM::Action::"getTokenForInstanceAccess", resource ) when { resource.hasTag("Environment") && resource.getTag("Environment") == "Testing" }; Setting up just-in-time access with Systems Manager 158 AWS Systems Manager User Guide This policy statement: 1. Uses the permit effect to allow access 2. Applies to any principal (since no specific principal is defined) 3. Specifically targets the "getTokenForInstanceAccess" action 4. Applies to resources that have a tag with key "Environment" and value "Testing" 5. Uses the proper syntax for the condition clause with the hasTag() and getTag() operators The statement follows the Cedar policy language structure as documented in the AWS Systems Manager documentation for just-in-time node access policies. 4. Paste the policy statement into a new Cedar file to validate the syntax. You can also validate the statement using the Cedar playground. 5. After validating the statement, save the Cedar file. 6. From your terminal, run the following AWS CLI command to create an SSM document using your policy content. Before using approval policies in a production environment, test your approval policies with a subset of identities and nodes in an AWS account and AWS Region. Note For an auto-approval policy, the document name must be SSM- JustInTimeAccessAutoApprovalPolicy. There can only be one auto-approval policy per AWS account and AWS Region. For a deny-access policy, the document name must be SSM-JustInTimeAccessDenyAccessOrgPolicy. There can only be one deny-access policy per AWS Organizations organization, and the policy must be created in the delegated administrator account for Systems Manager. The naming constraints for manual approval policies are the same as other SSM documents. For more information, see CreateDocument. Linux & macOS aws ssm create-document \ --content file://path/to/file/policyContent.cedar \ --name "SSM-JustInTimeAccessAutoApprovalPolicy" \ --document-type "AutoApproval" Setting up just-in-time access with Systems Manager 159 AWS Systems Manager Windows User Guide aws ssm create-document ^ --content file://C:\path\to\file\policyContent.cedar ^ --name "SSM-JustInTimeAccessAutoApprovalPolicy" ^ --document-type "AutoApproval" PowerShell $cedar = Get-Content -Path "C:\path\to\file\policyContent.cedar" | Out-String New-SSMDocument ` -Content $cedar ` -Name "SSM-JustInTimeAccessAutoApprovalPolicy" ` -DocumentType "AutoApproval" Update just-in-time node access session preferences With just-in-time node access, you can specify general session and logging preferences in each AWS account and AWS Region in your organization. Alternatively, you can use AWS CloudFormation StackSets to create a session preferences document in multiple accounts and Regions to help you have consistent session preferences. For information about the schema for session preferences documents, see Session document schema. For logging purposes, we recommend using the streaming option with Amazon CloudWatch Logs. This feature allows you to send a continual stream of session data logs to CloudWatch Logs. Essential details, such as the commands a user has run in a session, the ID of the user who ran the commands, and timestamps for when the session data is streamed to CloudWatch Logs, are included when streaming session data. When streaming session data, the logs are JSON-formatted to help you integrate with your existing logging solutions. Systems Manager doesn't automatically terminate just-in-time node access sessions. As a best practice, specify values for the maximum session duration and idle session timeout settings. Using these settings helps you to prevent a user from remaining connected to a node longer than the window of time approved in an access request. The following procedure describes how to update session preferences for just-in-time node access. Setting up just-in-time access with Systems Manager 160 AWS Systems Manager To update session preferences User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. 4. Select Settings in the navigation pane. Select the Just-in-time node access tab. In the Session preferences section, select Edit. 5. Update your general and logging preferences as needed and select Save. Configure notifications for just-in-time access requests You can configure Systems Manager to send notifications when a user creates a just-in-time node access request to the email addresses, or chat client, for approvers and the requester. The notification contains the reason for the access request provided by the requester, the AWS account, AWS Region, status of the request, and ID of the target node. Currently, Systems Manager supports Slack and Microsoft Teams clients through integration with Amazon Q Developer in chat applications. When using noficiations through chat clients, access request approvers can interact directly with access requests. This eliminates the need to log in to the console to take action on access requests. If you're using IAM roles to manage user identities in your organization, you must manually associate the email addresses of the approvers or requesters you want to send notifications to with the associated role. Otherwise the intended recipients can't be notified
systems-manager-ug-052
systems-manager-ug.pdf
52
status of the request, and ID of the target node. Currently, Systems Manager supports Slack and Microsoft Teams clients through integration with Amazon Q Developer in chat applications. When using noficiations through chat clients, access request approvers can interact directly with access requests. This eliminates the need to log in to the console to take action on access requests. If you're using IAM roles to manage user identities in your organization, you must manually associate the email addresses of the approvers or requesters you want to send notifications to with the associated role. Otherwise the intended recipients can't be notified by email. The following procedures describe how to configure notifications for just-in-time node access requests. To configure a chat client for just-in-time node access notifications 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. 5. manager/. Select Settings in the navigation pane. Select the Just-in-time node access tab. In the Chat section, select Configure new client. In the Select client type dropdown, choose the type of chat client you want to configure and select Next. 6. You're prompted to allow Amazon Q Developer in chat applications to access your chat client. Select Allow. Setting up just-in-time access with Systems Manager 161 AWS Systems Manager User Guide 7. In the Configure channel section, enter the information for your chat client channel and select the types of notifications you want to receive. 8. Select Configure channel. To configure email notifications for just-in-time node access notifications 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. 5. 6. manager/. Select Settings in the navigation pane. Select the Just-in-time node access tab. In the Email section, select Edit. Select Add emails, choose the IAM role you want to manually associate email addresses with. Enter an email address in the Email address field. Whenever an access request is created that requires approval from the IAM role you specified, the email addresses you associate with the role are notified. 7. Select Add email address. Recording RDP connections Just-in-time node access includes the ability to record RDP connections made to your Windows Server nodes. Recording RDP connections requires an S3 bucket and an AWS Key Management Service (AWS KMS) customer managed key. The KMS key is used to temporarily encrypt the recording data while it's generated and stored on Systems Manager resources. The recording uploaded to your S3 bucket isn't encrypted with this key. The customer managed key must be a symmetric key with a key usage of encrypt and decrypt. You can either use a multi-Region key for your organization, or you must create a customer managed key in each Region where you've enabled just-in-time node access. Configuring IAM permissions for recording RDP connections In addition to the required IAM permissions for just-in-time node access, the user or role you use must be allowed the following permissions based on the task you need to perform. Permissions for configuring connection recording To configure RDP connection recording, the following permissions are required: Setting up just-in-time access with Systems Manager 162 AWS Systems Manager User Guide • ssm-guiconnect:UpdateConnectionRecordingPreferences • ssm-guiconnect:GetConnectionRecordingPreferences • ssm-guiconnect:DeleteConnectionRecordingPreferences • kms:CreateGrant Permissions for initiating connections To make RDP connections with just-in-time node access, the following permissions are required: • ssm-guiconnect:CancelConnection • ssm-guiconnect:GetConnection • ssm-guiconnect:StartConnection • kms:CreateGrant Before you begin To store your connection recordings, you must first create an S3 bucket and add the following bucket policy. Replace each example resource placeholder with your own information. { "Version": "2012-10-17", "Statement": [ { "Sid": "ConnectionRecording", "Effect": "Allow", "Principal": { "Service": [ "ssm-guiconnect.amazonaws.com" ] }, "Action": "s3:PutObject", "Resource": [ "arn:aws:s3:::bucket name", "arn:aws:s3:::bucket name/*" ], "Condition":{ "StringEquals":{ "aws:SourceAccount":"123456789012" } Setting up just-in-time access with Systems Manager 163 AWS Systems Manager } } ] } User Guide For more information about adding a bucket policy, see Adding a bucket policy by using the Amazon S3 console in the Amazon Simple Storage Service User Guide. The following procedure describes how to enable and configure RDP connection recording. To configure RDP connection recording 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. Select Settings in the navigation pane. Select the Just-in-time node access tab. In the RDP recording section, select Enable RDP recording. 2. 3. 4. 5. Choose the S3 bucket you want to upload session recordings to. 6. Choose the customer managed key you want to use to temporarily encrypt the recording data while it's generated and stored on Systems Manager resources. The recording uploaded to your S3 bucket isn't encrypted with this key. 7. Select Save. Modifying targets When you set up just-in-time node access, you choose the targets where you want to set up just- in-time node access. Targets consist of AWS Organizations organizational units (OUs) and AWS Regions. By default, the same targets you chose when setting up the unified Systems Manager
systems-manager-ug-053
systems-manager-ug.pdf
53
5. Choose the S3 bucket you want to upload session recordings to. 6. Choose the customer managed key you want to use to temporarily encrypt the recording data while it's generated and stored on Systems Manager resources. The recording uploaded to your S3 bucket isn't encrypted with this key. 7. Select Save. Modifying targets When you set up just-in-time node access, you choose the targets where you want to set up just- in-time node access. Targets consist of AWS Organizations organizational units (OUs) and AWS Regions. By default, the same targets you chose when setting up the unified Systems Manager console are selected for just-in-time node access. You can choose to set up just-in-time node access for all of the same targets, or a subset of the targets you specified when setting up the unified Systems Manager console. Adding new targets that weren't selected when you set up the unified Systems Manager console isn't supported. You can change the targets you selected after setting up just-in-time node access. The following procedure describes how to modify the targets for just-in-time node access. Setting up just-in-time access with Systems Manager 164 AWS Systems Manager To modify targets User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. Select Settings in the navigation pane. Select the Just-in-time node access tab. In the Targets section, select Edit. Select the Organizational units and Regions where you want to use just-in-time node access. Select Save. 2. 3. 4. 5. 6. Changing identity providers By default, just-in-time node access uses IAM for an identity provider. After enabling just-in-time node access, customers using the unified console with an organization can modify this setting to use IAM Identity Center. Just-in-time node access doesn't support IAM Identity Center as an identity provider when set up for a single account and Region. The following procedure describes how to modify the identity provider for just-in-time node access. To modify identity providers 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. 4. Select Settings in the navigation pane. Select the Just-in-time node access tab. In the User identity section, select Edit. 5. Choose AWS IAM Identity Center. 6. Select Save. Start a just-in-time node access session After enabling and setting up just-in-time node access, and configuring session and notification preferences, users are ready to start just-in-time node access sessions. You can start sessions using just-in-time node access from the Systems Manager console or from the AWS Command Line Interface using the Session Manager plugin. Just-in-time node access sessions can be started on Start a just-in-time node access session 165 AWS Systems Manager User Guide nodes in the same account and Region. The following procedures describe how to start sessions with just-in-time node access. Note If your users previously used Session Manager to connect to nodes, you must remove the Session Manager permissions, for example ssm:StartSession, from their IAM policies to start sessions using just-in-time node access. Otherwise, when connecting to nodes they'll continue to use Session Manager. To start a session with just-in-time node access using the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. 4. Select Explore nodes in the navigation pane. Select the node you want to connect to. In the Actions dropdown, select Connect. If your organization's approval policies don't allow you to automatically connect to the node, you're prompted to submit an access request. After you fill out the information requested and submit the acccess request, you'll be able to start sessions to the node once all of the required approvals are received. To start a session with just-in-time node access using the AWS CLI 1. Run the following command to start the access request workflow, making sure to replace the placeholder values with your own information. aws ssm start-access-request \ --targets InstanceIds=i-02573cafcfEXAMPLE --reason "Troubleshooting networking performance issue" Depending on your organization's approval policies, you'll either be automatically connected to the node or the manual approval process is started. For requests that require manual approvals, note the ID of the access request that is returned in the response. 2. Wait for all of the required approvals to be provided. Start a just-in-time node access session 166 AWS Systems Manager User Guide 3. After all required approvals have been provided, run the following command to get an access token containing temporary credentials. Replace the placeholder values with your own information. aws ssm get-access-token \ --access-request-id oi-12345abcdef Note the access token returned in the response. 4. Run the following command to use the temporary credential in the AWS CLI, making sure to replace the placeholder values with your own information. export AWS_SESSION_TOKEN=AQoDYXdzEJr...<remainder of session token> 5. Run the following command to start a session to the node, making sure to replace the placeholder values with your own information. aws ssm start-session
systems-manager-ug-054
systems-manager-ug.pdf
54
User Guide 3. After all required approvals have been provided, run the following command to get an access token containing temporary credentials. Replace the placeholder values with your own information. aws ssm get-access-token \ --access-request-id oi-12345abcdef Note the access token returned in the response. 4. Run the following command to use the temporary credential in the AWS CLI, making sure to replace the placeholder values with your own information. export AWS_SESSION_TOKEN=AQoDYXdzEJr...<remainder of session token> 5. Run the following command to start a session to the node, making sure to replace the placeholder values with your own information. aws ssm start-session \ --target i-02573cafcfEXAMPLE Managing just-in-time access requests For increased visibility across your organization, Systems Manager replicates access requests to the delegated administrator account for your organization. To help you meet compliance requirements, Systems Manager retains all access requests for 1 year. The following topics describe how to manage just-in-time node access requests. This information is intended for access request approvers. Before you begin, we commend reviewing your IAM policies and making sure you have the required permissions for administering just-in-time node access. For more information see, Setting up just-in-time access with Systems Manager. Topics • Approving and denying just-in-time node access requests Approving and denying just-in-time node access requests Access request approvers can approve or deny just-in-time node access requests from the unified Systems Manager console or using your preferred command line tool. This information is intended for access request approvers. If you don't have the permissions required to approve or reject access Managing just-in-time access requests 167 AWS Systems Manager User Guide requests, contact your administrator. The following procedures describe how to approve or deny just-in-time node access requests. To approve or deny just-in-time node access requests using the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. Select Manage node access in the navigation pane. Select the Access requests tab. Select the Requests for me toggle. Select the checkbox next to the access request you want to approve or deny. Select Approve or Reject. 2. 3. 4. 5. 6. After approving an access request you can revoke your approval at any time by selecting Revoke. To approve or deny just-in-time node access requests using the command line 1. Note the access request ID from the notification. For example, oi-12345abcdef. 2. Run the following command to return details about the access request approval workflow, making sure to replace the placeholder values with your own information. aws ssm get-ops-item \ --ops-item-id oi-12345abcdef Note the automationExecutionId value in the /aws/accessrequest field for the OperationalData. For example, 9231944f-61c6-40be-8bce-8ee2bEXAMPLE. 3. Run the following command to approve or deny the access request. Use the Approve signal type to approve the request, and Deny to deny the request. Make sure to replace the placeholder values with your own information. aws ssm send-automation-signal \ --automation-execution-id 9231944f-61c6-40be-8bce-8ee2bEXAMPLE \ --signal-type "Approve" Managing just-in-time access requests 168 AWS Systems Manager User Guide Moving to just-in-time node access from Session Manager When you enable just-in-time node access, Systems Manager doesn't make any changes to your existing resources for Session Manager. This ensures there's no disruption to your existing environment and users can continue to start sessions while you create and validate approval policies. Once you're ready to test your approval policies, you must modify your existing IAM policies to complete the transition to just-in-time node access. This includes adding the required permissions for just-in-time node access to identities, and removing permission for the StartSession API operation for Session Manager. We recommend testing approval policies with a subset of identities and nodes in an AWS account and AWS Region. For more information about the permissions required for just-in-time node access, see Setting up just-in-time access with Systems Manager. For more information about modifying and identity's IAM permissions, see Adding and removing IAM identity permissions in the IAM User Guide. The following describes a detailed method of how you can move to just-in-time node access from Session Manager. Moving from Session Manager to just-in-time node access requires careful planning and testing to ensure a smooth transition without disrupting your operations. The following sections describe how you can complete this process. Prerequisites Before you begin, ensure that you have completed the following tasks: • Set up the Systems Manager unified console. • Verified you have permissions to modify IAM policies in your account. • Identified all IAM policies and roles that currently grant Session Manager permissions. • Documented your current Session Manager configuration, including session preferences and logging settings. Assessment Assess your current environment and outline desired approval behaviors by completing the following tasks: Moving to just-in-time node access from Session Manager 169 AWS Systems Manager User Guide 1. Inventory your nodes - Identify all nodes that users currently access through Session Manager. 2. Identify user access patterns - Document which
systems-manager-ug-055
systems-manager-ug.pdf
55
following tasks: • Set up the Systems Manager unified console. • Verified you have permissions to modify IAM policies in your account. • Identified all IAM policies and roles that currently grant Session Manager permissions. • Documented your current Session Manager configuration, including session preferences and logging settings. Assessment Assess your current environment and outline desired approval behaviors by completing the following tasks: Moving to just-in-time node access from Session Manager 169 AWS Systems Manager User Guide 1. Inventory your nodes - Identify all nodes that users currently access through Session Manager. 2. Identify user access patterns - Document which users or roles need access to which nodes, and under what circumstances. 3. Map approval workflows - Determine who should approve access requests for different types of nodes. 4. Review tagging strategy - Ensure your nodes are properly tagged to support your planned approval policies. 5. Audit existing IAM policies - Identify all policies that include Session Manager permissions. Planning Phased strategy When moving from Session Manager to just-in-time node access, we recommend using a phased approach like the following: 1. Phase 1: Setup and configuration - Enable just-in-time node access without modifying existing Session Manager permissions. 2. Phase 2: Policy development - Create and test approval policies for your nodes. 3. Phase 3: Pilot migration - Modify a small group of non-critical nodes and users or roles from Session Manager to just-in-time node access. 4. Phase 4: Full migration - Gradually migrate all remaining nodes and users or roles. Timeline considerations Consider the following factors when creating your timeline to move from Session Manager to just- in-time node access: • Allow time for user training and adjustment to the new approval workflow. • Schedule migrations during periods of lower operational activity. • Include buffer time for troubleshooting and adjustments. • Plan for a period of parallel operation where both systems are available. Moving to just-in-time node access from Session Manager 170 AWS Systems Manager Implementation steps Phase 1: Setup and configuration User Guide 1. Enable just-in-time node access in the Systems Manager console. For detailed steps, see Setting up just-in-time access with Systems Manager. 2. Configure session preferences for just-in-time node access to match your current Session Manager settings. For more information, see Update just-in-time node access session preferences. 3. Set up notification preferences for access requests. For more information, see Configure notifications for just-in-time access requests. 4. If you use RDP connections to Windows Server nodes, configure RDP recording. For more information, see Recording RDP connections. Phase 2: Policy development 1. Create IAM policies for just-in-time node access administrators and users. 2. Develop approval policies based on your security requirements and use case. 3. Test your policies in a non-production environment to ensure they work as expected. Phase 3: Pilot migration 1. Select a small group of users and non-critical nodes for the pilot. 2. Create new IAM policies for pilot users that include just-in-time node access permissions. 3. Remove Session Manager permissions (ssm:StartSession) from the pilot users' IAM policies. 4. Train pilot users on the new access request workflow. 5. Monitor the pilot for issues and gather feedback. 6. Adjust policies and procedures based on pilot results. Example IAM policy modification for pilot users Original policy with Session Manager permissions: { "Version": "2012-10-17", Moving to just-in-time node access from Session Manager 171 AWS Systems Manager User Guide "Statement": [ { "Effect": "Allow", "Action": [ "ssm:StartSession", "ssm:ResumeSession", "ssm:TerminateSession" ], "Resource": "*" } ] } Modified policy for just-in-time node access: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:StartAccessRequest", "ssm:GetAccessToken", "ssm:ResumeSession", "ssm:TerminateSession" ], "Resource": "*" } ] } Phase 4: Full migration Develop a schedule for migrating remaining users and nodes in batches. Testing methodology Throughout the migration process, conduct the following tests: • Policy validation - Verify that approval policies correctly apply to the intended nodes and users. • Access request workflow - Test the complete workflow from access request to session establishment for both auto-approval and manual approval scenarios. Moving to just-in-time node access from Session Manager 172 AWS Systems Manager User Guide • Notifications - Verify that approvers receive notifications through configured channels (email, Slack, Microsoft Teams). • Logging and monitoring - Verify that session logs and access requests are properly captured and stored. Best practices for a successful migration • Communicate early and often - Inform users about the migration timeline and benefits of just- in-time node access. • Start with non-critical systems - Begin migration with development or test environments before moving to production. • Document everything - Maintain detailed records of your approval policies, IAM policy changes, and configuration settings. • Monitor and adjust - Continuously monitor access requests and approval workflows, adjusting policies as needed. • Establish governance - Create a process for regularly reviewing and updating approval policies
systems-manager-ug-056
systems-manager-ug.pdf
56
that session logs and access requests are properly captured and stored. Best practices for a successful migration • Communicate early and often - Inform users about the migration timeline and benefits of just- in-time node access. • Start with non-critical systems - Begin migration with development or test environments before moving to production. • Document everything - Maintain detailed records of your approval policies, IAM policy changes, and configuration settings. • Monitor and adjust - Continuously monitor access requests and approval workflows, adjusting policies as needed. • Establish governance - Create a process for regularly reviewing and updating approval policies as your environment changes. Disabling just-in-time access with Systems Manager The following procedure describes how to disable just-in-time node access. After disabling just- in-time node access, users in your organization might be unable to connect to your nodes unless you've already implemented other connection methods. To disable just-in-time node access 1. Log in to the Systems Manager delegated administrator account for your organization. 2. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 3. 4. Select Settings in the navigation pane. In the Just-in-time node access tab, select Disable. Disabling just-in-time access with Systems Manager 173 AWS Systems Manager User Guide Just-in-time node access frequently asked questions How do I move from Session Manager to just-in-time node access? After setting up the unified console and enabling just-in-time node access, you must modify your existing IAM policies to complete the move to just-in-time node access. This includes adding the required permissions for just-in-time node access and removing permission for the StartSession API operation for Session Manager. For more information about IAM policies for just-in-time node access see Setting up just-in-time access with Systems Manager. Do I have to set up the unified console to use just-in-time node access? Yes, setting up the unified console is a prerequisite for just-in-time node access. However, after you set up the unified console and enable just-in-time node access, there are several methods for connecting to your nodes. For example, you can start just-in-time node access sessions from the Amazon EC2 console and the AWS CLI. For more information about setting up the unified console, see Setting up Systems Manager unified console for an organization. Is there cost associated with just-in-time node access? Systems Manager provides a 30 day free trial for just-in-time node access. After the trial, just-in- time node access incurs costs. For more information, see AWS Systems Manager Pricing. What is the precedence for just-in-time node access approval policies? Approval policies are evaluated in the following order: 1. Deny-access 2. Auto-approval 3. Manual How are manual approval policies evaluated? Just-in-time node access always favors the more specific policy for a node. Manual approval policies are evaluated in the following order: 1. Tag specific target 2. All nodes target FAQ 174 AWS Systems Manager User Guide What happens if there isn't an approval policy that applies to a node? To connect to a node using just-in-time node access, an approval policy must apply to the node. If there are no approval policies that apply to a node, users are unable to request access to the node. Can multiple approval policies target a tag? A tag can only be targeted once in your approval policies. What happens if multiple manual approval policies apply to a node as a result of overlapping tags? When multiple manual approval policies apply to a node, this results in a conflict and users are unable to request access to the node. Keep this in mind when creating your manual approval policies since some instances might have multiple tags depending on your case. Can I use just-in-time node access to request access and start sessions on nodes across accounts and Regions? Just-in-time node access supports requesting access to and starting sessions on nodes in the same account and Region as the requester. Can I use just-in-time node access to request access and start sessions on nodes registered with a hybrid activation? Yes, just-in-time node access supports requesting access to and starting sessions on nodes registered with a hybrid activation. The node must be registered in the same account and Region as the requester. Diagnosing and remediating Using the unified Systems Manager console, you can identify problems across your fleet in a single diagnosis operation. For organizations, you can then attempt remediation on all or only select targets using a single Automation operation. For an organization, as a delegated account administrator, you can select targets across all accounts and Regions. If you are working in a single account, you can select targets in a single Region at a time. Systems Manager can diagnose and help you remediate several types of deployment failures, as well as drifted configurations. Systems Manager can also identify Amazon Elastic Compute Diagnosing and remediating 175 AWS Systems Manager
systems-manager-ug-057
systems-manager-ug.pdf
57
console, you can identify problems across your fleet in a single diagnosis operation. For organizations, you can then attempt remediation on all or only select targets using a single Automation operation. For an organization, as a delegated account administrator, you can select targets across all accounts and Regions. If you are working in a single account, you can select targets in a single Region at a time. Systems Manager can diagnose and help you remediate several types of deployment failures, as well as drifted configurations. Systems Manager can also identify Amazon Elastic Compute Diagnosing and remediating 175 AWS Systems Manager User Guide Cloud (Amazon EC2) instances in your account or organization that Systems Manager isn't able to treat as a managed node. The EC2 instance diagnosis process can identify issues related to misconfigurations for a virtual private cloud (VPC), in a Domain Name Service (DNS) setting, or in an Amazon Elastic Compute Cloud (Amazon EC2) security group. Note Systems Manager supports both EC2 instances and other machine types in a hybrid and multicloud environment as managed nodes. To be a managed node, AWS Systems Manager Agent (SSM Agent) must be installed on the machine, and Systems Manager must have permission to perform actions on the machine. For EC2 instances, this permission can be provided at the account level using an AWS Identity and Access Management (IAM) role, or at the instance level using an instance profile. For more information, see Configure instance permissions required for Systems Manager. For non-EC2 machines, this permission is provided using an IAM service role. For more information, see Create the IAM service role required for Systems Manager in hybrid and multicloud environments. Before you begin In order to use the Diagnose and remediate feature to detect unmanaged EC2 instances, you must first onboard your organization or account to the unified Systems Manager console. During this process, you must choose the option to create IAM roles and managed policies required for these operations. For more information, see Setting up Systems Manager unified console for an organization. Use the following topics to help you identify and fix certain common types of failed deployments, drifted configurations, and unmanaged EC2 instances. Topics • Diagnosing and remediating failed deployments • Diagnosing and remediating drifted configurations • Diagnosing and remediating unmanaged Amazon EC2 instances in Systems Manager • Remediation impact types of runbook actions • Viewing execution progress and history for remediations in Systems Manager Diagnosing and remediating 176 AWS Systems Manager User Guide Diagnosing and remediating failed deployments Systems Manager can diagnose and then help you remediate the following types of failed deployments: • Core setup for organization member accounts • Core setup for delegated administrator account • Core setup for your account Use the following procedure to attempt to remediate these types of issues. To diagnose and remediate failed deployments 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Diagnose and remediate. 3. Choose the Deployment issues tab. 4. 5. In the Failed deployments section, review the list of findings for failed deployments. In the Setup step column, choose the name of a finding to review additional details about the issue. For example: Core setup for organization member accounts. 6. In the detail page for that failed deployment, you can view a list of accounts and how many Regions in each have experienced deployment failures. 7. 8. Select an account ID to view information about the reason for failures in that account. In the Failed Regions area, examine the information provided for Status reason. This information can indicate a reason for the failed deployment, which might provide insight into configuration changes that need to be made. 9. If you want to retry the deployment without making configuration changes, choose Redeploy. Diagnosing and remediating drifted configurations Systems Manager can diagnose and then help you remediate the following types of drifted configurations: • Core setup for organization member accounts • Core setup for delegated administrator account Diagnosing and remediating failed deployments 177 AWS Systems Manager • Core setup for your account User Guide Use the following procedure to attempt to remediate these types of drifted configurations. To diagnose and remediate drifted configurations 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Diagnose and remediate. 3. Choose the Deployment issues tab. 4. In the Drifted deployments section, review the list of finding for failed deployments. -or- To run a new diagnosis, choose Detect drift. 5. In the Setup step column, choose the name of a finding to review additional details about the issue. For example: Core setup for organization member accounts. 6. In the detail page for that failed deployment, you can view a list of accounts and how many Regions in each have experienced configuration drifts. 7.
systems-manager-ug-058
systems-manager-ug.pdf
58
the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Diagnose and remediate. 3. Choose the Deployment issues tab. 4. In the Drifted deployments section, review the list of finding for failed deployments. -or- To run a new diagnosis, choose Detect drift. 5. In the Setup step column, choose the name of a finding to review additional details about the issue. For example: Core setup for organization member accounts. 6. In the detail page for that failed deployment, you can view a list of accounts and how many Regions in each have experienced configuration drifts. 7. Select an account ID to view information about the reason for configuration drifts in that account. 8. In the Drifted resources area, the Resource column reports names of resources that have experienced drift. The Drift type column reports whether the resource was modified or deleted.. 9. To redeploy the intended configuration, choose Redeploy. Diagnosing and remediating unmanaged Amazon EC2 instances in Systems Manager To help you manage your Amazon Elastic Compute Cloud (Amazon EC2) instances with Systems Manager, you can use the unified Systems Manager console to do the following: 1. Run a manual or scheduled diagnosis process to identify which EC2 instances in your account or organization aren't currently managed by Systems Manager. Diagnosing and remediating unmanaged Amazon EC2 instances 178 AWS Systems Manager User Guide 2. Identify network or other issues that are preventing Systems Manager from taking over management of the instances. 3. Run an Automation execution to automatically remediate the problem, or access information to help you manually address the issue. Use the information in the following topics to help you diagnose and remediate issues that are preventing Systems Manager from managing your EC2 instances. How Systems Manager counts impacted nodes for the 'Unmanaged EC2 instance issues' list The number of nodes reported as unmanaged on the Unmanaged EC2 instances issues tab represents to the total number of instances with any of the follow status values at the diagnosis scan time: • Running • Stopped • Stopping This number is reported as Impacted nodes in the Issue summary area. In the following image, this number of impacted nodes not currently managed by Systems Manager is 40. Unlike the report of unmanaged EC2 instances on the Review node insights page, this count of EC2 instances is not dynamic. It represents findings made during the last reported diagnostic scan, Diagnosing and remediating unmanaged Amazon EC2 instances 179 AWS Systems Manager User Guide shown as the Scan time value. We therefore recommend running a diagnostic scan for unmanaged EC2 instances on a regular schedule to keep this reported number of impacted nodes up to date. For information about unmanaged instance counts on the Review node insights page, see What is an unmanaged instance? in the topic Reviewing node insights. Topics • Categories of diagnosable unmanaged EC2 instance issues • Running a diagnosis and optional remediation for unmanaged EC2 instances • Scheduling a recurring scan for unmanaged EC2 instances Categories of diagnosable unmanaged EC2 instance issues This topic lists the major categories of EC2 management issues, and the specific issues in each category, that Systems Manager can help you diagnose and remediate. Note that for some of the issues, Systems Manager can identify the issue, but not provide automatic remediation. In those cases, the Systems Manager console directs you to information to help you manually resolve an issue. The diagnosis process examines each group of EC2 instances at once according to the virtual private cloud (VPC) they belong to. Issue types • Problem category: Security group configuration and HTTPS communications • Problem category: DNS or DNS host name configuration • Problem category: VPC endpoint configuration Problem category: Security group configuration and HTTPS communications A diagnosis operation might find that SSM Agent isn't able to communicate with the Systems Manager service over HTTPS. In those cases, you can choose to execute an Automation runbook that attempts to update security groups that are attached to the instances. Note Occasionally, Systems Manager might not be able to automatically remediate these issues, but you can manually edit the affected security groups. Diagnosing and remediating unmanaged Amazon EC2 instances 180 AWS Systems Manager Supported issue types User Guide • Instance security group: Outbound traffic is not allowed on port 443 • ssm VPC endpoint’s security group: Inbound traffic is not allowed on port 443 • ssmmessages VPC endpoint's security group: Inbound traffic not allowed on port 443 • ec2messages VPC endpoint's security group: Inbound traffic not allowed on port 443 For more information, see Verify ingress rules on endpoint security groups in the topic Troubleshooting SSM Agent. Problem category: DNS or DNS host name configuration A diagnosis operation might find that Doman Name System (DNS) or DNS host names aren't properly configured for the VPC.
systems-manager-ug-059
systems-manager-ug.pdf
59
types User Guide • Instance security group: Outbound traffic is not allowed on port 443 • ssm VPC endpoint’s security group: Inbound traffic is not allowed on port 443 • ssmmessages VPC endpoint's security group: Inbound traffic not allowed on port 443 • ec2messages VPC endpoint's security group: Inbound traffic not allowed on port 443 For more information, see Verify ingress rules on endpoint security groups in the topic Troubleshooting SSM Agent. Problem category: DNS or DNS host name configuration A diagnosis operation might find that Doman Name System (DNS) or DNS host names aren't properly configured for the VPC. In those cases, you can choose to execute an Automation runbook that attempts to enable the enableDnsSupport and enableDnsHostnames attributes of the affected VPC. Supported issue types • DNS support is disabled in a VPC. • A DNS hostname is disabled in a VPC. For more information, see Verify your VPC DNS-related attributes in the topic Troubleshooting SSM Agent. Problem category: VPC endpoint configuration A diagnosis operation might find that VPC endpoints aren't properly configured for the VPC. If VPC endpoints required by SSM Agent don't exist, Systems Manager attempts to execute an Automation runbook to create the VPC endpoints and associates them with one subnet in each relevant regional availability zone (AZ). If VPC the required endpoints exist but aren't associated with a subnet in which the issue is found, the runbook associates the VPC endpoints to the affected subnet. Diagnosing and remediating unmanaged Amazon EC2 instances 181 AWS Systems Manager Note User Guide Systems Manager doesn't support remediating all misconfigured VPC endpoint issues. In those cases, Systems Manager directs you to manual remedy instructions instead of running an Automation runbook. Supported issue types • No ssm.region.amazonaws.com endpoint for PrivateLink was found. • No ssmmessages.region.amazonaws.com endpoint for PrivateLink was found. • No ec2messages.region.amazonaws.com endpoint for PrivateLink was found. Diagnosable issue types Systems Manager can diagnose the following issue types, but currently no runbook is available for remediating their issues. You can edit your configuration manually for these issues. • An instance's subnet is not attached to an ssm.region.amazonaws.com endpoint. • An instance's subnet is not attached to an ssmmessages.region.amazonaws.com endpoint. • An instance's subnet not attached to an ec2messages.region.amazonaws.com endpoint. For more information, see Verify your VPC configuration in the topic Troubleshooting SSM Agent. Running a diagnosis and optional remediation for unmanaged EC2 instances Use the following procedure to diagnose the network-related and VPC-related issues that might be preventing Systems Manager from managing your EC2 instances. The diagnosis operation can detect and group together issues of the following types: • Network configurations issues – Types of networking issues that might be preventing EC2 instances from communicating with the Systems Manager service in the cloud. Remediation operations might be available for these issues. For more information about the network configuration issues, see Categories of diagnosable unmanaged EC2 instance issues. • Unidentified issues – A list of findings for cases where the diagnostic operation was unable to determine why EC2 instances are not able to communicate with the Systems Manager service in the cloud. Diagnosing and remediating unmanaged Amazon EC2 instances 182 AWS Systems Manager User Guide To run a diagnosis and remediation for unmanaged EC2 instances 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Diagnose and remediate. 3. Choose the Unmanaged EC2 instances issue tab. 4. In the Issue summary section, choose Run new diagnosis. -or- If this is your first time to diagnose unmanaged EC2 issues, in the Diagnose unmanaged EC2 instances section, choose Execute. Tip While the diagnosis is running, choose View progress or View executions to monitor the current state of the execution. For more information, see Viewing execution progress and history for remediations in Systems Manager. 5. After the diagnosis completes, do the following: • For any issues reported in the Unidentified issues section, choose the Learn more link for information about resolving the problem. • For issues reported in the Network configurations issues section, continue with the next step. 6. In the list of finding types, in the Recommendations column, for a particular issue, choose the link, such as 2 recommendations. 7. In the Recommendations pane that opens, choose from the available mitigations: • Learn more – Open a topic with information about how to resolve an issue manually. • View runbook – Open a pane with information about the Automation runbook you can execute to resolve the issue with your EC2 instances, as well as options for generating a preview of the actions that runbook would take. Continue with the next step. 8. In the runbook pane, do the following: Diagnosing and remediating unmanaged Amazon EC2 instances 183 AWS Systems Manager User Guide a. For Document description, review the content, which provides an overview of the
systems-manager-ug-060
systems-manager-ug.pdf
60
opens, choose from the available mitigations: • Learn more – Open a topic with information about how to resolve an issue manually. • View runbook – Open a pane with information about the Automation runbook you can execute to resolve the issue with your EC2 instances, as well as options for generating a preview of the actions that runbook would take. Continue with the next step. 8. In the runbook pane, do the following: Diagnosing and remediating unmanaged Amazon EC2 instances 183 AWS Systems Manager User Guide a. For Document description, review the content, which provides an overview of the actions the runbook can take to remediate your unmanaged EC2 instance issues. Choose View steps to preview the individual actions the runbook would take. b. For Targets, do the following: • If you are managing remediations for an organization, for Accounts, specify whether this runbook would target all accounts, or only a subset of accounts you choose. • For Regions, specify whether this runbook would target all AWS Regions in your account or organization, or only a subset of Regions you choose. c. For Runbook preview, carefully review the information. This information explains what the scope and impact would be if you choose to execute the runbook. Note Choosing to execute the runbook would incur charges. Review the preview information carefully before deciding whether to proceed. The Runbook preview content provides the following information: • How many Regions the runbook operation would occur in. • (Organizations only) How many organizational units (OUs) the operation would run in. • The types of actions that would be taken, and how many of each. Action types include the following: • Mutating: The runbook step would make changes to the targets through actions that create, modify, or delete resources. • Non-mutating: The runbook step would retrieve data about resources but not make changes to them. This category generally includes Describe*, List*, Get*, and similar read-only API actions. • Undetermined: An undetermined step invokes executions performed by another orchestration service like AWS Lambda, AWS Step Functions, or AWS Systems Manager Run Command. An undetermined step might also call a third-party API. Systems Manager Automation doesn’t know the outcome of the orchestration processes or third-party API executions, so the results of the steps are undetermined. Diagnosing and remediating unmanaged Amazon EC2 instances 184 AWS Systems Manager User Guide d. At this point, you can choose one of the following actions: • Stop and do not execute the runbook. • Choose Execute to run the runbook with the options you have already selected. If you choose to run the operation, choose View progress or View executions to monitor the current state of the execution. For more information, see Viewing execution progress and history for remediations in Systems Manager. Scheduling a recurring scan for unmanaged EC2 instances You can run an on-demand scan for Amazon EC2 instances in your account or organization that Systems Manager isn't able to manage due to various configuration issues. You can also schedule this scan to occur automatically on a regular schedule. To schedule a recurring scan for unmanaged EC2 instances 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Diagnose and remediate. 3. Choose the Unmanaged EC2 instances issue tab. 4. 5. 6. In the Diagnose unmanaged EC2 instances section, turn on Schedule recurring diagnosis. For Diagnostic frequency, select whether to run the diagnosis once a day or once a week. (Optional) For Start time, enter a time, in 24-hour format, for the diagnosis to begin. For example, for 8:15 PM, enter 20:15. The time you enter is for your current local time zone. If you don't specify a time, the diagnostic scan runs immediately. Systems Manager also schedules the scan to run in the future at the current time. If you specify a time, Systems Manager waits to run the diagnostic scan at the specified time. 7. Choose Execute. The diagnosis runs immediately, but will also run on the schedule you have specified. Diagnosing and remediating unmanaged Amazon EC2 instances 185 AWS Systems Manager User Guide Remediation impact types of runbook actions Systems Manager can run diagnosis operations that discover certain types of failed deployments and drifted configurations, as well as certain types of configuration issues that are preventing Systems Manager from managing EC2 instances. The results of the diagnosis might include recommendations for Automation runbooks that you can execute to attempt to remedy a problem. For more information about these diagnosis operations, see the following topics: • Diagnosing and remediating failed deployments • Diagnosing and remediating drifted configurations • Diagnosing and remediating unmanaged Amazon EC2 instances in Systems Manager When Systems Manager identifies an issue that might be fixed by running an Automation runbook on the affected resources, it provides you with an
systems-manager-ug-061
systems-manager-ug.pdf
61
deployments and drifted configurations, as well as certain types of configuration issues that are preventing Systems Manager from managing EC2 instances. The results of the diagnosis might include recommendations for Automation runbooks that you can execute to attempt to remedy a problem. For more information about these diagnosis operations, see the following topics: • Diagnosing and remediating failed deployments • Diagnosing and remediating drifted configurations • Diagnosing and remediating unmanaged Amazon EC2 instances in Systems Manager When Systems Manager identifies an issue that might be fixed by running an Automation runbook on the affected resources, it provides you with an execution preview. The execution preview provides information about the types of changes the runbook execution would make to your targets. This information includes how many of each of three types of changes the diagnosis identified. These change types are as follows: • Mutating: A runbook step would make changes to the targets through actions that create, modify, or delete resources. • Non-Mutating: A runbook step would retrieve data about resources but not make changes to them. This category generally includes Describe*, List*, Get*, and similar read-only API actions. • Undetermined: An undetermined step invokes executions performed by another orchestration service like AWS Lambda, AWS Step Functions, or Run Command, a tool in AWS Systems Manager. An undetermined step might also call a third-party API or run a Python or PowerShell script. Systems Manager Automation can't detect what the outcome would be of the orchestration processes or third-party API executions, and therefore can't evaluate them. The results of those steps would have to be manually reviewed to determine their impact. See the following table for information about the impact type of supported Automation actions. Remediation impact types of runbook actions 186 AWS Systems Manager User Guide Impact types of supported remediation actions The table presents the impact type—Mutating, Non-mutating, and Undetermined—of various actions that can be included in a remediation runbook. Action¹ aws:approve Impact type Non-mutating aws:assertAwsResourceProperty Non-mutating aws:branch Non-mutating aws:changeInstanceState aws:copyImage aws:createImage aws:createStack aws:createTags aws:deleteImage aws:deleteStack aws:executeAutomation aws:executeAwsApi aws:executeScript aws:executeStateMachine Mutating Mutating Mutating Mutating Mutating Mutating Mutating Undetermined Undetermined Undetermined Undetermined aws:invokeLambdaFunction Undetermined aws:invokeWebhook Undetermined aws:loop aws:pause Varies. Depends on the actions in the loop. Non-mutating Remediation impact types of runbook actions 187 AWS Systems Manager Action¹ aws:runCommand aws:runInstances aws:sleep aws:updateVariable Impact type Undetermined Mutating Non-mutating Mutating User Guide aws:waitForAwsResourceProperty Non-mutating ¹ For more information about Automation actions, see Systems Manager Automation actions reference. Viewing execution progress and history for remediations in Systems Manager You can view a list of all in-progress and completed remediation operations made using the Diagnose and remediate feature in Systems Manager. Data in the execution history list reports the following types of information: • The type of execution, Diagnosis or Remediation. • The execution status, such as Success or Failed. • The times that the execution started and ended. To view execution progress and history for remediations 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Diagnose and remediate. 3. Choose View executions. Viewing execution history details for remediations 188 AWS Systems Manager Tip User Guide When an execution is running, you can also choose View progress to open the Execution history page. 4. (Optional) In the search ( box, enter a phrase to help narrow down the execution list, such as EC2 or VPC. ) 5. (Optional) To view additional details about an execution, in the Execution name column, choose an operation name, such as AWS-DiagnoseUnmanagedEC2NetworkIssues. In the details pane, you can review information about all the steps attempted during the operation, and about all the inputs and outputs for the execution. Adjusting Systems Manager settings The options on the Settings pages enable and configure features in the Systems Manager unified console. The options displayed depend on the account you are logged into and whether or not you have already set up Systems Manager. Note The options on the Settings page don't affect Systems Manager tools (formerly called capabilities). Account setup settings If Systems Manager is enabled, and if you are logged into an account that is not a member of Organizations or if the delegated administrator has not added your Organizations account to Systems Manager, the Account setup page shows the option to Disable Systems Manager. Disabling Systems Manager means Systems Manager doesn't display the unified console. All Systems Manager tools still function. Adjusting Systems Manager settings 189 AWS Systems Manager User Guide Organizational setup settings On the Organizational setup tab, the Home Region section displays the AWS Region chosen as the home Region during setup. In multi-account and multi-Region environments that use AWS Organizations, Systems Manager automatically aggregates node data from all accounts and Regions to the home Region. Aggregating data in this way enables you to view node data across accounts and Regions in
systems-manager-ug-062
systems-manager-ug.pdf
62
Account setup page shows the option to Disable Systems Manager. Disabling Systems Manager means Systems Manager doesn't display the unified console. All Systems Manager tools still function. Adjusting Systems Manager settings 189 AWS Systems Manager User Guide Organizational setup settings On the Organizational setup tab, the Home Region section displays the AWS Region chosen as the home Region during setup. In multi-account and multi-Region environments that use AWS Organizations, Systems Manager automatically aggregates node data from all accounts and Regions to the home Region. Aggregating data in this way enables you to view node data across accounts and Regions in a single location. Note If you want to change the home Region, you must disable Systems Manager and enable it again. To disable Systems Manager, choose Disable. The Organizational setup section displays the AWS organizational units and AWS Regions chosen during setup. To change which organizational units and Regions display node data in Systems Manager, choose Edit. For more information about setting up Systems Manager for Organizations, see Setting up AWS Systems Manager. Diagnose and remediate settings The Diagnose and remediate settings determine whether or not Systems Manager automatically scans your nodes to ensure they can communicate with Systems Manager. If enabled, the feature runs automatically according to a schedule you define. The feature identifies which nodes can't connect to Systems Manager and why. This feature also provides recommended runbooks for remediating networking issues and other problems preventing nodes from being configured as managed nodes. Scheduling a recurring diagnostic scan Systems Manager can diagnose and help you remediate several types of deployment failures, as well as drifted configurations. Systems Manager can also identify Amazon Elastic Compute Cloud (Amazon EC2) instances in your account or organization that Systems Manager isn't able to treat as a managed node. The EC2 instance diagnosis process can identify issues related to misconfigurations for a virtual private cloud (VPC), in a Domain Name Service (DNS) setting, or in an Amazon Elastic Compute Cloud (Amazon EC2) security group. To simply the task of identifying nodes that can't connect to Systems Manager, the Schedule recurring diagnosis feature enables you to automate a recurring diagnostic scan. The scans help Organizational setup settings 190 AWS Systems Manager User Guide identify which nodes can't connect to Systems Manager and why. Use the following procedure to enable and configure a recurring diagnostic scan of your nodes. To schedule a recurring diagnostic scan 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. 4. 5. In the navigation pane, choose Settings, and then choose the Diagnose and remediate tab. Turn on the Schedule recurring diagnosis option. For Scanning period, choose how often you want the scan to run. (Optional) For Start time, enter a time, in 24-hour format, for the diagnosis to begin. For example, for 8:15 PM, enter 20:15. The time you enter is for your current local time zone. If you don't specify a time, the diagnostic scan runs immediately. Systems Manager also schedules the scan to run in the future at the current time. If you specify a time, Systems Manager waits to run the diagnostic scan at the specified time. 6. Choose Save. 7. After the scan completes, view the details by choosing Diagnose and remediate in the left navigation. For more information about the Diagnose and remediate feature, see Diagnosing and remediating. Updating S3 bucket encryption When you onboard Systems Manager, Quick Setup creates an Amazon Simple Storage Service (Amazon S3) bucket in the delegated administrator account for AWS Organizations setups. For single-account setups, the bucket is stored in the account being set up. This bucket is used to store the metadata generated during diagnostic scans. For more information about setting up the unified Systems Manager console, see Setting up AWS Systems Manager. By default, your data in the bucket is encrypted using a AWS Key Management Service (AWS KMS) key that AWS owns and manages for you. Diagnose and remediate settings 191 AWS Systems Manager User Guide You can choose to use a different AWS KMS key for your bucket encryption. As another alternative, you can use server-side encryption with AWS KMS keys (SSE-KMS) using a customer managed key (CMK). For information, see Working with Amazon S3 buckets and bucket policies for Systems Manager. To use a different AWS KMS key for S3 bucket encryption 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. 4. 5. In the navigation pane, choose Settings, and then choose the Diagnose and remediate tab. In the Update S3 bucket encryption area, choose Edit. Select the Customize encryption settings (advanced) check box. For Choose an AWS KMS key, choose or enter the Amazon Resource Name (ARN) of the key. Tip To create a new key, choose Create an AWS KMS key. 6. Choose Save. Working with Amazon
systems-manager-ug-063
systems-manager-ug.pdf
63
Amazon S3 buckets and bucket policies for Systems Manager. To use a different AWS KMS key for S3 bucket encryption 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. 4. 5. In the navigation pane, choose Settings, and then choose the Diagnose and remediate tab. In the Update S3 bucket encryption area, choose Edit. Select the Customize encryption settings (advanced) check box. For Choose an AWS KMS key, choose or enter the Amazon Resource Name (ARN) of the key. Tip To create a new key, choose Create an AWS KMS key. 6. Choose Save. Working with Amazon S3 buckets and bucket policies for Systems Manager During the onboarding process for AWS Systems Manager, Quick Setup creates an Amazon Simple Storage Service (Amazon S3) bucket in the delegated administrator account for organization setups. For single-account setups, the bucket is stored in the account being set up. You can use Systems Manager to run diagnostic operations on your fleet to identify cases of failed deployments and drifted configurations. Systems Manager can also detect cases where configuration issues are preventing Systems Manager from managing EC2 instances in your account or organization. The results of these diagnostic operations are stored in this Amazon S3 bucket, which is protected by both an encryption method and an S3 bucket policy. For information about the diagnostic operations that output data to this bucket, see Diagnosing and remediating. Changing the bucket encryption method By default, the S3 bucket uses server-side encryption with Amazon S3 managed keys (SSE-S3). Working with Amazon S3 buckets and bucket policies for Systems Manager 192 AWS Systems Manager User Guide You can instead use server-side encryption with AWS KMS keys (SSE-KMS) using a customer managed key (CMK) as an alternative to Amazon S3 managed keys, as explained in Changing to an AWS KMS customer managed key to encrypt S3 resources. Contents of the bucket policy The bucket policy prevents member accounts in an organization from discovering one another. Read and write permissions to the bucket are allowed only for the diagnosis and remediation roles created for Systems Manager. The contents of these system-generated policies are presented in S3 bucket policies for the unified Systems Manager console. Warning Modifying the default bucket policy might allow member accounts in an organization to discover one another, or read diagnosis outputs for instances in another account. We recommend using extreme caution if you choose to modify this policy. Topics • Changing to an AWS KMS customer managed key to encrypt S3 resources • S3 bucket policies for the unified Systems Manager console Changing to an AWS KMS customer managed key to encrypt S3 resources During the onboarding process for the unified Systems Manager console, Quick Setup creates an Amazon Simple Storage Service (Amazon S3) bucket in the delegated administrator account. This bucket is used to store the diagnosis output data generated during remediation runbook executions. By default, the bucket uses server-side encryption with Amazon S3 managed keys (SSE- S3). You can review the content of these policies in S3 bucket policies for the unified Systems Manager console. However, you can instead use server-side encryption with AWS KMS keys (SSE-KMS) using a customer managed key (CMK) as an alternative to an AWS KMS key. Complete the following tasks in order to configure Systems Manager to use your CMK. Working with Amazon S3 buckets and bucket policies for Systems Manager 193 AWS Systems Manager User Guide Task 1: Add a tag to an existing CMK AWS Systems Manager uses your CMK only if it is tagged with the following key-value pair: • Key: SystemsManagerManaged • Value: true Use the following procedure to provide access for encrypting the S3 bucket with your CMK. To add a tag to your existing CMK 1. Open the AWS KMS console at https://console.aws.amazon.com/kms. 2. 3. In the left navigation, choose Customer managed keys. Select the AWS KMS key to use with AWS Systems Manager. 4. Choose the Tags tab, and then choose Edit. 5. Choose Add tag. 6. Do the following: a. b. For Tag key, enter SystemsManagerManaged. For Tag value, enter true. 7. Choose Save. Task 2: Modify an existing CMK key policy Use the following procedure to update the KMS key policy of your CMK to allow AWS Systems Manager roles to encrypt the S3 bucket on your behalf. To modify an existing CMK key policy 1. Open the AWS KMS console at https://console.aws.amazon.com/kms. 2. 3. In the left navigation, choose Customer managed keys. Select the AWS KMS key to use with AWS Systems Manager. 4. On the Key policy tab, choose Edit. 5. Add the following JSON statement to the Statement field, and replace the placeholder values with your own information. Working with Amazon S3 buckets and bucket policies for Systems Manager 194 AWS Systems Manager User Guide Ensure
systems-manager-ug-064
systems-manager-ug.pdf
64
key policy of your CMK to allow AWS Systems Manager roles to encrypt the S3 bucket on your behalf. To modify an existing CMK key policy 1. Open the AWS KMS console at https://console.aws.amazon.com/kms. 2. 3. In the left navigation, choose Customer managed keys. Select the AWS KMS key to use with AWS Systems Manager. 4. On the Key policy tab, choose Edit. 5. Add the following JSON statement to the Statement field, and replace the placeholder values with your own information. Working with Amazon S3 buckets and bucket policies for Systems Manager 194 AWS Systems Manager User Guide Ensure that you add all AWS account IDs that are onboarded in your organization to AWS Systems Manager in the Principal field. To locate the correct bucket name in the Amazon S3 console, in the delegated administrator account, locate the bucket in the format do-not-delete-ssm-operational-account- id-home-region-disambiguator. { "Sid": "EncryptionForSystemsManagerS3Bucket", "Effect": "Allow", "Principal": { "AWS": [ "account-id-1", "account-id-2", ... ] }, "Action": ["kms:Decrypt", "kms:GenerateDataKey"], "Resource": "*", "Condition": { "StringEquals": { "kms:EncryptionContext:aws:s3:arn": "arn:aws:s3:::amzn-s3-demo-bucket" }, "StringLike": { "kms:ViaService": "s3.*.amazonaws.com" }, "ArnLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/AWS-SSM-*" } } } Tip Alternatively, you can update the CMK key policy using the aws:PrincipalOrgID condition key to grant AWS Systems Manager access to your CMK. Working with Amazon S3 buckets and bucket policies for Systems Manager 195 AWS Systems Manager User Guide Task 3: Specify the CMK in Systems Manager settings After completing the previous two tasks, use the following procedure to change the S3 bucket encryption. This change ensures that the associated Quick Setup configuration process can add permissions for Systems Manager to accept your CMK. 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Settings. 3. On the Diagnose and remediate tab, in the Update S3 bucket encryption section, choose 4. 5. Edit. Select the Customize encryption settings (advanced) check box. In the search ( box, choose the ID of an existing key, or paste the ARN of an existing key. 6. Choose Save. ) S3 bucket policies for the unified Systems Manager console This topic includes the Amazon S3 bucket policies created by Systems Manager when you onboard an organization or single account to the unified Systems Manager console. Warning Modifying the default bucket policy might allow member accounts in an organization to discover one another, or read diagnosis outputs for instances in another account. We recommend using extreme caution if you choose to modify this policy. Amazon S3 bucket policy for an organization The diagnosis bucket is created with the following default bucket policy when onboarding an organization to Systems Manager. { "Version": "2012-10-17", "Statement": [ { Working with Amazon S3 buckets and bucket policies for Systems Manager 196 AWS Systems Manager User Guide "Sid": "DenyHTTPRequests", "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::", "arn:aws:s3:::amzn-s3-demo-bucket/*" ], "Condition": { "Bool": { "aws:SecureTransport": "false" } } }, { "Sid": "DenyNonSigV4Requests", "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket", "arn:aws:s3:::amzn-s3-demo-bucket/*" ], "Condition": { "StringNotEquals": { "s3:SignatureVersion": "AWS4-HMAC-SHA256" } } }, { "Sid": "AllowAccessLog", "Effect": "Allow", "Principal": { "Service": "logging.s3.amazonaws.com" }, "Action": "s3:PutObject", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/access-logs/*", "Condition": { "StringEquals": { "aws:SourceAccount": "operational-account-id" }, "ArnLike": { "aws:SourceArn": "arn:aws:s3:::amzn-s3-demo-bucket" } Working with Amazon S3 buckets and bucket policies for Systems Manager 197 User Guide AWS Systems Manager } }, { "Sid": "AllowCrossAccountRead", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket/actions/*/ ${aws:PrincipalAccount}/*", "Condition": { "StringEquals": { "aws:PrincipalOrgID": "organization-id" } } }, { "Sid": "AllowCrossAccountWrite", "Effect": "Allow", "Principal": "*", "Action": [ "s3:PutObject", "s3:DeleteObject" ], "Resource": "arn:aws:s3:::bucket-name/actions/*/${aws:PrincipalAccount}/*", "Condition": { "StringEquals": { "aws:PrincipalOrgID": "organization-id" }, "ArnLike": { "aws:PrincipalArn": [ "arn:aws:iam::*:role/AWS-SSM- DiagnosisExecutionRole-operational-account-id-home-region", "arn:aws:iam::*:role/AWS-SSM-DiagnosisAdminRole-operational- account-id-home-region", "arn:aws:iam::*:role/AWS-SSM- RemediationExecutionRole-operational-account-id-home-region", "arn:aws:iam::*:role/AWS-SSM-RemediationAdminRole-operational- account-id-home-region" ] } } }, { "Sid": "AllowCrossAccountListUnderAccountOwnPrefix", Working with Amazon S3 buckets and bucket policies for Systems Manager 198 AWS Systems Manager User Guide "Effect": "Allow", "Principal": "*", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket", "Condition": { "StringEquals": { "aws:PrincipalOrgID": "organization-id" }, "StringLike": { "s3:prefix": "*/${aws:PrincipalAccount}/*" } } }, { "Sid": "AllowCrossAccountGetConfigWithinOrganization", "Effect": "Allow", "Principal": "*", "Action": "s3:GetEncryptionConfiguration", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket", "Condition": { "StringEquals": { "aws:PrincipalOrgID": "organization-id" } } } ] } Amazon S3 bucket policy for a single account The diagnosis bucket is created with the following default bucket policy when onboarding a single account to Systems Manager. { "Version": "2012-10-17", "Statement": [ { "Sid": "DenyHTTPRequests", "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket", Working with Amazon S3 buckets and bucket policies for Systems Manager 199 AWS Systems Manager User Guide "arn:aws:s3:::amzn-s3-demo-bucket/*" ], "Condition": { "Bool": { "aws:SecureTransport": "false" } } }, { "Sid": "DenyNonSigV4Requests", "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket", "arn:aws:s3:::amzn-s3-demo-bucket/*" ], "Condition": { "StringNotEquals": { "s3:SignatureVersion": "AWS4-HMAC-SHA256" } } } ] } Working with Amazon S3 buckets and bucket policies for Systems Manager 200 AWS Systems Manager User Guide Using AWS Systems Manager tools Systems Manager groups tools into four categories. The following documentation describes the various
systems-manager-ug-065
systems-manager-ug.pdf
65
{ "Sid": "DenyHTTPRequests", "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket", Working with Amazon S3 buckets and bucket policies for Systems Manager 199 AWS Systems Manager User Guide "arn:aws:s3:::amzn-s3-demo-bucket/*" ], "Condition": { "Bool": { "aws:SecureTransport": "false" } } }, { "Sid": "DenyNonSigV4Requests", "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket", "arn:aws:s3:::amzn-s3-demo-bucket/*" ], "Condition": { "StringNotEquals": { "s3:SignatureVersion": "AWS4-HMAC-SHA256" } } } ] } Working with Amazon S3 buckets and bucket policies for Systems Manager 200 AWS Systems Manager User Guide Using AWS Systems Manager tools Systems Manager groups tools into four categories. The following documentation describes the various tools of AWS Systems Manager and how to set up and use these tools. Choose the tabs under each category to learn more about each tool. Node tools A managed node is any machine configured for use with Systems Manager in hybrid and multicloud environments. Compliance Use Compliance to scan your fleet of managed nodes for patch compliance and configuration inconsistencies. You can collect and aggregate data from multiple AWS accounts and AWS Regions, and then drill down into specific resources that aren’t compliant. By default, Compliance displays compliance data about Patch Manager patching and State Manager associations. You can also customize the service and create your own compliance types based on your IT or business requirements. Distributor Use Distributor to create and deploy packages to managed nodes. With Distributor, you can package your own software—or find AWS-provided agent software packages, such as AmazonCloudWatchAgent—to install on Systems Manager managed nodes. After you install a package for the first time, you can use Distributor to uninstall and reinstall a new package version, or perform an in-place update that adds new or changed files. Distributor publishes resources, such as software packages, to Systems Manager managed nodes. Fleet Manager Fleet Manager is a unified user interface (UI) experience that helps you remotely manage your nodes. With Fleet Manager, you can view the health and performance status of your entire fleet from one console. You can also gather data from individual devices and instances to perform common troubleshooting and management tasks from the console. This includes viewing directory and file contents, Windows registry management, operating system user management, and more. Node tools 201 AWS Systems Manager Hybrid Activations User Guide To set up non-EC2 machines in your hybrid and multicloud environment as managed nodes, create a hybrid activation. After you complete the activation, you receive an activation code and ID. This code and ID combination functions like an Amazon Elastic Compute Cloud (Amazon EC2) access ID and secret key to provide secure access to the Systems Manager service from your managed instances. You can also create an activation for edge devices if you want to manage them by using Systems Manager. Inventory Inventory automates the process of collecting software inventory from your managed nodes. You can use Inventory to gather metadata about applications, files, components, patches, and more. Patch Manager Use Patch Manager to automate the process of patching your managed nodes with both security related and other types of updates. You can use Patch Manager to apply patches for both operating systems and applications. (On Windows Server, application support is limited to updates for applications released by Microsoft.) This tool allows you to scan managed nodes for missing patches and apply missing patches individually or to large groups of managed nodes by using tags. Patch Manager uses patch baselines, which can include rules for auto-approving patches within days of their release, and a list of approved and rejected patches. You can install security patches on a regular basis by scheduling patching to run as a Systems Manager maintenance window task, or you can patch your managed nodes on demand at any time. For Linux operating systems, you can define the repositories that should be used for patching operations as part of your patch baseline. This allows you to ensure that updates are installed only from trusted repositories regardless of what repositories are configured on the managed node. For Linux, you also have the ability to update any package on the managed node, not just those that are classified as operating system security updates. You can also generate patch reports that are sent to an S3 bucket of your choice. For a single managed node, reports include details of all patches for the machine. For a report on all managed nodes, only a summary of how many patches are missing is provided. Node tools 202 AWS Systems Manager Run Command User Guide Use Run Command to remotely and securely manage the configuration of your managed nodes at scale. Use Run Command to perform on-demand changes such as updating applications or running Linux shell scripts and Windows PowerShell commands on a target set of dozens or hundreds of managed nodes. Session Manager Use Session Manager
systems-manager-ug-066
systems-manager-ug.pdf
66
an S3 bucket of your choice. For a single managed node, reports include details of all patches for the machine. For a report on all managed nodes, only a summary of how many patches are missing is provided. Node tools 202 AWS Systems Manager Run Command User Guide Use Run Command to remotely and securely manage the configuration of your managed nodes at scale. Use Run Command to perform on-demand changes such as updating applications or running Linux shell scripts and Windows PowerShell commands on a target set of dozens or hundreds of managed nodes. Session Manager Use Session Manager to manage your edge devices and Amazon Elastic Compute Cloud (Amazon EC2) instances through an interactive one-click browser-based shell or through the AWS CLI. Session Manager provides secure and auditable edge device and instance management without needing to open inbound ports, maintain bastion hosts, or manage SSH keys. Session Manager also allows you to comply with corporate policies that require controlled access to edge devices and instances, strict security practices, and fully auditable logs with edge device and instance access details, while still providing end users with simple one-click cross-platform access to your edge devices and EC2 instances. To use Session Manager, you must enable the advanced-instances tier. For more information, see Turning on the advanced- instances tier. State Manager Use State Manager to automate the process of keeping your managed nodes in a defined state. You can use State Manager to guarantee that your managed nodes are bootstrapped with specific software at startup, joined to a Windows domain (Windows Server nodes only), or patched with specific software updates. Change Management tools Automation Use Automation to automate common maintenance and deployment tasks. You can use Automation to create and update Amazon Machine Images (AMIs), apply driver and agent updates, reset passwords on Windows Server instance, reset SSH keys on Linux instances, and apply OS patches or application updates. Change Calendar Change Calendar helps you set up date and time ranges when actions you specify (for example, in Systems Manager Automation runbooks) can or can't be performed in your AWS account. Change Management tools 203 AWS Systems Manager User Guide In Change Calendar, these ranges are called events. When you create a Change Calendar entry, you're creating a Systems Manager document of the type ChangeCalendar. In Change Calendar, the document stores iCalendar 2.0 data in plaintext format. Events that you add to the Change Calendar entry become part of the document. You can add events manually in the Change Calendar interface or import events from a supported third-party calendar using an .ics file. Change Manager Change Manager is an enterprise change management framework for requesting, approving, implementing, and reporting on operational changes to your application configuration and infrastructure. From a single delegated administrator account, if you use AWS Organizations, you can manage changes across multiple AWS accounts in multiple AWS Regions. Alternatively, using a local account, you can manage changes for a single AWS account. Use Change Manager for managing changes to both AWS resources and on-premises resources. Documents A Systems Manager document (SSM document) defines the actions that Systems Manager performs. SSM document types include Command documents, which are used by State Manager and Run Command, and Automation runbooks, which are used by Systems Manager Automation. Systems Manager includes dozens of pre-configured documents that you can use by specifying parameters at runtime. Documents can be expressed in JSON or YAML, and include steps and parameters that you specify. Maintenance Windows Use Maintenance Windows to set up recurring schedules for managed instances to run administrative tasks such as installing patches and updates without interrupting business- critical operations. Quick Setup Use Quick Setup to configure frequently used AWS services and features with recommended best practices. You can use Quick Setup in an individual AWS account or across multiple AWS accounts and AWS Regions by integrating with AWS Organizations. Quick Setup simplifies setting up services, including Systems Manager, by automating common or recommended tasks. These tasks include, for example, creating required AWS Identity and Access Management (IAM) instance profile roles and setting up operational best practices, such as periodic patch scans and inventory collection. Change Management tools 204 AWS Systems Manager Application tools AppConfig User Guide AppConfig helps you create, manage, and deploy application configurations and feature flags. AppConfig supports controlled deployments to applications of any size. You can use AppConfig with applications hosted on Amazon EC2 instances, AWS Lambda containers, mobile applications, or edge devices. To prevent errors when deploying application configurations, AppConfig includes validators. A validator provides a syntactic or semantic check to verify that the configuration you want to deploy works as intended. During a configuration deployment, AppConfig monitors the application to verify that the deployment is successful. If the system encounters an error or if the deployment invokes an
systems-manager-ug-067
systems-manager-ug.pdf
67
AppConfig User Guide AppConfig helps you create, manage, and deploy application configurations and feature flags. AppConfig supports controlled deployments to applications of any size. You can use AppConfig with applications hosted on Amazon EC2 instances, AWS Lambda containers, mobile applications, or edge devices. To prevent errors when deploying application configurations, AppConfig includes validators. A validator provides a syntactic or semantic check to verify that the configuration you want to deploy works as intended. During a configuration deployment, AppConfig monitors the application to verify that the deployment is successful. If the system encounters an error or if the deployment invokes an alarm, AppConfig rolls back the change to minimize impact for your application users. Application Manager Application Manager helps DevOps engineers investigate and remediate issues with their AWS resources in the context of their applications and clusters. In Application Manager, an application is a logical group of AWS resources that you want to operate as a unit. This logical group can represent different versions of an application, ownership boundaries for operators, or developer environments, to name a few. Application Manager support for container clusters includes both Amazon Elastic Kubernetes Service (Amazon EKS) and Amazon Elastic Container Service (Amazon ECS) clusters. Application Manager aggregates operations information from multiple AWS services and Systems Manager tools to a single AWS Management Console. Parameter Store Parameter Store provides secure, hierarchical storage for configuration data and secrets management. You can store data such as passwords, database strings, Amazon Elastic Compute Cloud (Amazon EC2) instance IDs and Amazon Machine Image (AMI) IDs, and license codes as parameter values. You can store values as plain text or encrypted data. You can then reference values by using the unique name you specified when you created the parameter. Operations tools CloudWatch Dashboards Amazon CloudWatch Dashboards are customizable pages in the CloudWatch console that you can use to monitor your resources in a single view, even those resources that are spread Application tools 205 AWS Systems Manager User Guide across different regions. You can use CloudWatch dashboards to create customized views of the metrics and alarms for your AWS resources. Explorer Explorer is a customizable operations dashboard that reports information about your AWS resources. Explorer displays an aggregated view of operations data (OpsData) for your AWS accounts and across AWS Regions. In Explorer, OpsData includes metadata about your Amazon EC2 instances, patch compliance details, and operational work items (OpsItems). Explorer provides context about how OpsItems are distributed across your business units or applications, how they trend over time, and how they vary by category. You can group and filter information in Explorer to focus on items that are relevant to you and that require action. When you identify high priority issues, you can use OpsCenter, a tool in Systems Manager, to run Automation runbooks and resolve those issues. Incident Manager Incident Manager is an incident management console that helps users mitigate and recover from incidents affecting their AWS hosted applications. Incident Manager increases incident resolution by notifying responders of impact, highlighting relevant troubleshooting data, and providing collaboration tools to get services back up and running. Incident Manager also automates response plans and allows responder team escalation. OpsCenter OpsCenter provides a central location where operations engineers and IT professionals can view, investigate, and resolve operational work items (OpsItems) related to AWS resources. OpsCenter is designed to reduce mean time to resolution for issues impacting AWS resources. This Systems Manager tool aggregates and standardizes OpsItems across services while providing contextual investigation data about each OpsItem, related OpsItems, and related resources. OpsCenter also provides Systems Manager Automation runbooks that you can use to resolve issues. You can specify searchable, custom data for each OpsItem. You can also view automatically generated summary reports about OpsItems by status and source. Operations tools 206 AWS Systems Manager User Guide Perform a node task with Systems Manager Use this tutorial to get started with AWS Systems Manager. You'll learn how to launch an Amazon Elastic Compute Cloud (Amazon EC2) instance that is managed by Systems Manager, and how to connect to the managed instance. Because Systems Manager is a collection of multiple tools, no single walkthrough or tutorial can introduce the entire service. This tutorial provides an introduction to some of the tools. Prerequisites Before you begin, be sure that you've completed the steps in Managing EC2 instances with Systems Manager. Launch an instance using an AMI with SSM Agent preinstalled You can launch an Amazon EC2 instance using the AWS Management Console as described in the following procedure. This tutorial is intended to help you launch your first managed instance quickly, so it doesn't cover all possible options. To launch an instance 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. 3. 4. From the EC2 console dashboard, in the Launch instance box, choose Launch instance, and
systems-manager-ug-068
systems-manager-ug.pdf
68
to some of the tools. Prerequisites Before you begin, be sure that you've completed the steps in Managing EC2 instances with Systems Manager. Launch an instance using an AMI with SSM Agent preinstalled You can launch an Amazon EC2 instance using the AWS Management Console as described in the following procedure. This tutorial is intended to help you launch your first managed instance quickly, so it doesn't cover all possible options. To launch an instance 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. 3. 4. From the EC2 console dashboard, in the Launch instance box, choose Launch instance, and then choose Launch instance from the options that appear. For Name and tags, for Name, enter a descriptive name for your instance. For Application and OS Images (Amazon Machine Image), do the following: a. Choose the Quick Start tab, and then choose Amazon Linux. This is the operating system (OS) for your instance. b. For Amazon Machine Image (AMI), choose an HVM version of Amazon Linux 2. 5. For Instance type, from the Instance type list, choose the hardware configuration for your instance. Choose the t2.micro instance type, which is selected by default. The t2.micro instance type is eligible for the AWS Free Tier. In AWS Regions where t2.micro is unavailable, you can use a t3.micro instance under the Free Tier. For more information, see AWS Free Tier. 6. For Key pair (login), for Key pair name, choose a key pair. Perform a node task with Systems Manager 207 AWS Systems Manager User Guide 7. For Network settings, choose Edit. For Security group name, notice that the wizard created and selected a security group for you. You can use this security group, or alternatively you can select a security group that you created previously using the following steps: a. b. Choose Select existing security group. From Common security groups, choose your security group from the list of existing security groups. 8. If you aren't using Default Host Management Configuration, expand the Advanced details section, and for IAM instance profile, choose the instance profile that you created when getting set up in Configure instance permissions required for Systems Manager. 9. Keep the default selections for the other configuration settings for your instance. 10. Review a summary of your instance configuration in the Summary pane. When you're ready, choose Launch instance. 11. A confirmation page informs you that your instance is launching. Choose View all instances to close the confirmation page and return to the console. 12. On the Instances screen, you can view the status of the launch. It takes a short time for an instance to launch. 13. It can take a few minutes for the instance to show as managed and be ready for you to connect to it. To check that your instance passed its status checks, view this information in the Status check column. Connect to your managed instance using Systems Manager To connect to your managed instance 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. 3. Choose the button next to the instance that you want to connect to. 4. 5. In the Node actions menu, choose Start terminal session. Select Connect. Connect to your managed instance using Systems Manager 208 AWS Systems Manager Clean up your instance User Guide If you're done working with the managed instance that you created for this tutorial, terminate it. Terminating an instance effectively deletes it. To terminate your instance 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. In the navigation pane, choose Instances. In the list of instances, select the instance. 3. Choose Instance state, Terminate instance. 4. Choose Terminate when prompted for confirmation. Amazon EC2 shuts down and terminates your instance. After your instance is terminated, it remains visible on the console briefly, and then the entry is deleted automatically. You can't remove the terminated instance from the console display yourself. AWS Systems Manager Node tools AWS Systems Manager provides the following tools for accessing, managing, and configuring your managed nodes. A managed node is any machine configured for use with Systems Manager in a hybrid and multicloud environment. Topics • AWS Systems Manager Compliance • AWS Systems Manager Distributor • AWS Systems Manager Fleet Manager • AWS Systems Manager Hybrid Activations • AWS Systems Manager Inventory • AWS Systems Manager Patch Manager • AWS Systems Manager Run Command • AWS Systems Manager Session Manager • AWS Systems Manager State Manager Clean up your instance 209 AWS Systems Manager User Guide AWS Systems Manager Compliance You can use Compliance, a tool in AWS Systems Manager, to scan your fleet of managed nodes for patch compliance and configuration inconsistencies. You can collect and aggregate data from multiple AWS accounts and Regions, and then drill down into specific resources
systems-manager-ug-069
systems-manager-ug.pdf
69
Systems Manager Distributor • AWS Systems Manager Fleet Manager • AWS Systems Manager Hybrid Activations • AWS Systems Manager Inventory • AWS Systems Manager Patch Manager • AWS Systems Manager Run Command • AWS Systems Manager Session Manager • AWS Systems Manager State Manager Clean up your instance 209 AWS Systems Manager User Guide AWS Systems Manager Compliance You can use Compliance, a tool in AWS Systems Manager, to scan your fleet of managed nodes for patch compliance and configuration inconsistencies. You can collect and aggregate data from multiple AWS accounts and Regions, and then drill down into specific resources that aren’t compliant. By default, Compliance displays current compliance data about patching in Patch Manager and associations in State Manager. (Patch Manager and State Manager are also both tools in AWS Systems Manager.) To get started with Compliance, open the Systems Manager console. In the navigation pane, choose Compliance. Patch compliance data from Patch Manager can be sent to AWS Security Hub. Security Hub gives you a comprehensive view of your high-priority security alerts and compliance status. It also monitors the patching status of your fleet. For more information, see Integrating Patch Manager with AWS Security Hub. Compliance offers the following additional benefits and features: • View compliance history and change tracking for Patch Manager patching data and State Manager associations by using AWS Config. • Customize Compliance to create your own compliance types based on your IT or business requirements. • Remediate issues by using Run Command, another tool in AWS Systems Manager, State Manager, or Amazon EventBridge. • Port data to Amazon Athena and Amazon QuickSight to generate fleet-wide reports. EventBridge support This Systems Manager tool is supported as an event type in Amazon EventBridge rules. For information, see Monitoring Systems Manager events with Amazon EventBridge and Reference: Amazon EventBridge event patterns and types for Systems Manager. Chef InSpec integration Systems Manager integrates with Chef InSpec. InSpec is an open-source, runtime framework that allows you to create human-readable profiles on GitHub or Amazon Simple Storage Service (Amazon S3). You can then use Systems Manager to run compliance scans and view compliant and noncompliant managed nodes. For more information, see Using Chef InSpec profiles with Systems Manager Compliance. Compliance 210 AWS Systems Manager Pricing User Guide Compliance is offered at no additional charge. You only pay for the AWS resources that you use. Contents • Getting started with Compliance • Configuring permissions for Compliance • Creating a resource data sync for Compliance • Learn details about Compliance • Deleting a resource data sync for Compliance • Remediating compliance issues using EventBridge • Assign custom compliance metadata using the AWS CLI Getting started with Compliance To get started with Compliance, a tool in AWS Systems Manager, complete the following tasks. Task For more information Compliance works with patch data in Patch Manager and associations in State Manager. Setting up Systems Manager unified console for an organization (Patch Manager and State Manager are also both tools in AWS Systems Manager.) Compliance also works with custom complianc e types on managed nodes that are managed using Systems Manager. Verify that you have completed the setup requirements for your Amazon Elastic Compute Cloud (Amazon EC2) instances and non-EC2 machines in a hybrid and multicloud environment. Update the AWS Identity and Access Management (IAM) role used by your managed nodes to restrict Compliance permissions. Configuring permissions for Compliance If you plan to monitor patch compliance, verify that you've configured Patch Manager. AWS Systems Manager Patch Manager Compliance 211 AWS Systems Manager Task For more information User Guide You must perform patching operations by using Patch Manager before Compliance can display patch compliance data. If you plan to monitor association complianc e, verify that you've created State Manager associations. You must create associations before Compliance can display association compliance data. AWS Systems Manager State Manager (Optional) Configure the system to view compliance history and change tracking. Viewing compliance configuration history and change tracking Assign custom compliance metadata using the AWS CLI Creating a resource data sync for Compliance (Optional) Create custom compliance types. (Optional) Create a resource data sync to aggregate all compliance data in a target Amazon Simple Storage Service (Amazon S3) bucket. Configuring permissions for Compliance As a security best practice, we recommend that you update the AWS Identity and Access Management (IAM) role used by your managed nodes with the following permissions to restrict the node's ability to use the PutComplianceItems API action. This API action registers a compliance type and other compliance details on a designated resource, such as an Amazon EC2 instance or a managed node. If your node is an Amazon EC2 instance, you must update the IAM instance profile used by the instance with the following permissions. For more information about instance profiles for EC2 instance managed by
systems-manager-ug-070
systems-manager-ug.pdf
70
permissions for Compliance As a security best practice, we recommend that you update the AWS Identity and Access Management (IAM) role used by your managed nodes with the following permissions to restrict the node's ability to use the PutComplianceItems API action. This API action registers a compliance type and other compliance details on a designated resource, such as an Amazon EC2 instance or a managed node. If your node is an Amazon EC2 instance, you must update the IAM instance profile used by the instance with the following permissions. For more information about instance profiles for EC2 instance managed by Systems Manager, see Configure instance permissions required for Systems Manager. For other types of managed nodes, update the IAM role used by the node with the following permissions. For more information, see Update permissions for a role in the IAM User Guide. Compliance 212 AWS Systems Manager User Guide { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:PutComplianceItems" ], "Resource": "*", "Condition": { "StringEquals": { "ec2:SourceInstanceARN": "${ec2:SourceInstanceARN}" } } }, { "Effect": "Allow", "Action": [ "ssm:PutComplianceItems" ], "Resource": "*", "Condition": { "StringEquals": { "ssm:SourceInstanceARN": "${ssm:SourceInstanceARN}" } } } ] } Creating a resource data sync for Compliance You can use the resource data sync feature in AWS Systems Manager to send compliance data from all of your managed nodes to a target Amazon Simple Storage Service (Amazon S3) bucket. When you create the sync, you can specify managed nodes from multiple AWS accounts, AWS Regions, and your hybrid and multicloud environment. Resource data sync then automatically updates the centralized data when new compliance data is collected. With all compliance data stored in a target S3 bucket, you can use services like Amazon Athena and Amazon QuickSight to query and analyze the aggregated data. Configuring resource data sync for Compliance is a one-time operation. Use the following procedure to create a resource data sync for Compliance by using the AWS Management Console. Compliance 213 AWS Systems Manager User Guide To create and configure an S3 bucket for resource data sync (console) 1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/. 2. Create a bucket to store your aggregated compliance data. For more information, see Create a Bucket in the Amazon Simple Storage Service User Guide. Make a note of the bucket name and the AWS Region where you created it. 3. Open the bucket, choose the Permissions tab, and then choose Bucket Policy. 4. Copy and paste the following bucket policy into the policy editor. Replace amzn-s3-demo- bucket and Account-ID with the name of the S3 bucket you created and a valid AWS account ID. Optionally, replace Bucket-Prefix with the name of an Amazon S3 prefix (subdirectory). If you didn't create a prefix, remove Bucket-Prefix/ from the ARN in the policy. { "Version": "2012-10-17", "Statement": [ { "Sid": "SSMBucketPermissionsCheck", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "s3:GetBucketAcl", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket" }, { "Sid": " SSMBucketDelivery", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "s3:PutObject", "Resource": ["arn:aws:s3:::amzn-s3-demo-bucket/Bucket-Prefix/*/ accountid=Account_ID_number/*"], "Condition": { "StringEquals": { "s3:x-amz-acl": "bucket-owner-full-control" } } } ] } Compliance 214 AWS Systems Manager To create a resource data sync User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. 3. Choose Account management, Resource Data Syncs, and then choose Create resource data 4. 5. 6. 7. sync. In the Sync name field, enter a name for the sync configuration. In the Bucket name field, enter the name of the Amazon S3 bucket you created at the start of this procedure. (Optional) In the Bucket prefix field, enter the name of an S3 bucket prefix (subdirectory). In the Bucket region field, choose This region if the S3 bucket you created is located in the current AWS Region. If the bucket is located in a different AWS Region, choose Another region, and enter the name of the Region. Note If the sync and the target S3 bucket are located in different Regions, you might be subject to data transfer pricing. For more information, see Amazon S3 Pricing. 8. Choose Create. Learn details about Compliance Compliance, a tool in AWS Systems Manager, collects and reports data about the status of patching in Patch Manager patching and associations in State Manager. (Patch Manager and State Manager are also both tools in AWS Systems Manager.) Compliance also reports on custom compliance types you have specified for your managed nodes. This section includes details about each of these compliance types and how to view Systems Manager compliance data. This section also includes information about how to view compliance history and change tracking. Note Systems Manager integrates with Chef InSpec. InSpec is an open-source, runtime framework that allows you to create human-readable profiles on GitHub or Amazon Simple Storage Service (Amazon S3). Then you can use Systems
systems-manager-ug-071
systems-manager-ug.pdf
71
Manager patching and associations in State Manager. (Patch Manager and State Manager are also both tools in AWS Systems Manager.) Compliance also reports on custom compliance types you have specified for your managed nodes. This section includes details about each of these compliance types and how to view Systems Manager compliance data. This section also includes information about how to view compliance history and change tracking. Note Systems Manager integrates with Chef InSpec. InSpec is an open-source, runtime framework that allows you to create human-readable profiles on GitHub or Amazon Simple Storage Service (Amazon S3). Then you can use Systems Manager to run compliance scans Compliance 215 AWS Systems Manager User Guide and view compliant and noncompliant instances. For more information, see Using Chef InSpec profiles with Systems Manager Compliance. About patch compliance After you use Patch Manager to install patches on your instances, compliance status information is immediately available to you in the console or in response to AWS Command Line Interface (AWS CLI) commands or corresponding Systems Manager API operations. For information about patch compliance status values, see Patch compliance state values. About State Manager association compliance After you create one or more State Manager associations, compliance status information is immediately available to you in the console or in response to AWS CLI commands or corresponding Systems Manager API operations. For associations, Compliance shows statuses of Compliant or Non-compliant and the severity level assigned to the association, such as Critical or Medium. About custom compliance You can assign compliance metadata to a managed node. This metadata can then be aggregated with other compliance data for compliance reporting purposes. For example, say that your business runs versions 2.0, 3.0, and 4.0 of software X on your managed nodes. The company wants to standardize on version 4.0, meaning that instances running versions 2.0 and 3.0 are non-compliant. You can use the PutComplianceItems API operation to explicitly note which managed nodes are running older versions of software X. You can only assign compliance metadata by using the AWS CLI, AWS Tools for Windows PowerShell, or the SDKs. The following CLI sample command assigns compliance metadata to a managed instance and specifies the compliance type in the required format Custom:. Replace each example resource placeholder with your own information. Linux & macOS aws ssm put-compliance-items \ --resource-id i-1234567890abcdef0 \ --resource-type ManagedInstance \ --compliance-type Custom:SoftwareXCheck \ --execution-summary ExecutionTime=AnyStringToDenoteTimeOrDate \ --items Id=Version2.0,Title=SoftwareXVersion,Severity=CRITICAL,Status=NON_COMPLIANT Compliance 216 AWS Systems Manager Windows User Guide aws ssm put-compliance-items ^ --resource-id i-1234567890abcdef0 ^ --resource-type ManagedInstance ^ --compliance-type Custom:SoftwareXCheck ^ --execution-summary ExecutionTime=AnyStringToDenoteTimeOrDate ^ --items Id=Version2.0,Title=SoftwareXVersion,Severity=CRITICAL,Status=NON_COMPLIANT Note The ResourceType parameter only supports ManagedInstance. If you add custom compliance to a managed AWS IoT Greengrass core device, you must specify a ResourceType of ManagedInstance. Compliance managers can then view summaries or create reports about which managed nodes are or aren't compliant. You can assign a maximum of 10 different custom compliance types to a managed node. For an example of how to create a custom compliance type and view compliance data, see Assign custom compliance metadata using the AWS CLI. Viewing current compliance data This section describes how to view compliance data in the Systems Manager console and by using the AWS CLI. For information about how to view patch and association compliance history and change tracking, see Viewing compliance configuration history and change tracking. Topics • Viewing current compliance data (console) • Viewing current compliance data (AWS CLI) Viewing current compliance data (console) Use the following procedure to view compliance data in the Systems Manager console. Compliance 217 AWS Systems Manager User Guide To view current compliance reports in the Systems Manager console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. manager/. In the navigation pane, choose Compliance. In the Compliance dashboard filtering section, choose an option to filter compliance data. The Compliance resources summary section displays counts of compliance data based on the filter you chose. To drill down into a resource for more information, scroll down to the Details overview for resources area and choose the ID of a managed node. 5. On the Instance ID or Name details page, choose the Configuration compliance tab to view a detailed configuration compliance report for the managed node. Note For information about fixing compliance issues, see Remediating compliance issues using EventBridge. Viewing current compliance data (AWS CLI) You can view summaries of compliance data for patching, associations, and custom compliance types in the in the AWS CLI by using the following AWS CLI commands. list-compliance-summaries Returns a summary count of compliant and non-compliant association statuses according to the filter you specify. (API: ListComplianceSummaries) list-resource-compliance-summaries Returns a resource-level summary count. The summary includes information about compliant and non-compliant statuses and detailed compliance-item severity counts, according to the filter criteria you specify. (API: ListResourceComplianceSummaries) You can view additional compliance data
systems-manager-ug-072
systems-manager-ug.pdf
72
Note For information about fixing compliance issues, see Remediating compliance issues using EventBridge. Viewing current compliance data (AWS CLI) You can view summaries of compliance data for patching, associations, and custom compliance types in the in the AWS CLI by using the following AWS CLI commands. list-compliance-summaries Returns a summary count of compliant and non-compliant association statuses according to the filter you specify. (API: ListComplianceSummaries) list-resource-compliance-summaries Returns a resource-level summary count. The summary includes information about compliant and non-compliant statuses and detailed compliance-item severity counts, according to the filter criteria you specify. (API: ListResourceComplianceSummaries) You can view additional compliance data for patching by using the following AWS CLI commands. Compliance 218 AWS Systems Manager describe-patch-group-state User Guide Returns high-level aggregated patch compliance state for a patch group. (API: DescribePatchGroupState) describe-instance-patch-states-for-patch-group Returns the high-level patch state for the instances in the specified patch group. (API: DescribeInstancePatchStatesForPatchGroup) Note For an illustration of how to configure patching and view patch compliance details by using the AWS CLI, see Tutorial: Patch a server environment using the AWS CLI. Viewing compliance configuration history and change tracking Systems Manager Compliance displays current patching and association compliance data for your managed nodes. You can view patching and association compliance history and change tracking by using AWS Config. AWS Config provides a detailed view of the configuration of AWS resources in your AWS account. This includes how the resources are related to one another and how they were configured in the past so that you can see how the configurations and relationships change over time. To view patching and association compliance history and change tracking, you must turn on the following resources in AWS Config: • SSM:PatchCompliance • SSM:AssociationCompliance For information about how to choose and configure these specific resources in AWS Config, see Selecting Which Resources AWS Config Records in the AWS Config Developer Guide. Note For information about AWS Config pricing, see Pricing. Compliance 219 AWS Systems Manager User Guide Deleting a resource data sync for Compliance If you no longer want to use AWS Systems Manager Compliance to view compliance data, then we also recommend deleting resource data syncs used for Compliance data collection. To delete a Compliance resource data sync 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. 3. Choose Account management, Resource data syncs. 4. Choose a sync in the list. Important Make sure you choose the sync used for Compliance. Systems Manager supports resource data sync for multiple tools. If you choose the wrong sync, you could disrupt data aggregation for Systems Manager Explorer or Systems Manager Inventory. 5. Choose Delete. 6. Delete the Amazon Simple Storage Service (Amazon S3) bucket where the data was stored. For information about deleting an S3 bucket, see Deleting a bucket. Remediating compliance issues using EventBridge You can quickly remediate patch and association compliance issues by using Run Command, a tool in AWS Systems Manager. You can target instance or AWS IoT Greengrass core device IDs or tags and run the AWS-RunPatchBaseline document or the AWS-RefreshAssociation document. If refreshing the association or re-running the patch baseline fails to resolve the compliance issue, then you need to investigate your associations, patch baselines, or instance configurations to understand why the Run Command operations didn't resolve the problem. For more information about patching, see AWS Systems Manager Patch Manager and SSM Command document for patching: AWS-RunPatchBaseline. For more information about associations, see Working with associations in Systems Manager. For more information about running a command, see AWS Systems Manager Run Command. Compliance 220 AWS Systems Manager User Guide Specify Compliance as the target of an EventBridge event You can also configure Amazon EventBridge to perform an action in response to Systems Manager Compliance events. For example, if one or more managed nodes fail to install Critical patch updates or run an association that installs anti-virus software, then you can configure EventBridge to run the AWS-RunPatchBaseline document or the AWS-RefreshAssocation document when the Compliance event occurs. Use the following procedure to configure Compliance as the target of an EventBridge event. To configure Compliance as the target of a EventBridge event (console) 1. Open the Amazon EventBridge console at https://console.aws.amazon.com/events/. 2. In the navigation pane, choose Rules. 3. Choose Create rule. 4. Enter a name and description for the rule. A rule can't have the same name as another rule in the same AWS Region and on the same event bus. 5. For Event bus, choose the event bus that you want to associate with this rule. If you want this rule to respond to matching events that come from your own AWS account, select default. When an AWS service in your account emits an event, it always goes to your account’s default event bus. 6. For Rule type, choose Rule
systems-manager-ug-073
systems-manager-ug.pdf
73
In the navigation pane, choose Rules. 3. Choose Create rule. 4. Enter a name and description for the rule. A rule can't have the same name as another rule in the same AWS Region and on the same event bus. 5. For Event bus, choose the event bus that you want to associate with this rule. If you want this rule to respond to matching events that come from your own AWS account, select default. When an AWS service in your account emits an event, it always goes to your account’s default event bus. 6. For Rule type, choose Rule with an event pattern. 7. Choose Next. 8. 9. For Event source, choose AWS events or EventBridge partner events. In the Event pattern section, choose Event pattern form. 10. For Event source, choose AWS services. 11. For AWS service, choose Systems Manager. 12. For Event type, choose Configuration Compliance. 13. For Specific detail type(s), choose Configuration Compliance State Change. 14. Choose Next. 15. For Target types, choose AWS service. 16. For Select a target, choose Systems Manager Run Command. Compliance 221 AWS Systems Manager User Guide 17. In the Document list, choose a Systems Manager document (SSM document) to run when your target is invoked. For example, choose AWS-RunPatchBaseline for a non-compliant patch event, or choose AWS-RefreshAssociation for a non-compliant association event. 18. Specify information for the remaining fields and parameters. Note Required fields and parameters have an asterisk (*) next to the name. To create a target, you must specify a value for each required parameter or field. If you don't, the system creates the rule, but the rule won't be run. 19. Choose Next. 20. (Optional) Enter one or more tags for the rule. For more information, see Tagging Your Amazon EventBridge Resources in the Amazon EventBridge User Guide. 21. Choose Next. 22. Review the details of the rule and choose Create rule. Assign custom compliance metadata using the AWS CLI The following procedure walks you through the process of using the AWS Command Line Interface (AWS CLI) to call the AWS Systems Manager PutComplianceItems API operation to assign custom compliance metadata to a resource. You can also use this API operation to manually assign patch or association compliance metadata to a managed nodes, as shown in the following walkthrough. For more information about custom compliance, see About custom compliance. To assign custom compliance metadata to a managed instance (AWS CLI) 1. Install and configure the AWS Command Line Interface (AWS CLI), if you haven't already. For information, see Installing or updating the latest version of the AWS CLI. 2. Run the following command to assign custom compliance metadata to a managed node. Replace each example resource placeholder with your own information. The ResourceType parameter only supports a value of ManagedInstance. Specify this value even if you are assigning custom compliance metadata to a managed AWS IoT Greengrass core device. Compliance 222 AWS Systems Manager Linux & macOS User Guide aws ssm put-compliance-items \ --resource-id instance_ID \ --resource-type ManagedInstance \ --compliance-type Custom:user-defined_string \ --execution-summary ExecutionTime=user-defined_time_and/or_date_value \ --items Id=user-defined_ID,Title=user- defined_title,Severity=one_or_more_comma-separated_severities:CRITICAL, MAJOR, MINOR,INFORMATIONAL, or UNSPECIFIED,Status=COMPLIANT or NON_COMPLIANT Windows aws ssm put-compliance-items ^ --resource-id instance_ID ^ --resource-type ManagedInstance ^ --compliance-type Custom:user-defined_string ^ --execution-summary ExecutionTime=user-defined_time_and/or_date_value ^ --items Id=user-defined_ID,Title=user- defined_title,Severity=one_or_more_comma-separated_severities:CRITICAL, MAJOR, MINOR,INFORMATIONAL, or UNSPECIFIED,Status=COMPLIANT or NON_COMPLIANT 3. Repeat the previous step to assign additional custom compliance metadata to one or more nodes. You can also manually assign patch or association compliance metadata to managed nodes by using the following commands: Association compliance metadata Linux & macOS aws ssm put-compliance-items \ --resource-id instance_ID \ --resource-type ManagedInstance \ --compliance-type Association \ --execution-summary ExecutionTime=user-defined_time_and/or_date_value \ --items Id=user-defined_ID,Title=user- defined_title,Severity=one_or_more_comma-separated_severities:CRITICAL, MAJOR, MINOR,INFORMATIONAL, or UNSPECIFIED,Status=COMPLIANT or NON_COMPLIANT Compliance 223 AWS Systems Manager Windows User Guide aws ssm put-compliance-items ^ --resource-id instance_ID ^ --resource-type ManagedInstance ^ --compliance-type Association ^ --execution-summary ExecutionTime=user-defined_time_and/or_date_value ^ --items Id=user-defined_ID,Title=user- defined_title,Severity=one_or_more_comma-separated_severities:CRITICAL, MAJOR, MINOR,INFORMATIONAL, or UNSPECIFIED,Status=COMPLIANT or NON_COMPLIANT Patch compliance metadata Linux & macOS aws ssm put-compliance-items \ --resource-id instance_ID \ --resource-type ManagedInstance \ --compliance-type Patch \ --execution-summary ExecutionTime=user-defined_time_and/ or_date_value,ExecutionId=user-defined_ID,ExecutionType=Command \ --items Id=for_example, KB12345,Title=user- defined_title,Severity=one_or_more_comma-separated_severities:CRITICAL, MAJOR, MINOR,INFORMATIONAL, or UNSPECIFIED,Status=COMPLIANT or NON_COMPLIANT,Details="{PatchGroup=name_of_group,PatchSeverity=the_patch_severity, for example, CRITICAL}" Windows aws ssm put-compliance-items ^ --resource-id instance_ID ^ --resource-type ManagedInstance ^ --compliance-type Patch ^ --execution-summary ExecutionTime=user-defined_time_and/ or_date_value,ExecutionId=user-defined_ID,ExecutionType=Command ^ --items Id=for_example, KB12345,Title=user- defined_title,Severity=one_or_more_comma-separated_severities:CRITICAL, MAJOR, MINOR,INFORMATIONAL, or UNSPECIFIED,Status=COMPLIANT or NON_COMPLIANT,Details="{PatchGroup=name_of_group,PatchSeverity=the_patch_severity, for example, CRITICAL}" Compliance 224 AWS Systems Manager User Guide 4. Run the following command to view a list of compliance items for a specific managed node. Use filters to drill down into specific compliance data. Linux & macOS aws ssm list-compliance-items \ --resource-ids instance_ID \ --resource-types ManagedInstance \ --filters one_or_more_filters Windows aws ssm list-compliance-items ^ --resource-ids instance_ID ^ --resource-types ManagedInstance ^ --filters one_or_more_filters The following examples show you how to use this command with filters. Linux & macOS aws ssm list-compliance-items \ --resource-ids i-02573cafcfEXAMPLE \ --resource-type ManagedInstance \ --filters Key=DocumentName,Values=AWS-RunPowerShellScript Key=Status,Values=NON_COMPLIANT,Type=NotEqual Key=Id,Values=cee20ae7-6388-488e-8be1-a88ccEXAMPLE Key=Severity,Values=UNSPECIFIED Windows
systems-manager-ug-074
systems-manager-ug.pdf
74
MINOR,INFORMATIONAL, or UNSPECIFIED,Status=COMPLIANT or NON_COMPLIANT,Details="{PatchGroup=name_of_group,PatchSeverity=the_patch_severity, for example, CRITICAL}" Compliance 224 AWS Systems Manager User Guide 4. Run the following command to view a list of compliance items for a specific managed node. Use filters to drill down into specific compliance data. Linux & macOS aws ssm list-compliance-items \ --resource-ids instance_ID \ --resource-types ManagedInstance \ --filters one_or_more_filters Windows aws ssm list-compliance-items ^ --resource-ids instance_ID ^ --resource-types ManagedInstance ^ --filters one_or_more_filters The following examples show you how to use this command with filters. Linux & macOS aws ssm list-compliance-items \ --resource-ids i-02573cafcfEXAMPLE \ --resource-type ManagedInstance \ --filters Key=DocumentName,Values=AWS-RunPowerShellScript Key=Status,Values=NON_COMPLIANT,Type=NotEqual Key=Id,Values=cee20ae7-6388-488e-8be1-a88ccEXAMPLE Key=Severity,Values=UNSPECIFIED Windows aws ssm list-compliance-items ^ --resource-ids i-02573cafcfEXAMPLE ^ --resource-type ManagedInstance ^ --filters Key=DocumentName,Values=AWS-RunPowerShellScript Key=Status,Values=NON_COMPLIANT,Type=NotEqual Key=Id,Values=cee20ae7-6388-488e-8be1-a88ccEXAMPLE Key=Severity,Values=UNSPECIFIED Compliance 225 AWS Systems Manager Linux & macOS User Guide aws ssm list-resource-compliance-summaries \ --filters Key=OverallSeverity,Values=UNSPECIFIED Windows aws ssm list-resource-compliance-summaries ^ --filters Key=OverallSeverity,Values=UNSPECIFIED Linux & macOS aws ssm list-resource-compliance-summaries \ --filters Key=OverallSeverity,Values=UNSPECIFIED Key=ComplianceType,Values=Association Key=InstanceId,Values=i-02573cafcfEXAMPLE Windows aws ssm list-resource-compliance-summaries ^ --filters Key=OverallSeverity,Values=UNSPECIFIED Key=ComplianceType,Values=Association Key=InstanceId,Values=i-02573cafcfEXAMPLE 5. Run the following command to view a summary of compliance statuses. Use filters to drill down into specific compliance data. aws ssm list-resource-compliance-summaries --filters One or more filters. The following examples show you how to use this command with filters. Linux & macOS aws ssm list-resource-compliance-summaries \ --filters Key=ExecutionType,Values=Command Windows aws ssm list-resource-compliance-summaries ^ Compliance 226 AWS Systems Manager User Guide --filters Key=ExecutionType,Values=Command Linux & macOS aws ssm list-resource-compliance-summaries \ --filters Key=AWS:InstanceInformation.PlatformType,Values=Windows Key=OverallSeverity,Values=CRITICAL Windows aws ssm list-resource-compliance-summaries ^ --filters Key=AWS:InstanceInformation.PlatformType,Values=Windows Key=OverallSeverity,Values=CRITICAL 6. Run the following command to view a summary count of compliant and non-compliant resources for a compliance type. Use filters to drill down into specific compliance data. aws ssm list-compliance-summaries --filters One or more filters. The following examples show you how to use this command with filters. Linux & macOS aws ssm list-compliance-summaries \ --filters Key=AWS:InstanceInformation.PlatformType,Values=Windows Key=PatchGroup,Values=TestGroup Windows aws ssm list-compliance-summaries ^ --filters Key=AWS:InstanceInformation.PlatformType,Values=Windows Key=PatchGroup,Values=TestGroup Linux & macOS aws ssm list-compliance-summaries \ --filters Key=AWS:InstanceInformation.PlatformType,Values=Windows Key=ExecutionId,Values=4adf0526-6aed-4694-97a5-14522EXAMPLE Compliance 227 AWS Systems Manager Windows User Guide aws ssm list-compliance-summaries ^ --filters Key=AWS:InstanceInformation.PlatformType,Values=Windows Key=ExecutionId,Values=4adf0526-6aed-4694-97a5-14522EXAMPLE AWS Systems Manager Distributor Distributor, a tool in AWS Systems Manager, helps you package and publish software to AWS Systems Manager managed nodes. You can package and publish your own software or use Distributor to find and publish AWS-provided agent software packages, such as AmazonCloudWatchAgent, or third-party packages such as Trend Micro. Publishing a package advertises specific versions of the package's document to managed nodes that you identify using node IDs, AWS account IDs, tags, or an AWS Region. To get started with Distributor, open the Systems Manager console. In the navigation pane, choose Distributor. After you create a package in Distributor, you can install the package in one of the following ways: • One time by using AWS Systems Manager Run Command • On a schedule by using AWS Systems Manager State Manager Important Packages distributed by third-party sellers are not managed by AWS and are published by the vendor of the package. We encourage you to conduct additional due diligence to ensure compliance with your internal security controls. Security is a shared responsibility between AWS and you. This is described as the shared responsibility model. To learn more, see the shared responsibility model. How can Distributor benefit my organization? Distributor offers these benefits: • One package, many platforms Distributor 228 AWS Systems Manager User Guide When you create a package in Distributor, the system creates an AWS Systems Manager document (SSM document). You can attach .zip files to this document. When you run Distributor, the system processes the instructions in the SSM document and installs the software package in the .zip file on the specified targets. Distributor supports multiple operating systems, including Windows, Ubuntu Server, Debian Server, and Red Hat Enterprise Linux. For more information about supported platforms, see Supported package platforms and architectures. • Control package access across groups of managed instances You can use Run Command or State Manager to control which of your managed nodes get a package and which version of that package. Run Command and State Manager are tools in AWS Systems Manager. Managed nodes can be grouped by instance or device IDs, AWS account numbers, tags, or AWS Regions. You can use State Manager associations to deliver different versions of a package to different groups of instances. • Many AWS agent packages included and ready to use Distributor includes many AWS agent packages that are ready for you to deploy to managed nodes. Look for packages in the Distributor Packages list page that are published by Amazon. Examples include AmazonCloudWatchAgent and AWSPVDriver. • Automate deployment To keep your environment current, use State Manager to schedule packages for automatic deployment on target managed nodes when those machines are first launched. Who should use Distributor? • Any AWS customer who wants to create new or deploy existing software packages, including AWS published packages,
systems-manager-ug-075
systems-manager-ug.pdf
75
package to different groups of instances. • Many AWS agent packages included and ready to use Distributor includes many AWS agent packages that are ready for you to deploy to managed nodes. Look for packages in the Distributor Packages list page that are published by Amazon. Examples include AmazonCloudWatchAgent and AWSPVDriver. • Automate deployment To keep your environment current, use State Manager to schedule packages for automatic deployment on target managed nodes when those machines are first launched. Who should use Distributor? • Any AWS customer who wants to create new or deploy existing software packages, including AWS published packages, to multiple Systems Manager managed nodes at one time. • Software developers who create software packages. • Administrators who are responsible for keeping Systems Manager managed nodes current with the most up-to-date software packages. What are the features of Distributor? • Deployment of packages to both Windows and Linux instances Distributor 229 AWS Systems Manager User Guide With Distributor, you can deploy software packages to Amazon Elastic Compute Cloud (Amazon EC2) instances and AWS IoT Greengrass core devices for Linux and Windows Server. For a list of supported instance operating system types, see the section called “Supported package platforms and architectures”. Note Distributor isn't supported on the macOS operating system. • Deploy packages one time, or on an automated schedule You can choose to deploy packages one time, on a regular schedule, or whenever the default package version is changed to a different version. • Completely reinstall packages, or perform in-place updates To install a new package version, you can completely uninstall the current version and install a new one in its place, or only update the current version with new and updated components, according to an update script that you provide. Your package application is unavailable during a reinstallation, but can remain available during an in-place update. In-place updates are especially useful for security monitoring applications or other scenarios where you need to avoid application downtime. • Console, CLI, PowerShell, and SDK access to Distributor capabilities You can work with Distributor by using the Systems Manager console, AWS Command Line Interface (AWS CLI), AWS Tools for PowerShell, or the AWS SDK of your choice. • IAM access control By using AWS Identity and Access Management (IAM) policies, you can control which members of your organization can create, update, deploy, or delete packages or package versions. For example, you might want to give an administrator permissions to deploy packages, but not to change packages or create new package versions. • Logging and auditing capability support You can audit and log Distributor user actions in your AWS account through integration with other AWS services. For more information, see Auditing and logging Distributor activity. Distributor 230 AWS Systems Manager User Guide What is a package in Distributor? A package is a collection of installable software or assets that includes the following. • A .zip file of software per target operating system platform. Each .zip file must include the following. • An install and an uninstall script. Windows Server-based managed nodes require PowerShell scripts (scripts named install.ps1 and uninstall.ps1). Linux-based managed nodes require shell scripts (scripts named install.sh and uninstall.sh). AWS Systems Manager SSM Agent reads and carries out the instructions in the install and uninstall scripts. • An executable file. SSM Agent must find this executable to install the package on target managed nodes. • A JSON-formatted manifest file that describes the package contents. The manifest isn't included in the .zip file, but it's stored in the same Amazon Simple Storage Service (Amazon S3) bucket as the .zip files that form the package. The manifest identifies the package version and maps the .zip files in the package to target managed node attributes, such as operating system version or architecture. For information about how to create the manifest, see Step 2: Create the JSON package manifest. When you choose Simple package creation in the Distributor console, Distributor generates the installation and uninstallation scripts, file hashes, and the JSON package manifest for you, based on the software executable file name and target platforms and architectures. Supported package platforms and architectures You can use Distributor to publish packages to the following Systems Manager managed node platforms. A version value must match the exact release version of the operating system Amazon Machine Image (AMI) that you're targeting. For more information about determining this version, see step 4 of Step 2: Create the JSON package manifest. Note Systems Manager doesn't support all of the following operating systems for AWS IoT Greengrass core devices. For more information, see Setting up AWS IoT Greengrass core devices in the AWS IoT Greengrass Version 2 Developer Guide. Distributor 231 AWS Systems Manager User Guide Platform AlmaLinux almalinux Code value in manifest file Supported architectures Amazon Linux 1, Amazon Linux 2, and
systems-manager-ug-076
systems-manager-ug.pdf
76
platforms. A version value must match the exact release version of the operating system Amazon Machine Image (AMI) that you're targeting. For more information about determining this version, see step 4 of Step 2: Create the JSON package manifest. Note Systems Manager doesn't support all of the following operating systems for AWS IoT Greengrass core devices. For more information, see Setting up AWS IoT Greengrass core devices in the AWS IoT Greengrass Version 2 Developer Guide. Distributor 231 AWS Systems Manager User Guide Platform AlmaLinux almalinux Code value in manifest file Supported architectures Amazon Linux 1, Amazon Linux 2, and Amazon Linux amazon 2023 CentOS Debian Server centos debian openSUSE opensuse x86_64 ARM64 x86_64 or x86 ARM64 (Amazon Linux 2 and AL2023, A1 instance types) x86_64 or x86 x86_64 or x86 x86_64 or x86 openSUSE Leap opensuseleap x86_64 or x86 Oracle Linux Red Hat Enterprise Linux (RHEL) oracle redhat Rocky Linux rocky SUSE Linux Enterprise Server (SLES) suse x86_64 x86_64 or x86 ARM64 (RHEL 7.6 and later, A1 instance types) x86_64 ARM64 x86_64 or x86 Ubuntu Server ubuntu x86_64 or x86 ARM64 (Ubuntu Server 16 and later, A1 instance types) Windows Server windows x86_64 or x86 Distributor 232 AWS Systems Manager Topics • Setting up Distributor • Working with Distributor packages • Auditing and logging Distributor activity • Troubleshooting AWS Systems Manager Distributor Setting up Distributor User Guide Before you use Distributor, a tool in AWS Systems Manager, to create, manage, and deploy software packages, follow these steps. Complete Distributor prerequisites Before you use Distributor, a tool in AWS Systems Manager, be sure your environment meets the following requirements. Distributor prerequisites Requirement SSM Agent AWS CLI Description AWS Systems Manager SSM Agent version 2.3.274.0 or later must be installed on the managed nodes on which you want to deploy or from which you want to remove packages. To install or update SSM Agent, see Working with SSM Agent. (Optional) To use the AWS Command Line Interface (AWS CLI) instead of the Systems Manager console to create and manage packages, install the newest release of the AWS CLI on your local computer. For more information about how to install or upgrade the CLI, see Installing the AWS Command Line Interface in the AWS Command Line Interface User Guide. Distributor 233 AWS Systems Manager Requirement AWS Tools for PowerShell User Guide Description (Optional) To use the Tools for PowerShel l instead of the Systems Manager console to create and manage packages, install the newest release of Tools for PowerShell on your local computer. For more information about how to install or upgrade the Tools for PowerShell, see Setting up the AWS Tools for Windows PowerShell or AWS Tools for PowerShell Core in the AWS Tools for Windows PowerShell User Guide. Note Systems Manager doesn't support distributing packages to Oracle Linux managed nodes by using Distributor. Verify or create an IAM instance profile with Distributor permissions By default, AWS Systems Manager doesn't have permission to perform actions on your instances. You must grant access by using an AWS Identity and Access Management (IAM) instance profile. An instance profile is a container that passes IAM role information to an Amazon Elastic Compute Cloud (Amazon EC2) instance at launch. This requirement applies to permissions for all Systems Manager tools, not just Distributor. Note When you configure your edge devices to run AWS IoT Greengrass Core software and SSM Agent, you specify an IAM service role that enables Systems Manager to peform actions on it. You don't need to configure managed edge devices with an instance profile. If you already use other Systems Manager tools, such as Run Command and State Manager, an instance profile with the required permissions for Distributor is already attached to your instances. Distributor 234 AWS Systems Manager User Guide The simplest way to ensure that you have permissions to perform Distributor tasks is to attach the AmazonSSMManagedInstanceCore policy to your instance profile. For more information, see Configure instance permissions required for Systems Manager. Control user access to packages Using AWS Identity and Access Management (IAM) policies, you can control who can create, deploy, and manage packages. You also control which Run Command and State Manager API operations they can perform on managed nodes. Like Distributor, both Run Command and State Manager, are tools in AWS Systems Manager. ARN Format User-defined packages are associated with document Amazon Resource Names (ARNs) and have the following format. arn:aws:ssm:region:account-id:document/document-name The following is an example. arn:aws:ssm:us-west-1:123456789012:document/ExampleDocumentName You can use a pair of AWS supplied default IAM policies, one for end users and one for administrators, to grant permissions for Distributor activities. Or you can create custom IAM policies appropriate for your permissions requirements. For more information about using variables in IAM policies, see IAM Policy Elements: Variables. For information about how to create policies and attach
systems-manager-ug-077
systems-manager-ug.pdf
77
managed nodes. Like Distributor, both Run Command and State Manager, are tools in AWS Systems Manager. ARN Format User-defined packages are associated with document Amazon Resource Names (ARNs) and have the following format. arn:aws:ssm:region:account-id:document/document-name The following is an example. arn:aws:ssm:us-west-1:123456789012:document/ExampleDocumentName You can use a pair of AWS supplied default IAM policies, one for end users and one for administrators, to grant permissions for Distributor activities. Or you can create custom IAM policies appropriate for your permissions requirements. For more information about using variables in IAM policies, see IAM Policy Elements: Variables. For information about how to create policies and attach them to users or groups, see Creating IAM Policies and Adding and Removing IAM Policies in the IAM User Guide. Create or choose an Amazon S3 bucket to store Distributor packages When you create a package by using the Simple workflow in the AWS Systems Manager console, you choose an existing Amazon Simple Storage Service (Amazon S3) bucket to which Distributor uploads your software. Distributor is a tool in AWS Systems Manager. In the Advanced workflow, you must upload .zip files of your software or assets to an Amazon S3 bucket before you begin. Whether you create a package by using the Simple or Advanced workflows in the console, or by using the API, you must have an Amazon S3 bucket before you start creating your package. As part of the package creation process, Distributor copies your installable software and assets from this Distributor 235 AWS Systems Manager User Guide bucket to an internal Systems Manager store. Because the assets are copied to an internal store, you can delete or repurpose your Amazon S3 bucket when package creation is finished. For more information about how to create a bucket, see Create a Bucket in the Amazon Simple Storage Service Getting Started Guide. For more information about how to run an AWS CLI command to create a bucket, see mb in the AWS CLI Command Reference. Working with Distributor packages You can use the AWS Systems Manager console, AWS command line tools (AWS CLI and AWS Tools for PowerShell), and AWS SDKs to add, manage, or deploy packages in Distributor. Distributor is a tool in AWS Systems Manager. Before you add a package to Distributor: • Create and zip installable assets. • (Optional) Create a JSON manifest file for the package. This isn't required to use the Simple package creation process in the Distributor console. Simple package creation generates a JSON manifest file for you. You can use the AWS Systems Manager console or a text or JSON editor to create the manifest file. • Have an Amazon Simple Storage Service (Amazon S3) bucket ready to store your installable assets or software. If you're using the Advanced package creation process, upload your assets to the Amazon S3 bucket before you begin. Note You can delete or repurpose this bucket after you finish creating your package because Distributor moves the package contents to an internal Systems Manager bucket as part of the package creation process. AWS published packages are already packaged and ready for deployment. To deploy an AWS- published package to managed nodes, see Install or update Distributor packages. You can share Distributor packages between AWS accounts. When using a package shared from another account in AWS CLI commands use the package Amazon Resource Name (ARN) instead of the package name. Topics Distributor 236 User Guide AWS Systems Manager • View packages in Distributor • Create a package in Distributor • Edit Distributor package permissions in the console • Edit Distributor package tags in the console • Add a version to a Distributor package • Install or update Distributor packages • Uninstall a Distributor package • Delete a Distributor package View packages in Distributor To view packages that are available for installation, you can use the AWS Systems Manager console or your preferred AWS command line tool. Distributor is a tool in AWS Systems Manager. To access Distributor, open the AWS Systems Manager console and choose Distributor in the left navigation pane. You will see all of the packages available to you. The following section describes how you can view Distributor packages using your preferred command line tool. View packages using the command line This section contains information about how you can use your preferred command line tool to view Distributor packages using the provided commands. Linux & macOS To view packages using the AWS CLI on Linux • To view all packages, excluding shared packages, run the following command. aws ssm list-documents \ --filters Key=DocumentType,Values=Package • To view all packages owned by Amazon, run the following command. aws ssm list-documents \ --filters Key=DocumentType,Values=Package Key=Owner,Values=Amazon • To view all packages owned by third parties, run the following command. Distributor 237 AWS Systems Manager User Guide aws ssm list-documents \ --filters Key=DocumentType,Values=Package
systems-manager-ug-078
systems-manager-ug.pdf
78
the command line This section contains information about how you can use your preferred command line tool to view Distributor packages using the provided commands. Linux & macOS To view packages using the AWS CLI on Linux • To view all packages, excluding shared packages, run the following command. aws ssm list-documents \ --filters Key=DocumentType,Values=Package • To view all packages owned by Amazon, run the following command. aws ssm list-documents \ --filters Key=DocumentType,Values=Package Key=Owner,Values=Amazon • To view all packages owned by third parties, run the following command. Distributor 237 AWS Systems Manager User Guide aws ssm list-documents \ --filters Key=DocumentType,Values=Package Key=Owner,Values=ThirdParty Windows To view packages using the AWS CLI on Windows • To view all packages, excluding shared packages, run the following command. aws ssm list-documents ^ --filters Key=DocumentType,Values=Package • To view all packages owned by Amazon, run the following command. aws ssm list-documents ^ --filters Key=DocumentType,Values=Package Key=Owner,Values=Amazon • To view all packages owned by third parties, run the following command. aws ssm list-documents ^ --filters Key=DocumentType,Values=Package Key=Owner,Values=ThirdParty PowerShell To view packages using the Tools for PowerShell • To view all packages, excluding shared packages, run the following command. $filter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $filter.Key = "DocumentType" $filter.Values = "Package" Get-SSMDocumentList ` -Filters @($filter) • To view all packages owned by Amazon, run the following command. $typeFilter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter Distributor 238 AWS Systems Manager User Guide $typeFilter.Key = "DocumentType" $typeFilter.Values = "Package" $ownerFilter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $ownerFilter.Key = "Owner" $ownerFilter.Values = "Amazon" Get-SSMDocumentList ` -Filters @($typeFilter,$ownerFilter) • To view all packages owned by third parties, run the following command. $typeFilter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $typeFilter.Key = "DocumentType" $typeFilter.Values = "Package" $ownerFilter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $ownerFilter.Key = "Owner" $ownerFilter.Values = "ThirdParty" Get-SSMDocumentList ` -Filters @($typeFilter,$ownerFilter) Create a package in Distributor To create a package, prepare your installable software or assets, one file per operating system platform. At least one file is required to create a package. Different platforms might sometimes use the same file, but all files that you attach to your package must be listed in the Files section of the manifest. If you're creating a package by using the simple workflow in the console, the manifest is generated for you. The maximum number of files that you can attach to a single document is 20. The maximum size of each file is 1 GB. For more information about supported platforms, see Supported package platforms and architectures. When you create a package, the system creates a new SSM document. This document allows you to deploy the package to managed nodes. For demonstration purposes only, an example package, ExamplePackage.zip, is available for you to download from our website. The example package includes a completed JSON manifest and Distributor 239 AWS Systems Manager User Guide three .zip files containing installers for PowerShell v7.0.0. The installation and uninstallation scripts don't contain valid commands. Although you must zip each software installable and scripts into a .zip file to create a package in the Advanced workflow, you don't zip installable assets in the Simple workflow. Topics • Create a package using the Simple workflow • Create a package using the Advanced workflow Create a package using the Simple workflow This section describes how to create a package in Distributor by choosing the Simple package creation workflow in the Distributor console. Distributor is a tool in AWS Systems Manager. To create a package, prepare your installable assets, one file per operating system platform. At least one file is required to create a package. The Simple package creation process generates installation and uninstallation scripts, file hashes, and a JSON-formatted manifest for you. The Simple workflow handles the process of uploading and zipping your installable files, and creating a new package and associated SSM document. For more information about supported platforms, see Supported package platforms and architectures. When you use the Simple method to create a package, Distributor creates install and uninstall scripts for you. However, when you create a package for an in-place update, you must provide your own update script content on the Update script tab. When you add input commands for an update script, Distributor includes this script in the .zip package it creates for you, along with the install and uninstall scripts. Note Use the In-place update option to add new or updated files to an existing package installation without taking the associated application offline. To create a package using the Simple workflow 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. Distributor 240 AWS Systems Manager User Guide 3. On the Distributor home page, choose Create package, and then choose Simple. 4. On the Create package page, enter a name for your package. Package names can contain letters, numbers, periods, dashes, and underscores. The name should be generic enough to apply to all versions of the
systems-manager-ug-079
systems-manager-ug.pdf
79
In-place update option to add new or updated files to an existing package installation without taking the associated application offline. To create a package using the Simple workflow 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. Distributor 240 AWS Systems Manager User Guide 3. On the Distributor home page, choose Create package, and then choose Simple. 4. On the Create package page, enter a name for your package. Package names can contain letters, numbers, periods, dashes, and underscores. The name should be generic enough to apply to all versions of the package attachments, but specific enough to identify the purpose of the package. 5. 6. 7. 8. (Optional) For Version name, enter a version name. Version names can be a maximum of 512 characters, and can't contain special characters. For Location, choose a bucket by using the bucket name and prefix or by using the bucket URL. For Upload software, choose Add software, and then navigate to installable software files with .rpm, .msi, or .deb extensions. If the file name contains spaces, the upload fails. You can upload more than one software file in a single action. For Target platform, verify that the target operating system platform shown for each installable file is correct. If the operating system shown isn't correct, choose the correct operating system from the dropdown list. For the Simple package creation workflow, because you upload each installable file only once, extra steps are required to instruct Distributor to target a single file at multiple operating systems. For example, if you upload an installable software file named Logtool_v1.1.1.rpm, you must change some defaults in the Simple workflow to target the same software at both Amazon Linux and Ubuntu operating systems. When targeting multiple platforms, do one of the following. • Use the Advanced workflow instead, zip each installable file into a .zip file before you begin, and manually author the manifest so that one installable file can be targeted at multiple operating system platforms or versions. For more information, see Create a package using the Advanced workflow. • Manually edit the manifest file in the Simple workflow so that your .zip file is targeted at multiple operating system platforms or versions. For more information about how to do this, see the end of step 4 in Step 2: Create the JSON package manifest. 9. For Platform version, verify that the operating system platform version shown is either _any, a major release version followed by a wildcard (7.*), or the exact operating system release version to which you want your software to apply. For more information about specifying an operating system platform version, see step 4 in Step 2: Create the JSON package manifest. Distributor 241 AWS Systems Manager User Guide 10. For Architecture, choose the correct processor architecture for each installable file from the dropdown list. For more information about supported processor architectures, see Supported package platforms and architectures. 11. (Optional) Expand Scripts, and review the scripts that Distributor generates for your installable software. 12. (Optional) To provide an update script for use with in-place updates, expand Scripts, choose the Update script tab, and enter your update script commands. Systems Manager doesn't generate update scripts on your behalf. 13. To add more installable software files, choose Add software. Otherwise, go to the next step. 14. (Optional) Expand Manifest, and review the JSON package manifest that Distributor generates for your installable software. If you changed any information about your software since you began this procedure, such as platform version or target platform, choose Generate manifest to show the updated package manifest. You can edit the manifest manually if you want to target a software installable at more than one operating system, as described in step 8. For more information about editing the manifest, see Step 2: Create the JSON package manifest. 15. Choose Create package. Wait for Distributor to finish uploading your software and creating your package. Distributor shows upload status for each installable file. Depending on the number and size of packages you're adding, this can take a few minutes. Distributor automatically redirects you to the Package details page for the new package, but you can choose to open this page yourself after the software is uploaded. The Package details page doesn't show all information about your package until Distributor finishes the package creation process. To stop the upload and package creation process, choose Cancel. If Distributor can't upload any of the software installable files, it displays an Upload failed message. To retry the upload, choose Retry upload. For more information about how to troubleshoot package creation failures, see Troubleshooting AWS Systems Manager Distributor. Create a package using the Advanced workflow In this section, learn about how advanced users can create a package in Distributor after uploading installable
systems-manager-ug-080
systems-manager-ug.pdf
80
open this page yourself after the software is uploaded. The Package details page doesn't show all information about your package until Distributor finishes the package creation process. To stop the upload and package creation process, choose Cancel. If Distributor can't upload any of the software installable files, it displays an Upload failed message. To retry the upload, choose Retry upload. For more information about how to troubleshoot package creation failures, see Troubleshooting AWS Systems Manager Distributor. Create a package using the Advanced workflow In this section, learn about how advanced users can create a package in Distributor after uploading installable assets zipped with installation and uninstallation scripts, and a JSON manifest file, to an Amazon S3 bucket. Distributor 242 AWS Systems Manager User Guide To create a package, prepare your .zip files of installable assets, one .zip file per operating system platform. At least one .zip file is required to create a package. Next, create a JSON manifest. The manifest includes pointers to your package code files. When you have your required code files added to a folder or directory, and the manifest is populated with correct values, upload your package to an S3 bucket. An example package, ExamplePackage.zip, is available for you to download from our website. The example package includes a completed JSON manifest and three .zip files. Topics • Step 1: Create the ZIP files • Step 2: Create the JSON package manifest • Step 3: Upload the package and manifest to an Amazon S3 bucket • Step 4: Add a package to Distributor Step 1: Create the ZIP files The foundation of your package is at least one .zip file of software or installable assets. A package includes one .zip file per operating system that you want to support, unless one .zip file can be installed on multiple operating systems. For example, Red Hat Enterprise Linux and Amazon Linux instances can typically run the same .RPM executable files, so you need to attach only one .zip file to your package to support both operating systems. Required files The following items are required in each .zip file: • An install and an uninstall script. Windows Server-based managed nodes require PowerShell scripts (scripts named install.ps1 and uninstall.ps1). Linux-based managed nodes require shell scripts (scripts named install.sh and uninstall.sh). SSM Agent runs the instructions in the install and uninstall scripts. For example, your installation scripts might run an installer (such as .rpm or .msi), they might copy files, or they might set configurations. • An executable file, installer packages (.rpm, .deb, .msi, etc.), other scripts, or configuration files. Optional files Distributor 243 AWS Systems Manager User Guide The following item is optional in each .zip file: • An update script. Providing an update script makes it possible for you to use the In-place update option to install a package. When you want to add new or updated files to an existing package installation, the In-place update option doesn't take the package application offline while the update is performed. Windows Server-based managed nodes require a PowerShell script (script named update.ps1). Linux-based managed nodes require a shell script (script named update.sh). SSM Agent runs the instructions in the update script. For more information about installing or updating packages, see Install or update Distributor packages. For examples of .zip files, including sample install and uninstall scripts, download the example package, ExamplePackage.zip. Step 2: Create the JSON package manifest After you prepare and zip your installable files, create a JSON manifest. The following is a template. The parts of the manifest template are described in the procedure in this section. You can use a JSON editor to create this manifest in a separate file. Alternatively, you can author the manifest in the AWS Systems Manager console when you create a package. { "schemaVersion": "2.0", "version": "your-version", "publisher": "optional-publisher-name", "packages": { "platform": { "platform-version": { "architecture": { "file": ".zip-file-name-1.zip" } } }, "another-platform": { "platform-version": { "architecture": { "file": ".zip-file-name-2.zip" } } }, Distributor 244 User Guide AWS Systems Manager "another-platform": { "platform-version": { "architecture": { "file": ".zip-file-name-3.zip" } } } }, "files": { ".zip-file-name-1.zip": { "checksums": { "sha256": "checksum" } }, ".zip-file-name-2.zip": { "checksums": { "sha256": "checksum" } } } } To create a JSON package manifest 1. Add the schema version to your manifest. In this release, the schema version is always 2.0. { "schemaVersion": "2.0", 2. Add a user-defined package version to your manifest. This is also the value of Version name that you specify when you add your package to Distributor. It becomes part of the AWS Systems Manager document that Distributor creates when you add your package. You also provide this value as an input in the AWS-ConfigureAWSPackage document to install a version of the package other than the latest. A version value can contain letters, numbers, underscores, hyphens,
systems-manager-ug-081
systems-manager-ug.pdf
81
a JSON package manifest 1. Add the schema version to your manifest. In this release, the schema version is always 2.0. { "schemaVersion": "2.0", 2. Add a user-defined package version to your manifest. This is also the value of Version name that you specify when you add your package to Distributor. It becomes part of the AWS Systems Manager document that Distributor creates when you add your package. You also provide this value as an input in the AWS-ConfigureAWSPackage document to install a version of the package other than the latest. A version value can contain letters, numbers, underscores, hyphens, and periods, and be a maximum of 128 characters in length. We recommend that you use a human-readable package version to make it easier for you and other administrators to specify exact package versions when you deploy. The following is an example. "version": "1.0.1", 3. (Optional) Add a publisher name. The following is an example. Distributor 245 AWS Systems Manager User Guide "publisher": "MyOrganization", 4. Add packages. The "packages" section describes the platforms, release versions, and architectures supported by the .zip files in your package. For more information, see Supported package platforms and architectures. The platform-version can be the wildcard value, _any. Use it to indicate that a .zip file supports any release of the platform. You can also specify a major release version followed by a wildcard so all minor versions are supported, for example 7.*. If you choose to specify a platform-version value for a specific operating system version, be sure that it matches the exact release version of the operating system AMI that you're targeting. The following are suggested resources for getting the correct value of the operating system. • On a Windows Server-based managed nodes, the release version is available as Windows Management Instrumentation (WMI) data. You can run the following command from a command prompt to get version information, then parse the results for version. wmic OS get /format:list • On a Linux-based managed node, get the version by first scanning for operating system release (the following command). Look for the value of VERSION_ID. cat /etc/os-release If that doesn't return the results that you need, run the following command to get LSB release information from the /etc/lsb-release file, and look for the value of DISTRIB_RELEASE. lsb_release -a If these methods fail, you can usually find the release based on the distribution. For example, on Debian Server, you can scan the /etc/debian_version file, or on Red Hat Enterprise Linux, the /etc/redhat-release file. hostnamectl Distributor 246 AWS Systems Manager User Guide "packages": { "platform": { "platform-version": { "architecture": { "file": ".zip-file-name-1.zip" } } }, "another-platform": { "platform-version": { "architecture": { "file": ".zip-file-name-2.zip" } } }, "another-platform": { "platform-version": { "architecture": { "file": ".zip-file-name-3.zip" } } } } The following is an example. In this example, the operating system platform is amazon, the supported release version is 2016.09, the architecture is x86_64, and the .zip file that supports this platform is test.zip. { "amazon": { "2016.09": { "x86_64": { "file": "test.zip" } } } }, You can add the _any wildcard value to indicate that the package supports all versions of the parent element. For example, to indicate that the package is supported on any release version Distributor 247 AWS Systems Manager User Guide of Amazon Linux, your package statement should be similar to the following. You can use the _any wildcard at the version or architecture levels to support all versions of a platform, or all architectures in a version, or all versions and all architectures of a platform. { "amazon": { "_any": { "x86_64": { "file": "test.zip" } } } }, The following example adds _any to show that the first package, data1.zip, is supported for all architectures of Amazon Linux 2016.09. The second package, data2.zip, is supported for all releases of Amazon Linux, but only for managed nodes with x86_64 architecture. Both the 2016.09 and _any versions are entries under amazon. There is one platform (Amazon Linux), but different supported versions, architectures, and associated .zip files. { "amazon": { "2016.09": { "_any": { "file": "data1.zip" } }, "_any": { "x86_64": { "file": "data2.zip" } } } } You can refer to a .zip file more than once in the "packages" section of the manifest, if the .zip file supports more than one platform. For example, if you have a .zip file that supports both Red Hat Enterprise Linux 7.x versions and Amazon Linux, you have two entries in the "packages" section that point to the same .zip file, as shown in the following example. Distributor 248 AWS Systems Manager User Guide { "amazon": { "2018.03": { "x86_64": { "file": "test.zip" } } }, "redhat": { "7.*": { "x86_64": { "file": "test.zip" } } } }, 5. Add the list of .zip files that are part
systems-manager-ug-082
systems-manager-ug.pdf
82
than once in the "packages" section of the manifest, if the .zip file supports more than one platform. For example, if you have a .zip file that supports both Red Hat Enterprise Linux 7.x versions and Amazon Linux, you have two entries in the "packages" section that point to the same .zip file, as shown in the following example. Distributor 248 AWS Systems Manager User Guide { "amazon": { "2018.03": { "x86_64": { "file": "test.zip" } } }, "redhat": { "7.*": { "x86_64": { "file": "test.zip" } } } }, 5. Add the list of .zip files that are part of this package from step 4. Each file entry requires the file name and sha256 hash value checksum. Checksum values in the manifest must match the sha256 hash value in the zipped assets to prevent the package installation from failing. To get the exact checksum from your installables, you can run the following commands. On Linux, run shasum -a 256 file-name.zip or openssl dgst -sha256 file- name.zip. On Windows, run the Get-FileHash -Path path-to-.zip-file cmdlet in PowerShell. The "files" section of the manifest includes one reference to each of the .zip files in your package. "files": { "test-agent-x86.deb.zip": { "checksums": { "sha256": "EXAMPLE2706223c7616ca9fb28863a233b38e5a23a8c326bb4ae241dcEXAMPLE" } }, "test-agent-x86_64.deb.zip": { "checksums": { "sha256": "EXAMPLE572a745844618c491045f25ee6aae8a66307ea9bff0e9d1052EXAMPLE" } Distributor 249 AWS Systems Manager }, "test-agent-x86_64.nano.zip": { "checksums": { "sha256": User Guide "EXAMPLE63ccb86e830b63dfef46995af6b32b3c52ce72241b5e80c995EXAMPLE" } }, "test-agent-rhel5-x86.nano.zip": { "checksums": { "sha256": "EXAMPLE13df60aa3219bf117638167e5bae0a55467e947a363fff0a51EXAMPLE" } }, "test-agent-x86.msi.zip": { "checksums": { "sha256": "EXAMPLE12a4abb10315aa6b8a7384cc9b5ca8ad8e9ced8ef1bf0e5478EXAMPLE" } }, "test-agent-x86_64.msi.zip": { "checksums": { "sha256": "EXAMPLE63ccb86e830b63dfef46995af6b32b3c52ce72241b5e80c995EXAMPLE" } }, "test-agent-rhel5-x86.rpm.zip": { "checksums": { "sha256": "EXAMPLE13df60aa3219bf117638167e5bae0a55467e947a363fff0a51EXAMPLE" } }, "test-agent-rhel5-x86_64.rpm.zip": { "checksums": { "sha256": "EXAMPLE7ce8a2c471a23b5c90761a180fd157ec0469e12ed38a7094d1EXAMPLE" } } } 6. After you add your package information, save and close the manifest file. Distributor 250 AWS Systems Manager User Guide The following is an example of a completed manifest. In this example, you have a .zip file, NewPackage_LINUX.zip, that supports more than one platform, but is referenced in the "files" section only once. { "schemaVersion": "2.0", "version": "1.7.1", "publisher": "Amazon Web Services", "packages": { "windows": { "_any": { "x86_64": { "file": "NewPackage_WINDOWS.zip" } } }, "amazon": { "_any": { "x86_64": { "file": "NewPackage_LINUX.zip" } } }, "ubuntu": { "_any": { "x86_64": { "file": "NewPackage_LINUX.zip" } } } }, "files": { "NewPackage_WINDOWS.zip": { "checksums": { "sha256": "EXAMPLEc2c706013cf8c68163459678f7f6daa9489cd3f91d52799331EXAMPLE" } }, "NewPackage_LINUX.zip": { "checksums": { "sha256": "EXAMPLE2b8b9ed71e86f39f5946e837df0d38aacdd38955b4b18ffa6fEXAMPLE" } Distributor 251 AWS Systems Manager } } } Package example User Guide An example package, ExamplePackage.zip, is available for you to download from our website. The example package includes a completed JSON manifest and three .zip files. Step 3: Upload the package and manifest to an Amazon S3 bucket Prepare your package by copying or moving all .zip files into a folder or directory. A valid package requires the manifest that you created in Step 2: Create the JSON package manifest and all .zip files identified in the manifest file list. To upload the package and manifest to Amazon S3 1. Copy or move all .zip archive files that you specified in the manifest to a folder or directory. Don't zip the folder or directory you move your .zip archive files and manifest file to. 2. Create a bucket or choose an existing bucket. For more information, see Create a Bucket in the Amazon Simple Storage Service Getting Started Guide. For more information about how to run an AWS CLI command to create a bucket, see mb in the AWS CLI Command Reference. 3. Upload the folder or directory to the bucket. For more information, see Add an Object to a Bucket in the Amazon Simple Storage Service Getting Started Guide. If you plan to paste your JSON manifest into the AWS Systems Manager console, don't upload the manifest. For more information about how to run an AWS CLI command to upload files to a bucket, see mv in the AWS CLI Command Reference. 4. On the bucket's home page, choose the folder or directory that you uploaded. If you uploaded your files to a subfolder in a bucket, be sure to note the subfolder (also known as a prefix). You need the prefix to add your package to Distributor. Step 4: Add a package to Distributor You can use the AWS Systems Manager console, AWS command line tools (AWS CLI and AWS Tools for PowerShell), or AWS SDKs to add a new package to Distributor. When you add a package, you're adding a new SSM document. The document allows you to deploy the package to managed nodes. Topics • Add a package using the console Distributor 252 AWS Systems Manager User Guide • Add a package using the AWS CLI Add a package using the console You can use the AWS Systems Manager console to create a package. Have ready the name of the bucket to which you uploaded your package in Step 3: Upload
systems-manager-ug-083
systems-manager-ug.pdf
83
command line tools (AWS CLI and AWS Tools for PowerShell), or AWS SDKs to add a new package to Distributor. When you add a package, you're adding a new SSM document. The document allows you to deploy the package to managed nodes. Topics • Add a package using the console Distributor 252 AWS Systems Manager User Guide • Add a package using the AWS CLI Add a package using the console You can use the AWS Systems Manager console to create a package. Have ready the name of the bucket to which you uploaded your package in Step 3: Upload the package and manifest to an Amazon S3 bucket. To add a package to Distributor (console) 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. 3. On the Distributor home page, choose Create package, and then choose Advanced. 4. On the Create package page, enter a name for your package. Package names can contain letters, numbers, periods, dashes, and underscores. The name should be generic enough to apply to all versions of the package attachments, but specific enough to identify the purpose of the package. 5. 6. 7. 8. For Version name, enter the exact value of the version entry in your manifest file. For S3 bucket name, choose the name of the bucket to which you uploaded your .zip files and manifest in the section called “Step 3: Upload the package and manifest to an Amazon S3 bucket”. For S3 key prefix, enter the subfolder of the bucket where your .zip files and manifest are stored. For Manifest, choose Extract from package to use a manifest that you have uploaded to the Amazon S3 bucket with your .zip files. (Optional) If you didn't upload your JSON manifest to the S3 bucket where you stored your .zip files, choose New manifest. You can author or paste the entire manifest in the JSON editor field. For more information about how to create the JSON manifest, see Step 2: Create the JSON package manifest. 9. When you're finished with the manifest, choose Create package. 10. Wait for Distributor to create your package from your .zip files and manifest. Depending on the number and size of packages you are adding, this can take a few minutes. Distributor automatically redirects you to the Package details page for the new package, but you can choose to open this page yourself after the software is uploaded. The Package details page Distributor 253 AWS Systems Manager User Guide doesn't show all information about your package until Distributor finishes the package creation process. To stop the upload and package creation process, choose Cancel. Add a package using the AWS CLI You can use the AWS CLI to create a package. Have the URL ready from the bucket to which you uploaded your package in Step 3: Upload the package and manifest to an Amazon S3 bucket. To add a package to Amazon S3 using the AWS CLI 1. To use the AWS CLI to create a package, run the following command, replacing package- name with the name of your package and path-to-manifest-file with the file path for your JSON manifest file. amzn-s3-demo-bucket is the URL of the Amazon S3 bucket where the entire package is stored. When you run the create-document command in Distributor, you specify the Package value for --document-type. If you didn't add your manifest file to the Amazon S3 bucket, the --content parameter value is the file path to the JSON manifest file. aws ssm create-document \ --name "package-name" \ --content file://path-to-manifest-file \ --attachments Key="SourceUrl",Values="amzn-s3-demo-bucket" \ --version-name version-value-from-manifest \ --document-type Package The following is an example. aws ssm create-document \ --name "ExamplePackage" \ --content file://path-to-manifest-file \ --attachments Key="SourceUrl",Values="https://s3.amazonaws.com/amzn-s3-demo- bucket/ExamplePackage" \ --version-name 1.0.1 \ --document-type Package 2. Verify that your package was added and show the package manifest by running the following command, replacing package-name with the name of your package. To get a specific version of the document (not the same as the version of a package), you can add the --document- version parameter. Distributor 254 AWS Systems Manager User Guide aws ssm get-document \ --name "package-name" For information about other options you can use with the create-document command, see create-document in the AWS Systems Manager section of the AWS CLI Command Reference. For information about other options you can use with the get-document command, see get- document. Edit Distributor package permissions in the console After you add a package to Distributor, a tool in AWS Systems Manager, you can edit the package's permissions in the Systems Manager console. You can add other AWS accounts to a package's permissions. Packages can be shared with other accounts in the same AWS Region only. Cross- Region sharing isn't supported. By default, packages are set to Private, meaning only those
systems-manager-ug-084
systems-manager-ug.pdf
84
create-document command, see create-document in the AWS Systems Manager section of the AWS CLI Command Reference. For information about other options you can use with the get-document command, see get- document. Edit Distributor package permissions in the console After you add a package to Distributor, a tool in AWS Systems Manager, you can edit the package's permissions in the Systems Manager console. You can add other AWS accounts to a package's permissions. Packages can be shared with other accounts in the same AWS Region only. Cross- Region sharing isn't supported. By default, packages are set to Private, meaning only those with access to the package creator's AWS account can view package information and update or delete the package. If Private permissions are acceptable, you can skip this procedure. Note You can update the permissions of packages that are shared with 20 or fewer accounts. To edit package permissions in the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. 3. On the Packages page, choose the package for which you want to edit permissions. 4. On the Package details tab, choose Edit permissions to change permissions. 5. For Edit permissions, choose Shared with specific accounts. 6. Under Shared with specific accounts, add AWS account numbers, one at a time. When you're finished, choose Save. Distributor 255 AWS Systems Manager User Guide Edit Distributor package tags in the console After you have added a package to Distributor, a tool in AWS Systems Manager, you can edit the package's tags in the Systems Manager console. These tags are applied to the package, and aren't connected to tags on the managed node on which you want to deploy the package. Tags are case sensitive key and value pairs that can help you group and filter your packages by criteria that are relevant to your organization. If you don't want to add tags, you're ready to install your package or add a new version. To edit package tags in the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. 3. On the Packages page, choose the package for which you want to edit tags. 4. On the Package details tab, in Tags, choose Edit. 5. For Add tags, enter a tag key, or a tag key and value pair, and then choose Add. Repeat if you want to add more tags. To delete tags, choose X on the tag at the bottom of the window. 6. When you're finished adding tags to your package, choose Save. Add a version to a Distributor package To add a package version, create a package, and then use Distributor to add a package version by adding an entry to the AWS Systems Manager (SSM) document that already exists for older versions. Distributor is a tool in AWS Systems Manager. To save time, update the manifest for an older version of the package, change the value of the version entry in the manifest (for example, from Test_1.0 to Test_2.0) and save it as the manifest for the new version. The simple Add version workflow in the Distributor console updates the manifest file for you. A new package version can: • Replace at least one of the installable files attached to the current version. • Add new installable files to support additional platforms. • Delete files to discontinue support for specific platforms. A newer version can use the same Amazon Simple Storage Service (Amazon S3) bucket, but must have a URL with a different file name shown at the end. You can use the Systems Manager console Distributor 256 AWS Systems Manager User Guide or the AWS Command Line Interface (AWS CLI) to add the new version. Uploading an installable file with the exact name as an existing installable file in the Amazon S3 bucket overwrites the existing file. No installable files are copied over from the older version to the new version; you must upload installable files from the older version to have them be part of a new version. After Distributor is finished creating your new package version, you can delete or repurpose the Amazon S3 bucket, because Distributor copies your software to an internal Systems Manager bucket as part of the versioning process. Note Each package is held to a maximum of 25 versions. You can delete versions that are no longer required. Topics • Adding a package version using the console • Adding a package version using the AWS CLI Adding a package version using the console Before you perform these steps, follow the instructions in Create a package in Distributor to create a new package for the version. Then, use the Systems Manager console to add a new package version to Distributor. Adding a package version using
systems-manager-ug-085
systems-manager-ug.pdf
85
your software to an internal Systems Manager bucket as part of the versioning process. Note Each package is held to a maximum of 25 versions. You can delete versions that are no longer required. Topics • Adding a package version using the console • Adding a package version using the AWS CLI Adding a package version using the console Before you perform these steps, follow the instructions in Create a package in Distributor to create a new package for the version. Then, use the Systems Manager console to add a new package version to Distributor. Adding a package version using the Simple workflow To add a package version by using the Simple workflow, prepare updated installable files or add installable files to support more platforms and architectures. Then, use Distributor to upload new and updated installable files and add a package version. The simplified Add version workflow in the Distributor console updates the manifest file and associated SSM document for you. To add a package version using the Simple workflow 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. 3. On the Distributor home page, choose the package to which you want to add another version. Distributor 257 AWS Systems Manager User Guide 4. On the Add version page, choose Simple. 5. 6. 7. 8. For Version name, enter a version name. The version name for the new version must be different from older version names. Version names can be a maximum of 512 characters, and can't contain special characters. For S3 bucket name, choose an existing S3 bucket from the list. This can be the same bucket that you used to store installable files for older versions, but the installable file names must be different to avoid overwriting existing installable files in the bucket. For S3 key prefix, enter the subfolder of the bucket where your installable assets are stored. For Upload software, navigate to the installable software files that you want to attach to the new version. Installable files from existing versions aren't automatically copied over to a new version; you must upload any installable files from older versions of the package if you want any of the same installable files to be part of the new version. You can upload more than one software file in a single action. 9. For Target platform, verify that the target operating system platform shown for each installable file is correct. If the operating system shown isn't correct, choose the correct operating system from the dropdown list. In the Simple versioning workflow, because you upload each installable file only once, extra steps are required to target a single file at multiple operating systems. For example, if you upload an installable software file named Logtool_v1.1.1.rpm, you must change some defaults in the Simple workflow to instruct Distributor to target the same software at both Amazon Linux and Ubuntu operating systems. You can do one of the following to work around this limitation. • Use the Advanced versioning workflow instead, zip each installable file into a .zip file before you begin, and manually author the manifest so that one installable file can be targeted at multiple operating system platforms or versions. For more information, see Adding a package version using the Advanced workflow. • Manually edit the manifest file in the Simple workflow so that your .zip file is targeted at multiple operating system platforms or versions. For more information about how to do this, see the end of step 4 in Step 2: Create the JSON package manifest. 10. For Platform version, verify that the operating system platform version shown is either _any, a major release version followed by a wildcard (7.*), or the exact operating system release version to which you want your software to apply. For more information about specifying a platform version, see step 4 in Step 2: Create the JSON package manifest. Distributor 258 AWS Systems Manager User Guide 11. For Architecture, choose the correct processor architecture for each installable file from the drop-down list. For more information about supported architectures, see Supported package platforms and architectures. 12. (Optional) Expand Scripts, and review the installation and uninstallation scripts that Distributor generates for your installable software. 13. To add more installable software files to the new version, choose Add software. Otherwise, go to the next step. 14. (Optional) Expand Manifest, and review the JSON package manifest that Distributor generates for your installable software. If you changed any information about your installable software since you began this procedure, such as platform version or target platform, choose Generate manifest to show the updated package manifest. You can edit the manifest manually if you want to target a software installable at more than one operating system, as described in step 9. For more information
systems-manager-ug-086
systems-manager-ug.pdf
86
generates for your installable software. 13. To add more installable software files to the new version, choose Add software. Otherwise, go to the next step. 14. (Optional) Expand Manifest, and review the JSON package manifest that Distributor generates for your installable software. If you changed any information about your installable software since you began this procedure, such as platform version or target platform, choose Generate manifest to show the updated package manifest. You can edit the manifest manually if you want to target a software installable at more than one operating system, as described in step 9. For more information about editing the manifest, see Step 2: Create the JSON package manifest. 15. When you finish adding software and reviewing the target platform, version, and architecture data, choose Add version. 16. Wait for Distributor to finish uploading your software and creating the new package version. Distributor shows upload status for each installable file. Depending on the number and size of packages you are adding, this can take a few minutes. Distributor automatically redirects you to the Package details page for the package, but you can choose to open this page yourself after the software is uploaded. The Package details page doesn't show all information about your package until Distributor finishes creating the new package version. To stop the upload and package version creation, choose Stop upload. 17. If Distributor can't upload any of the software installable files, it displays an Upload failed message. To retry the upload, choose Retry upload. For more information about how to troubleshoot package version creation failures, see Troubleshooting AWS Systems Manager Distributor. 18. When Distributor is finished creating the new package version, on the package's Details page, on the Versions tab, view the new version in the list of available package versions. Set a default version of the package by choosing a version, and then choosing Set default version. If you don't set a default version, the newest package version is the default version. Distributor 259 AWS Systems Manager User Guide Adding a package version using the Advanced workflow To add a package version, create a package, and then use Distributor to add a package version by adding an entry to the SSM document that exists for older versions. To save time, update the manifest for an older version of the package, change the value of the version entry in the manifest (for example, from Test_1.0 to Test_2.0) and save it as the manifest for the new version. You must have an updated manifest to add a new package version by using the Advanced workflow. To add a package version using the Advanced workflow 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. 3. On the Distributor home page, choose the package to which you want to add another version, and then choose Add version. 4. 5. 6. 7. For Version name, enter the exact value that is in the version entry of your manifest file. For S3 bucket name, choose an existing S3 bucket from the list. This can be the same bucket that you used to store installable files for older versions, but the installable file names must be different to avoid overwriting existing installable files in the bucket. For S3 key prefix, enter the subfolder of the bucket where your installable assets are stored. For Manifest, choose Extract from package to use a manifest that you uploaded to the S3 bucket with your .zip files. (Optional) If you didn't upload your revised JSON manifest to the Amazon S3 bucket where you stored your .zip files, choose New manifest. You can author or paste the entire manifest in the JSON editor field. For more information about how to create the JSON manifest, see Step 2: Create the JSON package manifest. 8. When you're finished with the manifest, choose Add package version. 9. On the package's Details page, on the Versions tab, view the new version in the list of available package versions. Set a default version of the package by choosing a version, and then choosing Set default version. If you don't set a default version, the newest package version is the default version. Distributor 260 AWS Systems Manager User Guide Adding a package version using the AWS CLI You can use the AWS CLI to add a new package version to Distributor. Before you run these commands, you must create a new package version and upload it to S3, as described at the start of this topic. To add a package version using the AWS CLI 1. Run the following command to edit the AWS Systems Manager document with an entry for a new package version. Replace document-name with the name of your document. Replace amzn-s3-demo-bucket with the URL of the JSON manifest that
systems-manager-ug-087
systems-manager-ug.pdf
87
260 AWS Systems Manager User Guide Adding a package version using the AWS CLI You can use the AWS CLI to add a new package version to Distributor. Before you run these commands, you must create a new package version and upload it to S3, as described at the start of this topic. To add a package version using the AWS CLI 1. Run the following command to edit the AWS Systems Manager document with an entry for a new package version. Replace document-name with the name of your document. Replace amzn-s3-demo-bucket with the URL of the JSON manifest that you copied in Step 3: Upload the package and manifest to an Amazon S3 bucket. S3-bucket-URL-of-package is the URL of the Amazon S3 bucket where the entire package is stored. Replace version-name- from-updated-manifest with the value of version in the manifest. Set the --document- version parameter to $LATEST to make the document associated with this package version the latest version of the document. aws ssm update-document \ --name "document-name" \ --content "S3-bucket-URL-to-manifest-file" \ --attachments Key="SourceUrl",Values="amzn-s3-demo-bucket" \ --version-name version-name-from-updated-manifest \ --document-version $LATEST The following is an example. aws ssm update-document \ --name ExamplePackage \ --content "https://s3.amazonaws.com/amzn-s3-demo-bucket/ExamplePackage/ manifest.json" \ --attachments Key="SourceUrl",Values="https://s3.amazonaws.com/amzn-s3-demo- bucket/ExamplePackage" \ --version-name 1.1.1 \ --document-version $LATEST 2. Run the following command to verify that your package was updated and show the package manifest. Replace package-name with the name of your package, and optionally, document- version with the version number of the document (not the same as the package version) that you updated. If this package version is associated with the latest version of the document, you can specify $LATEST for the value of the optional --document-version parameter. Distributor 261 AWS Systems Manager User Guide aws ssm get-document \ --name "package-name" \ --document-version "document-version" For information about other options you can use with the update-document command, see update-document in the AWS Systems Manager section of the AWS CLI Command Reference. Install or update Distributor packages You can deploy packages to your AWS Systems Manager managed nodes by using Distributor, a tool in AWS Systems Manager. To deploy the packages, use either the AWS Management Console or AWS Command Line Interface (AWS CLI). You can deploy one version of one package per command. You can install new packages or update existing installations in place. You can choose to deploy a specific version or choose to always deploy the latest version of a package for deployment. We recommend using State Manager, a tool in AWS Systems Manager, to install packages. Using State Manager helps ensure that your managed nodes are always running the most up-to-date version of your package. Important Packages that you install using Distributor should be uninstalled only by using Distributor. Otherwise, Systems Manager can still register the application as INSTALLED and lead to other unintended results. Preference AWS Systems Manager action More info Install or update a package immediately. Run Command • Installing or updating a package one time using the console • Installing a package one time using the AWS CLI • Updating a package one time using the AWS CLI Distributor 262 AWS Systems Manager Preference Install or update a package on a schedule, so that the installation always includes the default version. User Guide AWS Systems Manager action More info State Manager • Scheduling a package installation or update using the console • Scheduling a package installation using the AWS CLI • Scheduling a package update using the AWS CLI One way to do this is to apply tags to new managed nodes, and then specify the tags as targets in your State Manager association. State Manager automatically installs the package in an association on managed nodes that have matching tags. See Understan ding targets and rate controls in State Manager associations. State Manager Automatically install a package on new managed nodes that have a specific tag or set of tags. For example, installing the Amazon CloudWatch agent on new instances. Topics • Installing or updating a package one time using the console • Scheduling a package installation or update using the console • Installing a package one time using the AWS CLI • Updating a package one time using the AWS CLI • Scheduling a package installation using the AWS CLI • Scheduling a package update using the AWS CLI Distributor 263 AWS Systems Manager User Guide Installing or updating a package one time using the console You can use the AWS Systems Manager console to install or update a package one time. When you configure a one-time installation, Distributor uses AWS Systems Manager Run Command, a tool in AWS Systems Manager, to perform the installation. To install or update a package one time using the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Distributor. 3. On