id
stringlengths
8
78
source
stringclasses
743 values
chunk_id
int64
1
5.05k
text
stringlengths
593
49.7k
systems-manager-ug-088
systems-manager-ug.pdf
88
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 the Distributor home page, choose the package that you want to install. 4. Choose Install one time. This command opens Run Command with the command document AWS- ConfigureAWSPackage and your Distributor package already selected. For Document version, select the version of the AWS-ConfigureAWSPackage document that you want to run. For Action, choose Install. For Installation type, choose one of the following: • Uninstall and reinstall: The package is completely uninstalled, and then reinstalled. The application is unavailable until the reinstallation is complete. • In-place update: Only new or changed files are added to the existing installation according to instructions you provide in an update script. The application remains available throughout the update process. This option isn't supported for AWS published packages except the AWSEC2Launch-Agent package. For Name, verify that the name of the package you selected is entered. (Optional) For Version, enter the version name value of the package. If you leave this field blank, Run Command installs the default version that you selected in Distributor. 5. 6. 7. 8. 9. 10. In the Targets section, choose the managed nodes on which you want to run this operation by specifying tags, selecting instances or devices manually, or by specifying a resource group. Distributor 264 AWS Systems Manager Note User Guide If you don't see a managed node in the list, see Troubleshooting managed node availability. 11. For Other parameters: • For Comment, enter information about this command. • For Timeout (seconds), specify the number of seconds for the system to wait before failing the overall command execution. 12. For Rate Control: • For Concurrency, specify either a number or a percentage of targets on which to run the command at the same time. Note If you selected targets by specifying tags or resource groups and you aren't certain how many managed nodes are targeted, then restrict the number of targets that can run the document at the same time by specifying a percentage. • For Error threshold, specify when to stop running the command on other targets after it fails on either a number or a percentage of managed nodes. For example, if you specify three errors, then Systems Manager stops sending the command when the fourth error is received. Managed nodes still processing the command might also send errors. 13. (Optional) For Output options, to save the command output to a file, select the Write command output to an S3 bucket box. Enter the bucket and prefix (folder) names in the boxes. Note The S3 permissions that grant the ability to write the data to an S3 bucket are those of the instance profile (for EC2 instances) or IAM service role (hybrid-activated machines) assigned to the instance, not those of the IAM user performing this task. For more information, see Configure instance permissions required for Systems Manager or Create an IAM service role for a hybrid environment. In addition, if the specified S3 bucket is in a different AWS account, make sure that the instance profile or IAM service Distributor 265 AWS Systems Manager User Guide role associated with the managed node has the necessary permissions to write to that bucket. 14. In the SNS notifications section, if you want notifications sent about the status of the command execution, select the Enable SNS notifications check box. For more information about configuring Amazon SNS notifications for Run Command, see Monitoring Systems Manager status changes using Amazon SNS notifications. 15. When you're ready to install the package, choose Run. 16. The Command status area reports the progress of the execution. If the command is still in progress, choose the refresh icon in the top-left corner of the console until the Overall status or Detailed status column shows Success or Failed. 17. In the Targets and outputs area, choose the button next to a managed node name, and then choose View output. The command output page shows the results of your command execution. 18. (Optional) If you chose to write command output to an Amazon S3 bucket, choose Amazon S3 to view the output log data. Scheduling a package installation or update using the console You can use the AWS Systems Manager console to schedule the installation or update of a package.
systems-manager-ug-089
systems-manager-ug.pdf
89
in the top-left corner of the console until the Overall status or Detailed status column shows Success or Failed. 17. In the Targets and outputs area, choose the button next to a managed node name, and then choose View output. The command output page shows the results of your command execution. 18. (Optional) If you chose to write command output to an Amazon S3 bucket, choose Amazon S3 to view the output log data. Scheduling a package installation or update using the console You can use the AWS Systems Manager console to schedule the installation or update of a package. When you schedule package installation or update, Distributor uses AWS Systems Manager State Manager to install or update. To schedule a package installation 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 the Distributor home page, choose the package that you want to install or update. 4. For Package, choose Install on a schedule. This command opens State Manager to a new association that is created for you. 5. For Name, enter a name (for example, Deploy-test-agent-package). This is optional, but recommended. Spaces aren't allowed in the name. Distributor 266 AWS Systems Manager User Guide 6. 7. 8. In the Document list, the document name AWS-ConfigureAWSPackage is already selected. For Action, verify that Install is selected. For Installation type, choose one of the following: • Uninstall and reinstall: The package is completely uninstalled, and then reinstalled. The application is unavailable until the reinstallation is complete. • In-place update: Only new or changed files are added to the existing installation according to instructions you provide in an update script. The application remains available throughout the update process. 9. For Name, verify that the name of your package is entered. 10. For Version, if you to want to install a package version other than the latest published version, enter the version identifier. 11. For Targets, choose Selecting all managed instances in this account, Specifying tags, or Manually Selecting Instance. If you target resources by using tags, enter a tag key and a tag value in the fields provided. Note You can choose managed AWS IoT Greengrass core devices by choosing either Selecting all managed instances in this account or Manually Selecting Instance. 12. For Specify schedule, choose On Schedule to run the association on a regular schedule, or No Schedule to run the association once. For more information about these options, see Working with associations in Systems Manager. Use the controls to create a cron or rate schedule for the association. 13. Choose Create Association. 14. On the Association page, choose the button next to the association you created, and then choose Apply association now. State Manager creates and immediately runs the association on the specified targets. For more information about the results of running associations, see Working with associations in Systems Manager in this guide. For more information about working with the options in Advanced options, Rate control, and Output options, see Working with associations in Systems Manager. Distributor 267 AWS Systems Manager User Guide Installing a package one time using the AWS CLI You can run send-command in the AWS CLI to install a Distributor package one time. If the package is already installed, the application will be taken offline while the package is uninstalled and the new version installed in its place. To install a package one time using the AWS CLI • Run the following command in the AWS CLI. aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "instance-IDs" \ --parameters '{"action":["Install"],"installationType":["Uninstall and reinstall"],"name":["package-name (in same account) or package-ARN (shared from different account)"]}' Note The default behavior for installationType is Uninstall and reinstall. You can omit "installationType":["Uninstall and reinstall"] from this command when you're installing a complete package. The following is an example. aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "i-00000000000000" \ --parameters '{"action":["Install"],"installationType":["Uninstall and reinstall"],"name":["ExamplePackage"]}' For information about other options you can use with the send-command command, see send- command in the AWS Systems Manager section of the AWS CLI Command Reference. Updating a package one time using the AWS CLI You can run send-command in the AWS CLI to update a Distributor package without taking the associated application offline. Only new or updated files in the package are replaced. Distributor 268 AWS Systems Manager User Guide To update a package one time using the AWS CLI • Run the following command in the AWS CLI. aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "instance-IDs" \ --parameters '{"action":["Install"],"installationType":["In-place update"],"name":["package-name (in same account) or package-ARN (shared from different account)"]}' Note When you add new or changed files, you must include "installationType":["In- place update"] in the command. The following is an example. aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "i-02573cafcfEXAMPLE" \ --parameters '{"action":["Install"],"installationType":["In-place update"],"name":["ExamplePackage"]}'
systems-manager-ug-090
systems-manager-ug.pdf
90
package without taking the associated application offline. Only new or updated files in the package are replaced. Distributor 268 AWS Systems Manager User Guide To update a package one time using the AWS CLI • Run the following command in the AWS CLI. aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "instance-IDs" \ --parameters '{"action":["Install"],"installationType":["In-place update"],"name":["package-name (in same account) or package-ARN (shared from different account)"]}' Note When you add new or changed files, you must include "installationType":["In- place update"] in the command. The following is an example. aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "i-02573cafcfEXAMPLE" \ --parameters '{"action":["Install"],"installationType":["In-place update"],"name":["ExamplePackage"]}' For information about other options you can use with the send-command command, see send- command in the AWS Systems Manager section of the AWS CLI Command Reference. Scheduling a package installation using the AWS CLI You can run create-association in the AWS CLI to install a Distributor package on a schedule. The value of --name, the document name, is always AWS-ConfigureAWSPackage. The following command uses the key InstanceIds to specify target managed nodes. If the package is already installed, the application will be taken offline while the package is uninstalled and the new version installed in its place. aws ssm create-association \ --name "AWS-ConfigureAWSPackage" \ Distributor 269 AWS Systems Manager User Guide --parameters '{"action":["Install"],"installationType":["Uninstall and reinstall"],"name":["package-name (in same account) or package-ARN (shared from different account)"]}' \ --targets [{\"Key\":\"InstanceIds\",\"Values\":[\"instance-ID1\",\"instance- ID2\"]}] Note The default behavior for installationType is Uninstall and reinstall. You can omit "installationType":["Uninstall and reinstall"] from this command when you're installing a complete package. The following is an example. aws ssm create-association \ --name "AWS-ConfigureAWSPackage" \ --parameters '{"action":["Install"],"installationType":["Uninstall and reinstall"],"name":["Test-ConfigureAWSPackage"]}' \ --targets [{\"Key\":\"InstanceIds\",\"Values\":[\"i-02573cafcfEXAMPLE\", \"i-0471e04240EXAMPLE\"]}] For information about other options you can use with the create-association command, see create-association in the AWS Systems Manager section of the AWS CLI Command Reference. Scheduling a package update using the AWS CLI You can run create-association in the AWS CLI to update a Distributor package on a schedule without taking the associated application offline. Only new or updated files in the package are replaced. The value of --name, the document name, is always AWS-ConfigureAWSPackage. The following command uses the key InstanceIds to specify target instances. aws ssm create-association \ --name "AWS-ConfigureAWSPackage" \ --parameters '{"action":["Install"],"installationType":["In-place update"],"name": ["package-name (in same account) or package-ARN (shared from different account)"]}' \ --targets [{\"Key\":\"InstanceIds\",\"Values\":[\"instance-ID1\",\"instance- ID2\"]}] Distributor 270 AWS Systems Manager Note User Guide When you add new or changed files, you must include "installationType":["In- place update"] in the command. The following is an example. aws ssm create-association \ --name "AWS-ConfigureAWSPackage" \ --parameters '{"action":["Install"],"installationType":["In-place update"],"name": ["Test-ConfigureAWSPackage"]}' \ --targets [{\"Key\":\"InstanceIds\",\"Values\":[\"i-02573cafcfEXAMPLE\", \"i-0471e04240EXAMPLE\"]}] For information about other options you can use with the create-association command, see create-association in the AWS Systems Manager section of the AWS CLI Command Reference. Uninstall a Distributor package You can use the AWS Management Console or the AWS Command Line Interface (AWS CLI) to uninstall Distributor packages from your AWS Systems Manager managed nodes by using Run Command. Distributor and Run Command are tools in AWS Systems Manager. In this release, you can uninstall one version of one package per command. You can uninstall a specific version or the default version. 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. Topics • Uninstalling a package using the console • Uninstalling a package using the AWS CLI Distributor 271 AWS Systems Manager User Guide Uninstalling a package using the console You can use Run Command in the Systems Manager console to uninstall a package one time. Distributor uses AWS Systems Manager Run Command to uninstall packages. To uninstall a package using the console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Run Command. 3. On the Run Command home page, choose Run command. 4. Choose the AWS-ConfigureAWSPackage command document. 5. 6. 7. From Action, choose Uninstall For Name, enter the name of the package that you want to uninstall. For Targets, choose how you want to target your managed nodes. You can specify a tag key and values that are shared by the targets. You can also specify targets by choosing attributes, such as an ID, platform, and SSM Agent version. 8. You can use the advanced options to add comments about the operation, change Concurrency and Error threshold values in Rate control, specify output options, or configure Amazon Simple Notification Service (Amazon SNS) notifications. For more information, see Running Commands from the Console in this guide. 9. When you're ready to uninstall the package, choose Run, and then choose View results. 10. In the commands list, choose the AWS-ConfigureAWSPackage command that you ran. If the command is still in progress, choose the refresh icon in the top-right corner of the
systems-manager-ug-091
systems-manager-ug.pdf
91
attributes, such as an ID, platform, and SSM Agent version. 8. You can use the advanced options to add comments about the operation, change Concurrency and Error threshold values in Rate control, specify output options, or configure Amazon Simple Notification Service (Amazon SNS) notifications. For more information, see Running Commands from the Console in this guide. 9. When you're ready to uninstall the package, choose Run, and then choose View results. 10. In the commands list, choose the AWS-ConfigureAWSPackage command that you ran. If the command is still in progress, choose the refresh icon in the top-right corner of the console. 11. When the Status column shows Success or Failed, choose the Output tab. 12. Choose View output. The command output page shows the results of your command execution. Uninstalling a package using the AWS CLI You can use the AWS CLI to uninstall a Distributor package from managed nodes by using Run Command. To uninstall a package using the AWS CLI • Run the following command in the AWS CLI. Distributor 272 AWS Systems Manager User Guide aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "instance-IDs" \ --parameters '{"action":["Uninstall"],"name":["package-name (in same account) or package-ARN (shared from different account)"]}' The following is an example. aws ssm send-command \ --document-name "AWS-ConfigureAWSPackage" \ --instance-ids "i-02573cafcfEXAMPLE" \ --parameters '{"action":["Uninstall"],"name":["Test-ConfigureAWSPackage"]}' For information about other options you can use with the send-command command, see send- command in the AWS Systems Manager section of the AWS CLI Command Reference. Delete a Distributor package This section describes how to a delete a package. You can't delete a version of a package, only the entire package. Deleting a package using the console You can use the AWS Systems Manager console to delete a package or a package version from Distributor, a tool in AWS Systems Manager. Deleting a package deletes all versions of a package from Distributor. To delete a package 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 the Distributor home page, choose the package that you want to delete. 4. On the package's details page, choose Delete package. 5. When you're prompted to confirm the deletion, choose Delete package. Distributor 273 AWS Systems Manager User Guide Deleting a package version using the console You can use the Systems Manager console to delete a package version from Distributor. To delete a package version 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 the Distributor home page, choose the package that you want to delete a version of. 4. On the versions page for the package, choose the version to delete and choose Delete version. 5. When you're prompted to confirm the deletion, choose Delete package version. Deleting a package using the command line You can use your preferred command line tool to delete a package from Distributor. Linux & macOS To delete a package using the AWS CLI 1. Run the following command to list documents for specific packages. In the results of this command, look for the package that you want to delete. aws ssm list-documents \ --filters Key=Name,Values=package-name 2. Run the following command to delete a package. Replace package-name with the package name. aws ssm delete-document \ --name "package-name" 3. Run the list-documents command again to verify that the package was deleted. The package you deleted shouldn't be included in the list. aws ssm list-documents \ --filters Key=Name,Values=package-name Distributor 274 AWS Systems Manager Windows To delete a package using the AWS CLI User Guide 1. Run the following command to list documents for specific packages. In the results of this command, look for the package that you want to delete. aws ssm list-documents ^ --filters Key=Name,Values=package-name 2. Run the following command to delete a package. Replace package-name with the package name. aws ssm delete-document ^ --name "package-name" 3. Run the list-documents command again to verify that the package was deleted. The package you deleted shouldn't be included in the list. aws ssm list-documents ^ --filters Key=Name,Values=package-name PowerShell To delete a package using Tools for PowerShell 1. Run the following command to list documents for specific packages. In the results of this command, look for the package that you want to delete. $filter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $filter.Key = "Name" $filter.Values = "package-name" Get-SSMDocumentList ` -Filters @($filter) 2. Run the following command to delete a package. Replace package-name with the package name. Distributor 275 AWS Systems Manager User Guide Remove-SSMDocument ` -Name "package-name" 3. Run the Get-SSMDocumentList command again to verify that the package was deleted. The package you deleted shouldn't be included in the list. $filter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $filter.Key = "Name" $filter.Values = "package-name" Get-SSMDocumentList ` -Filters @($filter) Deleting a package version using the command line You can
systems-manager-ug-092
systems-manager-ug.pdf
92
results of this command, look for the package that you want to delete. $filter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $filter.Key = "Name" $filter.Values = "package-name" Get-SSMDocumentList ` -Filters @($filter) 2. Run the following command to delete a package. Replace package-name with the package name. Distributor 275 AWS Systems Manager User Guide Remove-SSMDocument ` -Name "package-name" 3. Run the Get-SSMDocumentList command again to verify that the package was deleted. The package you deleted shouldn't be included in the list. $filter = New-Object Amazon.SimpleSystemsManagement.Model.DocumentKeyValuesFilter $filter.Key = "Name" $filter.Values = "package-name" Get-SSMDocumentList ` -Filters @($filter) Deleting a package version using the command line You can use your preferred command line tool to delete a package version from Distributor. Linux & macOS To delete a package version using the AWS CLI 1. Run the following command to list the versions of your package. In the results of this command, look for the package version that you want to delete. aws ssm list-document-versions \ --name "package-name" 2. Run the following command to delete a package version. Replace package-name with the package name and version with the version number. aws ssm delete-document \ --name "package-name" \ --document-version version 3. Run the list-document-versions command to verify that the version of the package was deleted. The package version that you deleted shouldn't be found. aws ssm list-document-versions \ Distributor 276 AWS Systems Manager User Guide --name "package-name" Windows To delete a package version using the AWS CLI 1. Run the following command to list the versions of your package. In the results of this command, look for the package version that you want to delete. aws ssm list-document-versions ^ --name "package-name" 2. Run the following command to delete a package version. Replace package-name with the package name and version with the version number. aws ssm delete-document ^ --name "package-name" ^ --document-version version 3. Run the list-document-versions command to verify that the version of the package was deleted. The package version that you deleted shouldn't be found. aws ssm list-document-versions ^ --name "package-name" PowerShell To delete a package version using Tools for PowerShell 1. Run the following command to list the versions of your package. In the results of this command, look for the package version that you want to delete. Get-SSMDocumentVersionList ` -Name "package-name" 2. Run the following command to delete a package version. Replace package-name with the package name and version with the version number. Remove-SSMDocument ` Distributor 277 AWS Systems Manager User Guide -Name "package-name" ` -DocumentVersion version 3. Run the Get-SSMDocumentVersionList command to verify that the version of the package was deleted. The package version that you deleted shouldn't be found. Get-SSMDocumentVersionList ` -Name "package-name" For information about other options you can use with the list-documents command, see list- documents in the AWS Systems Manager section of the AWS CLI Command Reference. For information about other options you can use with the delete-document command, see delete- document. Auditing and logging Distributor activity You can use AWS CloudTrail to audit activity related to Distributor, a tool in AWS Systems Manager. For more information about auditing and logging options for Systems Manager, see Logging and monitoring in AWS Systems Manager. Audit Distributor activity using CloudTrail CloudTrail captures API calls made in the AWS Systems Manager console, the AWS Command Line Interface (AWS CLI), and the Systems Manager SDK. The information can be viewed in the CloudTrail console or stored in an Amazon Simple Storage Service (Amazon S3) bucket. One bucket is used for all CloudTrail logs for your account. Logs of Run Command and State Manager actions show document creation, package installation, and package uninstallation activity. Run Command and State Manager are tools in AWS Systems Manager. For more information about viewing and using CloudTrail logs of Systems Manager activity, see Logging AWS Systems Manager API calls with AWS CloudTrail. Troubleshooting AWS Systems Manager Distributor The following information can help you troubleshoot problems that might occur when you use Distributor, a tool in AWS Systems Manager. Topics • Wrong package with the same name is installed • Error: Failed to retrieve manifest: Could not find latest version of package Distributor 278 AWS Systems Manager User Guide • Error: Failed to retrieve manifest: Validation exception • Package isn't supported (package is missing install action) • Error: Failed to download manifest : Document with name does not exist • Upload failed. Wrong package with the same name is installed Problem: You've installed a package, but Distributor installed a different package instead. Cause: During installation, Systems Manager finds AWS published packages as results before user- defined external packages. If your user-defined package name is the same as an AWS published package name, the AWS package is installed instead of your package. Solution: To avoid this problem, name your package something different from the name for an AWS published package. Error: Failed to
systems-manager-ug-093
systems-manager-ug.pdf
93
is missing install action) • Error: Failed to download manifest : Document with name does not exist • Upload failed. Wrong package with the same name is installed Problem: You've installed a package, but Distributor installed a different package instead. Cause: During installation, Systems Manager finds AWS published packages as results before user- defined external packages. If your user-defined package name is the same as an AWS published package name, the AWS package is installed instead of your package. Solution: To avoid this problem, name your package something different from the name for an AWS published package. Error: Failed to retrieve manifest: Could not find latest version of package Problem: You received an error like the following. Failed to retrieve manifest: ResourceNotFoundException: Could not find the latest version of package arn:aws:ssm:::package/package-name status code: 400, request id: guid Cause: You're using a version of SSM Agent with Distributor that is earlier than version 2.3.274.0. Solution: Update the version of SSM Agent to version 2.3.274.0 or later. For more information, see Updating the SSM Agent using Run Command or Walkthrough: Automatically update SSM Agent with the AWS CLI. Error: Failed to retrieve manifest: Validation exception Problem: You received an error like the following. Failed to retrieve manifest: ValidationException: 1 validation error detected: Value 'documentArn' at 'packageName' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws:ssm:region-id:account-id:package/package-name Cause: You're using a version of SSM Agent with Distributor that is earlier than version 2.3.274.0. Distributor 279 AWS Systems Manager User Guide Solution: Update the version of SSM Agent to version 2.3.274.0 or later. For more information, see Updating the SSM Agent using Run Command or Walkthrough: Automatically update SSM Agent with the AWS CLI. Package isn't supported (package is missing install action) Problem: You received an error like the following. Package is not supported (package is missing install action) Cause: The package directory structure is incorrect. Solution: Don't zip a parent directory containing the software and required scripts. Instead, create a .zip file of all the required contents directly in the absolute path. To verify the .zip file was created correctly, unzip the target platform directory and review the directory structure. For example, the install script absolute path should be /ExamplePackage_targetPlatform/ install.sh. Error: Failed to download manifest : Document with name does not exist Problem: You received an error like the following. Failed to download manifest - failed to retrieve package document description: InvalidDocument: Document with name filename does not exist. Cause 1: Distributor can't find the package by the package name when sharing a Distributor package from another account. Solution 1: When sharing a package from another account, use the full Amazon Resource Name (ARN) for the package and not just its name. Cause 2: When using a VPC, you haven't provided your IAM instance profile with access to the AWS managed S3 bucket that contains the document AWS-ConfigureAWSPackage for the AWS Region you are targeting. Solution 2: Ensure that your IAM instance profile provides SSM Agent with access to the AWS managed S3 bucket that contains the document AWS-ConfigureAWSPackage for the AWS Region you are targeting, as explained in SSM Agent communications with AWS managed S3 buckets. Upload failed. Problem: You received an error like the following. Distributor 280 AWS Systems Manager User Guide Upload failed. At least one of your files was not successfully uploaded to your S3 bucket. Cause: The name of your software package includes a space. For example, Hello World.msi would fail to upload. AWS Systems Manager Fleet Manager Fleet Manager, a tool in AWS Systems Manager, is a unified user interface (UI) experience that helps you remotely manage your nodes running on AWS or on premises. With Fleet Manager, you can view the health and performance status of your entire server fleet from one console. You can also gather data from individual nodes to perform common troubleshooting and management tasks from the console. This includes connecting to Windows instances using the Remote Desktop Protocol (RDP), viewing folder and file contents, Windows registry management, operating system user management, and more. To get started with Fleet Manager, open the Systems Manager console. In the navigation pane, choose Fleet Manager. Who should use Fleet Manager? Any AWS customer who wants a centralized way to manage their node fleet should use Fleet Manager. How can Fleet Manager benefit my organization? Fleet Manager offers these benefits: • Perform a variety of common systems administration tasks without having to manually connect to your managed nodes. • Manage nodes running on multiple platforms from a single unified console. • Manage nodes running different operating systems from a single unified console. • Improve the efficiency of your systems administration. What are the features of Fleet Manager? Key features of Fleet Manager include the following: Fleet Manager 281 AWS Systems Manager User Guide • Access
systems-manager-ug-094
systems-manager-ug.pdf
94
wants a centralized way to manage their node fleet should use Fleet Manager. How can Fleet Manager benefit my organization? Fleet Manager offers these benefits: • Perform a variety of common systems administration tasks without having to manually connect to your managed nodes. • Manage nodes running on multiple platforms from a single unified console. • Manage nodes running different operating systems from a single unified console. • Improve the efficiency of your systems administration. What are the features of Fleet Manager? Key features of Fleet Manager include the following: Fleet Manager 281 AWS Systems Manager User Guide • Access the Red Hat Knowledgebase Portal Access binaries, knowledge-shares, and discussion forums on the Red Hat Knowledgebase Portal through your Red Hat Enterprise Linux (RHEL) instances. • Managed node status View which managed instances are running and which are stopped. For more information about stopped instances, see Stop and start your instance in the Amazon EC2 User Guide. For AWS IoT Greengrass core devices, you can view which are online, offline, or show a status of Connection lost. Note If you stopped your managed instance before July 12, 2021, it won't display the stopped marker. To show the marker, start and stop the instance. • View instance information View information about the folder and file data stored on the volumes attached to your managed instances, performance data about your instances in real-time, and log data stored on your instances. • View edge device information View the AWS IoT Greengrass Thing name for the device, SSM Agent ping status and version, and more. • Manage accounts and registry Manage operating system (OS) user accounts on your instances and registry on your Windows instances. • Control access to features Control access to Fleet Manager features using AWS Identity and Access Management (IAM) policies. With these policies, you can control which individual users or groups in your organization can use various Fleet Manager features, and which managed nodes they can manage. Topics • Setting up Fleet Manager Fleet Manager 282 AWS Systems Manager • Working with managed nodes User Guide • Managing EC2 instances automatically with Default Host Management Configuration • Connecting to a Windows Server managed instance using Remote Desktop • Managing Amazon EBS volumes on managed instances • Accessing the Red Hat Knowledge base portal • Troubleshooting managed node availability Setting up Fleet Manager Before users in your AWS account can use Fleet Manager, a tool in AWS Systems Manager, to monitor and manage your managed nodes, they must be granted the necessary permissions. In addition, any Amazon Elastic Compute Cloud (Amazon EC2) instances; AWS IoT Greengrass core devices; and on-premises servers, edge devices, and virtual machines (VMs) to be monitored and managed using Fleet Manager must be Systems Manager managed nodes. A managed node is any machine configured for use with Systems Manager in hybrid and multicloud environments. This means your nodes must meet certain prerequisites and be configured with the AWS Systems Manager Agent (SSM Agent). Depending on the machine type, refer to one of the following topics to ensure your machines meet the requirements for managed nodes. • Amazon EC2 instances: Managing EC2 instances with Systems Manager Tip You can also use Quick Setup, a tool in AWS Systems Manager, to help you quickly configure your Amazon EC2 instances as managed instances in an individual account. If your business or organization uses AWS Organizations, you can also configure instances across multiple organizational units (OUs) and AWS Regions. For more information about using Quick Setup to configure managed instances, see Set up Amazon EC2 host management using Quick Setup. • On-premises and other server types in the cloud: Managing nodes in hybrid and multicloud environments with Systems Manager • AWS IoT Greengrass (edge) devices: Managing edge devices with Systems Manager Fleet Manager 283 AWS Systems Manager Sample policies • Controlling access to Fleet Manager Controlling access to Fleet Manager User Guide To use Fleet Manager, a tool in AWS Systems Manager, your AWS Identity and Access Management (IAM) user or role must have the required permissions. You can create an IAM policy that provides access to all Fleet Manager features, or modify your policy to grant access to the features you choose. You then grant these permissions to users, or identities, in your account. Task 1: Create IAM policies to define access permissions Follow one of the methods provided in the followig topic in the IAM User Guide to create an IAM to provide identities (users, roles, or user groupss) with access to Fleet Manager: • Define custom IAM permissions with customer managed policies You can use one of the sample policies we provide below, or modify them according to the permissions you want to grant. We provide sample policies for full Fleet Manager access and read-only access. Task 2:
systems-manager-ug-095
systems-manager-ug.pdf
95
you choose. You then grant these permissions to users, or identities, in your account. Task 1: Create IAM policies to define access permissions Follow one of the methods provided in the followig topic in the IAM User Guide to create an IAM to provide identities (users, roles, or user groupss) with access to Fleet Manager: • Define custom IAM permissions with customer managed policies You can use one of the sample policies we provide below, or modify them according to the permissions you want to grant. We provide sample policies for full Fleet Manager access and read-only access. Task 2: Attach the IAM policies to users to grant permissions After you have created the IAM policy or policies that define access permissions to Fleet Manager, use one of the following procedures in the IAM User Guide to grant these permissions to identities in your account: • Adding IAM identity permissions (console) • Adding IAM identity permissions (AWS CLI) • Adding IAM identity permissions (AWS API) Topics • Sample policy for Fleet Manager administrator access • Sample policy for Fleet Manager read-only access Sample policy for Fleet Manager administrator access The following policy provides permissions to all Fleet Manager features. This means a user can create and delete local users and groups, modify group membership for any local group, and Fleet Manager 284 AWS Systems Manager User Guide modify Windows Server registry keys or values. Replace each example resource placeholder with your own information. { "Version":"2012-10-17", "Statement":[ { "Sid":"EC2", "Effect":"Allow", "Action":[ "ec2:CreateTags", "ec2:DeleteTags", "ec2:DescribeInstances", "ec2:DescribeTags" ], "Resource":"*" }, { "Sid":"General", "Effect":"Allow", "Action":[ "ssm:AddTagsToResource", "ssm:DescribeInstanceAssociationsStatus", "ssm:DescribeInstancePatches", "ssm:DescribeInstancePatchStates", "ssm:DescribeInstanceProperties", "ssm:GetCommandInvocation", "ssm:GetServiceSetting", "ssm:GetInventorySchema", "ssm:ListComplianceItems", "ssm:ListInventoryEntries", "ssm:ListTagsForResource", "ssm:ListCommandInvocations", "ssm:ListAssociations", "ssm:RemoveTagsFromResource" ], "Resource":"*" }, { "Sid":"DefaultHostManagement", "Effect": "Allow", "Action": [ "ssm:ResetServiceSetting", Fleet Manager 285 AWS Systems Manager User Guide "ssm:UpdateServiceSetting" ], "Resource": "arn:aws:ssm:region:account-id:servicesetting/ssm/managed- instance/default-ec2-instance-management-role" }, { "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": "arn:aws:iam::account-id:role/service-role/ AWSSystemsManagerDefaultEC2InstanceManagementRole", "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com" ] } } }, { "Sid":"SendCommand", "Effect":"Allow", "Action":[ "ssm:GetDocument", "ssm:SendCommand", "ssm:StartSession" ], "Resource":[ "arn:aws:ec2:*:account-id:instance/*", "arn:aws:ssm:*:account-id:managed-instance/*", "arn:aws:ssm:*:account-id:document/SSM-SessionManagerRunShell", "arn:aws:ssm:*:*:document/AWS-PasswordReset", "arn:aws:ssm:*:*:document/AWSFleetManager-AddUsersToGroups", "arn:aws:ssm:*:*:document/AWSFleetManager-CopyFileSystemItem", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateDirectory", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateGroup", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateUser", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateUserInteractive", "arn:aws:ssm:*:*:document/AWSFleetManager-CreateWindowsRegistryKey", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteFileSystemItem", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteGroup", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteUser", "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteWindowsRegistryKey", Fleet Manager 286 AWS Systems Manager User Guide "arn:aws:ssm:*:*:document/AWSFleetManager-DeleteWindowsRegistryValue", "arn:aws:ssm:*:*:document/AWSFleetManager-GetDiskInformation", "arn:aws:ssm:*:*:document/AWSFleetManager-GetFileContent", "arn:aws:ssm:*:*:document/AWSFleetManager-GetFileSystemContent", "arn:aws:ssm:*:*:document/AWSFleetManager-GetGroups", "arn:aws:ssm:*:*:document/AWSFleetManager-GetPerformanceCounters", "arn:aws:ssm:*:*:document/AWSFleetManager-GetProcessDetails", "arn:aws:ssm:*:*:document/AWSFleetManager-GetUsers", "arn:aws:ssm:*:*:document/AWSFleetManager-GetWindowsEvents", "arn:aws:ssm:*:*:document/AWSFleetManager-GetWindowsRegistryContent", "arn:aws:ssm:*:*:document/AWSFleetManager-MountVolume", "arn:aws:ssm:*:*:document/AWSFleetManager-MoveFileSystemItem", "arn:aws:ssm:*:*:document/AWSFleetManager-RemoveUsersFromGroups", "arn:aws:ssm:*:*:document/AWSFleetManager-RenameFileSystemItem", "arn:aws:ssm:*:*:document/AWSFleetManager-SetWindowsRegistryValue", "arn:aws:ssm:*:*:document/AWSFleetManager-StartProcess", "arn:aws:ssm:*:*:document/AWSFleetManager-TerminateProcess" ] }, { "Sid":"TerminateSession", "Effect":"Allow", "Action":[ "ssm:TerminateSession" ], "Resource":"*", "Condition": { "StringLike":{ "ssm:resourceTag/aws:ssmmessages:session-id":[ "${aws:userid}" ] } } } ] } Sample policy for Fleet Manager read-only access The following policy provides permissions to read-only Fleet Manager features. Replace each example resource placeholder with your own information. { Fleet Manager 287 AWS Systems Manager User Guide "Version":"2012-10-17", "Statement":[ { "Sid":"EC2", "Effect":"Allow", "Action":[ "ec2:DescribeInstances", "ec2:DescribeTags" ], "Resource":"*" }, { "Sid":"General", "Effect":"Allow", "Action":[ "ssm:DescribeInstanceAssociationsStatus", "ssm:DescribeInstancePatches", "ssm:DescribeInstancePatchStates", "ssm:DescribeInstanceProperties", "ssm:GetCommandInvocation", "ssm:GetServiceSetting", "ssm:GetInventorySchema", "ssm:ListComplianceItems", "ssm:ListInventoryEntries", "ssm:ListTagsForResource", "ssm:ListCommandInvocations", "ssm:ListAssociations" ], "Resource":"*" }, { "Sid":"SendCommand", "Effect":"Allow", "Action":[ "ssm:GetDocument", "ssm:SendCommand", "ssm:StartSession" ], "Resource":[ "arn:aws:ec2:*:account-id:instance/*", "arn:aws:ssm:*:account-id:managed-instance/*", "arn:aws:ssm:*:account-id:document/SSM-SessionManagerRunShell", "arn:aws:ssm:*:*:document/AWSFleetManager-GetDiskInformation", "arn:aws:ssm:*:*:document/AWSFleetManager-GetFileContent", Fleet Manager 288 AWS Systems Manager User Guide "arn:aws:ssm:*:*:document/AWSFleetManager-GetFileSystemContent", "arn:aws:ssm:*:*:document/AWSFleetManager-GetGroups", "arn:aws:ssm:*:*:document/AWSFleetManager-GetPerformanceCounters", "arn:aws:ssm:*:*:document/AWSFleetManager-GetProcessDetails", "arn:aws:ssm:*:*:document/AWSFleetManager-GetUsers", "arn:aws:ssm:*:*:document/AWSFleetManager-GetWindowsEvents", "arn:aws:ssm:*:*:document/AWSFleetManager-GetWindowsRegistryContent" ] }, { "Sid":"TerminateSession", "Effect":"Allow", "Action":[ "ssm:TerminateSession" ], "Resource":"*", "Condition": { "StringLike":{ "ssm:resourceTag/aws:ssmmessages:session-id":[ "${aws:userid}" ] } } } ] } Working with managed nodes A managed node is any machine configured for AWS Systems Manager. You can configure the following machine types as managed nodes: • 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 In the Systems Manager console, any machine prefixed with "mi-" is has been configured as a managed node using a hybrid activation. Edge devices display their AWS IoT Thing name. Fleet Manager 289 AWS Systems Manager Note User Guide The only supported feature for macOS instances is viewing the file system. About Systems Manager instances tiers AWS Systems Manager offers a standard-instances tier and an advanced-instances tier. Both support managed nodes in your hybrid and multicloud environment. The standard-instances tier allows you to register a maximum of 1,000 machines per AWS account per AWS Region. If you need to register more than 1,000 machines in a single account and Region, then use the advanced- instances tier. You can create as many managed nodes as you like in the advanced-instances tier. All managed nodes configured for Systems Manager are priced on a pay-per-use basis. For more information about enabling the advanced instances tier, see Turning on the advanced-instances tier. For more information about pricing, see AWS Systems Manager Pricing. Note the following additional information about the standard-instances tier and advanced- instances tier: • Advanced instances also allow you to connect to your non-EC2 nodes in a hybrid and multicloud environment by using AWS Systems Manager Session Manager. Session Manager provides interactive shell access to your instances. For more information, see AWS Systems Manager Session Manager. • The standard-instances quota also applies to EC2 instances
systems-manager-ug-096
systems-manager-ug.pdf
96
configured for Systems Manager are priced on a pay-per-use basis. For more information about enabling the advanced instances tier, see Turning on the advanced-instances tier. For more information about pricing, see AWS Systems Manager Pricing. Note the following additional information about the standard-instances tier and advanced- instances tier: • Advanced instances also allow you to connect to your non-EC2 nodes in a hybrid and multicloud environment by using AWS Systems Manager Session Manager. Session Manager provides interactive shell access to your instances. For more information, see AWS Systems Manager Session Manager. • The standard-instances quota also applies to EC2 instances that use a Systems Manager on- premises activation (which isn't a common scenario). • To patch applications released by Microsoft on virtual machines (VMs) on-premises instances, activate the advanced-instances tier. There is a charge to use the advanced-instances tier. There is no additional charge to patch applications released by Microsoft on Amazon Elastic Compute Cloud (Amazon EC2) instances. For more information, see Patching applications released by Microsoft on Windows Server. Display managed nodes If you don't see your managed nodes listed in the console, then do the following: 1. Verify that the console is open in the AWS Region where you created your managed nodes. You can switch Regions by using the list in the top, right corner of the console. Fleet Manager 290 AWS Systems Manager User Guide 2. Verify that the setup steps for your managed nodes meet Systems Manager requirements. For information, see Setting up managed nodes for AWS Systems Manager. 3. For non-EC2 machines, verify that you completed the hybrid activation process. For more information, see Managing nodes in hybrid and multicloud environments with Systems Manager. Note the following additional information: • The Fleet Manager console does not display Amazon EC2 nodes that have been terminated. • Systems Manager requires accurate time references in order to perform operations on your machines. If the date and time aren't set correctly on your managed nodes, the machines might not match the signature date of your API requests. For more information, see Use cases and best practices. • When you create or edit tags, the system can take up to one hour to display changes in the table filter. • After the status of a managed node has been Connection Lost for at least 30 days, the node might no longer be listed in the Fleet Manager console. To restore it to the list, the issue that caused the lost connection must be resolved. For troubleshooting tips, see Troubleshooting managed node availability. Verify Systems Manager support on a managed node AWS Config provides AWS Managed Rules, which are predefined, customizable rules that AWS Config uses to evaluate whether your AWS resource configurations comply with common best practices. AWS Config Managed Rules include the ec2-instance-managed-by-systems-manager rule. This rule checks whether the Amazon EC2 instances in your account are managed by Systems Manager. For more information, see AWS Config Managed Rules. Increase security posture on managed nodes For information about increasing your security posture against unauthorized root-level commands on your managed nodes, see Restricting access to root-level commands through SSM Agent. Deregister managed nodes You can deregister managed nodes at any time. For example, if you're managing multiple nodes with the same AWS Identity and Access Management (IAM) role and you notice any kind of malicious behavior, you can deregister any number of machines at any point. (In order to re- Fleet Manager 291 AWS Systems Manager User Guide register the same machine, you must use a different hybrid Activation Code and Activation ID than previously used to register it.) For information about deregistering managed nodes, see Deregistering managed nodes in a hybrid and multicloud environment. Topics • Configuring instance tiers • Resetting passwords on managed nodes • Deregistering managed nodes in a hybrid and multicloud environment • Working with OS file systems using Fleet Manager • Monitoring managed node performance • Working with processes • Viewing logs on managed nodes • Managing OS user accounts and groups on managed nodes using Fleet Manager • Managing the Windows registry on managed nodes Configuring instance tiers This topic describes the scenarios when you must activate the advanced-instanced tier. AWS Systems Manager offers a standard-instances tier and an advanced-instances tier for non-EC2 machines in a hybrid and multicloud environment. You can register up to 1,000 standard hybrid-activated nodes per account per AWS Region at no additional cost. However, registering more than 1,000 hybrid nodes requires that you activate the advanced-instances tier. There is a charge to use the advanced-instances tier. For more information, see AWS Systems Manager Pricing. Even with fewer than 1,000 registered hybrid-activated nodes, two other scenarios require the advanced-instances tier: • You want to use Session Manager to connect to non-EC2 nodes. • You want to patch applications (not operating
systems-manager-ug-097
systems-manager-ug.pdf
97
a standard-instances tier and an advanced-instances tier for non-EC2 machines in a hybrid and multicloud environment. You can register up to 1,000 standard hybrid-activated nodes per account per AWS Region at no additional cost. However, registering more than 1,000 hybrid nodes requires that you activate the advanced-instances tier. There is a charge to use the advanced-instances tier. For more information, see AWS Systems Manager Pricing. Even with fewer than 1,000 registered hybrid-activated nodes, two other scenarios require the advanced-instances tier: • You want to use Session Manager to connect to non-EC2 nodes. • You want to patch applications (not operating systems) released by Microsoft on non-EC2 nodes. Note There is no charge to patch applications released by Microsoft on Amazon EC2 instances. Fleet Manager 292 AWS Systems Manager User Guide Advanced-instances tier detailed scenarios The following information provides details on the three scenarios for which you must activate the advanced-instances tier. Scenario 1: You want to register more than 1,000 hybrid-activated nodes Using the standard-instances tier, you can register a maximum of 1,000 non-EC2 nodes in a hybrid and multicloud environment per AWS Region in a specific account without additional charge. If you need to register more than 1,000 non-EC2 nodes in a Region, you must use the advanced-instances tier. You can then activate as many machines for your hybrid and multicloud environment as you want. Charges for the advanced-instances tier are based on the number of advanced nodes activated as Systems Manager managed nodes and the hours those nodes are running. All Systems Manager managed nodes that use the activation process described in Create a hybrid activation to register nodes with Systems Manager are then subject to charge if you exceed 1,000 on-premises nodes in a Region in a specific account . Note You can also activate existing Amazon Elastic Compute Cloud (Amazon EC2) instances using Systems Manager hybrid activations and work with them as non-EC2 instances, such as for testing. These also qualify as hybrid nodes. This isn't a common scenario. Scenario 2: Patching Microsoft-released applications on hybrid-activated nodes The advanced-instances tier is also required if you want to patch Microsoft-released applications on non-EC2 nodes in a hybrid and multicloud environment. If you activate the advanced-instances tier to patch Microsoft applications on non-EC2 nodes, charges are then incurred for all on-premises nodes, even if you have fewer than 1,000. There is no additional charge to patch applications released by Microsoft on Amazon Elastic Compute Cloud (Amazon EC2) instances. For more information, see Patching applications released by Microsoft on Windows Server. Fleet Manager 293 AWS Systems Manager User Guide Scenario 3: Connecting to hybrid-activated nodes using Session Manager Session Manager provides interactive shell access to your instances. To connect to hybrid- activated managed nodes using Session Manager, you must activate the advanced-instances tier. Charges are then incurred for all hybrid-activated nodes, even if you have fewer than 1,000. Summary: When do I need the advanced-instances tier? Use the following table to review when you must use the advanced-instances tier, and for which scenarios additional charges apply. Scenario Advanced-instances tier required? Additional charges apply? Yes Yes Yes No Yes Yes The number of hybrid-ac tivated nodes in my Region in a specific account is more than 1,000. I want to use Patch Manager to patch Microsoft-released applications on any number of hybrid-activated nodes, even less than 1,000. I want to use Session Manager to connect to any number of Yes hybrid-activated nodes, even less than 1,000. No 1. The number of hybrid-ac tivated nodes in a Region in a specific account is 1,000 or less; and 2. I am not patching Microsoft applications on any hybrid-activated nodes; and Fleet Manager 294 AWS Systems Manager Scenario 3. I am not connecting to any hybrid-activated nodes using Session Manager. Advanced-instances tier required? Additional charges apply? User Guide Topics • Turning on the advanced-instances tier • Reverting from the advanced-instances tier to the standard-instances tier Turning on the advanced-instances tier AWS Systems Manager offers a standard-instances tier and an advanced-instances tier for non-EC2 machines in a hybrid and multicloud environment. The standard-instances tier lets you register a maximum of 1,000 hybrid-activated machines per AWS account per AWS Region. The advanced- instances tier is also required to use Patch Manager to patch Microsoft-released applications on non-EC2 nodes, and to connect to non-EC2 nodes using Session Manager. For more information, see Turning on the advanced-instances tier. This section describes how to configure your hybrid and multicloud environment to use the advanced-instances tier. Before you begin Review pricing details for advanced instances. Advanced instances are available on a per-use-basis. For more information see, AWS Systems Manager Pricing. Configuring permissions to turn on the advanced-instances tier Verify that you have permission in AWS Identity and Access Management (IAM) to change your environment from the standard-instances tier to
systems-manager-ug-098
systems-manager-ug.pdf
98
also required to use Patch Manager to patch Microsoft-released applications on non-EC2 nodes, and to connect to non-EC2 nodes using Session Manager. For more information, see Turning on the advanced-instances tier. This section describes how to configure your hybrid and multicloud environment to use the advanced-instances tier. Before you begin Review pricing details for advanced instances. Advanced instances are available on a per-use-basis. For more information see, AWS Systems Manager Pricing. Configuring permissions to turn on the advanced-instances tier Verify that you have permission in AWS Identity and Access Management (IAM) to change your environment from the standard-instances tier to the advanced-instances tier. You must either have the AdministratorAccess IAM policy attached to your user, group, or role, or you must have permission to change the Systems Manager activation-tier service setting. The activation-tier setting uses the following API operations: • GetServiceSetting • UpdateServiceSetting Fleet Manager 295 AWS Systems Manager • ResetServiceSetting User Guide Use the following procedure to add an inline IAM policy to a user account. This policy allows a user to view the current managed-instance tier setting. This policy also allows the user to change or reset the current setting in the specified AWS account and AWS Region. 1. Sign in to the AWS Management Console and open the IAM console at https:// console.aws.amazon.com/iam/. In the navigation pane, choose Users. In the list, choose the name of the user to embed a policy in. 2. 3. 4. Choose the Permissions tab. 5. On the right side of the page, under Permission policies, choose Add inline policy. 6. Choose the JSON tab. 7. Replace the default content with the following: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], "Resource": "arn:aws:ssm:region:aws-account-id:servicesetting/ssm/ managed-instance/activation-tier" } ] } 8. Choose Review policy. Fleet Manager 296 AWS Systems Manager User Guide 9. On the Review policy page, for Name, enter a name for the inline policy. For example: Managed-Instances-Tier. 10. Choose Create policy. Administrators can specify read-only permission by assigning the following inline policy to the user. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting" ], "Resource": "*" }, { "Effect": "Deny", "Action": [ "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], "Resource": "*" } ] } For more information about creating and editing IAM policies, see Creating IAM Policies in the IAM User Guide. Turning on the advanced-instances tier (console) The following procedure shows you how to use the Systems Manager console to change all non- EC2 nodes that were added using managed-instance activation, in the specified AWS account and AWS Region, to use the advanced-instances tier. Before you begin Verify that the console is open in the AWS Region where you created your managed instances. You can switch Regions by using the list in the top, right corner of the console. Fleet Manager 297 AWS Systems Manager User Guide 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. For information, see Setting up managed nodes for AWS Systems Manager. Important The following procedure describes how to change an account-level setting. This change results in charges being billed to your account. To turn on the advanced-instances tier (console) 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 Settings, and then choose Change instance tier settings. 4. Review the information in the dialog box about changing account settings. 5. If you approve, choose the option to accept, and then choose Change setting. The system can take several minutes to complete the process of moving all instances from the standard-instances tier to the advanced-instances tier. Note For information about changing back to the standard-instances tier, see Reverting from the advanced-instances tier to the standard-instances tier. Turning on the advanced-instances tier (AWS CLI) The following procedure shows you how to use the AWS Command Line Interface to change all on-premises servers and VMs that were added using managed-instance activation, in the specified AWS account and AWS Region, to use the advanced-instances tier. Fleet Manager 298 AWS Systems Manager Important User Guide The following procedure describes how to change an account-level setting. This change results in charges being billed to your account. To turn on the advanced-instances tier using the AWS CLI 1. Open the AWS CLI and run the following command. Replace each example resource placeholder with your own information. Linux & macOS aws ssm update-service-setting \ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier \ --setting-value advanced Windows aws ssm update-service-setting ^ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier ^ --setting-value advanced There is no output if the command succeeds. 2. Run the following command to view the current service settings for managed nodes in the current AWS account and AWS Region. Linux
systems-manager-ug-099
systems-manager-ug.pdf
99
how to change an account-level setting. This change results in charges being billed to your account. To turn on the advanced-instances tier using the AWS CLI 1. Open the AWS CLI and run the following command. Replace each example resource placeholder with your own information. Linux & macOS aws ssm update-service-setting \ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier \ --setting-value advanced Windows aws ssm update-service-setting ^ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier ^ --setting-value advanced There is no output if the command succeeds. 2. Run the following command to view the current service settings for managed nodes in the current AWS account and AWS Region. Linux & macOS aws ssm get-service-setting \ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier Windows aws ssm get-service-setting ^ Fleet Manager 299 AWS Systems Manager User Guide --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier The command returns information like the following. { "ServiceSetting": { "SettingId": "/ssm/managed-instance/activation-tier", "SettingValue": "advanced", "LastModifiedDate": 1555603376.138, "LastModifiedUser": "arn:aws:sts::123456789012:assumed-role/ Administrator/User_1", "ARN": "arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/managed- instance/activation-tier", "Status": "PendingUpdate" } } Turning on the advanced-instances tier (PowerShell) The following procedure shows you how to use the AWS Tools for Windows PowerShell to change all on-premises servers and VMs that were added using managed-instance activation, in the specified AWS account and AWS Region, to use the advanced-instances tier. Important The following procedure describes how to change an account-level setting. This change results in charges being billed to your account. To turn on the advanced-instances tier using PowerShell 1. Open AWS Tools for Windows PowerShell and run the following command. Replace each example resource placeholder with your own information. Update-SSMServiceSetting ` -SettingId "arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier" ` -SettingValue "advanced" Fleet Manager 300 AWS Systems Manager User Guide There is no output if the command succeeds. 2. Run the following command to view the current service settings for managed nodes in the current AWS account and AWS Region. Get-SSMServiceSetting ` -SettingId "arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier" The command returns information like the following. ARN:arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/managed-instance/ activation-tier LastModifiedDate : 4/18/2019 4:02:56 PM LastModifiedUser : arn:aws:sts::123456789012:assumed-role/Administrator/User_1 SettingId : /ssm/managed-instance/activation-tier SettingValue : advanced Status : PendingUpdate The system can take several minutes to complete the process of moving all nodes from the standard-instances tier to the advanced-instances tier. Note For information about changing back to the standard-instances tier, see Reverting from the advanced-instances tier to the standard-instances tier. Reverting from the advanced-instances tier to the standard-instances tier This section describes how to change hybrid-activated nodes running in the advanced-instances tier back to the standard-instances tier. This configuration applies to all hybrid-activated nodes in an AWS account and a single AWS Region. Before you begin Review the following important details. Fleet Manager 301 AWS Systems Manager Note User Guide • You can't revert back to the standard-instance tier if you're running more than 1,000 hybrid-activated nodes in the account and Region. You must first deregister nodes until you have 1,000 or fewer. This also applies to Amazon Elastic Compute Cloud (Amazon EC2) instances that use a Systems Manager hybrid activation (which isn't a common scenario). For more information, see Deregistering managed nodes in a hybrid and multicloud environment. • After you revert, you won't be able to use Session Manager, a tool in AWS Systems Manager, to interactively access your hybrid-activated nodes. • After you revert, you won't be able to use Patch Manager, a tool in AWS Systems Manager, to patch applications released by Microsoft on hybrid-activated nodes. • The process of reverting all hybrid-activated nodes back to the standard-instance tier can take 30 minutes or more to complete. This section describes how to revert all hybrid-activated nodes in an AWS account and AWS Region from the advanced-instances tier to the standard-instances tier. Reverting to the standard-instances tier (console) The following procedure shows you how to use the Systems Manager console to change all hybrid- activated nodes in your hybrid and multicloud environment to use the standard-instances tier in the specified AWS account and AWS Region. To revert to the standard-instances tier (console) 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the Account settings dropdown and choose Instance tier settings. 2. 3. 4. Choose Change account setting. 5. Review the information in the pop-up about changing account settings, and then if you approve, choose the option to accept and continue. Fleet Manager 302 AWS Systems Manager User Guide Reverting to the standard-instances tier (AWS CLI) The following procedure shows you how to use the AWS Command Line Interface to change all hybrid-activated nodes in your hybrid and multicloud environment to use the standard-instances tier in the specified AWS account and AWS Region. To revert to the standard-instances tier using the AWS CLI 1. Open the AWS CLI and run the following command. Replace each example resource placeholder with your own information. Linux & macOS aws ssm update-service-setting \ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier \ --setting-value standard Windows aws ssm update-service-setting ^ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier
systems-manager-ug-100
systems-manager-ug.pdf
100
302 AWS Systems Manager User Guide Reverting to the standard-instances tier (AWS CLI) The following procedure shows you how to use the AWS Command Line Interface to change all hybrid-activated nodes in your hybrid and multicloud environment to use the standard-instances tier in the specified AWS account and AWS Region. To revert to the standard-instances tier using the AWS CLI 1. Open the AWS CLI and run the following command. Replace each example resource placeholder with your own information. Linux & macOS aws ssm update-service-setting \ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier \ --setting-value standard Windows aws ssm update-service-setting ^ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier ^ --setting-value standard There is no output if the command succeeds. 2. Run the following command 30 minutes later to view the settings for managed instances in the current AWS account and AWS Region. Linux & macOS aws ssm get-service-setting \ --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier Windows aws ssm get-service-setting ^ Fleet Manager 303 AWS Systems Manager User Guide --setting-id arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier The command returns information like the following. { "ServiceSetting": { "SettingId": "/ssm/managed-instance/activation-tier", "SettingValue": "standard", "LastModifiedDate": 1555603376.138, "LastModifiedUser": "System", "ARN": "arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/managed- instance/activation-tier", "Status": "Default" } } The status changes to Default after the request has been approved. Reverting to the standard-instances tier (PowerShell) The following procedure shows you how to use AWS Tools for Windows PowerShell to change hybrid-activated nodes in your hybrid and multicloud environment to use the standard-instances tier in the specified AWS account and AWS Region. To revert to the standard-instances tier using PowerShell 1. Open AWS Tools for Windows PowerShell and run the following command. Update-SSMServiceSetting ` -SettingId "arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier" ` -SettingValue "standard" There is no output if the command succeeds. 2. Run the following command 30 minutes later to view the settings for managed instances in the current AWS account and AWS Region. Get-SSMServiceSetting ` Fleet Manager 304 AWS Systems Manager User Guide -SettingId "arn:aws:ssm:region:aws-account-id:servicesetting/ssm/managed- instance/activation-tier" The command returns information like the following. ARN: arn:aws:ssm:us-east-2:123456789012:servicesetting/ssm/managed-instance/ activation-tier LastModifiedDate : 4/18/2019 4:02:56 PM LastModifiedUser : System SettingId : /ssm/managed-instance/activation-tier SettingValue : standard Status : Default The status changes to Default after the request has been approved. Resetting passwords on managed nodes You can reset the password for any user on a managed node. This includes Amazon Elastic Compute Cloud (Amazon EC2) instances; AWS IoT Greengrass core devices; and on-premises servers, edge devices, and virtual machines (VMs) that are managed by AWS Systems Manager. The password reset functionality is built on Session Manager, a tool in AWS Systems Manager. You can use this functionality to connect to managed nodes without opening inbound ports, maintaining bastion hosts, or managing SSH keys. Password reset is useful when a user has forgotten a password, or when you want to quickly update a password without making an RDP or SSH connection to a managed node. Prerequisites Before you can reset the password on a managed node, the following requirements must be met: • The managed node on which you want to change a password must be a Systems Manager managed node. Also, SSM Agent version 2.3.668.0 or later must be installed on the managed node.) For information about installing or updating SSM Agent, see Working with SSM Agent. • The password reset functionality uses the Session Manager configuration that is set up for your account to connect to the managed node. Therefore, the prerequisites for using Session Manager must have been completed for your account in the current AWS Region. For more information, see Setting up Session Manager. Fleet Manager 305 AWS Systems Manager Note User Guide Session Manager support for on-premises nodes is provided for the advanced-instances tier only. For more information, see Turning on the advanced-instances tier. • The AWS user who is changing the password must have the ssm:SendCommand permission for the managed node. For more information, see Restricting Run Command access based on tags. Restricting access You can limit a user's ability to reset passwords to specific managed nodes. This is done by using identity-based policies for the Session Manager ssm:StartSession operation with the AWS- PasswordReset SSM document. For more information, see Control user session access to instances. Encrypting data Turn on AWS Key Management Service (AWS KMS) complete encryption for Session Manager data to use the password reset option for managed nodes. For more information, see Turn on KMS key encryption of session data (console). Reset a password on a managed node You can reset a password on a Systems Manager managed node using the Systems Manager Fleet Manager console or the AWS Command Line Interface (AWS CLI). To change the password on a managed node (console) 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 node that needs a new password. 4. Choose Instance actions, Reset password. 5. For User name,
systems-manager-ug-101
systems-manager-ug.pdf
101
option for managed nodes. For more information, see Turn on KMS key encryption of session data (console). Reset a password on a managed node You can reset a password on a Systems Manager managed node using the Systems Manager Fleet Manager console or the AWS Command Line Interface (AWS CLI). To change the password on a managed node (console) 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 node that needs a new password. 4. Choose Instance actions, Reset password. 5. For User name, enter the name of the user for which you're changing the password. This can be any user name that has an account on the node. 6. Choose Submit. Fleet Manager 306 AWS Systems Manager User Guide 7. Follow the prompts in the Enter new password command window to specify the new password. Note If the version of SSM Agent on the managed node doesn't support password resets, you're prompted to install a supported version using Run Command, a tool in AWS Systems Manager. To reset the password on a managed node (AWS CLI) 1. To reset the password for a user on a managed node, run the following command. Replace each example resource placeholder with your own information. Note To use the AWS CLI to reset a password, the Session Manager plugin must be installed on your local machine. For information, see Install the Session Manager plugin for the AWS CLI. Linux & macOS aws ssm start-session \ --target instance-id \ --document-name "AWS-PasswordReset" \ --parameters '{"username": ["user-name"]}' Windows aws ssm start-session ^ --target instance-id ^ --document-name "AWS-PasswordReset" ^ --parameters username="user-name" 2. Follow the prompts in the Enter new password command window to specify the new password. Fleet Manager 307 AWS Systems Manager User Guide Troubleshoot password resets on managed nodes Many password reset issues can be resolved by ensuring that you have completed the password reset prerequisites. For other problems, use the following information to help you troubleshoot password reset issues. Topics • Managed node not available • SSM Agent not up-to-date (console) • Password reset options aren't provided (AWS CLI) • No authorization to run ssm:SendCommand • Session Manager error message Managed node not available Problem: You want to reset the password for a managed node on the Managed instances console page, but the node isn't in the list. • Solution: The managed node you want to connect to might not be configured for Systems Manager. To use an EC2 instance with Systems Manager, an AWS Identity and Access Management (IAM) instance profile that gives Systems Manager permission to perform actions on your instances must be attached to the instance. For information, see Configure instance permissions required for Systems Manager. To use a non-EC2 machine with Systems Manager, create an IAM service role that gives Systems Manager permission to perform actions on your managed nodes. For more information, see Create the IAM service role required for Systems Manager in hybrid and multicloud environments. (Session Manager support for on-premises servers and VMs is provided for the advanced-instances tier only. For more information, see Turning on the advanced-instances tier.) SSM Agent not up-to-date (console) Problem: A message reports that the version of SSM Agent doesn't support password reset functionality. • Solution: Version 2.3.668.0 or later of SSM Agent is required to perform password resets. In the console, you can update the agent on the managed node by choosing Update SSM Agent. Fleet Manager 308 AWS Systems Manager User Guide An updated version of SSM Agent is released whenever new tools are added to Systems Manager or updates are made to existing tools. Failing to use the latest version of the agent can prevent your managed node from using various Systems Manager tools and features. For that reason, we recommend that you automate the process of keeping SSM Agent up to date on your machines. For information, see Automating updates to SSM Agent. Subscribe to the SSM Agent Release Notes page on GitHub to get notifications about SSM Agent updates. Password reset options aren't provided (AWS CLI) Problem: You connect successfully to a managed node using the AWS CLI start-session command. You specified the SSM Document AWS-PasswordReset and provided a valid user name, but prompts to change the password aren't displayed. • Solution: The version of SSM Agent on the managed node isn't up-to-date. Version 2.3.668.0 or later is required to perform password resets. An updated version of SSM Agent is released whenever new tools are added to Systems Manager or updates are made to existing tools. Failing to use the latest version of the agent can prevent your managed node from using various Systems Manager tools and features. For that reason, we recommend that you automate the process of keeping SSM
systems-manager-ug-102
systems-manager-ug.pdf
102
specified the SSM Document AWS-PasswordReset and provided a valid user name, but prompts to change the password aren't displayed. • Solution: The version of SSM Agent on the managed node isn't up-to-date. Version 2.3.668.0 or later is required to perform password resets. An updated version of SSM Agent is released whenever new tools are added to Systems Manager or updates are made to existing tools. Failing to use the latest version of the agent can prevent your managed node from using various Systems Manager tools and features. For that reason, we recommend that you automate the process of keeping SSM Agent up to date on your machines. For information, see Automating updates to SSM Agent. Subscribe to the SSM Agent Release Notes page on GitHub to get notifications about SSM Agent updates. No authorization to run ssm:SendCommand Problem: You attempt to connect to a managed node to change the password but receive an error message saying that you aren't authorized to run ssm:SendCommand on the managed node. • Solution: Your IAM policy must include permission to run the ssm:SendCommand command. For information, see Restricting Run Command access based on tags. Session Manager error message Problem: You receive an error message related to Session Manager. • Solution: Password reset support requires that Session Manager is configured correctly. For information, see Setting up Session Manager and Troubleshooting Session Manager. Fleet Manager 309 AWS Systems Manager User Guide Deregistering managed nodes in a hybrid and multicloud environment If you no longer want to manage an on-premises server, edge device, or virtual machine (VM) by using AWS Systems Manager, then you can deregister it. Deregistering a hybrid-activated node removes it from the list of managed nodes in Systems Manager. AWS Systems Manager Agent (SSM Agent) running on the hybrid-activated node won't be able to refresh its authorization token because it's no longer registered. SSM Agent hibernates and reduce its ping frequency to Systems Manager in the cloud to once per hour. Systems Manager stores the command history for a deregistered managed node for 30 days. If you want to reregister an on-premises server, edge device, or VM, you must use a different Activation Code and Activation ID than used to register the machine previously. The Activation Code and Activation ID must not have already been used on the maximum number of activations specified when they were created. The following procedure describes how to deregister a hybrid-activated node by using the Systems Manager console. For information about how to do this by using the AWS Command Line Interface , see deregister-managed-instance. For related information, see the following topics: • Deregister and reregister a managed node (Linux) (Linux) • Deregister and reregister a managed node (Windows Server) (Windows Server) To deregister a hybrid-activated node (console) 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the checkbox next to the managed node that you want to deregister. 2. 3. 4. Choose Node actions, Tools, Deregister this managed node. 5. Review the information in the Deregister this managed node dialog box. If you approve, choose Deregister. Working with OS file systems using Fleet Manager You can use Fleet Manager, a tool in AWS Systems Manager, to work with the file system on your managed nodes. Using Fleet Manager, you can view information about the directory and file data Fleet Manager 310 AWS Systems Manager User Guide stored on the volumes attached to your managed nodes. For example, you can view the name, size, extension, owner, and permissions for your directories and files. Up to 10,000 lines of file data can be previewed as text from the Fleet Manager console. You can also use this feature to tail files. When using tail to view file data, the last 10 lines of the file are displayed initially. As new lines of data are written to the file, the view is updated in real time. As a result, you can review log data from the console, which can improve the efficiency of your troubleshooting and systems administration. Additionally, you can create directories and copy, cut, paste, rename, or delete files and directories. We recommend creating regular backups, or taking snapshots of the Amazon Elastic Block Store (Amazon EBS) volumes attached to your managed nodes. When copying, or cutting and pasting files, existing files and directories in the destination path with the same name as the new files or directories are replaced. Serious problems can occur if you replace or modify system files and directories. AWS doesn't guarantee that these problems can be solved. Modify system files at your own risk. You're responsible for all file and directory changes, and ensuring you have backups. Deleting or replacing files and directories can't be undone. Note Fleet Manager uses Session Manager, a tool in AWS
systems-manager-ug-103
systems-manager-ug.pdf
103
Amazon Elastic Block Store (Amazon EBS) volumes attached to your managed nodes. When copying, or cutting and pasting files, existing files and directories in the destination path with the same name as the new files or directories are replaced. Serious problems can occur if you replace or modify system files and directories. AWS doesn't guarantee that these problems can be solved. Modify system files at your own risk. You're responsible for all file and directory changes, and ensuring you have backups. Deleting or replacing files and directories can't be undone. Note Fleet Manager uses Session Manager, a tool in AWS Systems Manager, to view text previews and tail files. For Amazon Elastic Compute Cloud (Amazon EC2) instances, the instance profile attached to your managed instances must provide permissions for Session Manager to use this feature. For more information about adding Session Manager permissions to an instance profile, see Add Session Manager permissions to an existing IAM role. Topics • Viewing the OS file system using Fleet Manager • Previewing OS files using Fleet Manager • Tailing OS files using Fleet Manager • Copying, cutting, and pasting OS files or directories using Fleet Manager • Renaming OS files and directories using Fleet Manager • Deleting OS files and directories using Fleet Manager • Creating OS directories using Fleet Manager • Cutting, copying, and pasting OS directories using Fleet Manager Fleet Manager 311 AWS Systems Manager User Guide Viewing the OS file system using Fleet Manager You can use Fleet Manager to view the OS file system on a Systems Manager managed node. To view the file OS system using Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the link of the managed node with the file system you want to view. 2. 3. 4. Choose Tools, File system. Previewing OS files using Fleet Manager You can use Fleet Manager to preview text files on an OS. To view text previews of files using Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the link of the managed node with the files you want to preview. 2. 3. 4. Choose Tools, File system. 5. Select the File name of the directory that contains the file you want to preview. 6. Choose the button next to the file whose content you want to preview. 7. Choose Actions, Preview as text. Tailing OS files using Fleet Manager You can use Fleet Manager to tail a file on a managed node. To tail OS files with Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. Fleet Manager 312 AWS Systems Manager User Guide 3. Select the link of the managed node with the files you want to tail. 4. Choose Tools, File system. 5. Select the File name of the directory that contains the file you want to tail. 6. Choose the button next to the file whose content you want to tail. 7. Choose Actions, Tail file. Copying, cutting, and pasting OS files or directories using Fleet Manager You can use Fleet Manager to copy, cut, and paste OS files on a managed node. To copy or cut and paste files or directories using Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the link of the managed node with the files you want to copy, or cut and paste. 2. 3. 4. Choose Tools, File system. 5. To copy or cut a file, select the File name of the directory that contains the file you want to copy or cut. To copy or cut a directory, choose the button next to the directory that you want to copy or cut and then proceed to step 8. 6. Choose the button next to the file you want to copy or cut. 7. 8. 9. In the Actions menu, choose Copy or Cut. In the File system view, choose the button next to the directory you want to paste the file in. In the Actions menu, choose Paste. Renaming OS files and directories using Fleet Manager You can use Fleet Manager to rename files and directories on a managed node in your account. To rename files or directories with Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. Fleet Manager 313 AWS Systems Manager User Guide 3. Select the link of the managed node with the files or directories you want to rename. 4. Choose Tools, File system. 5. To rename a file, select the File name of the directory that contains the file you want to rename. To
systems-manager-ug-104
systems-manager-ug.pdf
104
files and directories using Fleet Manager You can use Fleet Manager to rename files and directories on a managed node in your account. To rename files or directories with Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. Fleet Manager 313 AWS Systems Manager User Guide 3. Select the link of the managed node with the files or directories you want to rename. 4. Choose Tools, File system. 5. To rename a file, select the File name of the directory that contains the file you want to rename. To rename a directory, choose the button next to the directory that you want to rename and then proceed to step 8. 6. Choose the button next to the file whose content you want to rename. 7. Choose Actions, Rename. 8. For File name, enter the new name for the file and select Rename. Deleting OS files and directories using Fleet Manager You can use Fleet Manager to delete files and directories on a managed node in your account. To delete files or directories using Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the link of the managed node with the files or directories you want to delete. 2. 3. 4. Choose Tools, File system. 5. To delete a file, select the File name of the directory that contains the file you want to delete. To delete a directory, choose the button next to the directory that you want to delete and then proceed to step 7. 6. Choose the button next to the file with the content you want to delete. 7. Choose Actions, Delete. Creating OS directories using Fleet Manager You can use Fleet Manager to create directories on a managed node in your account. To create a directory using Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Fleet Manager. Fleet Manager 314 AWS Systems Manager User Guide 3. Select the link of the managed node you want to create a directory in. 4. Choose Tools, File system. 5. 6. 7. Select the File name of the directory where you want to create a new directory. Select Create directory. For Directory name, enter the name for the new directory, and then select Create directory. Cutting, copying, and pasting OS directories using Fleet Manager You can use Fleet Manager to cut, copy, and paste directories on a managed node in your account. To copy or cut and paste directories with Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the link of the managed node with the files you want to copy, or cut and paste. 2. 3. 4. Choose Tools, File system. 5. Choose the button next to the directory that you want to copy or cut and then proceed to step 8. In the Actions menu, choose Copy or Cut. In the File system view, choose the button next to the directory you want to paste the file in. In the Actions menu, choose Paste. 6. 7. 8. Monitoring managed node performance You can use Fleet Manager, a tool in AWS Systems Manager, to view performance data about your managed nodes in real time. The performance data is retrieved from performance counters. The following performance counters are available in Fleet Manager: • CPU utilization • Disk input/output (I/O) utilization • Network traffic • Memory usage Fleet Manager 315 AWS Systems Manager Note User Guide Fleet Manager uses Session Manager, a tool in AWS Systems Manager, to retrieve performance data. For Amazon Elastic Compute Cloud (Amazon EC2) instances, the instance profile attached to your managed instances must provide permissions for Session Manager to use this feature. For more information about adding Session Manager permissions to an instance profile, see Add Session Manager permissions to an existing IAM role. To view performance data with Fleet Manager 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 managed node whose performance you want to monitor. 4. Choose View details. 5. Choose Tools, Performance counters. Working with processes You can use Fleet Manager, a tool in AWS Systems Manager, to work with processes on your managed nodes. Using Fleet Manager, you can view information about processes. For example, you can see the CPU utilization and memory usage of processes in addition to their handles and threads. With Fleet Manager, you can start and terminate processes from the console. Note Fleet Manager uses Session Manager, a tool in AWS Systems Manager, to retrieve process data. For Amazon Elastic Compute Cloud (Amazon EC2) instances, the instance
systems-manager-ug-105
systems-manager-ug.pdf
105
to monitor. 4. Choose View details. 5. Choose Tools, Performance counters. Working with processes You can use Fleet Manager, a tool in AWS Systems Manager, to work with processes on your managed nodes. Using Fleet Manager, you can view information about processes. For example, you can see the CPU utilization and memory usage of processes in addition to their handles and threads. With Fleet Manager, you can start and terminate processes from the console. Note Fleet Manager uses Session Manager, a tool in AWS Systems Manager, to retrieve process data. For Amazon Elastic Compute Cloud (Amazon EC2) instances, the instance profile attached to your managed instances must provide permissions for Session Manager to use this feature. For more information about adding Session Manager permissions to an instance profile, see Add Session Manager permissions to an existing IAM role. Topics Fleet Manager 316 AWS Systems Manager User Guide • Viewing details about OS processes using Fleet Manager • Starting an OS process on a managed node using Fleet Manager • Terminating an OS process using Fleet Manager Viewing details about OS processes using Fleet Manager You can use Fleet Manager view details about processes on your managed nodes. To view details about processes with Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Fleet Manager. Select the link of the node whose processes you want to view. 4. Choose Tools, Processes. Starting an OS process on a managed node using Fleet Manager You can use Fleet Manager to start a process on a managed node. To start a process with Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the link of the managed node you want to start a process on. 2. 3. 4. Choose Tools, Processes. 5. 6. Select Start new process. For Process name or full path, enter the name of the process or the full path to the executable. 7. (Optional) For Working directory, enter the directory path where you want the process to run. Fleet Manager 317 AWS Systems Manager User Guide Terminating an OS process using Fleet Manager To terminate an OS process using Fleet Manager 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. Select the link of the managed node you want to start a process on. 2. 3. 4. Choose Tools, Processes. 5. Choose the button next to the process you want to terminate. 6. Choose Actions, Terminate process or Actions, Terminate process tree. Note Terminating a process tree also terminates all processes and applications using that process. Viewing logs on managed nodes You can use Fleet Manager, a tool in AWS Systems Manager, to view log data stored on your managed nodes. For Windows managed nodes, you can view Windows event logs and copy their details from the console. To help you search events, filter Windows event logs by Event level, Event ID, Event source, and Time created. You can also view other log data using the procedure to view the file system. For more information about viewing the file system with Fleet Manager, see Working with OS file systems using Fleet Manager. To view Windows event logs with Fleet Manager 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 managed node whose event logs you want to view. 4. Choose View details. 5. Choose Tools, Windows event logs. 6. Choose the Log name that contains the events you want to view. Fleet Manager 318 AWS Systems Manager User Guide 7. Choose the button next to the Log name you want to view, and then select View events. 8. Choose the button next to the event you want to view, and then select View event details. 9. (Optional) Select Copy as JSON to copy the event details to your clipboard. Managing OS user accounts and groups on managed nodes using Fleet Manager You can use Fleet Manager, a tool in AWS Systems Manager, to manage operating system (OS) user accounts and groups on your managed nodes. For example, you can create and delete users and groups. Additionally, you can view details like group membership, user roles, and status. Important Fleet Manager uses Run Command and Session Manager, tools in AWS Systems Manager, for various user management operations. As a result, a user could grant permissions to an operating system user account that they would otherwise be unable to. This is because AWS Systems Manager Agent (SSM Agent) runs on Amazon Elastic Compute Cloud (Amazon EC2) instances using root permissions (Linux) or SYSTEM permissions (Windows Server). For more information about restricting access to root-level commands through SSM
systems-manager-ug-106
systems-manager-ug.pdf
106
For example, you can create and delete users and groups. Additionally, you can view details like group membership, user roles, and status. Important Fleet Manager uses Run Command and Session Manager, tools in AWS Systems Manager, for various user management operations. As a result, a user could grant permissions to an operating system user account that they would otherwise be unable to. This is because AWS Systems Manager Agent (SSM Agent) runs on Amazon Elastic Compute Cloud (Amazon EC2) instances using root permissions (Linux) or SYSTEM permissions (Windows Server). For more information about restricting access to root-level commands through SSM Agent, see Restricting access to root-level commands through SSM Agent. To restrict access to this feature, we recommend creating AWS Identity and Access Management (IAM) policies for your users that only allow access to the actions you define. For more information about creating IAM policies for Fleet Manager, see Controlling access to Fleet Manager. Topics • Creating an OS user or group using Fleet Manager • Updating user or group membership using Fleet Manager • Deleting an OS user or group using Fleet Manager Creating an OS user or group using Fleet Manager Note Fleet Manager uses Session Manager to set passwords for new users. For Amazon EC2 instances, the instance profile attached to your managed instances must provide permissions for Session Manager to use this feature. For more information about adding Fleet Manager 319 AWS Systems Manager User Guide Session Manager permissions to an instance profile, see Add Session Manager permissions to an existing IAM role. Instead of logging on directly to a server to create a user account or group, you can use the Fleet Manager console to perform the same tasks. To create an OS user account using Fleet Manager 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 managed node you want to create a new user on. 4. Choose View details. 5. Choose Tools, Users and groups. 6. Choose the Users tab, and then choose Create user. 7. 8. 9. Enter a value for the Name of the new user. (Recommended) Select the check box next to Set password. You will be prompted to provide a password for the new user at the end of the procedure. Select Create user. If you selected the check box to create a password for the new user, you will be prompted to enter a value for the password and select Done. If the password you specify doesn't meet the requirements specified by your managed node's local or domain policies, an error is returned. To create an OS group using Fleet Manager 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 managed node you want to create a group in. 4. Choose View details. 5. Choose Tools, Users and groups. 6. Choose the Groups tab, and then choose Create group. 7. Enter a value for the Name of the new group. Fleet Manager 320 AWS Systems Manager User Guide 8. 9. (Optional) Enter a value for the Description of the new group. (Optional) Select users to add to the Group members for the new group. 10. Select Create group. Updating user or group membership using Fleet Manager Instead of logging on directly to a server to update a user account or group, you can use the Fleet Manager console to perform the same tasks. To add an OS user account to a new group using Fleet Manager 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 managed node where the user account exists that you want to update. 4. Choose View details. 5. Choose Tools, Users and groups. 6. Choose the Users tab. 7. Choose the button next to the user you want to update. 8. Choose Actions, Add user to group. 9. Choose the group you want to add the user to under Add to group. 10. Select Add user to group. To edit an OS group's membership using Fleet Manager 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 managed node where the group exists that you want to update. 4. Choose View details. 5. Choose Tools, Users and groups. 6. Choose the Groups tab. Fleet Manager 321 AWS Systems Manager User Guide 7. Choose the button next to the group you want to update. 8. Choose Actions, Modify group. 9. Choose the users you want to add or remove under Group members. 10. Select Modify group. Deleting an OS user or group
systems-manager-ug-107
systems-manager-ug.pdf
107
Manager 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 managed node where the group exists that you want to update. 4. Choose View details. 5. Choose Tools, Users and groups. 6. Choose the Groups tab. Fleet Manager 321 AWS Systems Manager User Guide 7. Choose the button next to the group you want to update. 8. Choose Actions, Modify group. 9. Choose the users you want to add or remove under Group members. 10. Select Modify group. Deleting an OS user or group using Fleet Manager Instead of logging on directly to a server to delete a user account or group, you can use the Fleet Manager console to perform the same tasks. To delete an OS user account using Fleet Manager 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 managed node where the user account exists that you want to delete. 4. Choose View details. 5. Choose Users and groups. 6. Choose the Users tab. 7. Choose the button next to the user you want to delete. 8. Choose Actions, Delete local user. To delete an OS group using Fleet Manager 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 managed node where the group exists that you want to delete. 4. Choose View details. 5. Choose Tools, Users and groups. 6. Choose the Group tab. 7. Choose the button next to the group you want to update. 8. Choose Actions, Delete local group. Fleet Manager 322 AWS Systems Manager User Guide Managing the Windows registry on managed nodes You can use Fleet Manager, a tool in AWS Systems Manager, to manage the registry on your Windows Server managed nodes. From the Fleet Manager console you can create, copy, update, and delete registry entries and values. Important We recommend creating a backup of the registry, or taking a snapshot of the root Amazon Elastic Block Store (Amazon EBS) volume attached to your managed node, before you modify the registry. Serious problems can occur if you modify the registry incorrectly. These problems might require you to reinstall the operating system, or restore the root volume of your node from a snapshot. AWS doesn't guarantee that these problems can be solved. Modify the registry at your own risk. You're responsible for all registry changes, and ensuring you have backups. Create a Windows registry key or entry To create a Windows registry key with Fleet Manager 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 managed node you want to create a registry key on. 4. Choose View details. 5. Choose Tools, Windows registry. 6. Choose the hive you want to create a new registry key in by selecting the Registry name. 7. Choose Create, Create registry key. 8. Choose the button next to the registry entry you want to create a new key in. 9. Choose Create registry key. 10. Enter a value for the Name of the new registry key, and select Submit. Fleet Manager 323 AWS Systems Manager User Guide To create a Windows registry entry with Fleet Manager 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 you want to create a registry entry on. 4. Choose View details. 5. Choose Tools, Windows registry. 6. Choose the hive, and subsequent registry key you want to create a new registry entry in by selecting the Registry name. 7. Choose Create, Create registry entry. 8. Enter a value for the Name of the new registry entry. 9. Choose the Type of value you want to create for the registry entry. For more information about registry value types, see Registry value types. 10. Enter a value for the Value of the new registry entry. Update a Windows registry entry To update a Windows registry entry with Fleet Manager 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 managed node you want to update a registry entry on. 4. Choose View details. 5. Choose Tools, Windows registry. 6. Choose the hive, and subsequent registry key you want to update by selecting the Registry name. 7. Choose the button next to the registry entry you want to update. 8. Choose Actions, Update registry entry. 9. Enter the new value for the Value of the registry entry. 10. Choose Update. Fleet Manager 324 AWS Systems
systems-manager-ug-108
systems-manager-ug.pdf
108
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 managed node you want to update a registry entry on. 4. Choose View details. 5. Choose Tools, Windows registry. 6. Choose the hive, and subsequent registry key you want to update by selecting the Registry name. 7. Choose the button next to the registry entry you want to update. 8. Choose Actions, Update registry entry. 9. Enter the new value for the Value of the registry entry. 10. Choose Update. Fleet Manager 324 AWS Systems Manager User Guide Delete a Windows registry entry or key To delete a Windows registry key with Fleet Manager 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 managed node you want to delete a registry key on. 4. Choose Tools, Windows registry. 5. Choose the hive, and subsequent registry key you want to delete by selecting the Registry name. 6. Choose the button next to the registry key you want to delete. 7. Choose Actions, Delete registry key. To delete a Windows registry entry with Fleet Manager 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 managed node you want to delete a registry entry on. 4. Choose View details. 5. Choose Tools, Windows registry. 6. Choose the hive, and subsequent registry key containing the entry you want to delete by selecting the Registry name. 7. Choose the button next to the registry entry you want to delete. 8. Choose Actions, Delete registry entry. Managing EC2 instances automatically with Default Host Management Configuration The Default Host Management Configuration setting allows AWS Systems Manager to manage your Amazon EC2 instances automatically as managed instances. A managed instance is an EC2 instance that is configured for use with Systems Manager. The benefits of managing your instances with Systems Manager include the following: Fleet Manager 325 AWS Systems Manager User Guide • Connect to your EC2 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 SSM Agent up to date automatically. Fleet Manager, Inventory, Patch Manager, and Session Manager are tools in Systems Manager. Default Host Management Configuration makes it possible to manage EC2 instances without your having to manually create an AWS Identity and Access Management (IAM) instance profile. Instead, Default Host Management Configuration creates and applies a default IAM role to ensure that Systems Manager has permissions to manage all instances in the AWS account and AWS Region where it's activated. 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. Implement least privilege access The procedures in this topic are intended to be performed only by administrators. Therefore, we recommend implementing least privilege access in order to prevent non-administrative users from configuring or modifying the Default Host Management Configuration. To view example policies that restrict access to the Default Host Management Configuration, see Least privilege policy examples for Default Host Management Configuration later in this topic. Important Registration information for instances registered using Default Host Management Configuration is stored locally in the var/lib/amazon/ssm or C:\ProgramData \Amazon directories. Removing these directories or their files will prevent the instance Fleet Manager 326 AWS Systems Manager User Guide from acquiring the necessary credentials to connect to Systems Manager using Default Host Management Configuration. In these cases, you must use an IAM instance profile to provide the required permissions to your instance, or recreate the instance. Topics • Prerequisites • Activating the Default Host Management Configuration setting • Deactivating the Default Host Management Configuration setting • Least privilege policy examples for Default Host Management Configuration Prerequisites In order to use Default Host Management Configuration in the AWS Region and AWS account where you activate the setting, the following requirements must be met. • An instance to be managed must use Instance Metadata Service Version 2 (IMDSv2). 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
systems-manager-ug-109
systems-manager-ug.pdf
109
your instance, or recreate the instance. Topics • Prerequisites • Activating the Default Host Management Configuration setting • Deactivating the Default Host Management Configuration setting • Least privilege policy examples for Default Host Management Configuration Prerequisites In order to use Default Host Management Configuration in the AWS Region and AWS account where you activate the setting, the following requirements must be met. • An instance to be managed must use Instance Metadata Service Version 2 (IMDSv2). 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 • SSM Agent version 3.2.582.0 or later must be installed on the instance to be managed. For information about checking the version of SSM Agent installed on your instance, see Checking the SSM Agent version number. For information about updating SSM Agent, see Automatically updating SSM Agent. • You, as the administrator performing the tasks in this topic, 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 providing these permissions. Replace each example resource placeholder with your own information. { "Version": "2012-10-17", "Statement": [ Fleet Manager 327 AWS Systems Manager { "Effect": "Allow", "Action": [ "ssm:GetServiceSetting", "ssm:ResetServiceSetting", "ssm:UpdateServiceSetting" ], User Guide "Resource": "arn:aws:ssm:region:account-id:servicesetting/ssm/managed- instance/default-ec2-instance-management-role" }, { "Effect": "Allow", "Action": [ "iam:PassRole" ], "Resource": "arn:aws:iam::account-id:role/service-role/ AWSSystemsManagerDefaultEC2InstanceManagementRole", "Condition": { "StringEquals": { "iam:PassedToService": [ "ssm.amazonaws.com" ] } } } ] } • If an IAM instance profile is already attached to an EC2 instance that is to be managed using Systems Manager, you must remove any permissions from it that allow the ssm:UpdateInstanceInformation operation. 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 own IAM instance profile, the instance will not use the Default Host Management Configuration permissions. Activating the Default Host Management Configuration setting You can activate Default Host Management Configuration from the Fleet Manager console, or by using the AWS Command Line Interface or AWS Tools for Windows PowerShell. You must turn on the Default Host Management Configuration one by one in each Region you where you want your Amazon EC2 instances managed by this setting. Fleet Manager 328 AWS Systems Manager User Guide After turning on Default Host Management Configuration, it might take up to 30 minutes for your instances to use the credentials of the role you choose in step 5 in the following procedure. To activate Default Host Management Configuration (console) 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, Configure Default Host Management Configuration. 4. Turn on Enable Default Host Management Configuration. 5. Choose the AWS Identity and Access Management (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. To activate Default Host Management Configuration (command line) 1. Create a JSON file on your local machine containing the following trust relationship policy. { "Version":"2012-10-17", "Statement":[ { "Sid":"", "Effect":"Allow", "Principal":{ "Service":"ssm.amazonaws.com" }, "Action":"sts:AssumeRole" } ] } 2. Open the AWS CLI or Tools for Windows PowerShell and run one of the following commands, depending on the operating system type of your local machine, to create a service role in your account. Replace each example resource placeholder with your own information. Fleet Manager 329 AWS Systems Manager Linux & macOS User Guide aws iam create-role \ --role-name AWSSystemsManagerDefaultEC2InstanceManagementRole \ --path /service-role/ \ --assume-role-policy-document file://trust-policy.json Windows aws iam create-role ^ --role-name AWSSystemsManagerDefaultEC2InstanceManagementRole ^ --path /service-role/ ^ --assume-role-policy-document file://trust-policy.json PowerShell New-IAMRole ` -RoleName "AWSSystemsManagerDefaultEC2InstanceManagementRole" ` -Path "/service-role/" ` -AssumeRolePolicyDocument "file://trust-policy.json" 3. Run the following command to attach the AmazonSSMManagedEC2InstanceDefaultPolicy managed policy to your newly created role. Replace each example resource placeholder with your own information. Linux & macOS aws iam attach-role-policy \ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedEC2InstanceDefaultPolicy \ --role-name AWSSystemsManagerDefaultEC2InstanceManagementRole Windows aws iam attach-role-policy ^ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedEC2InstanceDefaultPolicy ^ --role-name AWSSystemsManagerDefaultEC2InstanceManagementRole Fleet Manager 330 AWS Systems Manager PowerShell User Guide Register-IAMRolePolicy ` -PolicyArn "arn:aws:iam::aws:policy/AmazonSSMManagedEC2InstanceDefaultPolicy" ` -RoleName "AWSSystemsManagerDefaultEC2InstanceManagementRole" 4. Open the AWS CLI or Tools for Windows PowerShell and run the following command. Replace each example resource placeholder with your own information. Linux & macOS aws ssm update-service-setting \ --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role \ --setting-value service-role/AWSSystemsManagerDefaultEC2InstanceManagementRole Windows aws ssm update-service-setting ^ --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role ^ --setting-value service-role/AWSSystemsManagerDefaultEC2InstanceManagementRole PowerShell Update-SSMServiceSetting ` -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role" ` -SettingValue "service-role/AWSSystemsManagerDefaultEC2InstanceManagementRole" There is no output if the
systems-manager-ug-110
systems-manager-ug.pdf
110
& macOS aws iam attach-role-policy \ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedEC2InstanceDefaultPolicy \ --role-name AWSSystemsManagerDefaultEC2InstanceManagementRole Windows aws iam attach-role-policy ^ --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedEC2InstanceDefaultPolicy ^ --role-name AWSSystemsManagerDefaultEC2InstanceManagementRole Fleet Manager 330 AWS Systems Manager PowerShell User Guide Register-IAMRolePolicy ` -PolicyArn "arn:aws:iam::aws:policy/AmazonSSMManagedEC2InstanceDefaultPolicy" ` -RoleName "AWSSystemsManagerDefaultEC2InstanceManagementRole" 4. Open the AWS CLI or Tools for Windows PowerShell and run the following command. Replace each example resource placeholder with your own information. Linux & macOS aws ssm update-service-setting \ --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role \ --setting-value service-role/AWSSystemsManagerDefaultEC2InstanceManagementRole Windows aws ssm update-service-setting ^ --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role ^ --setting-value service-role/AWSSystemsManagerDefaultEC2InstanceManagementRole PowerShell Update-SSMServiceSetting ` -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role" ` -SettingValue "service-role/AWSSystemsManagerDefaultEC2InstanceManagementRole" There is no output if the command succeeds. 5. Run the following command to view the current service settings for Default Host Management Configuration in the current AWS account and AWS Region. Linux & macOS aws ssm get-service-setting \ Fleet Manager 331 AWS Systems Manager User Guide --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role Windows aws ssm get-service-setting ^ --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role PowerShell Get-SSMServiceSetting ` -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role" The command returns information like the following. { "ServiceSetting": { "SettingId": "/ssm/managed-instance/default-ec2-instance-management-role", "SettingValue": "service-role/ AWSSystemsManagerDefaultEC2InstanceManagementRole", "LastModifiedDate": "2022-11-28T08:21:03.576000-08:00", "LastModifiedUser": "System", "ARN": "arn:aws:ssm:us-east-2:-123456789012:servicesetting/ssm/managed- instance/default-ec2-instance-management-role", "Status": "Custom" } } Deactivating the Default Host Management Configuration setting You can deactivate Default Host Management Configuration from the Fleet Manager console, or by using the AWS Command Line Interface or AWS Tools for Windows PowerShell. You must turn off the Default Host Management Configuration setting one by one in each Region where you no longer want your your Amazon EC2 instances managed by this configuration. Deactivating it in one Region doesn't deactivate it in all Regions. Fleet Manager 332 AWS Systems Manager User Guide If you deactivate Default Host Management Configuration, and you have not attached an instance profile to your Amazon EC2 instances that allows access to Systems Manager, they will no longer be managed by Systems Manager. To deactivate Default Host Management Configuration (console) 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, Default Host Management Configuration. 4. Turn off Enable Default Host Management Configuration. 5. Choose Configure to disable Default Host Management Configuration. To deactivate Default Host Management Configuration (command line) • Open the AWS CLI or Tools for Windows PowerShell and run the following command. Replace each example resource placeholder with your own information. Linux & macOS aws ssm reset-service-setting \ --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role Windows aws ssm reset-service-setting ^ --setting-id arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role PowerShell Reset-SSMServiceSetting ` -SettingId "arn:aws:ssm:region:account-id:servicesetting/ssm/managed-instance/ default-ec2-instance-management-role" Fleet Manager 333 AWS Systems Manager User Guide Least privilege policy examples for Default Host Management Configuration The following sample policies demonstrate how to prevent members of your organization from making changes to the Default Host Management Configuration setting in your account. Service control policy for AWS Organizations The following policy demonstrates how to prevent non-administrative members in your AWS Organizations from updating your Default Host Management Configuration setting. Replace each example resource placeholder with your own information. { "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": [ "ssm:UpdateServiceSetting", "ssm:ResetServiceSetting" ], "Resource": "arn:aws:ssm:*:*:servicesetting/ssm/managed-instance/default- ec2-instance-management-role", "Condition": { "StringNotEqualsIgnoreCase": { "aws:PrincipalTag/job-function": [ "administrator" ] } } }, { "Effect": "Deny", "Action": [ "iam:PassRole" ], "Resource": "arn:aws:iam::*:role/service-role/ AWSSystemsManagerDefaultEC2InstanceManagementRole", "Condition": { "StringEquals": { "iam:PassedToService": "ssm.amazonaws.com" }, "StringNotEqualsIgnoreCase": { "aws:PrincipalTag/job-function": [ "administrator" Fleet Manager 334 User Guide AWS Systems Manager ] } } }, { "Effect": "Deny", "Resource": "arn:aws:iam::*:role/service-role/ AWSSystemsManagerDefaultEC2InstanceManagementRole", "Action": [ "iam:AttachRolePolicy", "iam:DeleteRole" ], "Condition": { "StringNotEqualsIgnoreCase": { "aws:PrincipalTag/job-function": [ "administrator" ] } } } ] } Policy for IAM principals The following policy demonstrates how to prevent IAM groups, roles, or users in your AWS Organizations from updating your Default Host Management Configuration setting. Replace each example resource placeholder with your own information. { "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": [ "ssm:UpdateServiceSetting", "ssm:ResetServiceSetting" ], "Resource": "arn:aws:ssm:region:account-id:servicesetting/ssm/managed- instance/default-ec2-instance-management-role" }, { "Effect": "Deny", Fleet Manager 335 AWS Systems Manager User Guide "Action": [ "iam:AttachRolePolicy", "iam:DeleteRole", "iam:PassRole" ], "Resource": "arn:aws:iam::account-id:role/service-role/ AWSSystemsManagerDefaultEC2InstanceManagementRole" } ] } Connecting to a Windows Server managed instance using Remote Desktop You can use Fleet Manager, a tool in AWS Systems Manager, to connect to your Windows Server Amazon Elastic Compute Cloud (Amazon EC2) instances using the Remote Desktop Protocol (RDP). Fleet Manager Remote Desktop, which is powered by Amazon DCV, provides you with secure connectivity to your Windows Server instances directly from the Systems Manager console. You can have up to four simultaneous connections in a single browser window. Currently, you can only use Remote Desktop with instances that are running Windows Server 2012 RTM or higher. Remote Desktop supports only English language inputs. Fleet Manager Remote Desktop is a console-only service and doesn't support command-line connections to your managed instances. To connect to a Windows Server managed instance through a shell, you can use Session Manager, another tool in AWS Systems Manager. For more information, see AWS Systems Manager Session Manager. Note The
systems-manager-ug-111
systems-manager-ug.pdf
111
connectivity to your Windows Server instances directly from the Systems Manager console. You can have up to four simultaneous connections in a single browser window. Currently, you can only use Remote Desktop with instances that are running Windows Server 2012 RTM or higher. Remote Desktop supports only English language inputs. Fleet Manager Remote Desktop is a console-only service and doesn't support command-line connections to your managed instances. To connect to a Windows Server managed instance through a shell, you can use Session Manager, another tool in AWS Systems Manager. For more information, see AWS Systems Manager Session Manager. Note The duration of an RDP connection is not determined by the duration of your AWS Identity and Access Management (IAM) credentials. Instead, the connection persists until the maximum connection duration or idle time limit is met, whichever comes first. For more information, see Remote connection duration and concurrency. For information about configuring AWS Identity and Access Management (IAM) permissions to allow your instances to interact with Systems Manager, see Configure instance permissions for Systems Manager. Topics Fleet Manager 336 User Guide AWS Systems Manager • Setting up your environment • Configuring IAM permissions for Remote Desktop • Authenticating Remote Desktop connections • Remote connection duration and concurrency • Connect to a managed node using Remote Desktop • Viewing information about current and completed connections Setting up your environment Before using Remote Desktop, verify that your environment meets the following requirements: • Managed node configuration Make sure that your Amazon EC2 instances are configured as managed nodes in Systems Manager. • SSM Agent minimum version Verify that nodes are running SSM Agent version 3.0.222.0 or higher. For information about how to check which agent version is running on a node, see Checking the SSM Agent version number. For information about installing or updating SSM Agent, see Working with SSM Agent. • RDP port configuration To accept remote connections, the Remote Desktop Services service on your Windows Server nodes must use default RDP port 3389. This is the default configuration on Amazon Machine Images (AMIs) provided by AWS. You are not explicitly required to open any inbound ports to use Remote Desktop. • PSReadLine module version for keyboard functionality To ensure that your keyboard functions properly in PowerShell, verify that nodes running Windows Server 2022 have PSReadLine module version 2.2.2 or higher installed. If they are running an older version, you can install the required version using the following commands. Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force After the NuGet package provider is installed, run the following command. Install-Module ` Fleet Manager 337 AWS Systems Manager User Guide -Name PSReadLine ` -Repository PSGallery ` -MinimumVersion 2.2.2 -Force • Session Manager configuration Before you can use Remote Desktop, you must complete the prerequisites for Session Manager setup. When you connect to an instance using Remote Desktop, any session preferences defined for your AWS account and AWS Region are applied. For more information, see Setting up Session Manager. Note If you log Session Manager activity using Amazon Simple Storage Service (Amazon S3), then your Remote Desktop connections will generate the following error in bucket_name/Port/stderr. This error is expected behavior and can be safely ignored. Setting up data channel with id SESSION_ID failed: failed to create websocket for datachannel with error: CreateDataChannel failed with no output or error: createDataChannel request failed: unexpected response from the service <BadRequest> <ClientErrorMessage>Session is already terminated</ClientErrorMessage> </BadRequest> Configuring IAM permissions for Remote Desktop In addition to the required IAM permissions for Systems Manager and Session Manager, the user or role you use must be allowed permissions for initiating connections. Permissions for initiating connections To make RDP connections to EC2 instances in the console, the following permissions are required: • ssm-guiconnect:CancelConnection • ssm-guiconnect:GetConnection • ssm-guiconnect:StartConnection Permissions for listing connections Fleet Manager 338 AWS Systems Manager User Guide In order to view lists of connections in the console, the following permission is required: ssm-guiconnect:ListConnections The following are example IAM policies that you can attach to a user or role to allow different types of interaction with Remote Desktop. Replace each example resource placeholder with your own information. Standard policy for connecting to EC2 instances { "Version": "2012-10-17", "Statement": [ { "Sid": "EC2", "Effect": "Allow", "Action": [ "ec2:DescribeInstances", "ec2:GetPasswordData" ], "Resource": "*" }, { "Sid": "SSM", "Effect": "Allow", "Action": [ "ssm:DescribeInstanceProperties", "ssm:GetCommandInvocation", "ssm:GetInventorySchema" ], "Resource": "*" }, { "Sid": "TerminateSession", "Effect": "Allow", "Action": [ "ssm:TerminateSession" ], "Resource": "*", "Condition": { "StringLike": { "ssm:resourceTag/aws:ssmmessages:session-id": [ "${aws:userid}" Fleet Manager 339 User Guide AWS Systems Manager ] } } }, { "Sid": "SSMStartSession", "Effect": "Allow", "Action": [ "ssm:StartSession" ], "Resource": [ "arn:aws:ec2:*:account-id:instance/*", "arn:aws:ssm:*:account-id:managed-instance/*", "arn:aws:ssm:*::document/AWS-StartPortForwardingSession" ], "Condition": { "ForAnyValue:StringEquals": { "aws:CalledVia": "ssm-guiconnect.amazonaws.com" } } }, { "Sid": "GuiConnect", "Effect": "Allow", "Action": [ "ssm-guiconnect:CancelConnection", "ssm-guiconnect:GetConnection", "ssm-guiconnect:StartConnection", "ssm-guiconnect:ListConnections" ], "Resource": "*" } ] } Policy for connecting to EC2 instances with
systems-manager-ug-112
systems-manager-ug.pdf
112
"Action": [ "ec2:DescribeInstances", "ec2:GetPasswordData" ], "Resource": "*" }, { "Sid": "SSM", "Effect": "Allow", "Action": [ "ssm:DescribeInstanceProperties", "ssm:GetCommandInvocation", "ssm:GetInventorySchema" ], "Resource": "*" }, { "Sid": "TerminateSession", "Effect": "Allow", "Action": [ "ssm:TerminateSession" ], "Resource": "*", "Condition": { "StringLike": { "ssm:resourceTag/aws:ssmmessages:session-id": [ "${aws:userid}" Fleet Manager 339 User Guide AWS Systems Manager ] } } }, { "Sid": "SSMStartSession", "Effect": "Allow", "Action": [ "ssm:StartSession" ], "Resource": [ "arn:aws:ec2:*:account-id:instance/*", "arn:aws:ssm:*:account-id:managed-instance/*", "arn:aws:ssm:*::document/AWS-StartPortForwardingSession" ], "Condition": { "ForAnyValue:StringEquals": { "aws:CalledVia": "ssm-guiconnect.amazonaws.com" } } }, { "Sid": "GuiConnect", "Effect": "Allow", "Action": [ "ssm-guiconnect:CancelConnection", "ssm-guiconnect:GetConnection", "ssm-guiconnect:StartConnection", "ssm-guiconnect:ListConnections" ], "Resource": "*" } ] } Policy for connecting to EC2 instances with specific tags Note In the following IAM policy, the SSMStartSession section requires an Amazon Resource Name (ARN) for the ssm:StartSession action. As shown, the ARN you specify does not require an AWS account ID. If you specify an account ID, Fleet Manager returns an AccessDeniedException. Fleet Manager 340 AWS Systems Manager User Guide The AccessTaggedInstances section, which is located lower in the example policy, also requires ARNs for ssm:StartSession. For those ARNs, you do specify AWS account IDs. { "Version": "2012-10-17", "Statement": [ { "Sid": "EC2", "Effect": "Allow", "Action": [ "ec2:DescribeInstances", "ec2:GetPasswordData" ], "Resource": "*" }, { "Sid": "SSM", "Effect": "Allow", "Action": [ "ssm:DescribeInstanceProperties", "ssm:GetCommandInvocation", "ssm:GetInventorySchema" ], "Resource": "*" }, { "Sid": "SSMStartSession", "Effect": "Allow", "Action": [ "ssm:StartSession" ], "Resource": [ "arn:aws:ssm:*::document/AWS-StartPortForwardingSession" ], "Condition": { "ForAnyValue:StringEquals": { "aws:CalledVia": "ssm-guiconnect.amazonaws.com" } } }, { "Sid": "AccessTaggedInstances", Fleet Manager 341 AWS Systems Manager User Guide "Effect": "Allow", "Action": [ "ssm:StartSession" ], "Resource": [ "arn:aws:ec2:*:account-id:instance/*", "arn:aws:ssm:*:account-id:managed-instance/*" ], "Condition": { "StringLike": { "ssm:resourceTag/tag key": [ "tag value" ] } } }, { "Sid": "GuiConnect", "Effect": "Allow", "Action": [ "ssm-guiconnect:CancelConnection", "ssm-guiconnect:GetConnection", "ssm-guiconnect:StartConnection", "ssm-guiconnect:ListConnections" ], "Resource": "*" } ] } Policy for AWS IAM Identity Center users to connect to EC2 instances { "Version": "2012-10-17", "Statement": [ { "Sid": "SSO", "Effect": "Allow", "Action": [ "sso:ListDirectoryAssociations*", "identitystore:DescribeUser" ], "Resource": "*" Fleet Manager 342 User Guide AWS Systems Manager }, { "Sid": "EC2", "Effect": "Allow", "Action": [ "ec2:DescribeInstances", "ec2:GetPasswordData" ], "Resource": "*" }, { "Sid": "SSM", "Effect": "Allow", "Action": [ "ssm:DescribeInstanceInformation", "ssm:DescribeInstanceProperties", "ssm:GetCommandInvocation", "ssm:GetInventorySchema" ], "Resource": "*" }, { "Sid": "TerminateSession", "Effect": "Allow", "Action": [ "ssm:TerminateSession" ], "Resource": "*", "Condition": { "StringLike": { "ssm:resourceTag/aws:ssmmessages:session-id": [ "${aws:userName}" ] } } }, { "Sid": "SSMStartSession", "Effect": "Allow", "Action": [ "ssm:StartSession" ], "Resource": [ "arn:aws:ec2:*:*:instance/*", Fleet Manager 343 AWS Systems Manager User Guide "arn:aws:ssm:*:*:managed-instance/*", "arn:aws:ssm:*:*:document/AWS-StartPortForwardingSession" ], "Condition": { "ForAnyValue:StringEquals": { "aws:CalledVia": "ssm-guiconnect.amazonaws.com" } } }, { "Sid": "SSMSendCommand", "Effect": "Allow", "Action": [ "ssm:SendCommand" ], "Resource": [ "arn:aws:ec2:*:*:instance/*", "arn:aws:ssm:*:*:managed-instance/*", "arn:aws:ssm:*:*:document/AWSSSO-CreateSSOUser" ] }, { "Sid": "GuiConnect", "Effect": "Allow", "Action": [ "ssm-guiconnect:CancelConnection", "ssm-guiconnect:GetConnection", "ssm-guiconnect:StartConnection", "ssm-guiconnect:ListConnections" ], "Resource": "*" } ] } Authenticating Remote Desktop connections When establishing a remote connection, you can authenticate using Windows credentials or the Amazon EC2 key pair (.pem file) that is associated with the instance. For information about using key pairs, see Amazon EC2 key pairs and Windows instances in the Amazon EC2 User Guide. Alternatively, if you're authenticated to the AWS Management Console using AWS IAM Identity Center, you can connect to your instances without providing additional credentials. For an example Fleet Manager 344 AWS Systems Manager User Guide of a policy to allow remote connection authentication using IAM Identity Center, see Configuring IAM permissions for Remote Desktop. Before you begin Note the following conditions for using IAM Identity Center authentication before you begin connecting using Remote Desktop. • Remote Desktop supports IAM Identity Center authentication for nodes in the same AWS Region where you enabled IAM Identity Center. • Remote Desktop supports IAM Identity Center user names of up to 16 characters. • Remote Desktop supports IAM Identity Center user names consisting of alphanumeric characters and the following special characters: . - _ Important Connections won't succeed for IAM Identity Center user names that contain the following characters: + = , IAM Identity Center supports these characters in user names, but Fleet Manager RDP connections do not. In addition, if an IAM Identity Center user name contains one or more @ symbols, Fleet Manager disregards the first @ symbol and all characters that follow it, whether or not the @ introduces the domain portion of an email address. For instance, for the IAM Identity Center user name diego_ramirez@example.com, the @example.com portion is ignored and the user name for Fleet Manager becomes diego_ramirez. For diego_r@mirez@example.com, Fleet Manager disregards @mirez@example.com, and the username for Fleet Manager becomes diego_r. • When a connection is authenticated using IAM Identity Center, Remote Desktop creates a local Windows user in the instance’s Local Administrators group. This user persists after the remote connection has ended. • Remote Desktop does not allow IAM Identity Center authentication for nodes that are Microsoft Active Directory domain controllers. • Although Remote Desktop allows you to use IAM Identity Center authentication for nodes joined to an Active Directory domain,
systems-manager-ug-113
systems-manager-ug.pdf
113
diego_ramirez@example.com, the @example.com portion is ignored and the user name for Fleet Manager becomes diego_ramirez. For diego_r@mirez@example.com, Fleet Manager disregards @mirez@example.com, and the username for Fleet Manager becomes diego_r. • When a connection is authenticated using IAM Identity Center, Remote Desktop creates a local Windows user in the instance’s Local Administrators group. This user persists after the remote connection has ended. • Remote Desktop does not allow IAM Identity Center authentication for nodes that are Microsoft Active Directory domain controllers. • Although Remote Desktop allows you to use IAM Identity Center authentication for nodes joined to an Active Directory domain, we do not recommend doing so. This authentication method grants administrative permissions to users which might override more restrictive permissions granted by the domain. Fleet Manager 345 AWS Systems Manager User Guide Supported Regions for IAM Identity Center authentication Remote Desktop connections using IAM Identity Center authentication are supported in the following AWS Regions: • US East (Ohio) (us-east-2) • US East (N. Virginia) (us-east-1) • US West (N. California) (us-west-1) • US West (Oregon) (us-west-2) • Africa (Cape Town) (af-south-1) • Asia Pacific (Hong Kong) (ap-east-1) • Asia Pacific (Mumbai) (ap-south-1) • Asia Pacific (Tokyo) (ap-northeast-1) • Asia Pacific (Seoul) (ap-northeast-2) • Asia Pacific (Osaka) (ap-northeast-3) • Asia Pacific (Singapore) (ap-southeast-1) • Asia Pacific (Sydney) (ap-southeast-2) • Asia Pacific (Jakarta) (ap-southeast-3) • Canada (Central) (ca-central-1) • Europe (Frankfurt) (eu-central-1) • Europe (Stockholm) (eu-north-1) • Europe (Ireland) (eu-west-1) • Europe (London) (eu-west-2) • Europe (Paris) (eu-west-3) • Israel (Tel Aviv) (il-central-1) • South America (São Paulo) (sa-east-1) • Europe (Milan) (eu-south-1) • Middle East (Bahrain) (me-south-1) • AWS GovCloud (US-East) (us-gov-east-1) • AWS GovCloud (US-West) (us-gov-west-1) Fleet Manager 346 AWS Systems Manager User Guide Remote connection duration and concurrency The following conditions apply to active Remote Desktop connections: • Connection duration By default, a Remote Desktop connection is disconnected after 60 minutes. To prevent a connection from being disconnected, you can choose Renew session before being disconnected to reset the duration timer. • Connection timeout A Remote Desktop connection disconnects after it has been idle for more than 10 minutes. • Connection persistence After you connect to a Windows Server using Remote Desktop, the connection persists until the maximum connection duration (60 minutes) or idle timeout limit (10 minutes) is met. Connection duration is not determined by the duration of your AWS Identity and Access Management (IAM) credentials. The connection persists after IAM credentials expire if the connection duration limits are not met. When using Remote Desktop, you should terminate your connection after your IAM credentials expire by leaving the browser page. • Concurrent connections By default, you can have a maximum of 5 active Remote Desktop connections at one time for the same AWS account and AWS Region. To request a service quota increase of up to 25 concurrent connections, see Requesting a quota increase in the Service Quotas User Guide. Note The standard license for Windows Server allows for two concurrent RDP connections. To support more connections, you must purchase additional Client Access Licenses (CALs) from Microsoft or Microsoft Remote Desktop Services licenses from AWS. For more information on supplemental licensing, see the following topics: • Client Access Licenses and Management Licenses on the Microsoft website • Use License Manager user-based subscriptions for supported software products in the License Manager User Guide Fleet Manager 347 AWS Systems Manager User Guide Connect to a managed node using Remote Desktop Browser copy/paste support for text Using the Google Chrome and Microsoft Edge browsers, you can copy and paste text from a managed node to your local machine, and from your local machine to a managed node that you are connected to. Using the Mozilla Firefox browser, you can copy and paste text from a managed node to your local machine only. Copying from your local machine to the managed node is not supported. To connect to a managed node using Fleet Manager Remote Desktop 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 node that you want to connect to. You can select either the check box or the node name. 4. On the Node actions menu, choose Connect with Remote Desktop. 5. Choose your preferred Authentication type. If you choose User credentials, enter the user name and password for a Windows user account on the node that you're connecting to. If you choose Key pair, you can provide authentication using one of the following methods: a. Choose Browse local machine if you want to select the PEM key associated with your instance from your local file system. - or - b. Choose Paste key pair content if you want to copy the contents of the PEM file and paste 6. 7. them in to the provided field.
systems-manager-ug-114
systems-manager-ug.pdf
114
Connect with Remote Desktop. 5. Choose your preferred Authentication type. If you choose User credentials, enter the user name and password for a Windows user account on the node that you're connecting to. If you choose Key pair, you can provide authentication using one of the following methods: a. Choose Browse local machine if you want to select the PEM key associated with your instance from your local file system. - or - b. Choose Paste key pair content if you want to copy the contents of the PEM file and paste 6. 7. them in to the provided field. Select Connect. To choose your preferred display resolution, in the Actions menu, choose Resolutions, and then select from the following: • Adapt Automatically • 1920 x 1080 • 1400 x 900 • 1366 x 768 Fleet Manager 348 AWS Systems Manager • 800 x 600 User Guide The Adapt Automatically option sets the resolution based on your detected screen size. Viewing information about current and completed connections You can use the Fleet Manager section of the Systems Manager console to view information about RDP connections that have been made in your account. Using a set of filters, you can limit the list of connections displayed to a time range, a specific instance, the user who made the connections, and connections of a specific status. The console also provides tabs that show information about all currently active connections, and all past connections. To view information about current and completed connections 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, Connect with Remote Desktop. 4. Choose one of the following tabs: • Active connections • Connection history 5. To further narrow the list of connection results displayed, specify one or more filters in the search ( box. You can also enter a free-text search term. ) Managing Amazon EBS volumes on managed instances Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for use with Amazon Elastic Compute Cloud (EC2) instances. EBS volumes behave like raw, unformatted block devices. You can mount these volumes as devices on your instances. You can use Fleet Manager, a tool in AWS Systems Manager, to manage Amazon EBS volumes on your managed instances. For example, you can initialize an EBS volume, format a partition, and mount the volume to make it available for use. Fleet Manager 349 AWS Systems Manager Note User Guide Fleet Manager currently supports Amazon EBS volume management for Windows Server instances only. View EBS volume details To view details for an EBS volume with Fleet Manager 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 managed instance for which you want to view EBS volume details. 4. Choose View details. 5. Choose Tools, EBS volumes. 6. To view details for an EBS volume, choose its ID in the Volume ID column. Initialize and format an EBS volume To initialize and format an EBS volume with Fleet Manager 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 managed instance for which you want to initialize, format, and mount an EBS volume. You can only initialize an EBS volume if its disk is empty. 4. Choose View details. 5. In the Tools menu, choose EBS volumes. 6. Choose the button next to the EBS volume you want to initialize and format. 7. Choose Initialize and format. 8. 9. In Partition style, choose the partition style you want to use for the EBS volume. (Optional) Choose a Drive letter for the partition. Fleet Manager 350 AWS Systems Manager User Guide 10. (Optional) Enter a Partition name to identify the partition. 11. Choose the File system to use to organize files and data stored in the partition. 12. Choose Confirm to make the EBS volume available for use. You can't change the partition configuration from the AWS Management Console after confirming, however, you can use SSH or RDP to log into the instance to change the partition configuration. Accessing the Red Hat Knowledge base portal You can use Fleet Manager, a tool in AWS Systems Manager, to access the Knowledge base portal if you are a Red Hat customer. You are considered a Red Hat customer if you run Red Hat Enterprise Linux (RHEL) instances or use RHEL services on AWS. The Knowledge base portal includes binaries, and knowledge-share and discussion forums for community support that are available only to Red Hat licensed customers. In addition to the required AWS Identity and Access Management (IAM) permissions for Systems Manager and Fleet Manager, the user or role you use to
systems-manager-ug-115
systems-manager-ug.pdf
115
the Red Hat Knowledge base portal You can use Fleet Manager, a tool in AWS Systems Manager, to access the Knowledge base portal if you are a Red Hat customer. You are considered a Red Hat customer if you run Red Hat Enterprise Linux (RHEL) instances or use RHEL services on AWS. The Knowledge base portal includes binaries, and knowledge-share and discussion forums for community support that are available only to Red Hat licensed customers. In addition to the required AWS Identity and Access Management (IAM) permissions for Systems Manager and Fleet Manager, the user or role you use to access the console must allow the rhelkb:GetRhelURL action to access the Knowledge base portal. To access the Red Hat Knowledgebase Portal 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 RHEL instance you want to use to connect to the Red Hat Knowledgebase Portal. 4. Choose Account management, Access Red Hat Knowledgebase to open the Red Hat Knowledge base page. If you use RHEL on AWS to run fully supported RHEL workloads, you can also access the Red Hat Knowledge base through Red Hat's website by using your AWS credentials. Troubleshooting managed node availability For several AWS Systems Manager tools like Run Command, Distributor, and Session Manager, you can choose to manually select the managed nodes on which you want to run an operation. In cases like these, after you specify that you want to choose nodes manually, the system displays a list of managed nodes where you can run the operation. Fleet Manager 351 AWS Systems Manager User Guide This topic provides information to help you diagnose why a managed node that you have confirmed is running isn't included in your lists of managed nodes in Systems Manager. In order for a node to be managed by Systems Manager and available in lists of managed nodes, it must meet three requirements: • SSM Agent must be installed and running on the node with a supported operating system. Note Some AWS managed Amazon Machine Images (AMIs) are configured to launch instances with SSM Agent preinstalled. (You can also configure a custom AMI to preinstall SSM Agent.) For more information, see Find AMIs with the SSM Agent preinstalled. • For Amazon Elastic Compute Cloud (Amazon EC2) instances, you must attach an AWS Identity and Access Management (IAM) instance profile to the instance. The instance profile enables the instance to communicate with the Systems Manager service. If you don't assign an instance profile to the instance, you register it using a hybrid activation, which is not a common scenario. • SSM Agent must be able to connect to a Systems Manager endpoint in order to register itself with the service. Thereafter, the managed node must be available to the service, which is confirmed by the service sending a signal every five minutes to check the instance's health. • After the status of a managed node has been Connection Lost for at least 30 days, the node might no longer be listed in the Fleet Manager console. To restore it to the list, the issue that caused the lost connection must be resolved. After you verify that a managed node is running, you can use the following command to check whether SSM Agent successfully registered with the Systems Manager service. This command doesn't return results until a successful registration has taken place. Linux & macOS aws ssm describe-instance-associations-status \ --instance-id instance-id Windows aws ssm describe-instance-associations-status ^ --instance-id instance-id Fleet Manager 352 AWS Systems Manager PowerShell Get-SSMInstanceAssociationsStatus ` -InstanceId instance-id User Guide If registration was successful and the managed node is now available for Systems Manager operations, the command returns results similar to the following. { "InstanceAssociationStatusInfos": [ { "AssociationId": "fa262de1-6150-4a90-8f53-d7eb5EXAMPLE", "Name": "AWS-GatherSoftwareInventory", "DocumentVersion": "1", "AssociationVersion": "1", "InstanceId": "i-02573cafcfEXAMPLE", "Status": "Pending", "DetailedStatus": "Associated" }, { "AssociationId": "f9ec7a0f-6104-4273-8975-82e34EXAMPLE", "Name": "AWS-RunPatchBaseline", "DocumentVersion": "1", "AssociationVersion": "1", "InstanceId": "i-02573cafcfEXAMPLE", "Status": "Queued", "AssociationName": "SystemAssociationForScanningPatches" } ] } If registration hasn't completed yet or was unsuccessful, the command returns results similar to the following: { "InstanceAssociationStatusInfos": [] } If the command doesn't return results after 5 minutes or so, use the following information to help you troubleshoot problems with your managed nodes. Fleet Manager 353 AWS Systems Manager Topics User Guide • Solution 1: Verify that SSM Agent is installed and running on the managed node • Solution 2: Verify that an IAM instance profile has been specified for the instance (EC2 instances only) • Solution 3: Verify service endpoint connectivity • Solution 4: Verify target operating system support • Solution 5: Verify you're working in the same AWS Region as the Amazon EC2 instance • Solution 6: Verify the proxy configuration you applied to SSM Agent on your managed node • Solution 7: Install a TLS certificate
systems-manager-ug-116
systems-manager-ug.pdf
116
with your managed nodes. Fleet Manager 353 AWS Systems Manager Topics User Guide • Solution 1: Verify that SSM Agent is installed and running on the managed node • Solution 2: Verify that an IAM instance profile has been specified for the instance (EC2 instances only) • Solution 3: Verify service endpoint connectivity • Solution 4: Verify target operating system support • Solution 5: Verify you're working in the same AWS Region as the Amazon EC2 instance • Solution 6: Verify the proxy configuration you applied to SSM Agent on your managed node • Solution 7: Install a TLS certificate on managed instances • Troubleshooting managed node availability using ssm-cli Solution 1: Verify that SSM Agent is installed and running on the managed node Make sure the latest version of SSM Agent is installed and running on the managed node. To determine whether SSM Agent is installed and running on a managed node, see Checking SSM Agent status and starting the agent. To install or reinstall SSM Agent on a managed node, see the following topics: • Manually installing and uninstalling SSM Agent on EC2 instances for Linux • How to install the SSM Agent on hybrid Linux nodes • Manually installing and uninstalling SSM Agent on EC2 instances for Windows Server • How to install the SSM Agent on hybrid Windows nodes Solution 2: Verify that an IAM instance profile has been specified for the instance (EC2 instances only) For Amazon Elastic Compute Cloud (Amazon EC2) instances, verify that the instance is configured with an AWS Identity and Access Management (IAM) instance profile that allows the instance to communicate with the Systems Manager API. Also verify that your user has an IAM trust policy that allows your user to communicate with the Systems Manager API. Fleet Manager 354 AWS Systems Manager Note User Guide On-premises servers, edge devices, and virtual machines (VMs) use an IAM service role instead of an instance profile. For more information, see Create the IAM service role required for Systems Manager in hybrid and multicloud environments. To determine whether an instance profile with the necessary permissions is attached to an EC2 instance 1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 2. In the navigation pane, choose Instances. 3. Choose the instance to check for an instance profile. 4. On the Description tab in the bottom pane, locate IAM role and choose the name of the role. 5. On the role Summary page for the instance profile, on the Permissions tab, ensure that AmazonSSMManagedInstanceCore is listed under Permissions policies. If a custom policy is used instead, ensure that it provides the same permissions as AmazonSSMManagedInstanceCore. Open AmazonSSMManagedInstanceCore in the console For information about other policies that can be attached to an instance profile for Systems Manager, see Configure instance permissions required for Systems Manager. Solution 3: Verify service endpoint connectivity Verify that the instance has connectivity to the Systems Manager service endpoints. This connectivity is provided by creating and configuring VPC endpoints for Systems Manager, or by allowing HTTPS (port 443) outbound traffic to the service endpoints. For Amazon EC2 instances, the Systems Manager service endpoint for the AWS Region is used to register the instance if your virtual private cloud (VPC) configuration allows outbound traffic. However, if the VPC configuration the instance was launched in does not allow outbound traffic and you can't change this configuration to allow connectivity to the public service endpoints, you must configure interface endpoints for your VPC instead. Fleet Manager 355 AWS Systems Manager User Guide For more information, see Improve the security of EC2 instances by using VPC endpoints for Systems Manager. Solution 4: Verify target operating system support Verify that the operation you have chosen can be run on the type of managed node you expect to see listed. Some Systems Manager operations can target only Windows instances or only Linux instances. For example, the Systems Manager (SSM) documents AWS- InstallPowerShellModule and AWS-ConfigureCloudWatch can be run only on Windows instances. In the Run a command page, if you choose either of these documents and select Choose instances manually, only your Windows instances are listed and available for selection. Solution 5: Verify you're working in the same AWS Region as the Amazon EC2 instance Amazon EC2 instances are created and available in specific AWS Regions, such as the US East (Ohio) Region (us-east-2) or Europe (Ireland) Region (eu-west-1). Ensure that you're working in the same AWS Region as the Amazon EC2 instance that you want to work with. For more information, see Choosing a Region in Getting Started with the AWS Management Console. Solution 6: Verify the proxy configuration you applied to SSM Agent on your managed node Verify that the proxy configuration you applied to SSM Agent on your managed node is correct. If the proxy configuration is
systems-manager-ug-117
systems-manager-ug.pdf
117
as the Amazon EC2 instance Amazon EC2 instances are created and available in specific AWS Regions, such as the US East (Ohio) Region (us-east-2) or Europe (Ireland) Region (eu-west-1). Ensure that you're working in the same AWS Region as the Amazon EC2 instance that you want to work with. For more information, see Choosing a Region in Getting Started with the AWS Management Console. Solution 6: Verify the proxy configuration you applied to SSM Agent on your managed node Verify that the proxy configuration you applied to SSM Agent on your managed node is correct. If the proxy configuration is incorrect, the node can't connect to the required service endpoints, or Systems Manager might identify the operating system of the managed node incorrectly. For more information, see Configuring SSM Agent to use a proxy on Linux nodes and Configure SSM Agent to use a proxy for Windows Server instances. Solution 7: Install a TLS certificate on managed instances A Transport Layer Security (TLS) certificate must be installed on each managed instance you use with AWS Systems Manager. AWS services use these certificates to encrypt calls to other AWS services. A TLS certificate is already installed by default on each Amazon EC2 instance created from any Amazon Machine Image (AMI). Most modern operating systems include the required TLS certificate from Amazon Trust Services CAs in their trust store. To verify whether the required certificate is installed on your instance run the following command based on the operating system of your instance. Be sure to replace the region portion of the URL with the AWS Region where your managed instance is located. Fleet Manager 356 AWS Systems Manager Linux & macOS curl -L https://ssm.region.amazonaws.com Windows Invoke-WebRequest -Uri https://ssm.region.amazonaws.com User Guide The command should return an UnknownOperationException error. If you receive an SSL/TLS error message instead then the required certificate might not be installed. If you find the required Amazon Trust Services CA certificates aren't installed on your base operating systems, on instances created from AMIs that aren't supplied by Amazon, or on your own on-premises servers and VMs, you must install and allow a certificate from Amazon Trust Services, or use AWS Certificate Manager (ACM) to create and manage certificates for a supported integrated service. Each of your managed instances must have one of the following Transport Layer Security (TLS) certificates installed. • Amazon Root CA 1 • Starfield Services Root Certificate Authority - G2 • Starfield Class 2 Certificate Authority For information about using ACM, see the AWS Certificate Manager User Guide. If certificates in your computing environment are managed by a Group Policy Object (GPO), then you might need to configure Group Policy to include one of these certificates. For more information about the Amazon Root and Starfield certificates, see the blog post How to Prepare for AWS’s Move to Its Own Certificate Authority. Troubleshooting managed node availability using ssm-cli The ssm-cli is a standalone command line tool included in the SSM Agent installation. When you install SSM Agent 3.1.501.0 or later on a machine, you can run ssm-cli commands on that machine. The output of those commands helps you determine whether the machine meets the minimum requirements for an Amazon EC2 instance or non-EC2 machine to be managed by AWS Fleet Manager 357 AWS Systems Manager User Guide Systems Manager, and therefore added to lists of managed nodes in Systems Manager. (SSM Agent version 3.1.501.0 was released in November, 2021.) Minimum requirements For an Amazon EC2 instance or non-EC2 machine to be managed by AWS Systems Manager, and available in lists of managed nodes, it must meet three primary requirements: • SSM Agent must be installed and running on a machine with a supported operating system. Some AWS managed Amazon Machine Images (AMIs) for EC2 are configured to launch instances with SSM Agent preinstalled. (You can also configure a custom AMI to preinstall SSM Agent.) For more information, see Find AMIs with the SSM Agent preinstalled. • An AWS Identity and Access Management (IAM) instance profile (for EC2 instances) or IAM service role (for non-EC2 machines) that supplies the required permissions to communicate with the Systems Manager service must be attached to the machine. • SSM Agent must be able to connect to a Systems Manager endpoint to register itself with the service. Thereafter, the managed node must be available to the service, which is confirmed by the service sending a signal every five minutes to check the managed node's health. Preconfigured commands in ssm-cli Preconfigured commands are included that gather the required information to help you diagnose why a machine that you have confirmed is running isn't included in your lists of managed nodes in Systems Manager. These commands are run when you specify the get-diagnostics option. On the machine, run the following command to use ssm-cli to
systems-manager-ug-118
systems-manager-ug.pdf
118
able to connect to a Systems Manager endpoint to register itself with the service. Thereafter, the managed node must be available to the service, which is confirmed by the service sending a signal every five minutes to check the managed node's health. Preconfigured commands in ssm-cli Preconfigured commands are included that gather the required information to help you diagnose why a machine that you have confirmed is running isn't included in your lists of managed nodes in Systems Manager. These commands are run when you specify the get-diagnostics option. On the machine, run the following command to use ssm-cli to help you troubleshoot managed node availability. Linux & macOS ssm-cli get-diagnostics --output table Windows On Windows Server machines, you must navigate to the C:\Program Files\Amazon\SSM directory before running the command. ssm-cli.exe get-diagnostics --output table Fleet Manager 358 AWS Systems Manager PowerShell User Guide On Windows Server machines, you must navigate to the C:\Program Files\Amazon\SSM directory before running the command. .\ssm-cli.exe get-diagnostics --output table The command returns output as a table similar to the following. Note Connectivity checks to the ssmmessages, s3, kms, logs, and monitoring endpoints are for additional optional features such as Session Manager that can log to Amazon Simple Storage Service (Amazon S3) or Amazon CloudWatch Logs, and use AWS Key Management Service (AWS KMS) encryption. Linux & macOS [root@instance]# ssm-cli get-diagnostics --output table ########################################################################################################################### # Check # Status # Note # ########################################################################################################################### # EC2 IMDS # Success # IMDS is accessible and has instance id i-0123456789abcdefa in Region # # # # us-east-2 # ########################################################################################################################### # Hybrid instance registration # Skipped # Instance does not have hybrid registration # ########################################################################################################################### # Connectivity to ssm endpoint # Success # ssm.us-east-2.amazonaws.com is reachable # ########################################################################################################################### # Connectivity to ec2messages endpoint # Success # ec2messages.us- east-2.amazonaws.com is reachable # ########################################################################################################################### # Connectivity to ssmmessages endpoint # Success # ssmmessages.us- east-2.amazonaws.com is reachable # ########################################################################################################################### Fleet Manager 359 AWS Systems Manager User Guide # Connectivity to s3 endpoint # Success # s3.us-east-2.amazonaws.com is reachable # ########################################################################################################################### # Connectivity to kms endpoint # Success # kms.us-east-2.amazonaws.com is reachable # ########################################################################################################################### # Connectivity to logs endpoint # Success # logs.us-east-2.amazonaws.com is reachable # ########################################################################################################################### # Connectivity to monitoring endpoint # Success # monitoring.us- east-2.amazonaws.com is reachable # ########################################################################################################################### # AWS Credentials # Success # Credentials are for # # # # arn:aws:sts::123456789012:assumed-role/Fullaccess/i-0123456789abcdefa # # # # and will expire at 2021-08-17 18:47:49 +0000 UTC # ########################################################################################################################### # Agent service # Success # Agent service is running and is running as expected user # ########################################################################################################################### # Proxy configuration # Skipped # No proxy configuration detected # ########################################################################################################################### # SSM Agent version # Success # SSM Agent version is 3.0.1209.0, latest available agent version is # # # # 3.1.192.0 # ########################################################################################################################### Windows Server and PowerShell PS C:\Program Files\Amazon\SSM> .\ssm-cli.exe get-diagnostics --output table ######################################################################################################################### # Check # Status # Note # ######################################################################################################################### # EC2 IMDS # Success # IMDS is accessible and has instance id i-0123456789EXAMPLE in # # # # Region us-east-2 # ######################################################################################################################### Fleet Manager 360 AWS Systems Manager User Guide # Hybrid instance registration # Skipped # Instance does not have hybrid registration # ######################################################################################################################### # Connectivity to ssm endpoint # Success # ssm.us-east-2.amazonaws.com is reachable # ######################################################################################################################### # Connectivity to ec2messages endpoint # Success # ec2messages.us- east-2.amazonaws.com is reachable # ######################################################################################################################### # Connectivity to ssmmessages endpoint # Success # ssmmessages.us- east-2.amazonaws.com is reachable # ######################################################################################################################### # Connectivity to s3 endpoint # Success # s3.us-east-2.amazonaws.com is reachable # ######################################################################################################################### # Connectivity to kms endpoint # Success # kms.us-east-2.amazonaws.com is reachable # ######################################################################################################################### # Connectivity to logs endpoint # Success # logs.us-east-2.amazonaws.com is reachable # ######################################################################################################################### # Connectivity to monitoring endpoint # Success # monitoring.us- east-2.amazonaws.com is reachable # ######################################################################################################################### # AWS Credentials # Success # Credentials are for # # # # arn:aws:sts::123456789012:assumed-role/SSM-Role/i-123abc45EXAMPLE # # # # and will expire at 2021-09-02 13:24:42 +0000 UTC # ######################################################################################################################### # Agent service # Success # Agent service is running and is running as expected user # ######################################################################################################################### # Proxy configuration # Skipped # No proxy configuration detected # ######################################################################################################################### # Windows sysprep image state # Success # Windows image state value is at desired value IMAGE_STATE_COMPLETE # ######################################################################################################################### # SSM Agent version # Success # SSM Agent version is 3.2.815.0, latest agent version in us-east-2 # # # # is 3.2.985.0 # Fleet Manager 361 AWS Systems Manager User Guide ######################################################################################################################### The following table provides additional details for each of the checks performed by ssm-cli. ssm-cli diagnostic checks Check Details Amazon EC2 instance metadata service Hybrid instance registration Connectivity to ssm endpoint Connectivity to ec2messages endpoint Indicates whether the managed node is able to reach the metadata service. A failed test indicates a connectivity issue to http://16 which can be caused by 9.254.169.254 local route, proxy, or operating system (OS) firewall and proxy configurations.
systems-manager-ug-119
systems-manager-ug.pdf
119
# SSM Agent version is 3.2.815.0, latest agent version in us-east-2 # # # # is 3.2.985.0 # Fleet Manager 361 AWS Systems Manager User Guide ######################################################################################################################### The following table provides additional details for each of the checks performed by ssm-cli. ssm-cli diagnostic checks Check Details Amazon EC2 instance metadata service Hybrid instance registration Connectivity to ssm endpoint Connectivity to ec2messages endpoint Indicates whether the managed node is able to reach the metadata service. A failed test indicates a connectivity issue to http://16 which can be caused by 9.254.169.254 local route, proxy, or operating system (OS) firewall and proxy configurations. Indicates whether SSM Agent is registered using a hybrid activation. Indicates whether the node is able to reach the service endpoints for Systems Manager on TCP port 443. A failed test indicates connectivity issues to https://s sm. region.amazonaws.com depending on the AWS Region where the node is located. Connectivity issues can be caused by the VPC configuration including security groups, network access control lists, route tables, or OS firewalls and proxies. Indicates whether the node is able to reach the service endpoints for Systems Manager on TCP port 443. A failed test indicates connectiv ity issues to https://ec2message s. region.amazonaws.com depending on the AWS Region where the node is located. Connectivity issues can be caused by the VPC configuration including security groups, Fleet Manager 362 AWS Systems Manager Check Connectivity to ssmmessages endpoint Connectivity to s3 endpoint Connectivity to kms endpoint User Guide Details network access control lists, route tables, or OS firewalls and proxies. Indicates whether the node is able to reach the service endpoints for Systems Manager on TCP port 443. A failed test indicates connectiv ity issues to https://ssmmessage s. region.amazonaws.com depending on the AWS Region where the node is located. Connectivity issues can be caused by the VPC configuration including security groups, network access control lists, route tables, or OS firewalls and proxies. Indicates whether the node is able to reach the service endpoint for Amazon Simple Storage Service on TCP port 443. A failed test indicates connectivity issues to https://s 3. region.amazonaws.com depending on the AWS Region where the node is located. Connectivity to this endpoint is not required for a node to appear in your managed nodes list. Indicates whether the node is able to reach the service endpoint for AWS Key Managemen t Service on TCP port 443. A failed test indicates connectivity issues to https://k ms. region.amazonaws.com depending on the AWS Region where the node is located. Connectivity to this endpoint is not required for a node to appear in your managed nodes list. Fleet Manager 363 AWS Systems Manager Check Connectivity to logs endpoint Connectivity to monitoring endpoint AWS Credentials Agent service User Guide Details Indicates whether the node is able to reach the service endpoint for Amazon CloudWatc h Logs on TCP port 443. A failed test indicates connectivity issues to https://l ogs. region.amazonaws.com depending on the AWS Region where the node is located. Connectivity to this endpoint is not required for a node to appear in your managed nodes list. Indicates whether the node is able to reach the service endpoint for Amazon CloudWatch on TCP port 443. A failed test indicates connectivity issues to https://m onitoring. region.amazonaws.com depending on the AWS Region where the node is located. Connectivity to this endpoint is not required for a node to appear in your managed nodes list. Indicates whether SSM Agent has the required credentials based on the IAM instance profile (for EC2 instances) or IAM service role (for non-EC2 machines) attached to the machine. A failed test indicates that no IAM instance profile or IAM service role is attached to the machine, or it does not contain the required permissions for Systems Manager. Indicates whether SSM Agent service is running, and whether the service is running as root for Linux or macOS, or SYSTEM for Windows Server. A failed test indicates SSM Agent service is not running or is not running as root or SYSTEM. Fleet Manager 364 AWS Systems Manager Check Proxy configuration Sysprep image state (Windows only) SSM Agent version User Guide Details Indicates whether SSM Agent is configured to use a proxy. Indicates the state of Sysprep on the node. SSM Agent will not start on the node if the Sysprep state is a value other than IMAGE_STATE_COMPLETE . Indicates whether the latest available version of SSM Agent is installed. AWS Systems Manager Hybrid Activations To configure non-EC2 machines for use with AWS Systems Manager in a hybrid and multicloud environment, you create a hybrid activation. Non-EC2 machine types supported as managed nodes include the following: • 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
systems-manager-ug-120
systems-manager-ug.pdf
120
on the node. SSM Agent will not start on the node if the Sysprep state is a value other than IMAGE_STATE_COMPLETE . Indicates whether the latest available version of SSM Agent is installed. AWS Systems Manager Hybrid Activations To configure non-EC2 machines for use with AWS Systems Manager in a hybrid and multicloud environment, you create a hybrid activation. Non-EC2 machine types supported as managed nodes include the following: • 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 When you run the create-activation command to start a hybrid activation process, you receive an activation code and ID in the command response. You then include the activation code and ID with the command to install SSM Agent on the machine, as described in step 3 of Install SSM Agent on hybrid Linux nodes and step 4 of Install SSM Agent on hybrid Windows Server nodes. This activation process applies to all non-EC2 machine types except AWS IoT Greengrass core devices. For information about configuring AWS IoT Greengrass core devices for Systems Manager, see Managing edge devices with Systems Manager. Note Support isn't currently provided for non-EC2 macOS machines. Hybrid Activations 365 AWS Systems Manager User Guide About Systems Manager instances tiers AWS Systems Manager offers a standard-instances tier and an advanced-instances tier. Both support managed nodes in your hybrid and multicloud environment. The standard-instances tier allows you to register a maximum of 1,000 machines per AWS account per AWS Region. If you need to register more than 1,000 machines in a single account and Region, then use the advanced- instances tier. You can create as many managed nodes as you like in the advanced-instances tier. All managed nodes configured for Systems Manager are priced on a pay-per-use basis. For more information about enabling the advanced instances tier, see Turning on the advanced-instances tier. For more information about pricing, see AWS Systems Manager Pricing. Note the following additional information about the standard-instances tier and advanced- instances tier: • Advanced instances also allow you to connect to your non-EC2 nodes in a hybrid and multicloud environment by using AWS Systems Manager Session Manager. Session Manager provides interactive shell access to your instances. For more information, see AWS Systems Manager Session Manager. • The standard-instances quota also applies to EC2 instances that use a Systems Manager on- premises activation (which isn't a common scenario). • To patch applications released by Microsoft on virtual machines (VMs) on-premises instances, activate the advanced-instances tier. There is a charge to use the advanced-instances tier. There is no additional charge to patch applications released by Microsoft on Amazon Elastic Compute Cloud (Amazon EC2) instances. For more information, see Patching applications released by Microsoft on Windows Server. AWS Systems Manager Inventory AWS Systems Manager Inventory provides visibility into your AWS computing environment. You can use Inventory to collect metadata from your managed nodes. You can store this metadata in a central Amazon Simple Storage Service (Amazon S3) bucket, and then use built-in tools to query the data and quickly determine which nodes are running the software and configurations required by your software policy, and which nodes need to be updated. You can configure Inventory on all of your managed nodes by using a one-click procedure. You can also configure and view inventory data from multiple AWS Regions and AWS accounts by using Amazon Athena. To get started with Inventory, open the Systems Manager console. In the navigation pane, choose Inventory. Inventory 366 AWS Systems Manager User Guide If the pre-configured metadata types collected by Systems Manager Inventory don't meet your needs, then you can create custom inventory. Custom inventory is simply a JSON file with information that you provide and add to the managed node in a specific directory. When Systems Manager Inventory collects data, it captures this custom inventory data. For example, if you run a large data center, you can specify the rack location of each of your servers as custom inventory. You can then view the rack space data when you view other inventory data. Important Systems Manager Inventory collects only metadata from your managed nodes. Inventory doesn't access proprietary information or data. The following table describes the types of data you can collect with Systems Manager Inventory. The table also describes different offerings for targeting nodes and the collection intervals you can specify. Configuration Metadata types Details You can configure Inventory to collect the following types of data: • Applications: Application names, publishers, versions, etc. • AWS components: EC2 driver, agents, versions, etc. • Files: Name, size, version, installed date, modification and last accessed times, etc. • Network configuration: IP address, MAC address, DNS, gateway, subnet mask, etc. • Windows updates: Hotfix ID, installed
systems-manager-ug-121
systems-manager-ug.pdf
121
nodes. Inventory doesn't access proprietary information or data. The following table describes the types of data you can collect with Systems Manager Inventory. The table also describes different offerings for targeting nodes and the collection intervals you can specify. Configuration Metadata types Details You can configure Inventory to collect the following types of data: • Applications: Application names, publishers, versions, etc. • AWS components: EC2 driver, agents, versions, etc. • Files: Name, size, version, installed date, modification and last accessed times, etc. • Network configuration: IP address, MAC address, DNS, gateway, subnet mask, etc. • Windows updates: Hotfix ID, installed by, installed date, etc. • Instance details: CPUModel, CPUCores, CPUs, CPUSpeedMHz, CPUSockets, CPUHyperThreadEnabled, OSService Packetc. Inventory 367 AWS Systems Manager Configuration Nodes to target When to collect information User Guide Details • Services: Name, display name, status, dependent services, service type, start type, etc. • Tags: Tags assigned to your nodes. • Windows Registry: Registry key path, value name, value type, and value. • Windows roles: Name, display name, path, feature type, installed state, etc. • Custom inventory: Metadata that was assigned to a managed node as described in Working with custom inventory. Note To view a list of all metadata collected by Inventory, see Metadata collected by Inventory. You can choose to inventory all managed nodes in your AWS account, individually select nodes, or target groups of nodes by using tags. For more information about collectin g inventory data from all of your managed nodes, see Inventory all managed nodes in your AWS account. You can specify a collection interval in terms of minutes, hours, and days. The shortest collection interval is every 30 minutes. Inventory 368 AWS Systems Manager Note User Guide Depending on the amount of data collected, the system can take several minutes to report the data to the output you specified. After the information is collected, the data is sent over a secure HTTPS channel to a plain-text AWS store that is accessible only from your AWS account. You can view the data in the Systems Manager console on the Inventory page, which includes several predefined cards to help you query the data. Note Inventory cards automatically filter out Amazon EC2 managed instances with a state of Terminated and Stopped. For on-premises and AWS IoT Greengrass core device managed nodes, Inventory cards automatically filter out nodes with a state of Terminated. Inventory 369 AWS Systems Manager User Guide If you create a resource data sync to synchronize and store all of your data in a single Amazon S3 bucket, then you can drill down into the data on the Inventory Detailed View page. For more information, see Querying inventory data from multiple Regions and accounts. 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. Contents • Learn more about Systems Manager Inventory • Setting up Systems Manager Inventory • Configuring inventory collection • Querying inventory data from multiple Regions and accounts • Querying an inventory collection by using filters • Aggregating inventory data • Working with custom inventory • Viewing inventory history and change tracking • Stopping data collection and deleting inventory data • Assigning custom inventory metadata to a managed node • Using the AWS CLI to configure inventory data collection • Walkthrough: Using resource data sync to aggregate inventory data • Troubleshooting problems with Systems Manager Inventory Learn more about Systems Manager Inventory When you configure AWS Systems Manager Inventory, you specify the type of metadata to collect, the managed nodes from where the metadata should be collected, and a schedule for metadata collection. These configurations are saved with your AWS account as an AWS Systems Manager State Manager association. An association is simply a configuration. Note Inventory only collects metadata. It doesn't collect any personal or proprietary data. Inventory 370 AWS Systems Manager Topics • Metadata collected by Inventory • Working with file and Windows registry inventory Metadata collected by Inventory User Guide The following sample shows the complete list of metadata collected by each AWS Systems Manager Inventory plugin. { "typeName": "AWS:InstanceInformation", "version": "1.0", "attributes":[ { "name": "AgentType", "dataType" : "STRING"}, { "name": "AgentVersion", "dataType" : "STRING"}, { "name": "ComputerName", "dataType" : "STRING"}, { "name": "InstanceId", "dataType" : "STRING"}, { "name": "IpAddress", "dataType" : "STRING"}, { "name": "PlatformName", "dataType" : "STRING"}, { "name": "PlatformType", "dataType" : "STRING"}, { "name": "PlatformVersion", "dataType" : "STRING"}, { "name": "ResourceType", "dataType" : "STRING"}, { "name": "AgentStatus", "dataType" : "STRING"}, { "name": "InstanceStatus", "dataType" : "STRING"} ] }, { "typeName" : "AWS:Application", "version": "1.1", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "ApplicationType", "dataType": "STRING"}, { "name": "Publisher", "dataType": "STRING"}, { "name": "Version", "dataType": "STRING"}, { "name": "Release",
systems-manager-ug-122
systems-manager-ug.pdf
122
"1.0", "attributes":[ { "name": "AgentType", "dataType" : "STRING"}, { "name": "AgentVersion", "dataType" : "STRING"}, { "name": "ComputerName", "dataType" : "STRING"}, { "name": "InstanceId", "dataType" : "STRING"}, { "name": "IpAddress", "dataType" : "STRING"}, { "name": "PlatformName", "dataType" : "STRING"}, { "name": "PlatformType", "dataType" : "STRING"}, { "name": "PlatformVersion", "dataType" : "STRING"}, { "name": "ResourceType", "dataType" : "STRING"}, { "name": "AgentStatus", "dataType" : "STRING"}, { "name": "InstanceStatus", "dataType" : "STRING"} ] }, { "typeName" : "AWS:Application", "version": "1.1", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "ApplicationType", "dataType": "STRING"}, { "name": "Publisher", "dataType": "STRING"}, { "name": "Version", "dataType": "STRING"}, { "name": "Release", "dataType": "STRING"}, { "name": "Epoch", "dataType": "STRING"}, { "name": "InstalledTime", "dataType": "STRING"}, { "name": "Architecture", "dataType": "STRING"}, { "name": "URL", "dataType": "STRING"}, { "name": "Summary", "dataType": "STRING"}, { "name": "PackageId", "dataType": "STRING"} ] Inventory 371 User Guide AWS Systems Manager }, { "typeName" : "AWS:File", "version": "1.0", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "Size", "dataType": "STRING"}, { "name": "Description", "dataType": "STRING"}, { "name": "FileVersion", "dataType": "STRING"}, { "name": "InstalledDate", "dataType": "STRING"}, { "name": "ModificationTime", "dataType": "STRING"}, { "name": "LastAccessTime", "dataType": "STRING"}, { "name": "ProductName", "dataType": "STRING"}, { "name": "InstalledDir", "dataType": "STRING"}, { "name": "ProductLanguage", "dataType": "STRING"}, { "name": "CompanyName", "dataType": "STRING"}, { "name": "ProductVersion", "dataType": "STRING"} ] }, { "typeName": "AWS:AWSComponent", "version": "1.0", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "ApplicationType", "dataType": "STRING"}, { "name": "Publisher", "dataType": "STRING"}, { "name": "Version", "dataType": "STRING"}, { "name": "InstalledTime", "dataType": "STRING"}, { "name": "Architecture", "dataType": "STRING"}, { "name": "URL", "dataType": "STRING"} ] }, { "typeName": "AWS:WindowsUpdate", "version":"1.0", "attributes":[ { "name": "HotFixId", "dataType": "STRING"}, { "name": "Description", "dataType": "STRING"}, { "name": "InstalledTime", "dataType": "STRING"}, { "name": "InstalledBy", "dataType": "STRING"} ] }, { "typeName": "AWS:Network", Inventory 372 User Guide AWS Systems Manager "version":"1.0", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "SubnetMask", "dataType": "STRING"}, { "name": "Gateway", "dataType": "STRING"}, { "name": "DHCPServer", "dataType": "STRING"}, { "name": "DNSServer", "dataType": "STRING"}, { "name": "MacAddress", "dataType": "STRING"}, { "name": "IPV4", "dataType": "STRING"}, { "name": "IPV6", "dataType": "STRING"} ] }, { "typeName": "AWS:PatchSummary", "version":"1.0", "attributes":[ { "name": "PatchGroup", "dataType": "STRING"}, { "name": "BaselineId", "dataType": "STRING"}, { "name": "SnapshotId", "dataType": "STRING"}, { "name": "OwnerInformation", "dataType": "STRING"}, { "name": "InstalledCount", "dataType": "NUMBER"}, { "name": "InstalledPendingRebootCount", "dataType": "NUMBER"}, { "name": "InstalledOtherCount", "dataType": "NUMBER"}, { "name": "InstalledRejectedCount", "dataType": "NUMBER"}, { "name": "NotApplicableCount", "dataType": "NUMBER"}, { "name": "UnreportedNotApplicableCount", "dataType": "NUMBER"}, { "name": "MissingCount", "dataType": "NUMBER"}, { "name": "FailedCount", "dataType": "NUMBER"}, { "name": "OperationType", "dataType": "STRING"}, { "name": "OperationStartTime", "dataType": "STRING"}, { "name": "OperationEndTime", "dataType": "STRING"}, { "name": "InstallOverrideList", "dataType": "STRING"}, { "name": "RebootOption", "dataType": "STRING"}, { "name": "LastNoRebootInstallOperationTime", "dataType": "STRING"}, { "name": "ExecutionId", "dataType": "STRING", "isOptional": "true"}, { "name": "NonCompliantSeverity", "dataType": "STRING", "isOptional": "true"}, { "name": "SecurityNonCompliantCount", "dataType": "NUMBER", "isOptional": "true"}, { "name": "CriticalNonCompliantCount", "dataType": "NUMBER", "isOptional": "true"}, { "name": "OtherNonCompliantCount", "dataType": "NUMBER", "isOptional": "true"} Inventory 373 User Guide AWS Systems Manager ] }, { "typeName": "AWS:PatchCompliance", "version":"1.0", "attributes":[ { "name": "Title", "dataType": "STRING"}, { "name": "KBId", "dataType": "STRING"}, { "name": "Classification", "dataType": "STRING"}, { "name": "Severity", "dataType": "STRING"}, { "name": "State", "dataType": "STRING"}, { "name": "InstalledTime", "dataType": "STRING"} ] }, { "typeName": "AWS:ComplianceItem", "version":"1.0", "attributes":[ { "name": "ComplianceType", "dataType": "STRING", "isContext": "true"}, { "name": "ExecutionId", "dataType": "STRING", "isContext": "true"}, { "name": "ExecutionType", "dataType": "STRING", "isContext": "true"}, { "name": "ExecutionTime", "dataType": "STRING", "isContext": "true"}, { "name": "Id", "dataType": "STRING"}, { "name": "Title", "dataType": "STRING"}, { "name": "Status", "dataType": "STRING"}, { "name": "Severity", "dataType": "STRING"}, { "name": "DocumentName", "dataType": "STRING"}, { "name": "DocumentVersion", "dataType": "STRING"}, { "name": "Classification", "dataType": "STRING"}, { "name": "PatchBaselineId", "dataType": "STRING"}, { "name": "PatchSeverity", "dataType": "STRING"}, { "name": "PatchState", "dataType": "STRING"}, { "name": "PatchGroup", "dataType": "STRING"}, { "name": "InstalledTime", "dataType": "STRING"}, { "name": "InstallOverrideList", "dataType": "STRING", "isOptional": "true"}, { "name": "DetailedText", "dataType": "STRING", "isOptional": "true"}, { "name": "DetailedLink", "dataType": "STRING", "isOptional": "true"}, Inventory 374 AWS Systems Manager User Guide { "name": "CVEIds", "dataType": "STRING", "isOptional": "true"} ] }, { "typeName": "AWS:ComplianceSummary", "version":"1.0", "attributes":[ { "name": "ComplianceType", "dataType": "STRING"}, { "name": "PatchGroup", "dataType": "STRING"}, { "name": "PatchBaselineId", "dataType": "STRING"}, { "name": "Status", "dataType": "STRING"}, { "name": "OverallSeverity", "dataType": "STRING"}, { "name": "ExecutionId", "dataType": "STRING"}, { "name": "ExecutionType", "dataType": "STRING"}, { "name": "ExecutionTime", "dataType": "STRING"}, { "name": "CompliantCriticalCount", "dataType": "NUMBER"}, { "name": "CompliantHighCount", "dataType": "NUMBER"}, { "name": "CompliantMediumCount", "dataType": "NUMBER"}, { "name": "CompliantLowCount", "dataType": "NUMBER"}, { "name": "CompliantInformationalCount", "dataType": "NUMBER"}, { "name": "CompliantUnspecifiedCount", "dataType": "NUMBER"}, { "name": "NonCompliantCriticalCount", "dataType": "NUMBER"}, { "name": "NonCompliantHighCount", "dataType": "NUMBER"}, { "name": "NonCompliantMediumCount", "dataType": "NUMBER"}, { "name": "NonCompliantLowCount", "dataType": "NUMBER"}, { "name": "NonCompliantInformationalCount", "dataType": "NUMBER"}, { "name": "NonCompliantUnspecifiedCount", "dataType": "NUMBER"} ] }, { "typeName": "AWS:InstanceDetailedInformation", "version":"1.0", "attributes":[ { "name": "CPUModel", "dataType": "STRING"}, { "name": "CPUCores", "dataType": "NUMBER"}, { "name": "CPUs", "dataType": "NUMBER"}, { "name": "CPUSpeedMHz", "dataType": "NUMBER"}, { "name": "CPUSockets", "dataType": "NUMBER"}, { "name": "CPUHyperThreadEnabled", "dataType": "STRING"}, { "name": "OSServicePack", "dataType": "STRING"} ] }, { Inventory 375 AWS Systems Manager User Guide "typeName": "AWS:Service", "version":"1.0",
systems-manager-ug-123
systems-manager-ug.pdf
123
{ "name": "CompliantLowCount", "dataType": "NUMBER"}, { "name": "CompliantInformationalCount", "dataType": "NUMBER"}, { "name": "CompliantUnspecifiedCount", "dataType": "NUMBER"}, { "name": "NonCompliantCriticalCount", "dataType": "NUMBER"}, { "name": "NonCompliantHighCount", "dataType": "NUMBER"}, { "name": "NonCompliantMediumCount", "dataType": "NUMBER"}, { "name": "NonCompliantLowCount", "dataType": "NUMBER"}, { "name": "NonCompliantInformationalCount", "dataType": "NUMBER"}, { "name": "NonCompliantUnspecifiedCount", "dataType": "NUMBER"} ] }, { "typeName": "AWS:InstanceDetailedInformation", "version":"1.0", "attributes":[ { "name": "CPUModel", "dataType": "STRING"}, { "name": "CPUCores", "dataType": "NUMBER"}, { "name": "CPUs", "dataType": "NUMBER"}, { "name": "CPUSpeedMHz", "dataType": "NUMBER"}, { "name": "CPUSockets", "dataType": "NUMBER"}, { "name": "CPUHyperThreadEnabled", "dataType": "STRING"}, { "name": "OSServicePack", "dataType": "STRING"} ] }, { Inventory 375 AWS Systems Manager User Guide "typeName": "AWS:Service", "version":"1.0", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "DisplayName", "dataType": "STRING"}, { "name": "ServiceType", "dataType": "STRING"}, { "name": "Status", "dataType": "STRING"}, { "name": "DependentServices", "dataType": "STRING"}, { "name": "ServicesDependedOn", "dataType": "STRING"}, { "name": "StartType", "dataType": "STRING"} ] }, { "typeName": "AWS:WindowsRegistry", "version":"1.0", "attributes":[ { "name": "KeyPath", "dataType": "STRING"}, { "name": "ValueName", "dataType": "STRING"}, { "name": "ValueType", "dataType": "STRING"}, { "name": "Value", "dataType": "STRING"} ] }, { "typeName": "AWS:WindowsRole", "version":"1.0", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "DisplayName", "dataType": "STRING"}, { "name": "Path", "dataType": "STRING"}, { "name": "FeatureType", "dataType": "STRING"}, { "name": "DependsOn", "dataType": "STRING"}, { "name": "Description", "dataType": "STRING"}, { "name": "Installed", "dataType": "STRING"}, { "name": "InstalledState", "dataType": "STRING"}, { "name": "SubFeatures", "dataType": "STRING"}, { "name": "ServerComponentDescriptor", "dataType": "STRING"}, { "name": "Parent", "dataType": "STRING"} ] }, { "typeName": "AWS:Tag", "version":"1.0", "attributes":[ { "name": "Key", "dataType": "STRING"}, Inventory 376 AWS Systems Manager User Guide { "name": "Value", "dataType": "STRING"} ] }, { "typeName": "AWS:ResourceGroup", "version":"1.0", "attributes":[ { "name": "Name", "dataType": "STRING"}, { "name": "Arn", "dataType": "STRING"} ] }, { "typeName": "AWS:BillingInfo", "version": "1.0", "attributes": [ { "name": "BillingProductId", "dataType": "STRING"} ] } Note • For "typeName": "AWS:InstanceInformation", InstanceStatus can be one of the following: Active, ConnectionLost, Stopped, Terminated. • With the release of version 2.5, RPM Package Manager replaced the Serial attribute with Epoch. The Epoch attribute is a monotonically increasing integer like Serial. When you inventory by using the AWS:Application type, a larger value for Epoch means a newer version. If Epoch values are the same or empty, then use the value of the Version or Release attribute to determine the newer version. • Some metadata is not available from Linux instances. Specifically, for "typeName": "AWS:Network", the following metadata types are not yet supported for Linux instances. They ARE supported for Windows. • { "name": "SubnetMask", "dataType": "STRING"}, • { "name": "DHCPServer", "dataType": "STRING"}, • { "name": "DNSServer", "dataType": "STRING"}, • { "name": "Gateway", "dataType": "STRING"}, Inventory 377 AWS Systems Manager User Guide Working with file and Windows registry inventory AWS Systems Manager Inventory allows you to search and inventory files on Windows, Linux, and macOS operating systems. You can also search and inventory the Windows Registry. Files: You can collect metadata information about files, including file names, the time files were created, the time files were last modified and accessed, and file sizes, to name a few. To start collecting file inventory, you specify a file path where you want to perform the inventory, one or more patterns that define the types of files you want to inventory, and if the path should be traversed recursively. Systems Manager inventories all file metadata for files in the specified path that match the pattern. File inventory uses the following parameter input. { "Path": string, "Pattern": array[string], "Recursive": true, "DirScanLimit" : number // Optional } • Path: The directory path where you want to inventory files. For Windows, you can use environment variables like %PROGRAMFILES% as long as the variable maps to a single directory path. For example, if you use %PATH% that maps to multiple directory paths, Inventory throws an error. • Pattern: An array of patterns to identify files. • Recursive: A Boolean value indicating whether Inventory should recursively traverse the directories. • DirScanLimit: An optional value specifying how many directories to scan. Use this parameter to minimize performance impact on your managed nodes. Inventory scans a maximum of 5,000 directories. Note Inventory collects metadata for a maximum of 500 files across all specified paths. Here are some examples of how to specify the parameters when performing an inventory of files. Inventory 378 AWS Systems Manager User Guide • On Linux and macOS, collect metadata of .sh files in the /home/ec2-user directory, excluding all subdirectories. [{"Path":"/home/ec2-user","Pattern":["*.sh", "*.sh"],"Recursive":false}] • On Windows, collect metadata of all ".exe" files in the Program Files folder, including subdirectories recursively. [{"Path":"C:\Program Files","Pattern":["*.exe"],"Recursive":true}] • On Windows, collect metadata of specific log patterns. [{"Path":"C:\ProgramData\Amazon","Pattern":["*amazon*.log"],"Recursive":true}] • Limit the directory count when performing recursive collection. [{"Path":"C:\Users","Pattern":["*.ps1"],"Recursive":true, "DirScanLimit": 1000}] Windows Registry: You can collect Windows Registry keys and values. You can choose a key path and collect all keys and values recursively. You can also collect a specific registry key and its value for a specific path. Inventory collects the
systems-manager-ug-124
systems-manager-ug.pdf
124
On Linux and macOS, collect metadata of .sh files in the /home/ec2-user directory, excluding all subdirectories. [{"Path":"/home/ec2-user","Pattern":["*.sh", "*.sh"],"Recursive":false}] • On Windows, collect metadata of all ".exe" files in the Program Files folder, including subdirectories recursively. [{"Path":"C:\Program Files","Pattern":["*.exe"],"Recursive":true}] • On Windows, collect metadata of specific log patterns. [{"Path":"C:\ProgramData\Amazon","Pattern":["*amazon*.log"],"Recursive":true}] • Limit the directory count when performing recursive collection. [{"Path":"C:\Users","Pattern":["*.ps1"],"Recursive":true, "DirScanLimit": 1000}] Windows Registry: You can collect Windows Registry keys and values. You can choose a key path and collect all keys and values recursively. You can also collect a specific registry key and its value for a specific path. Inventory collects the key path, name, type, and the value. { "Path": string, "Recursive": true, "ValueNames": array[string] // optional } • Path: The path to the Registry key. • Recursive: A Boolean value indicating whether Inventory should recursively traverse Registry paths. • ValueNames: An array of value names for performing inventory of Registry keys. If you use this parameter, Systems Manager will inventory only the specified value names for the specified path. Note Inventory collects a maximum of 250 Registry key values for all specified paths. Inventory 379 AWS Systems Manager User Guide Here are some examples of how to specify the parameters when performing an inventory of the Windows Registry. • Collect all keys and values recursively for a specific path. [{"Path":"HKEY_LOCAL_MACHINE\SOFTWARE\Amazon","Recursive": true}] • Collect all keys and values for a specific path (recursive search turned off). [{"Path":"HKEY_LOCAL_MACHINE\SOFTWARE\Intel\PSIS\PSIS_DECODER", "Recursive": false}] • Collect a specific key by using the ValueNames option. {"Path":"HKEY_LOCAL_MACHINE\SOFTWARE\Amazon\MachineImage","ValueNames":["AMIName"]} Setting up Systems Manager Inventory Before you use AWS Systems Manager Inventory to collect metadata about the applications, services, AWS components and more running on your managed nodes, we recommend that you configure resource data sync to centralize the storage of your inventory data in a single Amazon Simple Storage Service (Amazon S3) bucket. We also recommend that you configure Amazon EventBridge monitoring of inventory events. These processes make it easier to view and manage inventory data and collection. Topics • Creating a resource data sync for Inventory • Using EventBridge to monitor Inventory events Creating a resource data sync for Inventory This topic describes how to set up and configure resource data sync for AWS Systems Manager Inventory. For information about resource data sync for Systems Manager Explorer, see Setting up Systems Manager Explorer to display data from multiple accounts and Regions. About resource data sync You can use Systems Manager resource data sync to send inventory data collected from all of your managed nodes to a single Amazon Simple Storage Service (Amazon S3) bucket. Resource data Inventory 380 AWS Systems Manager User Guide sync then automatically updates the centralized data when new inventory data is collected. With all inventory data stored in a target Amazon S3 bucket, you can use services like Amazon Athena and Amazon QuickSight to query and analyze the aggregated data. For example, say that you've configured inventory to collect data about the operating system (OS) and applications running on a fleet of 150 managed nodes. Some of these nodes are located in an on-premises data center, and others are running in Amazon Elastic Compute Cloud (Amazon EC2) across multiple AWS Regions. If you have not configured resource data sync, you either need to manually gather the collected inventory data for each managed node, or you have to create scripts to gather this information. You would then need to port the data into an application so that you can run queries and analyze it. With resource data sync, you perform a one-time operation that synchronizes all inventory data from all of your managed nodes. After the sync is successfully created, Systems Manager creates a baseline of all inventory data and saves it in the target Amazon S3 bucket. When new inventory data is collected, Systems Manager automatically updates the data in the Amazon S3 bucket. You can then quickly and cost-effectively port the data to Amazon Athena and Amazon QuickSight. Diagram 1 shows how resource data sync aggregates inventory data from Amazon EC2 and other machine types in a hybrid and multicloud environment to a target Amazon S3 bucket. This diagram also shows how resource data sync works with multiple AWS accounts and AWS Regions. Diagram 1: Resource data sync with multiple AWS accounts and AWS Regions Inventory 381 AWS Systems Manager User Guide If you delete a managed node, resource data sync preserves the inventory file for the deleted node. For running nodes, however, resource data sync automatically overwrites old inventory files when new files are created and written to the Amazon S3 bucket. If you want to track inventory changes over time, you can use the AWS Config service to track the SSM:ManagedInstanceInventory resource type. For more information, see Getting Started with AWS Config. Use the procedures in this section to create a resource
systems-manager-ug-125
systems-manager-ug.pdf
125
1: Resource data sync with multiple AWS accounts and AWS Regions Inventory 381 AWS Systems Manager User Guide If you delete a managed node, resource data sync preserves the inventory file for the deleted node. For running nodes, however, resource data sync automatically overwrites old inventory files when new files are created and written to the Amazon S3 bucket. If you want to track inventory changes over time, you can use the AWS Config service to track the SSM:ManagedInstanceInventory resource type. For more information, see Getting Started with AWS Config. Use the procedures in this section to create a resource data sync for Inventory by using the Amazon S3 and AWS Systems Manager consoles. You can also use AWS CloudFormation to create or delete a resource data sync. To use AWS CloudFormation, add the AWS::SSM::ResourceDataSync resource to your AWS CloudFormation template. For information, see one of the following documentation resources: • AWS CloudFormation resource for resource data sync in AWS Systems Manager (blog) Inventory 382 AWS Systems Manager User Guide • Working with AWS CloudFormation Templates in the AWS CloudFormation User Guide Note You can use AWS Key Management Service (AWS KMS) to encrypt inventory data in the Amazon S3 bucket. For an example of how to create an encrypted sync by using the AWS Command Line Interface (AWS CLI) and how to work with the centralized data in Amazon Athena and Amazon QuickSight, see Walkthrough: Using resource data sync to aggregate inventory data. Before you begin Before you create a resource data sync, use the following procedure to create a central Amazon S3 bucket to store aggregated inventory data. The procedure describes how to assign a bucket policy that allows Systems Manager to write inventory data to the bucket from multiple accounts. If you already have an Amazon S3 bucket that you want to use to aggregate inventory data for resource data sync, then you must configure the bucket to use the policy in the following procedure. Note Systems Manager Inventory can't add data to a specified Amazon S3 bucket if that bucket is configured to use Object Lock. Verify that the Amazon S3 bucket you create or choose for resource data sync isn't configured to use Amazon S3 Object Lock. For more information, see How Amazon S3 Object Lock works in the Amazon Simple Storage Service User Guide. To create and configure an Amazon S3 bucket for resource data sync 1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/. 2. Create a bucket to store your aggregated Inventory 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. 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 with the name of the S3 bucket you created. Replace account_ID_number with a valid AWS account ID number. Inventory 383 AWS Systems Manager User Guide { "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/*/accountid=account_ID_number/*", "arn:aws:s3:::amzn-s3-demo-bucket/*/accountid=account_ID_number/*", "arn:aws:s3:::amzn-s3-demo-bucket/*/accountid=account_ID_number/*", "arn:aws:s3:::amzn-s3-demo-bucket/*/accountid=account_ID_number/*" ], "Condition": { "StringEquals": { "s3:x-amz-acl": "bucket-owner-full-control", "aws:SourceAccount": "ID_number" }, "ArnLike": { "aws:SourceArn": "arn:aws:ssm:*:account_ID_number:resource-data- sync/*" } } } ] } 5. Save your changes. Inventory 384 AWS Systems Manager User Guide Create a resource data sync for Inventory Use the following procedure to create a resource data sync for Systems Manager Inventory by using the Systems Manager console. For information about how to create a resource data sync by using the AWS CLI, see Using the AWS CLI to configure inventory data collection. To create a resource data sync 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. 3. In the navigation pane, choose Fleet Manager. In the Account management menu, choose Resource data sync. 4. Choose Create resource data sync. 5. 6. 7. 8. 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 using the To create and configure an Amazon S3 bucket for resource data sync procedure. (Optional) In the Bucket prefix field, enter the name of an Amazon S3 bucket prefix (subdirectory). In the Bucket region field, choose This region if the Amazon 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 Amazon S3 bucket are located in different regions, you might be subject to data transfer pricing. For more information, see Amazon S3 Pricing. 9. (Optional) In the
systems-manager-ug-126
systems-manager-ug.pdf
126
Amazon S3 bucket for resource data sync procedure. (Optional) In the Bucket prefix field, enter the name of an Amazon S3 bucket prefix (subdirectory). In the Bucket region field, choose This region if the Amazon 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 Amazon S3 bucket are located in different regions, you might be subject to data transfer pricing. For more information, see Amazon S3 Pricing. 9. (Optional) In the KMS Key ARN field, type or paste a KMS Key ARN to encrypt inventory data in Amazon S3. 10. Choose Create. To synchronize inventory data from multiple AWS Regions, you must create a resource data sync in each Region. Repeat this procedure in each AWS Region where you want to collect inventory data and send it to the central Amazon S3 bucket. When you create the sync in each Region, specify the central Amazon S3 bucket in the Bucket name field. Then use the Bucket region option to choose the Region where you created the central Amazon S3 bucket, as shown in the following screen Inventory 385 AWS Systems Manager User Guide shot. The next time the association runs to collect inventory data, Systems Manager stores the data in the central Amazon S3 bucket. Creating an inventory resource data sync for accounts defined in AWS Organizations You can synchronize inventory data from AWS accounts defined in AWS Organizations to a central Amazon S3 bucket. After you complete the following procedures, inventory data is synchronized to individual Amazon S3 key prefixes in the central bucket. Each key prefix represents a different AWS account ID. Before you begin Before you begin, verify that you set up and configured AWS accounts in AWS Organizations. For more information, see in the AWS Organizations User Guide. Also, be aware that you must create the organization-based resource data sync for each AWS Region and AWS account defined in AWS Organizations. Inventory 386 AWS Systems Manager User Guide Creating a central Amazon S3 bucket Use the following procedure to create a central Amazon S3 bucket to store aggregated inventory data. The procedure describes how to assign a bucket policy that allows Systems Manager to write inventory data to the bucket from your AWS Organizations account ID. If you already have an Amazon S3 bucket that you want to use to aggregate inventory data for resource data sync, then you must configure the bucket to use the policy in the following procedure. To create and configure an Amazon S3 bucket for resource data sync for multiple accounts defined in AWS Organizations 1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/. 2. Create a bucket to store your aggregated inventory 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. 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 organization-id with the name of the Amazon S3 bucket you created and a valid AWS Organizations 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 following policy. { "Version": "2012-10-17", "Statement": [ { "Sid": "SSMBucketPermissionsCheck", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "s3:GetBucketAcl", "Resource": "arn:aws:s3:::S3_bucket_name" }, { "Sid": " SSMBucketDelivery", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" Inventory 387 AWS Systems Manager }, "Action": "s3:PutObject", "Resource": [ User Guide "arn:aws:s3:::amzn-s3-demo-bucket/bucket-prefix/*/accountid=*/*" ], "Condition": { "StringEquals": { "s3:x-amz-acl": "bucket-owner-full-control", "aws:SourceOrgID": "organization-id" } } }, { "Sid": " SSMBucketDeliveryTagging", "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Action": "s3:PutObjectTagging", "Resource": [ "arn:aws:s3:::amzn-s3-demo-bucket/bucket-prefix/*/accountid=*/*" ] } ] } Create an inventory resource data sync for accounts defined in AWS Organizations The following procedure describes how to use the AWS CLI to create a resource data sync for accounts that are defined in AWS Organizations. You must use the AWS CLI to perform this task. You must also perform this procedure for each AWS Region and AWS account defined in AWS Organizations. To create a resource data sync for an account defined in AWS Organizations (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 verify that you don't have any other AWS Organizations-based resource data syncs. You can have multiple standard syncs, including multiple standard syncs Inventory 388 AWS Systems Manager User Guide and an Organizations-based sync. But, you can only have one Organizations-based resource
systems-manager-ug-127
systems-manager-ug.pdf
127
each AWS Region and AWS account defined in AWS Organizations. To create a resource data sync for an account defined in AWS Organizations (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 verify that you don't have any other AWS Organizations-based resource data syncs. You can have multiple standard syncs, including multiple standard syncs Inventory 388 AWS Systems Manager User Guide and an Organizations-based sync. But, you can only have one Organizations-based resource data sync. aws ssm list-resource-data-sync If the command returns other Organizations-based resource data sync, you must delete them or choose not to create a new one. 3. Run the following command to create a resource data sync for an account defined in AWS Organizations. For amzn-s3-demo-bucket, specify the name of the Amazon S3 bucket you created earlier in this topic. If you created a prefix (subdirectory) for your bucket, then specify this information for prefix-name. aws ssm create-resource-data-sync --sync-name name --s3- destination "BucketName=amzn-s3-demo-bucket,Prefix=prefix- name,SyncFormat=JsonSerDe,Region=AWS Region, for example us- east-2,DestinationDataSharing={DestinationDataSharingType=Organization}" 4. Repeat Steps 2 and 3 for every AWS Region and AWS account where you want to synchronize data to the central Amazon S3 bucket. Managing resource data syncs Each AWS account can have 5 resource data syncs per AWS Region. You can use the AWS Systems Manager Fleet Manager console to manage your resource data syncs. To view resource data syncs 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. 4. manager/. In the navigation pane, choose Fleet Manager. In the Account management dropdown, choose Resource data syncs. Select a resource data sync from the table, and then choose View details to view information about your resource data sync. Inventory 389 AWS Systems Manager To delete a resource data sync User Guide 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. In the navigation pane, choose Fleet Manager. In the Account management dropdown, choose Resource data syncs. Select a resource data sync from the table, and then choose Delete. 2. 3. 4. Using EventBridge to monitor Inventory events You can configure a rule in Amazon EventBridge to create an event in response to AWS Systems Manager Inventory resource state changes. EventBridge supports events for the following Inventory state changes. All events are sent on a best effort basis. Custom inventory type deleted for a specific instance: If a rule is configured to monitor for this event, EventBridge creates an event when a custom inventory type on a specific managed is deleted. EventBridge sends one event per node per custom inventory type. Here is a sample event pattern. { "timestampMillis": 1610042981103, "source": "SSM", "account": "123456789012", "type": "INVENTORY_RESOURCE_STATE_CHANGE", "startTime": "Jan 7, 2021 6:09:41 PM", "resources": [ { "arn": "arn:aws:ssm:us-east-1:123456789012:managed-instance/i-12345678" } ], "body": { "action-status": "succeeded", "action": "delete", "resource-type": "managed-instance", "resource-id": "i-12345678", "action-reason": "", "type-name": "Custom:MyCustomInventoryType" } } Inventory 390 AWS Systems Manager User Guide Custom inventory type deleted event for all instances: If a rule is configured to monitor for this event, EventBridge creates an event when a custom inventory type for all managed nodes is deleted. Here is a sample event pattern. { "timestampMillis": 1610042904712, "source": "SSM", "account": "123456789012", "type": "INVENTORY_RESOURCE_STATE_CHANGE", "startTime": "Jan 7, 2021 6:08:24 PM", "resources": [ ], "body": { "action-status": "succeeded", "action": "delete-summary", "resource-type": "managed-instance", "resource-id": "", "action-reason": "The delete for type name Custom:SomeCustomInventoryType was completed. The deletion summary is: {\"totalCount\":1,\"remainingCount\":0, \"summaryItems\":[{\"version\":\"1.1\",\"count\":1,\"remainingCount\":0}]}", "type-name": "Custom:MyCustomInventoryType" } } PutInventory call with old schema version event: If a rule is configured to monitor for this event, EventBridge creates an event when a PutInventory call is made that uses a schema version that is lower than the current schema. This event applies to all inventory types. Here is a sample event pattern. { "timestampMillis": 1610042629548, "source": "SSM", "account": "123456789012", "type": "INVENTORY_RESOURCE_STATE_CHANGE", "startTime": "Jan 7, 2021 6:03:49 PM", "resources": [ { "arn": "arn:aws:ssm:us-east-1:123456789012:managed-instance/i-12345678" } ], "body": { Inventory 391 AWS Systems Manager User Guide "action-status": "failed", "action": "put", "resource-type": "managed-instance", "resource-id": "i-01f017c1b2efbe2bc", "action-reason": "The inventory item with type name Custom:MyCustomInventoryType was sent with a disabled schema verison 1.0. You must send a version greater than 1.0", "type-name": "Custom:MyCustomInventoryType" } } For information about how to configure EventBridge to monitor for these events, see Configuring EventBridge for Systems Manager events. Configuring inventory collection This section describes how to configure AWS Systems Manager Inventory collection on one or more managed nodes by using the Systems Manager console. For an example of how to configure inventory collection by using the AWS Command Line Interface (AWS CLI), see Using the AWS CLI to configure inventory data collection. When you configure inventory collection, you start by creating a AWS Systems Manager State Manager association. Systems Manager collects the inventory data when the association is run.
systems-manager-ug-128
systems-manager-ug.pdf
128
For information about how to configure EventBridge to monitor for these events, see Configuring EventBridge for Systems Manager events. Configuring inventory collection This section describes how to configure AWS Systems Manager Inventory collection on one or more managed nodes by using the Systems Manager console. For an example of how to configure inventory collection by using the AWS Command Line Interface (AWS CLI), see Using the AWS CLI to configure inventory data collection. When you configure inventory collection, you start by creating a AWS Systems Manager State Manager association. Systems Manager collects the inventory data when the association is run. If you don't create the association first, and attempt to invoke the aws:softwareInventory plugin by using, for example, AWS Systems Manager Run Command, the system returns the following error: The aws:softwareInventory plugin can only be invoked via ssm- associate. Note Be aware of the following behavior if you create multiple inventory associations for a managed node: • Each node can be assigned an inventory association that targets all nodes (--targets "Key=InstanceIds,Values=*"). • Each node can also be assigned a specific association that uses either tag key/value pairs or an AWS resource group. • If a node is assigned multiple inventory associations, the status shows Skipped for the association that hasn't run. The association that ran most recently displays the actual status of the inventory association. Inventory 392 AWS Systems Manager User Guide • If a node is assigned multiple inventory associations and each uses a tag key/value pair, then those inventory associations fail to run on the node because of the tag conflict. The association still runs on nodes that don't have the tag key/value conflict. Before You Begin Before you configure inventory collection, complete the following tasks. • Update AWS Systems Manager SSM Agent on the nodes you want to inventory. By running the latest version of SSM Agent, you ensure that you can collect metadata for all supported inventory types. For information about how to update SSM Agent by using State Manager, see Walkthrough: Automatically update SSM Agent with the AWS CLI. • 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. For information, see Setting up managed nodes for AWS Systems Manager. • For Microsoft Windows nodes, verify that your managed node is configured with Windows PowerShell 3.0 (or later). SSM Agent uses the ConvertTo-Json cmdlet in PowerShell to convert Windows update inventory data to the required format. • (Optional) Create a resource data sync to centrally store inventory data in an Amazon S3 bucket. resource data sync then automatically updates the centralized data when new inventory data is collected. For more information, see Walkthrough: Using resource data sync to aggregate inventory data. • (Optional) Create a JSON file to collect custom inventory. For more information, see Working with custom inventory. Inventory all managed nodes in your AWS account You can inventory all managed nodes in your AWS account by creating a global inventory association. A global inventory association performs the following actions: • Automatically applies the global inventory configuration (association) to all existing managed nodes in your AWS account. Managed nodes that already have an inventory association are skipped when the global inventory association is applied and runs. When a node is skipped, the detailed status message states Overridden By Explicit Inventory Association. Those nodes are skipped by the global association, but they will still report inventory when they run their assigned inventory association. Inventory 393 AWS Systems Manager User Guide • Automatically adds new nodes created in your AWS account to the global inventory association. Note • If a managed node is configured for the global inventory association, and you assign a specific association to that node, then Systems Manager Inventory deprioritizes the global association and applies the specific association. • Global inventory associations are available in SSM Agent version 2.0.790.0 or later. For information about how to update SSM Agent on your nodes, see Updating the SSM Agent using Run Command. Configuring inventory collection with one click (console) Use the following procedure to configure Systems Manager Inventory for all managed nodes in your AWS account and in a single AWS Region. To configure all of your managed nodes in the current Region for Systems Manager inventory 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Inventory. In the Managed instances with inventory enabled card, choose Click here to enable inventory on all instances. Inventory 394 AWS Systems Manager User Guide If successful, the console displays the following message. Depending on the number of managed nodes in your account, it can take several minutes for the global inventory association to be applied. Wait a few minutes and then refresh the
systems-manager-ug-129
systems-manager-ug.pdf
129
a single AWS Region. To configure all of your managed nodes in the current Region for Systems Manager inventory 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Inventory. In the Managed instances with inventory enabled card, choose Click here to enable inventory on all instances. Inventory 394 AWS Systems Manager User Guide If successful, the console displays the following message. Depending on the number of managed nodes in your account, it can take several minutes for the global inventory association to be applied. Wait a few minutes and then refresh the page. Inventory 395 AWS Systems Manager User Guide Verify that the graphic changes to reflect that inventory is configured on all of your managed nodes. Configuring collection by using the console This section includes information about how to configure Systems Manager Inventory to collect metadata from your managed nodes by using the Systems Manager console. You can quickly collect metadata from all nodes in a specific AWS account (and any future nodes that might be created in that account) or you can selectively collect inventory data by using tags or node IDs. Note Before completing this procedure, check to see if a global inventory association already exists. If a global inventory association already exists, anytime you launch a new instance, the association will be applied to it, and the new instance will be inventoried. To configure inventory collection 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Inventory. 3. Choose Setup Inventory. 4. In the Targets section, identify the nodes where you want to run this operation by choosing one of the following. • Selecting all managed instances in this account - This option selects all managed nodes for which there is no existing inventory association. If you choose this option, nodes that already had inventory associations are skipped during inventory collection, and shown with a status of Skipped in inventory results. For more information, see Inventory all managed nodes in your AWS account. • Specifying a tag - Use this option to specify a single tag to identify nodes in your account from which you want to collect inventory. If you use a tag, any nodes created in the future with the same tag will also report inventory. If there is an existing inventory association with all nodes, using a tag to select specific nodes as a target for a different inventory overrides node membership in the All managed instances target group. Managed nodes with the specified tag are skipped on future inventory collection from All managed instances. Inventory 396 AWS Systems Manager User Guide • Manually selecting instances - Use this option to choose specific managed nodes in your account. Explicitly choosing specific nodes by using this option overrides inventory associations on the All managed instances target. The node is skipped on future inventory collection from All managed instances. Note If a managed node you expect to see isn't listed, see Troubleshooting managed node availability for troubleshooting tips. 5. 6. 7. In the Schedule section, choose how often you want the system to collect inventory metadata from your nodes. In the Parameters section, use the lists to turn on or turn off different types of inventory collection. For more information about collecting File and Windows Registry inventory, see Working with file and Windows registry inventory. In the Advanced section, choose Sync inventory execution logs to an Amazon S3 bucket if you want to store the association execution status in an Amazon S3 bucket. 8. Choose Setup Inventory. Systems Manager creates a State Manager association and immediately runs Inventory on the nodes. 9. In the navigation pane, choose State Manager. Verify that a new association was created that uses the AWS-GatherSoftwareInventory document. The association schedule uses a rate expression. Also, verify that the Status field shows Success. If you chose the option to Sync inventory execution logs to an Amazon S3 bucket, then you can view the log data in Amazon S3 after a few minutes. If you want to view inventory data for a specific node, then choose Managed Instances in the navigation pane. 10. Choose a node, and then choose View details. 11. On the node details page, choose Inventory. Use the Inventory type lists to filter the inventory. Querying inventory data from multiple Regions and accounts AWS Systems Manager Inventory integrates with Amazon Athena to help you query inventory data from multiple AWS Regions and AWS accounts. Athena integration uses resource data sync so that you can view inventory data from all of your managed nodes on the Detailed View page in the AWS Systems Manager console. Inventory 397 AWS Systems Manager Important User Guide This feature uses AWS Glue to crawl the data in your Amazon Simple Storage
systems-manager-ug-130
systems-manager-ug.pdf
130
View details. 11. On the node details page, choose Inventory. Use the Inventory type lists to filter the inventory. Querying inventory data from multiple Regions and accounts AWS Systems Manager Inventory integrates with Amazon Athena to help you query inventory data from multiple AWS Regions and AWS accounts. Athena integration uses resource data sync so that you can view inventory data from all of your managed nodes on the Detailed View page in the AWS Systems Manager console. Inventory 397 AWS Systems Manager Important User Guide This feature uses AWS Glue to crawl the data in your Amazon Simple Storage Service (Amazon S3) bucket, and Amazon Athena to query the data. Depending on how much data is crawled and queried, you can be charged for using these services. With AWS Glue, you pay an hourly rate, billed by the second, for crawlers (discovering data) and ETL jobs (processing and loading data). With Athena, you're charged based on the amount of data scanned by each query. We encourage you to view the pricing guidelines for these services before you use Amazon Athena integration with Systems Manager Inventory. For more information, see Amazon Athena pricing and AWS Glue pricing. You can view inventory data on the Detailed View page in all AWS Regions where Amazon Athena is available. For a list of supported Regions, see Amazon Athena Service Endpoints in the Amazon Web Services General Reference. Before you begin Athena integration uses resource data sync. You must set up and configure resource data sync to use this feature. For more information, see Walkthrough: Using resource data sync to aggregate inventory data. Also, be aware that the Detailed View page displays inventory data for the owner of the central Amazon S3 bucket used by resource data sync. If you aren't the owner of the central Amazon S3 bucket, then you won't see inventory data on the Detailed View page. Configuring access Before you can query and view data from multiple accounts and Regions on the Detailed View page in the Systems Manager console, you must configure your IAM entity with permission to view the data. If the inventory data is stored in an Amazon S3 bucket that uses AWS Key Management Service (AWS KMS) encryption, you must also configure your IAM entity and the Amazon- GlueServiceRoleForSSM service role for AWS KMS encryption. Topics • Configuring your IAM entity to access the Detailed View page • (Optional) Configure permissions for viewing AWS KMS encrypted data Inventory 398 AWS Systems Manager User Guide Configuring your IAM entity to access the Detailed View page The following describes the minimum permissions required to view inventory data on the Detailed View page. The AWSQuicksightAthenaAccess managed policy The following PassRole and additional required permissions block { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowGlue", "Effect": "Allow", "Action": [ "glue:GetCrawler", "glue:GetCrawlers", "glue:GetTables", "glue:StartCrawler", "glue:CreateCrawler" ], "Resource": "*" }, { "Sid": "iamPassRole", "Effect": "Allow", "Action": "iam:PassRole", "Resource": "*", "Condition": { "StringEquals": { "iam:PassedToService": "glue.amazonaws.com" } } }, { "Sid": "iamRoleCreation", "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:AttachRolePolicy" ], "Resource": "arn:aws:iam::account_ID:role/*" }, Inventory 399 AWS Systems Manager { "Sid": "iamPolicyCreation", "Effect": "Allow", "Action": "iam:CreatePolicy", "Resource": "arn:aws:iam::account_ID:policy/*" } ] } User Guide (Optional) If the Amazon S3 bucket used to store inventory data is encrypted by using AWS KMS, you must also add the following block to the policy. { "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": [ "arn:aws:kms:Region:account_ID:key/key_ARN" ] } To provide access, add permissions to your users, groups, or roles: • Users and groups in AWS IAM Identity Center: Create a permission set. Follow the instructions in Create a permission set in the AWS IAM Identity Center User Guide. • Users managed in IAM through an identity provider: Create a role for identity federation. Follow the instructions in Create a role for a third-party identity provider (federation) in the IAM User Guide. • IAM users: • Create a role that your user can assume. Follow the instructions in Create a role for an IAM user in the IAM User Guide. • (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the instructions in Adding permissions to a user (console) in the IAM User Guide. Inventory 400 AWS Systems Manager User Guide (Optional) Configure permissions for viewing AWS KMS encrypted data If the Amazon S3 bucket used to store inventory data is encrypted by using the AWS Key Management Service (AWS KMS), you must configure your IAM entity and the Amazon- GlueServiceRoleForSSM role with kms:Decrypt permissions for the AWS KMS key. Before you begin To provide the kms:Decrypt permissions for the AWS KMS key, add the following policy block to your IAM entity: { "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": [ "arn:aws:kms:Region:account_ID:key/key_ARN" ] } If you haven't done so already, complete that procedure and
systems-manager-ug-131
systems-manager-ug.pdf
131
Inventory 400 AWS Systems Manager User Guide (Optional) Configure permissions for viewing AWS KMS encrypted data If the Amazon S3 bucket used to store inventory data is encrypted by using the AWS Key Management Service (AWS KMS), you must configure your IAM entity and the Amazon- GlueServiceRoleForSSM role with kms:Decrypt permissions for the AWS KMS key. Before you begin To provide the kms:Decrypt permissions for the AWS KMS key, add the following policy block to your IAM entity: { "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": [ "arn:aws:kms:Region:account_ID:key/key_ARN" ] } If you haven't done so already, complete that procedure and add kms:Decrypt permissions for the AWS KMS key. Use the following procedure to configure the Amazon-GlueServiceRoleForSSM role with kms:Decrypt permissions for the AWS KMS key. To configure the Amazon-GlueServiceRoleForSSM role with kms:Decrypt permissions 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. In the navigation pane, choose Roles, and then use the search field to locate the Amazon- GlueServiceRoleForSSM role. The Summary page opens. 3. Use the search field to find the Amazon-GlueServiceRoleForSSM role. Choose the role name. The Summary page opens. 4. Choose the role name. The Summary page opens. 5. Choose Add inline policy. The Create policy page opens. 6. Choose the JSON tab. 7. Delete the existing JSON text in the editor, and then copy and paste the following policy into the JSON editor. Inventory 401 AWS Systems Manager User Guide { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": [ "arn:aws:kms:Region:account_ID:key/key_ARN" ] } ] } 8. Choose Review policy 9. On the Review Policy page, enter a name in the Name field. 10. Choose Create policy. Querying data on the inventory detailed view page Use the following procedure to view inventory data from multiple AWS Regions and AWS accounts on the Systems Manager Inventory Detailed View page. Important The Inventory Detailed View page is only available in AWS Regions that offer Amazon Athena. If the following tabs aren't displayed on the Systems Manager Inventory page, it means Athena isn't available in the Region and you can't use the Detailed View to query data. Inventory 402 AWS Systems Manager User Guide To view inventory data from multiple Regions and accounts in the AWS Systems Manager console 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Inventory. 3. Choose the Detailed View tab. 4. Choose the resource data sync for which you want to query data. Inventory 403 AWS Systems Manager User Guide 5. In the Inventory Type list, choose the type of inventory data that you want to query, and then press Enter. 6. To filter the data, choose the Filter bar, and then choose a filter option. You can use the Export to CSV button to view the current query set in a spreadsheet application such as Microsoft Excel. You can also use the Query History and Run Advanced Queries buttons to view history details and interact with your data in Amazon Athena. Editing the AWS Glue crawler schedule AWS Glue crawls the inventory data in the central Amazon S3 bucket twice daily, by default. If you frequently change the types of data to collect on your nodes then you might want to crawl the data more frequently, as described in the following procedure. Important AWS Glue charges your AWS account based on an hourly rate, billed by the second, for crawlers (discovering data) and ETL jobs (processing and loading data). Before you change the crawler schedule, view the AWS Glue pricing page. Inventory 404 AWS Systems Manager User Guide To change the inventory data crawler schedule 1. Open the AWS Glue console at https://console.aws.amazon.com/glue/. 2. 3. In the navigation pane, choose Crawlers. In the crawlers list, choose the option next to the Systems Manager Inventory data crawler. The crawler name uses the following format: AWSSystemsManager-s3-bucket-name-Region-account_ID 4. Choose Action, and then choose Edit crawler. 5. 6. In the navigation pane, choose Schedule. In the Cron expression field, specify a new schedule by using a cron format. For more information about the cron format, see Time-Based Schedules for Jobs and Crawlers in the AWS Glue Developer Guide. Important You can pause the crawler to stop incurring charges from AWS Glue. If you pause the crawler, or if you change the frequency so that the data is crawled less often, then the Inventory Detailed View might display data that isn't current. Querying an inventory collection by using filters After you collect inventory data, you can use the filter capabilities in AWS Systems Manager to query a list of managed nodes that meet certain filter criteria. To query nodes based on inventory filters 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Inventory. In the Filter by resource groups, tags or
systems-manager-ug-132
systems-manager-ug.pdf
132
from AWS Glue. If you pause the crawler, or if you change the frequency so that the data is crawled less often, then the Inventory Detailed View might display data that isn't current. Querying an inventory collection by using filters After you collect inventory data, you can use the filter capabilities in AWS Systems Manager to query a list of managed nodes that meet certain filter criteria. To query nodes based on inventory filters 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- 2. 3. manager/. In the navigation pane, choose Inventory. In the Filter by resource groups, tags or inventory types section, choose the filter box. A list of predefined filters is displayed. 4. Choose an attribute to filter on. For example, choose AWS:Application. If prompted, choose a secondary attribute to filter. For example, choose AWS:Application.Name. Inventory 405 AWS Systems Manager User Guide 5. Choose a delimiter from the list. For example, choose Begin with. A text box is displayed in the filter. 6. Enter a value in the text box. For example, enter Amazon (SSM Agent is named Amazon SSM Agent). 7. Press Enter. The system returns a list of managed nodes that include an application name that begins with the word Amazon. Note You can combine multiple filters to refine your search. Aggregating inventory data After you configure your managed nodes for AWS Systems Manager Inventory, you can view aggregated counts of inventory data. For example, say you configured dozens or hundreds of managed nodes to collect the AWS:Application inventory type. By using the information in this section, you can see an exact count of how many nodes are configured to collect this data. You can also see specific inventory details by aggregating on a data type. For example, the AWS:InstanceInformation inventory type collects operating system platform information with the Platform data type. By aggregating data on the Platform data type, you can quickly see how many nodes are running Windows, how many are running Linux, and how many are running macOS. The procedures in this section describe how to view aggregated counts of inventory data by using the AWS Command Line Interface (AWS CLI). You can also view pre-configured aggregated counts in the AWS Systems Manager console on the Inventory page. These pre-configured dashboards are called Inventory Insights and they offer one-click remediation of your inventory configuration issues. Note the following important details about aggregation counts of inventory data: • If you terminate a managed node that is configured to collect inventory data, Systems Manager retains the inventory data for 30 days and then deletes it. For running nodes, the systems deletes inventory data that is older than 30 days. If you need to store inventory data longer than 30 days, you can use AWS Config to record history or periodically query and upload the data to an Amazon Simple Storage Service (Amazon S3) bucket. Inventory 406 AWS Systems Manager User Guide • If a node was previously configured to report a specific inventory data type, for example AWS:Network, and later you change the configuration to stop collecting that type, aggregation counts still show AWS:Network data until the node has been terminated and 30 days have passed. For information about how to quickly configure and collect inventory data from all nodes in a specific AWS account (and any future nodes that might be created in that account), see Inventory all managed nodes in your AWS account. Topics • Aggregating inventory data to see counts of nodes that collect specific types of data • Aggregating inventory data with groups to see which nodes are and aren't configured to collect an inventory type Aggregating inventory data to see counts of nodes that collect specific types of data You can use the AWS Systems Manager GetInventory API operation to view aggregated counts of nodes that collect one or more inventory types and data types. For example, the AWS:InstanceInformation inventory type allows you to view an aggregate of operating systems by using the GetInventory API operation with the AWS:InstanceInformation.PlatformType data type. Here is an example AWS CLI command and output. aws ssm get-inventory --aggregators "Expression=AWS:InstanceInformation.PlatformType" The system returns information like the following. { "Entities":[ { "Data":{ "AWS:InstanceInformation":{ "Content":[ { "Count":"7", "PlatformType":"windows" }, { "Count":"5", Inventory 407 AWS Systems Manager User Guide "PlatformType":"linux" } ] } } } ] } Getting started Determine the inventory types and data types for which you want to view counts. You can view a list of inventory types and data types that support aggregation by running the following command in the AWS CLI. aws ssm get-inventory-schema --aggregator The command returns a JSON list of inventory types and data types that support aggregation. The TypeName field shows supported inventory types. And the Name field shows each data type. For example, in the following list, the AWS:Application
systems-manager-ug-133
systems-manager-ug.pdf
133
"PlatformType":"windows" }, { "Count":"5", Inventory 407 AWS Systems Manager User Guide "PlatformType":"linux" } ] } } } ] } Getting started Determine the inventory types and data types for which you want to view counts. You can view a list of inventory types and data types that support aggregation by running the following command in the AWS CLI. aws ssm get-inventory-schema --aggregator The command returns a JSON list of inventory types and data types that support aggregation. The TypeName field shows supported inventory types. And the Name field shows each data type. For example, in the following list, the AWS:Application inventory type includes data types for Name and Version. { "Schemas": [ { "TypeName": "AWS:Application", "Version": "1.1", "DisplayName": "Application", "Attributes": [ { "DataType": "STRING", "Name": "Name" }, { "DataType": "STRING", "Name": "Version" } ] }, { "TypeName": "AWS:InstanceInformation", "Version": "1.0", Inventory 408 AWS Systems Manager User Guide "DisplayName": "Platform", "Attributes": [ { "DataType": "STRING", "Name": "PlatformName" }, { "DataType": "STRING", "Name": "PlatformType" }, { "DataType": "STRING", "Name": "PlatformVersion" } ] }, { "TypeName": "AWS:ResourceGroup", "Version": "1.0", "DisplayName": "ResourceGroup", "Attributes": [ { "DataType": "STRING", "Name": "Name" } ] }, { "TypeName": "AWS:Service", "Version": "1.0", "DisplayName": "Service", "Attributes": [ { "DataType": "STRING", "Name": "Name" }, { "DataType": "STRING", "Name": "DisplayName" }, { "DataType": "STRING", "Name": "ServiceType" }, Inventory 409 User Guide AWS Systems Manager { "DataType": "STRING", "Name": "Status" }, { "DataType": "STRING", "Name": "StartType" } ] }, { "TypeName": "AWS:WindowsRole", "Version": "1.0", "DisplayName": "WindowsRole", "Attributes": [ { "DataType": "STRING", "Name": "Name" }, { "DataType": "STRING", "Name": "DisplayName" }, { "DataType": "STRING", "Name": "FeatureType" }, { "DataType": "STRING", "Name": "Installed" } ] } ] } You can aggregate data for any of the listed inventory types by creating a command that uses the following syntax. aws ssm get-inventory --aggregators "Expression=InventoryType.DataType" Here are some examples. Inventory 410 AWS Systems Manager Example 1 User Guide This example aggregates a count of the Windows roles used by your nodes. aws ssm get-inventory --aggregators "Expression=AWS:WindowsRole.Name" Example 2 This example aggregates a count of the applications installed on your nodes. aws ssm get-inventory --aggregators "Expression=AWS:Application.Name" Combining multiple aggregators You can also combine multiple inventory types and data types in one command to help you better understand the data. Here are some examples. Example 1 This example aggregates a count of the operating system types used by your nodes. It also returns the specific name of the operating systems. aws ssm get-inventory --aggregators '[{"Expression": "AWS:InstanceInformation.PlatformType", "Aggregators":[{"Expression": "AWS:InstanceInformation.PlatformName"}]}]' Example 2 This example aggregates a count of the applications running on your nodes and the specific version of each application. aws ssm get-inventory --aggregators '[{"Expression": "AWS:Application.Name", "Aggregators":[{"Expression": "AWS:Application.Version"}]}]' If you prefer, you can create an aggregation expression with one or more inventory types and data types in a JSON file and call the file from the AWS CLI. The JSON in the file must use the following syntax. [ { "Expression": "string", Inventory 411 AWS Systems Manager User Guide "Aggregators": [ { "Expression": "string" } ] } ] You must save the file with the .json file extension. Here is an example that uses multiple inventory types and data types. [ { "Expression": "AWS:Application.Name", "Aggregators": [ { "Expression": "AWS:Application.Version", "Aggregators": [ { "Expression": "AWS:InstanceInformation.PlatformType" } ] } ] } ] Use the following command to call the file from the AWS CLI. aws ssm get-inventory --aggregators file://file_name.json The command returns information like the following. {"Entities": [ {"Data": {"AWS:Application": {"Content": [ {"Count": "3", "PlatformType": "linux", "Version": "2.6.5", Inventory 412 AWS Systems Manager User Guide "Name": "audit-libs"}, {"Count": "2", "PlatformType": "windows", "Version": "2.6.5", "Name": "audit-libs"}, {"Count": "4", "PlatformType": "windows", "Version": "6.2.8", "Name": "microsoft office"}, {"Count": "2", "PlatformType": "windows", "Version": "2.6.5", "Name": "chrome"}, {"Count": "1", "PlatformType": "linux", "Version": "2.6.5", "Name": "chrome"}, {"Count": "2", "PlatformType": "linux", "Version": "6.3", "Name": "authconfig"} ] } }, "ResourceType": "ManagedInstance"} ] } Aggregating inventory data with groups to see which nodes are and aren't configured to collect an inventory type Groups in Systems Manager Inventory allow you to quickly see a count of which managed nodes are and aren’t configured to collect one or more inventory types. With groups, you specify one or more inventory types and a filter that uses the exists operator. For example, say that you have four managed nodes configured to collect the following inventory types: • Node 1: AWS:Application • Node 2: AWS:File • Node 3: AWS:Application, AWS:File • Node 4: AWS:Network Inventory 413 AWS Systems Manager User Guide You can run the following command from the AWS CLI to see how many nodes are configured to collect both the AWS:Application and AWS:File inventory types. The response also returns a count of how many nodes aren't configured to collect both of these inventory types. aws ssm get-inventory --aggregators 'Groups=[{Name=ApplicationAndFile,Filters=[{Key=TypeName,Values=[AWS:Application],Type=Exists}, {Key=TypeName,Values=[AWS:File],Type=Exists}]}]' The command response shows that only one managed node is configured to collect both
systems-manager-ug-134
systems-manager-ug.pdf
134
have four managed nodes configured to collect the following inventory types: • Node 1: AWS:Application • Node 2: AWS:File • Node 3: AWS:Application, AWS:File • Node 4: AWS:Network Inventory 413 AWS Systems Manager User Guide You can run the following command from the AWS CLI to see how many nodes are configured to collect both the AWS:Application and AWS:File inventory types. The response also returns a count of how many nodes aren't configured to collect both of these inventory types. aws ssm get-inventory --aggregators 'Groups=[{Name=ApplicationAndFile,Filters=[{Key=TypeName,Values=[AWS:Application],Type=Exists}, {Key=TypeName,Values=[AWS:File],Type=Exists}]}]' The command response shows that only one managed node is configured to collect both the AWS:Application and AWS:File inventory types. { "Entities":[ { "Data":{ "ApplicationAndFile":{ "Content":[ { "notMatchingCount":"3" }, { "matchingCount":"1" } ] } } } ] } Note Groups don't return data type counts. Also, you can't drill-down into the results to see the IDs of nodes that are or aren't configured to collect the inventory type. If you prefer, you can create an aggregation expression with one or more inventory types in a JSON file and call the file from the AWS CLI. The JSON in the file must use the following syntax: { "Aggregators":[ Inventory 414 User Guide AWS Systems Manager { "Groups":[ { "Name":"Name", "Filters":[ { "Key":"TypeName", "Values":[ "Inventory_type" ], "Type":"Exists" }, { "Key":"TypeName", "Values":[ "Inventory_type" ], "Type":"Exists" } ] } ] } ] } You must save the file with the .json file extension. Use the following command to call the file from the AWS CLI. aws ssm get-inventory --cli-input-json file://file_name.json Additional examples The following examples show you how to aggregate inventory data to see which managed nodes are and aren't configured to collect the specified inventory types. These examples use the AWS CLI. Each example includes a full command with filters that you can run from the command line and a sample input.json file if you prefer to enter the information in a file. Example 1 This example aggregates a count of nodes that are and aren't configured to collect either the AWS:Application or the AWS:File inventory types. Inventory 415 AWS Systems Manager User Guide Run the following command from the AWS CLI. aws ssm get-inventory --aggregators 'Groups=[{Name=ApplicationORFile,Filters=[{Key=TypeName,Values=[AWS:Application, AWS:File],Type=Exists}]}]' If you prefer to use a file, copy and paste the following sample into a file and save it as input.json. { "Aggregators":[ { "Groups":[ { "Name":"ApplicationORFile", "Filters":[ { "Key":"TypeName", "Values":[ "AWS:Application", "AWS:File" ], "Type":"Exists" } ] } ] } ] } Run the following command from the AWS CLI. aws ssm get-inventory --cli-input-json file://input.json The command returns information like the following. { "Entities":[ { "Data":{ "ApplicationORFile":{ Inventory 416 AWS Systems Manager User Guide "Content":[ { "notMatchingCount":"1" }, { "matchingCount":"3" } ] } } } ] } Example 2 This example aggregates a count of nodes that are and aren't configured to collect the AWS:Application, AWS:File, and AWS:Network inventory types. Run the following command from the AWS CLI. aws ssm get-inventory --aggregators 'Groups=[{Name=Application,Filters=[{Key=TypeName,Values=[AWS:Application],Type=Exists}]}, {Name=File,Filters=[{Key=TypeName,Values=[AWS:File],Type=Exists}]}, {Name=Network,Filters=[{Key=TypeName,Values=[AWS:Network],Type=Exists}]}]' If you prefer to use a file, copy and paste the following sample into a file and save it as input.json. { "Aggregators":[ { "Groups":[ { "Name":"Application", "Filters":[ { "Key":"TypeName", "Values":[ "AWS:Application" ], "Type":"Exists" } ] Inventory 417 User Guide AWS Systems Manager }, { "Name":"File", "Filters":[ { "Key":"TypeName", "Values":[ "AWS:File" ], "Type":"Exists" } ] }, { "Name":"Network", "Filters":[ { "Key":"TypeName", "Values":[ "AWS:Network" ], "Type":"Exists" } ] } ] } ] } Run the following command from the AWS CLI. aws ssm get-inventory --cli-input-json file://input.json The command returns information like the following. { "Entities":[ { "Data":{ "Application":{ "Content":[ { Inventory 418 AWS Systems Manager User Guide "notMatchingCount":"2" }, { "matchingCount":"2" } ] }, "File":{ "Content":[ { "notMatchingCount":"2" }, { "matchingCount":"2" } ] }, "Network":{ "Content":[ { "notMatchingCount":"3" }, { "matchingCount":"1" } ] } } } ] } Working with custom inventory You can assign any metadata you want to your nodes by creating AWS Systems Manager Inventory custom inventory. For example, let's say you manage a large number of servers in racks in your data center, and these servers have been configured as Systems Manager managed nodes. Currently, you store information about server rack location in a spreadsheet. With custom inventory, you can specify the rack location of each node as metadata on the node. When you collect inventory by using Systems Manager, the metadata is collected with other inventory metadata. You can then port all inventory metadata to a central Amazon S3 bucket by using resource data sync and query the data. Inventory 419 AWS Systems Manager Note User Guide Systems Manager supports a maximum of 20 custom inventory types per AWS account. To assign custom inventory to a node, you can either use the Systems Manager PutInventory API operation, as described in Assigning custom inventory metadata to a managed node. Or, you can create a custom inventory JSON file and upload it
systems-manager-ug-135
systems-manager-ug.pdf
135
node. When you collect inventory by using Systems Manager, the metadata is collected with other inventory metadata. You can then port all inventory metadata to a central Amazon S3 bucket by using resource data sync and query the data. Inventory 419 AWS Systems Manager Note User Guide Systems Manager supports a maximum of 20 custom inventory types per AWS account. To assign custom inventory to a node, you can either use the Systems Manager PutInventory API operation, as described in Assigning custom inventory metadata to a managed node. Or, you can create a custom inventory JSON file and upload it to the node. This section describes how to create the JSON file. The following example JSON file with custom inventory specifies rack information about an on-premises server. This examples specifies one type of custom inventory data ("TypeName": "Custom:RackInformation"), with multiple entries under Content that describe the data. { "SchemaVersion": "1.0", "TypeName": "Custom:RackInformation", "Content": { "Location": "US-EAST-02.CMH.RACK1", "InstalledTime": "2016-01-01T01:01:01Z", "vendor": "DELL", "Zone" : "BJS12", "TimeZone": "UTC-8" } } You can also specify distinct entries in the Content section, as shown in the following example. { "SchemaVersion": "1.0", "TypeName": "Custom:PuppetModuleInfo", "Content": [{ "Name": "puppetlabs/aws", "Version": "1.0" }, { "Name": "puppetlabs/dsc", "Version": "2.0" } ] } Inventory 420 AWS Systems Manager User Guide The JSON schema for custom inventory requires SchemaVersion, TypeName, and Content sections, but you can define the information in those sections. { "SchemaVersion": "user_defined", "TypeName": "Custom:user_defined", "Content": { "user_defined_attribute1": "user_defined_value1", "user_defined_attribute2": "user_defined_value2", "user_defined_attribute3": "user_defined_value3", "user_defined_attribute4": "user_defined_value4" } } The value of TypeName is limited to 100 characters. Also, the TypeName value must begin with the capitalized word Custom. For example, Custom:PuppetModuleInfo. Therefore, the following examples would result in an exception: CUSTOM:PuppetModuleInfo, custom:PuppetModuleInfo. The Content section includes attributes and data. These items aren't case-sensitive. However, if you define an attribute (for example: "Vendor": "DELL"), then you must consistently reference this attribute in your custom inventory files. If you specify "Vendor": "DELL" (using a capital “V” in vendor) in one file, and then you specify "vendor": "DELL" (using a lowercase “v” in vendor) in another file, the system returns an error. Note You must save the file with a .json extension and the inventory you define must consist only of string values. After you create the file, you must save it on the node. The following table shows the location where custom inventory JSON files must be stored on the node. Operating system Path Linux Inventory /var/lib/amazon/ssm/node-id/inventory/ custom 421 AWS Systems Manager User Guide Operating system Path macOS Windows /opt/aws/ssm/data/ node-id/ inventory/custom %SystemDrive%\ProgramData\Amazon\SSM \InstanceData\node-id\inventory\custom For an example of how to use custom inventory, see Get Disk Utilization of Your Fleet Using EC2 Systems Manager Custom Inventory Types. Deleting custom inventory You can use the DeleteInventory API operation to delete a custom inventory type and the data associated with that type. You call the delete-inventory command by using the AWS Command Line Interface (AWS CLI) to delete all data for an inventory type. You call the delete-inventory command with the SchemaDeleteOption to delete a custom inventory type. Note An inventory type is also called an inventory schema. The SchemaDeleteOption parameter includes the following options: • DeleteSchema: This option deletes the specified custom type and all data associated with it. You can recreate the schema later, if you want. • DisableSchema: If you choose this option, the system turns off the current version, deletes all data for it, and ignores all new data if the version is less than or equal to the turned off version. You can allow this inventory type again by calling the PutInventory action for a version greater than the turned off version. To delete or turn off custom inventory by using the 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. Inventory 422 AWS Systems Manager User Guide 2. Run the following command to use the dry-run option to see which data will be deleted from the system. This command doesn't delete any data. aws ssm delete-inventory --type-name "Custom:custom_type_name" --dry-run The system returns information like the following. { "DeletionSummary":{ "RemainingCount":3, "SummaryItems":[ { "Count":2, "RemainingCount":2, "Version":"1.0" }, { "Count":1, "RemainingCount":1, "Version":"2.0" } ], "TotalCount":3 }, "TypeName":"Custom:custom_type_name" } For information about how to understand the delete inventory summary, see Understanding the delete inventory summary. 3. Run the following command to delete all data for a custom inventory type. aws ssm delete-inventory --type-name "Custom:custom_type_name" Note The output of this command doesn't show the deletion progress. For this reason, TotalCount and Remaining Count are always the same because the system hasn't deleted anything yet. You can use the describe-inventory-deletions command to show the deletion progress, as described later in this topic. Inventory 423 AWS Systems Manager User Guide The system returns information
systems-manager-ug-136
systems-manager-ug.pdf
136
"RemainingCount":1, "Version":"2.0" } ], "TotalCount":3 }, "TypeName":"Custom:custom_type_name" } For information about how to understand the delete inventory summary, see Understanding the delete inventory summary. 3. Run the following command to delete all data for a custom inventory type. aws ssm delete-inventory --type-name "Custom:custom_type_name" Note The output of this command doesn't show the deletion progress. For this reason, TotalCount and Remaining Count are always the same because the system hasn't deleted anything yet. You can use the describe-inventory-deletions command to show the deletion progress, as described later in this topic. Inventory 423 AWS Systems Manager User Guide The system returns information like the following. { "DeletionId":"system_generated_deletion_ID", "DeletionSummary":{ "RemainingCount":3, "SummaryItems":[ { "Count":2, "RemainingCount":2, "Version":"1.0" }, { "Count":1, "RemainingCount":1, "Version":"2.0" } ], "TotalCount":3 }, "TypeName":"custom_type_name" } The system deletes all data for the specified custom inventory type from the Systems Manager Inventory service. 4. Run the following command. The command performs the following actions for the current version of the inventory type: turns off the current version, deletes all data for it, and ignores all new data if the version is less than or equal to the turned off version. aws ssm delete-inventory --type-name "Custom:custom_type_name" --schema-delete- option "DisableSchema" The system returns information like the following. { "DeletionId":"system_generated_deletion_ID", "DeletionSummary":{ "RemainingCount":3, "SummaryItems":[ Inventory 424 User Guide AWS Systems Manager { "Count":2, "RemainingCount":2, "Version":"1.0" }, { "Count":1, "RemainingCount":1, "Version":"2.0" } ], "TotalCount":3 }, "TypeName":"Custom:custom_type_name" } You can view a turned off inventory type by using the following command. aws ssm get-inventory-schema --type-name Custom:custom_type_name 5. Run the following command to delete an inventory type. aws ssm delete-inventory --type-name "Custom:custom_type_name" --schema-delete- option "DeleteSchema" The system deletes the schema and all inventory data for the specified custom type. The system returns information like the following. { "DeletionId":"system_generated_deletion_ID", "DeletionSummary":{ "RemainingCount":3, "SummaryItems":[ { "Count":2, "RemainingCount":2, "Version":"1.0" }, { "Count":1, "RemainingCount":1, Inventory 425 AWS Systems Manager User Guide "Version":"2.0" } ], "TotalCount":3 }, "TypeName":"Custom:custom_type_name" } Viewing the deletion status You can check the status of a delete operation by using the describe-inventory-deletions AWS CLI command. You can specify a deletion ID to view the status of a specific delete operation. Or, you can omit the deletion ID to view a list of all deletions run in the last 30 days. 1. Run the following command to view the status of a deletion operation. The system returned the deletion ID in the delete-inventory summary. aws ssm describe-inventory-deletions --deletion-id system_generated_deletion_ID The system returns the latest status. The delete operation might not be finished yet. The system returns information like the following. {"InventoryDeletions": [ {"DeletionId": "system_generated_deletion_ID", "DeletionStartTime": 1521744844, "DeletionSummary": {"RemainingCount": 1, "SummaryItems": [ {"Count": 1, "RemainingCount": 1, "Version": "1.0"} ], "TotalCount": 1}, "LastStatus": "InProgress", "LastStatusMessage": "The Delete is in progress", "LastStatusUpdateTime": 1521744844, "TypeName": "Custom:custom_type_name"} ] Inventory 426 AWS Systems Manager } User Guide If the delete operation is successful, the LastStatusMessage states: Deletion is successful. {"InventoryDeletions": [ {"DeletionId": "system_generated_deletion_ID", "DeletionStartTime": 1521744844, "DeletionSummary": {"RemainingCount": 0, "SummaryItems": [ {"Count": 1, "RemainingCount": 0, "Version": "1.0"} ], "TotalCount": 1}, "LastStatus": "Complete", "LastStatusMessage": "Deletion is successful", "LastStatusUpdateTime": 1521745253, "TypeName": "Custom:custom_type_name"} ] } 2. Run the following command to view a list of all deletions run in the last 30 days. aws ssm describe-inventory-deletions --max-results a number {"InventoryDeletions": [ {"DeletionId": "system_generated_deletion_ID", "DeletionStartTime": 1521682552, "DeletionSummary": {"RemainingCount": 0, "SummaryItems": [ {"Count": 1, "RemainingCount": 0, "Version": "1.0"} ], "TotalCount": 1}, Inventory 427 AWS Systems Manager User Guide "LastStatus": "Complete", "LastStatusMessage": "Deletion is successful", "LastStatusUpdateTime": 1521682852, "TypeName": "Custom:custom_type_name"}, {"DeletionId": "system_generated_deletion_ID", "DeletionStartTime": 1521744844, "DeletionSummary": {"RemainingCount": 0, "SummaryItems": [ {"Count": 1, "RemainingCount": 0, "Version": "1.0"} ], "TotalCount": 1}, "LastStatus": "Complete", "LastStatusMessage": "Deletion is successful", "LastStatusUpdateTime": 1521745253, "TypeName": "Custom:custom_type_name"}, {"DeletionId": "system_generated_deletion_ID", "DeletionStartTime": 1521680145, "DeletionSummary": {"RemainingCount": 0, "SummaryItems": [ {"Count": 1, "RemainingCount": 0, "Version": "1.0"} ], "TotalCount": 1}, "LastStatus": "Complete", "LastStatusMessage": "Deletion is successful", "LastStatusUpdateTime": 1521680471, "TypeName": "Custom:custom_type_name"} ], "NextToken": "next-token" Understanding the delete inventory summary To help you understand the contents of the delete inventory summary, consider the following example. A user assigned Custom:RackSpace inventory to three nodes. Inventory items 1 and 2 use Inventory 428 AWS Systems Manager User Guide custom type version 1.0 ("SchemaVersion":"1.0"). Inventory item 3 uses custom type version 2.0 ("SchemaVersion":"2.0"). RackSpace custom inventory 1 { "CaptureTime":"2018-02-19T10:48:55Z", "TypeName":"CustomType:RackSpace", "InstanceId":"i-1234567890", "SchemaVersion":"1.0" "Content":[ { content of custom type omitted } ] } RackSpace custom inventory 2 { "CaptureTime":"2018-02-19T10:48:55Z", "TypeName":"CustomType:RackSpace", "InstanceId":"i-1234567891", "SchemaVersion":"1.0" "Content":[ { content of custom type omitted } ] } RackSpace custom inventory 3 { "CaptureTime":"2018-02-19T10:48:55Z", "TypeName":"CustomType:RackSpace", "InstanceId":"i-1234567892", "SchemaVersion":"2.0" "Content":[ { content of custom type omitted } ] } Inventory 429 AWS Systems Manager User Guide The user runs the following command to preview which data will be deleted. aws ssm delete-inventory --type-name "Custom:RackSpace" --dry-run The system returns information like the following. { "DeletionId":"1111-2222-333-444-66666", "DeletionSummary":{ "RemainingCount":3, "TotalCount":3, TotalCount and RemainingCount are the number of items that would be deleted if this was not a dry run. These numbers are the same because the system didn't
systems-manager-ug-137
systems-manager-ug.pdf
137
{ "CaptureTime":"2018-02-19T10:48:55Z", "TypeName":"CustomType:RackSpace", "InstanceId":"i-1234567891", "SchemaVersion":"1.0" "Content":[ { content of custom type omitted } ] } RackSpace custom inventory 3 { "CaptureTime":"2018-02-19T10:48:55Z", "TypeName":"CustomType:RackSpace", "InstanceId":"i-1234567892", "SchemaVersion":"2.0" "Content":[ { content of custom type omitted } ] } Inventory 429 AWS Systems Manager User Guide The user runs the following command to preview which data will be deleted. aws ssm delete-inventory --type-name "Custom:RackSpace" --dry-run The system returns information like the following. { "DeletionId":"1111-2222-333-444-66666", "DeletionSummary":{ "RemainingCount":3, "TotalCount":3, TotalCount and RemainingCount are the number of items that would be deleted if this was not a dry run. These numbers are the same because the system didn't delete anything. "SummaryItems":[ { "Count":2, The system found two items that use SchemaVersion 1.0. Neither item was deleted. "RemainingCount":2, "Version":"1.0" }, { "Count":1, The system found one item that uses SchemaVersion 1.0. This item was not deleted. "RemainingCount":1, "Version":"2.0" } ], }, "TypeName":"Custom:RackSpace" } The user runs the following command to delete the Custom:RackSpace inventory. Note The output of this command doesn't show the deletion progress. For this reason, TotalCount and RemainingCount are always the same because the system hasn't deleted anything yet. You can use the describe-inventory-deletions command to show the deletion progress. Inventory 430 AWS Systems Manager User Guide aws ssm delete-inventory --type-name "Custom:RackSpace" The system returns information like the following. { "DeletionId":"1111-2222-333-444-7777777", "DeletionSummary":{ "RemainingCount":3, There are three items to delete "SummaryItems":[ { "Count":2, The system found two items that use SchemaVersion 1.0. "RemainingCount":2, "Version":"1.0" }, { "Count":1, The system found one item that uses SchemaVersion 2.0. "RemainingCount":1, "Version":"2.0" } ], "TotalCount":3 }, "TypeName":"RackSpace" } Viewing inventory delete actions in EventBridge You can configure Amazon EventBridge to create an event anytime a user deletes custom inventory. EventBridge offers three types of events for custom inventory delete operations: • Delete action for an instance: If the custom inventory for a specific managed node was successfully deleted or not. • Delete action summary: A summary of the delete action. • Warning for turned off custom inventory type: A warning event if a user called the PutInventory API operation for a custom inventory type version that was previously turned off. Here are examples of each event. Inventory 431 User Guide AWS Systems Manager Delete action for an instance { "version":"0", "id":"998c9cde-56c0-b38b-707f-0411b3ff9d11", "detail-type":"Inventory Resource State Change", "source":"aws.ssm", "account":"478678815555", "time":"2018-05-24T22:24:34Z", "region":"us-east-1", "resources":[ "arn:aws:ssm:us-east-1:478678815555:managed-instance/i-0a5feb270fc3f0b97" ], "detail":{ "action-status":"succeeded", "action":"delete", "resource-type":"managed-instance", "resource-id":"i-0a5feb270fc3f0b97", "action-reason":"", "type-name":"Custom:MyInfo" } } Delete action summary { "version":"0", "id":"83898300-f576-5181-7a67-fb3e45e4fad4", "detail-type":"Inventory Resource State Change", "source":"aws.ssm", "account":"478678815555", "time":"2018-05-24T22:28:25Z", "region":"us-east-1", "resources":[ ], "detail":{ "action-status":"succeeded", "action":"delete-summary", "resource-type":"managed-instance", "resource-id":"", Inventory 432 AWS Systems Manager User Guide "action-reason":"The delete for type name Custom:MyInfo was completed. The deletion summary is: {\"totalCount\":2,\"remainingCount\":0,\"summaryItems\": [{\"version\":\"1.0\",\"count\":2,\"remainingCount\":0}]}", "type-name":"Custom:MyInfo" } } Warning for turned off custom inventory type { "version":"0", "id":"49c1855c-9c57-b5d7-8518-b64aeeef5e4a", "detail-type":"Inventory Resource State Change", "source":"aws.ssm", "account":"478678815555", "time":"2018-05-24T22:46:58Z", "region":"us-east-1", "resources":[ "arn:aws:ssm:us-east-1:478678815555:managed-instance/i-0ee2d86a2cfc371f6" ], "detail":{ "action-status":"failed", "action":"put", "resource-type":"managed-instance", "resource-id":"i-0ee2d86a2cfc371f6", "action-reason":"The inventory item with type name Custom:MyInfo was sent with a disabled schema version 1.0. You must send a version greater than 1.0", "type-name":"Custom:MyInfo" } } Use the following procedure to create an EventBridge rule for custom inventory delete operations. This procedure shows you how to create a rule that sends notifications for custom inventory delete operations to an Amazon SNS topic. Before you begin, verify that you have an Amazon SNS topic, or create a new one. For more information, see Getting Started in the Amazon Simple Notification Service Developer Guide. To configure EventBridge for delete inventory operations 1. Open the Amazon EventBridge console at https://console.aws.amazon.com/events/. 2. In the navigation pane, choose Rules. Inventory 433 AWS Systems Manager 3. Choose Create rule. 4. Enter a name and description for the rule. User Guide A rule can't have the same name as another rule in the same 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 Inventory. 13. For Specific detail type(s), choose Inventory Resource State Change. 14. Choose Next. 15. For Target types, choose AWS service. 16. For Select a target, choose SNS topic, and then for Topic, choose your topic. 17. In the Additional settings section, for Configure target input, verify that Matched event is selected. 18. Choose Next. 19. (Optional) Enter one or more tags for the rule. For more information, see Tagging Your Amazon EventBridge Resources in the Amazon EventBridge
systems-manager-ug-138
systems-manager-ug.pdf
138
Event pattern form. 10. For Event source, choose AWS services. 11. For AWS service, choose Systems Manager. 12. For Event type, choose Inventory. 13. For Specific detail type(s), choose Inventory Resource State Change. 14. Choose Next. 15. For Target types, choose AWS service. 16. For Select a target, choose SNS topic, and then for Topic, choose your topic. 17. In the Additional settings section, for Configure target input, verify that Matched event is selected. 18. Choose Next. 19. (Optional) Enter one or more tags for the rule. For more information, see Tagging Your Amazon EventBridge Resources in the Amazon EventBridge User Guide. 20. Choose Next. 21. Review the details of the rule and choose Create rule. Viewing inventory history and change tracking You can view AWS Systems Manager Inventory history and change tracking for all of your managed nodes by using AWS Config. AWS Config provides a detailed view of the configuration of AWS Inventory 434 AWS Systems Manager User Guide 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 inventory history and change tracking, you must turn on the following resources in AWS Config: • SSM:ManagedInstanceInventory • SSM:PatchCompliance • SSM:AssociationCompliance • SSM:FileData Note Note the following important details about Inventory history and change tracking: • If you use AWS Config to track changes in your system, you must configure Systems Manager Inventory to collect AWS:File metadata so that you can view file changes in AWS Config (SSM:FileData). If you don't, then AWS Config doesn't track file changes on your system. • By turning on SSM:PatchCompliance and SSM:AssociationCompliance, you can view Systems Manager Patch Manager patching and Systems Manager State Manager association compliance history and change tracking. For more information about compliance management for these resources, see Learn details about Compliance. The following procedure describes how to turn on inventory history and change-track recording in AWS Config by using the AWS Command Line Interface (AWS CLI). For more information about how to choose and configure these resources in AWS Config, see Selecting Which Resources AWS Config Records in the AWS Config Developer Guide. For information about AWS Config pricing, see Pricing. Before you begin AWS Config requires AWS Identity and Access Management (IAM) permissions to get configuration details about Systems Manager resources. In the following procedure, you must specify an Amazon Resource Name (ARN) for an IAM role that gives AWS Config permission to Systems Manager resources. You can attach the AWS_ConfigRole managed policy to the IAM role that you assign to AWS Config. For more information about this role, see AWS managed policy: AWS_ConfigRole in the AWS Config Developer Guide. For information about how to create an IAM role and assign the Inventory 435 AWS Systems Manager User Guide AWS_ConfigRole managed policy to that role, see Creating a role to delegate permissions to an AWS service in the IAM User Guide. To turn on inventory history and change-track recording in AWS Config 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. Copy and paste the following JSON sample into a simple text file and save it as recordingGroup.json. { "allSupported":false, "includeGlobalResourceTypes":false, "resourceTypes":[ "AWS::SSM::AssociationCompliance", "AWS::SSM::PatchCompliance", "AWS::SSM::ManagedInstanceInventory", "AWS::SSM::FileData" ] } 3. Run the following command to load the recordingGroup.json file into AWS Config. aws configservice put-configuration-recorder --configuration-recorder name=myRecorder,roleARN=arn:aws:iam::123456789012:role/myConfigRole --recording- group file://recordingGroup.json 4. Run the following command to start recording inventory history and change tracking. aws configservice start-configuration-recorder --configuration-recorder- name myRecorder After you configure history and change tracking, you can drill down into the history for a specific managed node by choosing the AWS Config button in the Systems Manager console. You can access the AWS Config button from either the Managed Instances page or the Inventory page. Depending on your monitor size, you might need to scroll to the right side of the page to see the button. Inventory 436 AWS Systems Manager User Guide Stopping data collection and deleting inventory data If you no longer want to use AWS Systems Manager Inventory to view metadata about your AWS resources, you can stop data collection and delete data that has already been collected. This section includes the following information. Topics • Stopping data collection • Deleting an Inventory resource data sync Stopping data collection When you initially configure Systems Manager to collect inventory data, the system creates a State Manager association that defines the schedule and the resources from which to collect metadata. You can stop data collection by deleting any State Manager associations that use the AWS-GatherSoftwareInventory document. To delete an Inventory association 1. Open the AWS Systems Manager console at
systems-manager-ug-139
systems-manager-ug.pdf
139
Inventory to view metadata about your AWS resources, you can stop data collection and delete data that has already been collected. This section includes the following information. Topics • Stopping data collection • Deleting an Inventory resource data sync Stopping data collection When you initially configure Systems Manager to collect inventory data, the system creates a State Manager association that defines the schedule and the resources from which to collect metadata. You can stop data collection by deleting any State Manager associations that use the AWS-GatherSoftwareInventory document. To delete an Inventory association 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose State Manager. 3. Choose an association that uses the AWS-GatherSoftwareInventory document and then choose Delete. 4. Repeat step three for any remaining associations that use the AWS- GatherSoftwareInventory document. Deleting an Inventory resource data sync If you no longer want to use AWS Systems Manager Inventory to view metadata about your AWS resources, then we also recommend deleting resource data syncs used for inventory data collection. To delete an Inventory resource data sync 1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems- manager/. 2. In the navigation pane, choose Inventory. Inventory 437 AWS Systems Manager 3. Choose Resource Data Syncs. 4. Choose a sync in the list. Important User Guide Make sure you choose the sync used for Inventory. 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 Compliance. 5. Choose Delete 6. Repeat these steps for any remaining resource data syncs you want to delete. 7. Delete the Amazon Simple Storage Service (Amazon S3) bucket where the data was stored. For information about deleting an Amazon S3 bucket, see Deleting a bucket. Assigning custom inventory metadata to a managed node The following procedure walks you through the process of using the AWS Systems Manager PutInventory API operation to assign custom inventory metadata to a managed node. This example assigns rack location information to a node. For more information about custom inventory, see Working with custom inventory. To assign custom inventory metadata to a node 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 rack location information to a node. Linux aws ssm put-inventory --instance-id "ID" --items '[{"CaptureTime": "2016-08-22T10:01:01Z", "TypeName": "Custom:RackInfo", "Content":[{"RackLocation": "Bay B/Row C/Rack D/Shelf E"}], "SchemaVersion": "1.0"}]' Windows Inventory 438 AWS Systems Manager User Guide aws ssm put-inventory --instance-id "ID" --items "TypeName=Custom:RackInfo,SchemaVersion=1.0,CaptureTime=2021-05-22T10:01:01Z,Content=[{RackLocation='Bay B/Row C/Rack D/Shelf F'}]" 3. Run the following command to view custom inventory entries for this node. aws ssm list-inventory-entries --instance-id ID --type-name "Custom:RackInfo" The system responds with information like the following. { "InstanceId": "ID", "TypeName": "Custom:RackInfo", "Entries": [ { "RackLocation": "Bay B/Row C/Rack D/Shelf E" } ], "SchemaVersion": "1.0", "CaptureTime": "2016-08-22T10:01:01Z" } 4. Run the following command to view the custom inventory schema. aws ssm get-inventory-schema --type-name Custom:RackInfo The system responds with information like the following. { "Schemas": [ { "TypeName": "Custom:RackInfo", "Version": "1.0", "Attributes": [ { "DataType": "STRING", "Name": "RackLocation" } ] } ] Inventory 439 AWS Systems Manager } User Guide Using the AWS CLI to configure inventory data collection The following procedures walk you through the process of configuring AWS Systems Manager Inventory to collect metadata from your managed nodes. When you configure inventory collection, you start by creating a Systems Manager State Manager association. Systems Manager collects the inventory data when the association is run. If you don't create the association first, and attempt to invoke the aws:softwareInventory plugin by using, for example, Systems Manager Run Command, the system returns the following error: The aws:softwareInventory plugin can only be invoked via ssm-associate. Note A node can have only one inventory association configured at a time. If you configure a node with two or more inventory associations, the association doesn't run and no inventory data is collected. Quickly configure all of your managed nodes for Inventory (CLI) You can quickly configure all managed nodes in your AWS account and in the current Region to collect inventory data. This is called creating a global inventory association. To create a global inventory association by using the AWS CLI, use the wildcard option for the instanceIds value, as shown in the following procedure. To configure inventory for all managed nodes in your AWS account and in the current Region (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. Linux & macOS aws ssm create-association \ --name AWS-GatherSoftwareInventory \ Inventory 440 AWS Systems Manager User Guide --targets Key=InstanceIds,Values=* \
systems-manager-ug-140
systems-manager-ug.pdf
140
creating a global inventory association. To create a global inventory association by using the AWS CLI, use the wildcard option for the instanceIds value, as shown in the following procedure. To configure inventory for all managed nodes in your AWS account and in the current Region (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. Linux & macOS aws ssm create-association \ --name AWS-GatherSoftwareInventory \ Inventory 440 AWS Systems Manager User Guide --targets Key=InstanceIds,Values=* \ --schedule-expression "rate(1 day)" \ --parameters applications=Enabled,awsComponents=Enabled,customInventory=Enabled,instanceDetailedInformation=Enabled,networkConfig=Enabled,services=Enabled,windowsRoles=Enabled,windowsUpdates=Enabled Windows aws ssm create-association ^ --name AWS-GatherSoftwareInventory ^ --targets Key=InstanceIds,Values=* ^ --schedule-expression "rate(1 day)" ^ --parameters applications=Enabled,awsComponents=Enabled,customInventory=Enabled,instanceDetailedInformation=Enabled,networkConfig=Enabled,services=Enabled,windowsRoles=Enabled,windowsUpdates=Enabled Note This command doesn't allow Inventory to collect metadata for the Windows Registry or files. To inventory these datatypes, use the next procedure. Manually configuring Inventory on your managed nodes (CLI) Use the following procedure to manually configure AWS Systems Manager Inventory on your managed nodes by using node IDs or tags. To manually configure your managed nodes for inventory (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 create a State Manager association that runs Systems Manager Inventory on the node. Replace each example resource placeholder with your own information. This command configures the service to run every six hours and to collect network configuration, Windows Update, and application metadata from a node. Linux & macOS aws ssm create-association \ --name "AWS-GatherSoftwareInventory" \ --targets "Key=instanceids,Values=an_instance_ID" \ Inventory 441 AWS Systems Manager User Guide --schedule-expression "rate(240 minutes)" \ --output-location "{ \"S3Location\": { \"OutputS3Region\": \"region_ID, for example us-east-2\", \"OutputS3BucketName\": \"amzn-s3-demo-bucket\", \"OutputS3KeyPrefix\": \"Test\" } }" \ --parameters "networkConfig=Enabled,windowsUpdates=Enabled,applications=Enabled" Windows aws ssm create-association ^ --name "AWS-GatherSoftwareInventory" ^ --targets "Key=instanceids,Values=an_instance_ID" ^ --schedule-expression "rate(240 minutes)" ^ --output-location "{ \"S3Location\": { \"OutputS3Region\": \"region_ID, for example us-east-2\", \"OutputS3BucketName\": \"amzn-s3-demo-bucket\", \"OutputS3KeyPrefix\": \"Test\" } }" ^ --parameters "networkConfig=Enabled,windowsUpdates=Enabled,applications=Enabled" The system responds with information like the following. { "AssociationDescription": { "ScheduleExpression": "rate(240 minutes)", "OutputLocation": { "S3Location": { "OutputS3KeyPrefix": "Test", "OutputS3BucketName": "Test bucket", "OutputS3Region": "us-east-2" } }, "Name": "The name you specified", "Parameters": { "applications": [ "Enabled" ], "networkConfig": [ "Enabled" ], "windowsUpdates": [ "Enabled" ] }, "Overview": { Inventory 442 AWS Systems Manager User Guide "Status": "Pending", "DetailedStatus": "Creating" }, "AssociationId": "1a2b3c4d5e6f7g-1a2b3c-1a2b3c-1a2b3c-1a2b3c4d5e6f7g", "DocumentVersion": "$DEFAULT", "LastUpdateAssociationDate": 1480544990.06, "Date": 1480544990.06, "Targets": [ { "Values": [ "i-02573cafcfEXAMPLE" ], "Key": "InstanceIds" } ] } } You can target large groups of nodes by using the Targets parameter with EC2 tags. See the following example. Linux & macOS aws ssm create-association \ --name "AWS-GatherSoftwareInventory" \ --targets "Key=tag:Environment,Values=Production" \ --schedule-expression "rate(240 minutes)" \ --output-location "{ \"S3Location\": { \"OutputS3Region\": \"us-east-2\", \"OutputS3BucketName\": \"amzn-s3-demo-bucket\", \"OutputS3KeyPrefix\": \"Test \" } }" \ --parameters "networkConfig=Enabled,windowsUpdates=Enabled,applications=Enabled" Windows aws ssm create-association ^ --name "AWS-GatherSoftwareInventory" ^ --targets "Key=tag:Environment,Values=Production" ^ --schedule-expression "rate(240 minutes)" ^ --output-location "{ \"S3Location\": { \"OutputS3Region\": \"us-east-2\", \"OutputS3BucketName\": \"amzn-s3-demo-bucket\", \"OutputS3KeyPrefix\": \"Test \" } }" ^ --parameters "networkConfig=Enabled,windowsUpdates=Enabled,applications=Enabled" Inventory 443 AWS Systems Manager User Guide You can also inventory files and Windows Registry keys on a Windows Server node by using the files and windowsRegistry inventory types with expressions. For more information about these inventory types, see Working with file and Windows registry inventory. Linux & macOS aws ssm create-association \ --name "AWS-GatherSoftwareInventory" \ --targets "Key=instanceids,Values=i-0704358e3a3da9eb1" \ --schedule-expression "rate(240 minutes)" \ --parameters '{"files":["[{\"Path\": \"C:\\Program Files\", \"Pattern\": [\"*.exe\"], \"Recursive\": true}]"], "windowsRegistry": ["[{\"Path\": \"HKEY_LOCAL_MACHINE\\Software\\Amazon\", \"Recursive\":true}]"]}' \ --profile dev-pdx Windows aws ssm create-association ^ --name "AWS-GatherSoftwareInventory" ^ --targets "Key=instanceids,Values=i-0704358e3a3da9eb1" ^ --schedule-expression "rate(240 minutes)" ^ --parameters '{"files":["[{\"Path\": \"C:\\Program Files\", \"Pattern\": [\"*.exe\"], \"Recursive\": true}]"], "windowsRegistry": ["[{\"Path\": \"HKEY_LOCAL_MACHINE\\Software\\Amazon\", \"Recursive\":true}]"]}' ^ --profile dev-pdx 3. Run the following command to view the association status. aws ssm describe-instance-associations-status --instance-id an_instance_ID The system responds with information like the following. { "InstanceAssociationStatusInfos": [ { "Status": "Pending", "DetailedStatus": "Associated", "Name": "reInvent2016PolicyDocumentTest", "InstanceId": "i-1a2b3c4d5e6f7g", "AssociationId": "1a2b3c4d5e6f7g-1a2b3c-1a2b3c-1a2b3c-1a2b3c4d5e6f7g", Inventory 444 AWS Systems Manager User Guide "DocumentVersion": "1" } ] } Walkthrough: Using resource data sync to aggregate inventory data The following walkthrough describes how to create a resource data sync configuration for AWS Systems Manager Inventory by using the AWS Command Line Interface (AWS CLI). A resource data sync automatically ports inventory data from all of your managed nodes to a central Amazon Simple Storage Service (Amazon S3) bucket. The sync automatically updates the data in the central Amazon S3 bucket whenever new inventory data is discovered. This walkthrough also describes how to use Amazon Athena and Amazon QuickSight to query and analyze the aggregated data. For information about creating a resource data sync by using Systems Manager in the AWS Management Console, see Walkthrough: Using resource data sync to aggregate inventory data. For information about querying inventory from multiple AWS Regions and accounts by using Systems Manager in the
systems-manager-ug-141
systems-manager-ug.pdf
141
ports inventory data from all of your managed nodes to a central Amazon Simple Storage Service (Amazon S3) bucket. The sync automatically updates the data in the central Amazon S3 bucket whenever new inventory data is discovered. This walkthrough also describes how to use Amazon Athena and Amazon QuickSight to query and analyze the aggregated data. For information about creating a resource data sync by using Systems Manager in the AWS Management Console, see Walkthrough: Using resource data sync to aggregate inventory data. For information about querying inventory from multiple AWS Regions and accounts by using Systems Manager in the AWS Management Console, see Querying inventory data from multiple Regions and accounts. Note This walkthrough includes information about how to encrypt the sync by using AWS Key Management Service (AWS KMS). Inventory doesn't collect any user-specific, proprietary, or sensitive data so encryption is optional. For more information about AWS KMS, see AWS Key Management Service Developer Guide. Before you begin Review or complete the following tasks before you begin the walkthrough in this section: • Collect inventory data from your managed nodes. For the purpose of the Amazon Athena and Amazon QuickSight sections in this walkthrough, we recommend that you collect Application data. For more information about how to collect inventory data, see Configuring inventory collection or Using the AWS CLI to configure inventory data collection. • (Optional) If the inventory data is stored in an Amazon Simple Storage Service (Amazon S3) bucket that uses AWS Key Management Service (AWS KMS) encryption, you must also configure Inventory 445 AWS Systems Manager User Guide your IAM account and the Amazon-GlueServiceRoleForSSM service role for AWS KMS encryption. If you don't configure your IAM account and this role, Systems Manager displays Cannot load Glue tables when you choose the Detailed View tab in the console. For more information, see (Optional) Configure permissions for viewing AWS KMS encrypted data. • (Optional) If you want to encrypt the resource data sync by using AWS KMS, then you must either create a new key that includes the following policy, or you must update an existing key and add this policy to it. { "Version": "2012-10-17", "Id": "ssm-access-policy", "Statement": [ { "Sid": "ssm-access-policy-statement", "Action": [ "kms:GenerateDataKey" ], "Effect": "Allow", "Principal": { "Service": "ssm.amazonaws.com" }, "Resource": "arn:aws:kms:us-east-2:123456789012:key/KMS_key_id", "Condition": { "StringLike": { "aws:SourceAccount": "123456789012" }, "ArnLike": { "aws:SourceArn": "arn:aws:ssm:*:123456789012:resource-data-sync/ *" } } } ] } To create a resource data sync for Inventory 1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/. Inventory 446 AWS Systems Manager User Guide 2. Create a bucket to store your aggregated inventory 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. After you create 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 Amazon S3 bucket you created and a valid AWS account ID. When adding multiple accounts, add an additional condition string and ARN for each account. Remove the additional placeholders from the example when adding one account. Optionally, replace bucket-prefix with the name of an Amazon S3 prefix (subdirectory). If you didn't created a prefix, remove bucket-prefix/ from the ARN in the policy. { "Version": "2012-10-17", "Statement": [ { "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/*" ], "Condition": { "StringEquals": { "s3:x-amz-acl": "bucket-owner-full-control", "aws:SourceAccount": [ "account-id1", "account-id2", "account-id3", "account-id4" ] }, "ArnLike": { "aws:SourceArn": [ "arn:aws:ssm:*:account-id1:resource-data-sync/*", "arn:aws:ssm:*:account-id2:resource-data-sync/*", "arn:aws:ssm:*:account-id3:resource-data-sync/*", "arn:aws:ssm:*:account-id4:resource-data-sync/*" Inventory 447 AWS Systems Manager User Guide ] } } } ] } 5. (Optional) If you want to encrypt the sync, then you must add the following conditions to the policy listed in the previous step. Add these in the StringEquals section. "s3:x-amz-server-side-encryption":"aws:kms", "s3:x-amz-server-side-encryption-aws-kms-key- id":"arn:aws:kms:region:account_ID:key/KMS_key_ID" Here is an example: "StringEquals": { "s3:x-amz-acl": "bucket-owner-full-control", "aws:SourceAccount": "account-id", "s3:x-amz-server-side-encryption":"aws:kms", "s3:x-amz-server-side-encryption-aws-kms-key- id":"arn:aws:kms:region:account_ID:key/KMS_key_ID" } 6. 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. 7. (Optional) If you want to encrypt the sync, run the following command to verify that the bucket policy is enforcing the AWS KMS key requirement. Replace each example resource placeholder with your own information. Linux & macOS aws s3 cp ./A_file_in_the_bucket s3://amzn-s3-demo-bucket/prefix/ \ --sse aws:kms \ --sse-kms-key-id "arn:aws:kms:region:account_ID:key/KMS_key_id" \ --region region, for example, us-east-2 Inventory 448 AWS Systems Manager Windows User Guide aws s3 cp ./A_file_in_the_bucket s3://amzn-s3-demo-bucket/prefix/ ^ --sse aws:kms ^ --sse-kms-key-id "arn:aws:kms:region:account_ID:key/KMS_key_id" ^ --region region, for example, us-east-2 8. Run the following command to create a resource data sync configuration with the Amazon S3 bucket you created at the start of this procedure. This command creates a sync
systems-manager-ug-142
systems-manager-ug.pdf
142
the following command to verify that the bucket policy is enforcing the AWS KMS key requirement. Replace each example resource placeholder with your own information. Linux & macOS aws s3 cp ./A_file_in_the_bucket s3://amzn-s3-demo-bucket/prefix/ \ --sse aws:kms \ --sse-kms-key-id "arn:aws:kms:region:account_ID:key/KMS_key_id" \ --region region, for example, us-east-2 Inventory 448 AWS Systems Manager Windows User Guide aws s3 cp ./A_file_in_the_bucket s3://amzn-s3-demo-bucket/prefix/ ^ --sse aws:kms ^ --sse-kms-key-id "arn:aws:kms:region:account_ID:key/KMS_key_id" ^ --region region, for example, us-east-2 8. Run the following command to create a resource data sync configuration with the Amazon S3 bucket you created at the start of this procedure. This command creates a sync from the AWS Region you're logged into. Note If the sync and the target Amazon S3 bucket are located in different regions, you might be subject to data transfer pricing. For more information, see Amazon S3 Pricing. Linux & macOS aws ssm create-resource-data-sync \ --sync-name a_name \ --s3-destination "BucketName=amzn-s3-demo-bucket,Prefix=prefix_name, if_specified,SyncFormat=JsonSerDe,Region=bucket_region" Windows aws ssm create-resource-data-sync ^ --sync-name a_name ^ --s3-destination "BucketName=amzn-s3-demo-bucket,Prefix=prefix_name, if_specified,SyncFormat=JsonSerDe,Region=bucket_region" You can use the region parameter to specify where the sync configuration should be created. In the following example, inventory data from the us-west-1 Region, will be synchronized in the Amazon S3 bucket in the us-west-2 Region. Linux & macOS aws ssm create-resource-data-sync \ Inventory 449 AWS Systems Manager User Guide --sync-name InventoryDataWest \ --s3-destination "BucketName=amzn-s3-demo- bucket,Prefix=HybridEnv,SyncFormat=JsonSerDe,Region=us-west-2" --region us-west-1 Windows aws ssm create-resource-data-sync ^ --sync-name InventoryDataWest ^ --s3-destination "BucketName=amzn-s3-demo- bucket,Prefix=HybridEnv,SyncFormat=JsonSerDe,Region=us-west-2" ^ --region us- west-1 (Optional) If you want to encrypt the sync by using AWS KMS, run the following command to create the sync. If you encrypt the sync, then the AWS KMS key and the Amazon S3 bucket must be in the same Region. Linux & macOS aws ssm create-resource-data-sync \ --sync-name sync_name \ --s3-destination "BucketName=amzn-s3-demo-bucket,Prefix=prefix_name, if_specified,SyncFormat=JsonSerDe,AWSKMSKeyARN=arn:aws:kms:region:account_ID:key/ KMS_key_ID,Region=bucket_region" \ --region region Windows aws ssm create-resource-data-sync ^ --sync-name sync_name ^ --s3-destination "BucketName=amzn-s3-demo-bucket,Prefix=prefix_name, if_specified,SyncFormat=JsonSerDe,AWSKMSKeyARN=arn:aws:kms:region:account_ID:key/ KMS_key_ID,Region=bucket_region" ^ --region region 9. Run the following command to view the status of sync configuration. aws ssm list-resource-data-sync Inventory 450 AWS Systems Manager User Guide If you created the sync configuration in a different Region, then you must specify the region parameter, as shown in the following example. aws ssm list-resource-data-sync --region us-west-1 10. After the sync configuration is created successfully, examine the target bucket in Amazon S3. Inventory data should be displayed within a few minutes. Working with the Data in Amazon Athena The following section describes how to view and query the data in Amazon Athena. Before you begin, we recommend that you learn about Athena. For more information, see What is Amazon Athena? and Working with Data in the Amazon Athena User Guide. To view and query the data in Amazon Athena 1. Open the Athena console at https://console.aws.amazon.com/athena/. 2. Copy and paste the following statement into the query editor and then choose Run Query. CREATE DATABASE ssminventory The system creates a database called ssminventory. 3. Copy and paste the following statement into the query editor and then choose Run Query. Replace amzn-s3-demo-bucket and bucket_prefix with the name and prefix of the Amazon S3 target. CREATE EXTERNAL TABLE IF NOT EXISTS ssminventory.AWS_Application ( Name string, ResourceId string, ApplicationType string, Publisher string, Version string, InstalledTime string, Architecture string, URL string, Summary string, PackageId string ) PARTITIONED BY (AccountId string, Region string, ResourceType string) Inventory 451 AWS Systems Manager User Guide ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) LOCATION 's3://amzn-s3-demo-bucket/bucket_prefix/AWS:Application/' 4. Copy and paste the following statement into the query editor and then choose Run Query. MSCK REPAIR TABLE ssminventory.AWS_Application The system partitions the table. Note If you create resource data syncs from additional AWS Regions or AWS accounts, then you must run this command again to update the partitions. You might also need to update your Amazon S3 bucket policy. 5. To preview your data, choose the view icon next to the AWS_Application table. 6. Copy and paste the following statement into the query editor and then choose Run Query. SELECT a.name, a.version, count( a.version) frequency from aws_application a where a.name = 'aws-cfn-bootstrap' group by a.name, a.version order by frequency desc The query returns a count of different versions of aws-cfn-bootstrap, which is an AWS application present on Amazon Elastic Compute Cloud (Amazon EC2) instances for Linux, macOS, and Windows Server. 7. Individually copy and paste the following statements into the query editor, replace amzn-s3- demo-bucket and bucket-prefix with information for Amazon S3, and then choose Run Query. These statements set up additional inventory tables in Athena. CREATE EXTERNAL TABLE IF NOT EXISTS ssminventory.AWS_AWSComponent ( `ResourceId` string, `Name` string, Inventory 452 AWS Systems Manager User Guide `ApplicationType` string, `Publisher` string, `Version` string, `InstalledTime` string, `Architecture` string, `URL` string ) PARTITIONED BY (AccountId string, Region string, ResourceType string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) LOCATION 's3://amzn-s3-demo-bucket/bucket-prefix/AWS:AWSComponent/' MSCK REPAIR TABLE ssminventory.AWS_AWSComponent CREATE EXTERNAL TABLE IF NOT
systems-manager-ug-143
systems-manager-ug.pdf
143
Windows Server. 7. Individually copy and paste the following statements into the query editor, replace amzn-s3- demo-bucket and bucket-prefix with information for Amazon S3, and then choose Run Query. These statements set up additional inventory tables in Athena. CREATE EXTERNAL TABLE IF NOT EXISTS ssminventory.AWS_AWSComponent ( `ResourceId` string, `Name` string, Inventory 452 AWS Systems Manager User Guide `ApplicationType` string, `Publisher` string, `Version` string, `InstalledTime` string, `Architecture` string, `URL` string ) PARTITIONED BY (AccountId string, Region string, ResourceType string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) LOCATION 's3://amzn-s3-demo-bucket/bucket-prefix/AWS:AWSComponent/' MSCK REPAIR TABLE ssminventory.AWS_AWSComponent CREATE EXTERNAL TABLE IF NOT EXISTS ssminventory.AWS_WindowsUpdate ( `ResourceId` string, `HotFixId` string, `Description` string, `InstalledTime` string, `InstalledBy` string ) PARTITIONED BY (AccountId string, Region string, ResourceType string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) LOCATION 's3://amzn-s3-demo-bucket/bucket-prefix/AWS:WindowsUpdate/' MSCK REPAIR TABLE ssminventory.AWS_WindowsUpdate CREATE EXTERNAL TABLE IF NOT EXISTS ssminventory.AWS_InstanceInformation ( `AgentType` string, `AgentVersion` string, `ComputerName` string, `IamRole` string, `InstanceId` string, `IpAddress` string, `PlatformName` string, `PlatformType` string, `PlatformVersion` string ) Inventory 453 AWS Systems Manager User Guide PARTITIONED BY (AccountId string, Region string, ResourceType string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) LOCATION 's3://amzn-s3-demo-bucket/bucket-prefix/AWS:InstanceInformation/' MSCK REPAIR TABLE ssminventory.AWS_InstanceInformation CREATE EXTERNAL TABLE IF NOT EXISTS ssminventory.AWS_Network ( `ResourceId` string, `Name` string, `SubnetMask` string, `Gateway` string, `DHCPServer` string, `DNSServer` string, `MacAddress` string, `IPV4` string, `IPV6` string ) PARTITIONED BY (AccountId string, Region string, ResourceType string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) LOCATION 's3://amzn-s3-demo-bucket/bucket-prefix/AWS:Network/' MSCK REPAIR TABLE ssminventory.AWS_Network CREATE EXTERNAL TABLE IF NOT EXISTS ssminventory.AWS_PatchSummary ( `ResourceId` string, `PatchGroup` string, `BaselineId` string, `SnapshotId` string, `OwnerInformation` string, `InstalledCount` int, `InstalledOtherCount` int, `NotApplicableCount` int, `MissingCount` int, `FailedCount` int, `OperationType` string, `OperationStartTime` string, `OperationEndTime` string Inventory 454 AWS Systems Manager ) User Guide PARTITIONED BY (AccountId string, Region string, ResourceType string) ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe' WITH SERDEPROPERTIES ( 'serialization.format' = '1' ) LOCATION 's3://amzn-s3-demo-bucket/bucket-prefix/AWS:PatchSummary/' MSCK REPAIR TABLE ssminventory.AWS_PatchSummary Working with the Data in Amazon QuickSight The following section provides an overview with links for building a visualization in Amazon QuickSight. To build a visualization in Amazon QuickSight 1. Sign up for Amazon QuickSight and then log in to the QuickSight console. 2. Create a data set from the AWS_Application table and any other tables you created. For more information, see Creating a Data Set Using Amazon Athena Data. 3. Join tables. For example, you could join the instanceid column from AWS_InstanceInformation because it matches the resourceid column in other inventory tables. For more information about joining tables, see Joining Tables. 4. Build a visualization. For more information, see Working with Amazon QuickSight Visuals. Troubleshooting problems with Systems Manager Inventory This topic includes information about how to troubleshoot common errors or problems with AWS Systems Manager Inventory. If you're having trouble viewing your nodes in Systems Manager, see Troubleshooting managed node availability. Topics • Multiple apply all associations with document 'AWS-GatherSoftwareInventory' are not supported • Inventory execution status never exits pending • The AWS-ListWindowsInventory document fails to run • Console doesn't display Inventory Dashboard | Detailed View | Settings tabs • UnsupportedAgent Inventory 455 AWS Systems Manager • Skipped • Failed • Inventory compliance failed for an Amazon EC2 instance • S3 bucket object contains old data User Guide Multiple apply all associations with document 'AWS-GatherSoftwareInventory' are not supported An error that Multiple apply all associations with document 'AWS- GatherSoftwareInventory' are not supported means that one or more AWS Regions where you're trying to configure an Inventory association for all nodes are already configured with an inventory association for all nodes. If necessary, you can delete the existing inventory association for all nodes and then create a new one. To view existing inventory associations, choose State Manager in the Systems Manager console and then locate associations that use the AWS- GatherSoftwareInventory SSM document. If the existing inventory association for all nodes was created across multiple Regions, and you want to create a new one, you must delete the existing association from each Region where it exists. Inventory execution status never exits pending There are two reasons why inventory collection never exits the Pending status: • No nodes in the selected AWS Region: If you create a global inventory association by using Systems Manager Quick Setup, the status of the inventory association (AWS-GatherSoftwareInventory document) shows Pending if there are no nodes available in the selected Region. • Insufficient permissions: An inventory association shows Pending if one or more nodes don't have permission to run Systems Manager Inventory. Verify that the AWS Identity and Access Management (IAM) instance profile includes the AmazonSSMManagedInstanceCore managed policy. For information about how to add this policy to an instance profile, see Alternative configuration for EC2 instance permissions. At a minimum, the instance profile must have the following IAM permissions. { Inventory 456 AWS Systems Manager User Guide "Version":
systems-manager-ug-144
systems-manager-ug.pdf
144
Manager Quick Setup, the status of the inventory association (AWS-GatherSoftwareInventory document) shows Pending if there are no nodes available in the selected Region. • Insufficient permissions: An inventory association shows Pending if one or more nodes don't have permission to run Systems Manager Inventory. Verify that the AWS Identity and Access Management (IAM) instance profile includes the AmazonSSMManagedInstanceCore managed policy. For information about how to add this policy to an instance profile, see Alternative configuration for EC2 instance permissions. At a minimum, the instance profile must have the following IAM permissions. { Inventory 456 AWS Systems Manager User Guide "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ssm:DescribeAssociation", "ssm:ListAssociations", "ssm:ListInstanceAssociations", "ssm:PutInventory", "ssm:PutComplianceItems", "ssm:UpdateAssociationStatus", "ssm:UpdateInstanceAssociationStatus", "ssm:UpdateInstanceInformation", "ssm:GetDocument", "ssm:DescribeDocument" ], "Resource": "*" } ] } The AWS-ListWindowsInventory document fails to run The AWS-ListWindowsInventory document is deprecated. Don't use this document to collect inventory. Instead, use one of the processes described in Configuring inventory collection. Console doesn't display Inventory Dashboard | Detailed View | Settings tabs The Inventory Detailed View page is only available in AWS Regions that offer Amazon Athena. If the following tabs aren't displayed on the Inventory page, it means Athena isn't available in the Region and you can't use the Detailed View to query data. Inventory 457 AWS Systems Manager User Guide UnsupportedAgent If the detailed status of an inventory association shows UnsupportedAgent, and the Association status shows Failed, then the version of AWS Systems Manager SSM Agent on the managed node isn't correct. To create a global inventory association (to inventory all nodes in your AWS account) for example, you must use SSM Agent version 2.0.790.0 or later. You can view the agent version running on each of your nodes on the Managed Instances page in the Agent version column. For information about how to update SSM Agent on your nodes, see Updating the SSM Agent using Run Command. Skipped If the status of the inventory association for a node shows Skipped, this means that you created a global inventory association (to collect inventory from all nodes), but the skipped node already had an inventory association assigned to it. The global inventory association wasn't assigned to this node, and no inventory was collected by the global inventory association. However, the node will still report inventory data when the existing inventory association runs. If you don't want the node to be skipped by the global inventory association, you must delete the existing inventory association. To view existing inventory associations, choose State Manager in the Systems Manager console and then locate associations that use the AWS- GatherSoftwareInventory SSM document. Inventory 458 AWS Systems Manager Failed User Guide If the status of the inventory association for a node shows Failed, this could mean that the node has multiple inventory associations assigned to it. A node can only have one inventory association assigned at a time. An inventory association uses the AWS-GatherSoftwareInventory AWS Systems Manager document (SSM document). You can run the following command by using the AWS Command Line Interface (AWS CLI) to view a list of associations for a node. aws ssm describe-instance-associations-status --instance-id instance ID Inventory compliance failed for an Amazon EC2 instance Inventory compliance for an Amazon Elastic Compute Cloud (Amazon EC2) instance can fail if you assign multiple inventory associations to the instance. To resolve this issue, delete one or more inventory associations assigned to the instance. For more information, see Deleting an association. Note Be aware of the following behavior if you create multiple inventory associations for a managed node: • Each node can be assigned an inventory association that targets all nodes (--targets "Key=InstanceIds,Values=*"). • Each node can also be assigned a specific association that uses either tag key-value pairs or an AWS resource group. • If a node is assigned multiple inventory associations, the status shows Skipped for the association that hasn't run. The association that ran most recently displays the actual status of the inventory association. • If a node is assigned multiple inventory associations and each uses a tag key-value pair, then those inventory associations fail to run on the node because of the tag conflict. The association still runs on nodes that don't have the tag key-value conflict. Inventory 459 AWS Systems Manager User Guide S3 bucket object contains old data Data inside the Amazon S3 bucket object is updated when the inventory association is successful and new data is discovered. The Amazon S3 bucket object is updated for each node when the association runs and fails, but the data inside the object is not updated in this case. Data inside the Amazon S3 bucket object will update only when the association runs successfully. When the inventory association fails, you will see old data in the Amazon S3 bucket object. AWS Systems Manager Patch Manager Patch Manager, a tool in
systems-manager-ug-145
systems-manager-ug.pdf
145
AWS Systems Manager User Guide S3 bucket object contains old data Data inside the Amazon S3 bucket object is updated when the inventory association is successful and new data is discovered. The Amazon S3 bucket object is updated for each node when the association runs and fails, but the data inside the object is not updated in this case. Data inside the Amazon S3 bucket object will update only when the association runs successfully. When the inventory association fails, you will see old data in the Amazon S3 bucket object. AWS Systems Manager Patch Manager Patch Manager, a tool in AWS Systems Manager, automates the process of patching managed nodes with both security-related updates and other types of updates. Note Systems Manager provides support for patch policies in Quick Setup, a tool in AWS Systems Manager. Using patch policies is the recommended method for configuring your patching operations. Using a single patch policy configuration, you can define patching for all accounts in all Regions in your organization; for only the accounts and Regions you choose; or for a single account-Region pair. For more information, see Patch policy configurations in Quick Setup. 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.) You can use Patch Manager to install Service Packs on Windows nodes and perform minor version upgrades on Linux nodes. You can patch fleets of Amazon Elastic Compute Cloud (Amazon EC2) instances, edge devices, on-premises servers, and virtual machines (VMs) by operating system type. This includes supported versions of several operating systems, as listed in Patch Manager prerequisites. You can scan instances to see only a report of missing patches, or you can scan and automatically install all missing patches. To get started with Patch Manager, open the Systems Manager console. In the navigation pane, choose Patch Manager. AWS doesn't test patches before making them available in Patch Manager. Also, Patch Manager doesn't support upgrading major versions of operating systems, such as Windows Server 2016 to Windows Server 2019, or SUSE Linux Enterprise Server (SLES) 12.0 to SLES 15.0. For Linux-based operating system types that report a severity level for patches, Patch Manager uses the severity level reported by the software publisher for the update notice or individual Patch Manager 460 AWS Systems Manager User Guide patch. Patch Manager doesn't derive severity levels from third-party sources, such as the Common Vulnerability Scoring System (CVSS), or from metrics released by the National Vulnerability Database (NVD). How can Patch Manager benefit my organization? Patch Manager automates the process of patching managed nodes with both security-related updates and other types of updates. It provides several key benefits: • Centralized patching control –Using patch policies, you can set up recurring patching operations for all accounts in all Regions in your organization, specific accounts and Regions, or a single account-Region pair. • Flexible patching operations – You can choose to scan instances to see only a report of missing patches, or scan and automatically install all missing patches. • Comprehensive compliance reporting – After scanning operations, you can view detailed information about which managed nodes are out of patch compliance and which patches are missing. • Cross-platform support – Patch Manager supports multiple operating systems including various Linux distributions, macOS, and Windows Server. • Custom patch baselines – You can define what constitutes patch compliance for your organization through custom patch baselines that specify which patches are approved for installation. • Integration with other AWS services – Patch Manager integrates with AWS Organizations, AWS Security Hub, AWS CloudTrail, and AWS Config for enhanced management and security. • Deterministic upgrades – Support for deterministic upgrades through versioned repositories for operating systems like Amazon Linux 2023. Who should use Patch Manager? Patch Manager is designed for the following: • IT administrators who need to maintain patch compliance across their fleet of managed nodes • Operations managers who need visibility into patch compliance status across their infrastructure • Cloud architects who want to implement automated patching solutions at scale • DevOps engineers who need to integrate patching into their operational workflows Patch Manager 461 AWS Systems Manager User Guide • Organizations with multi-account/multi-Region deployments who need centralized patch management • Anyone responsible for maintaining the security posture and operational health of AWS managed nodes, edge devices, on-premises servers, and virtual machines What are the main features of Patch Manager? Patch Manager offers several key features: • Patch policies – Configure patching operations across multiple AWS accounts and Regions using a single policy through integration with AWS Organizations. • Custom patch baselines – Define rules for auto-approving patches within days of their release, along with approved and rejected patch lists. • Multiple patching methods – Choose from patch policies, maintenance
systems-manager-ug-146
systems-manager-ug.pdf
146
• Organizations with multi-account/multi-Region deployments who need centralized patch management • Anyone responsible for maintaining the security posture and operational health of AWS managed nodes, edge devices, on-premises servers, and virtual machines What are the main features of Patch Manager? Patch Manager offers several key features: • Patch policies – Configure patching operations across multiple AWS accounts and Regions using a single policy through integration with AWS Organizations. • Custom patch baselines – Define rules for auto-approving patches within days of their release, along with approved and rejected patch lists. • Multiple patching methods – Choose from patch policies, maintenance windows, or on-demand "Patch now" operations to meet your specific needs. • Compliance reporting – Generate detailed reports on patch compliance status that can be sent to an Amazon S3 bucket in CSV format. • Cross-platform support – Patch both operating systems and applications across Windows Server, various Linux distributions, and macOS. • Scheduling flexibility – Set different schedules for scanning and installing patches using custom CRON or Rate expressions. • Lifecycle hooks – Run custom scripts before and after patching operations using Systems Manager documents. • Security focus – By default, Patch Manager focuses on security-related updates rather than installing all available patches. • Rate control – Configure concurrency and error thresholds for patching operations to minimize operational impact. What is compliance in Patch Manager? The benchmark for what constitutes patch compliance for the managed nodes in your Systems Manager fleets is not defined by AWS, by operating system (OS) vendors, or by third parties such as security consulting firms. Patch Manager 462 AWS Systems Manager User Guide Instead, you define what patch compliance means for managed nodes in your organization or account in a patch baseline. A patch baseline is a configuration that specifies rules for which patches must be installed on a managed node. A managed node is patch compliant when it is up to date with all the patches that meet the approval criteria that you specify in the patch baseline. Note that being compliant with a patch baseline doesn't mean that a managed node is necessarily secure. Compliant means that the patches defined by the patch baseline that are both available and approved have been installed on the node. The overall security of a managed node is determined by many factors outside the scope of Patch Manager. For more information, see Security. Each patch baseline is a configuration for a specific supported operating system (OS) type, such as Red Hat Enterprise Linux (RHEL), macOS, or Windows Server. A patch baseline can define patching rules for all supported versions of an OS or be limited to only those you specify, such as RHEL 6.10, RHEL 7.8., and RHEL 9.3. In a patch baseline, you could specify that all patches of certain classifications and severity levels are approved for for installation. For example, you might include all patches classified as Security but exclude other classifications, such as Bugfix or Enhancement. And you could include all patches with a severity of Critical and exclude others, such as Important and Moderate. You can also define patches explicitly in a patch baseline by adding their IDs to lists of specific patches to approve or reject, such as KB2736693 for Windows Server or dbus.x86_64:1:1.12.28-1.amzn2023.0.1 for Amazon Linux 2023 (AL2023). You can optionally specify a certain number of days to wait for patching after a patch becomes available. For Linux and macOS, you have the option of specifying an external list of patches for compliance (an Install Override list) instead of those defined by the patch baseline rules. When a patching operation runs, Patch Manager compares the patches currently applied to a managed node to those that should be applied according to the rules set up in the patch baseline or an Install Override list. You can choose for Patch Manager to show you only a report of missing patches (a Scan operation), or you can choose for Patch Manager to automatically install all patches it find are missing from a managed node (a Scan and install operation). Patch Manager provides predefined patch baselines that you can use for your patching operations; however, these predefined configurations are provided as examples and not as recommended best practices. We recommend that you create custom patch baselines of your own to exercise greater control over what constitutes patch compliance for your fleet. For more information about patch baselines, see the following topics: Patch Manager 463 AWS Systems Manager User Guide • Predefined and custom patch baselines • Package name formats for approved and rejected patch lists • Viewing AWS predefined patch baselines • Working with custom patch baselines • Working with patch compliance reports Primary components Before you start working with the Patch Manager tool, you should familiarize yourself with some major components and features
systems-manager-ug-147
systems-manager-ug.pdf
147
as recommended best practices. We recommend that you create custom patch baselines of your own to exercise greater control over what constitutes patch compliance for your fleet. For more information about patch baselines, see the following topics: Patch Manager 463 AWS Systems Manager User Guide • Predefined and custom patch baselines • Package name formats for approved and rejected patch lists • Viewing AWS predefined patch baselines • Working with custom patch baselines • Working with patch compliance reports Primary components Before you start working with the Patch Manager tool, you should familiarize yourself with some major components and features of the tool's patching operations. Patch baselines Patch Manager uses patch baselines, which include rules for auto-approving patches within days of their release, in addition to optional lists of approved and rejected patches. When a patching operation runs, Patch Manager compares the patches currently applied to a managed node to those that should be applied according to the rules set up in the patch baseline. You can choose for Patch Manager to show you only a report of missing patches (a Scan operation), or you can choose for Patch Manager to automatically install all patches it find are missing from a managed node (a Scan and install operation). Patching operation methods Patch Manager currently offers four methods for running Scan and Scan and install operations: • (Recommended) A patch policy configured in Quick Setup – Based on integration with AWS Organizations, a single patch policy can define patching schedules and patch baselines for an entire organization, including multiple AWS accounts and all AWS Regions those accounts operate in. A patch policy can also target only some organizational units (OUs) in an organization. You can use a single patch policy to scan and install on different schedules. For more information, see Configure patching for instances in an organization using a Quick Setup patch policy and Patch policy configurations in Quick Setup. • A Host Management option configured in Quick Setup – Host Management configurations are also supported by integration with AWS Organizations, making it possible to run a patching operation for up to an entire Organization. However, this option is limited to scanning for missing patches using the current default patch baseline and providing results in compliance Patch Manager 464 AWS Systems Manager User Guide reports. This operation method can't install patches. For more information, see Set up Amazon EC2 host management using Quick Setup. • A maintenance window to run a patch Scan or Install task – A maintenance window, which you set up in the Systems Manager tool called Maintenance Windows, can be configured to run different types of tasks on a schedule you define. A Run Command-type task can be used to run Scan or Scan and install tasks a set of managed nodes that you choose. Each maintenance window task can target managed nodes in only a single AWS account-AWS Region pair. For more information, see Tutorial: Create a maintenance window for patching using the console. • An on-demand Patch now operation in Patch Manager – The Patch now option lets you bypass schedule setups when you need to patch managed nodes as quickly as possible. Using Patch now, you specify whether to run Scan or Scan and install operation and which managed nodes to run the operation on. You can also choose to running Systems Manager documents (SSM documents) as lifecycle hooks during the patching operation. Each Patch now operation can target managed nodes in only a single AWS account-AWS Region pair. For more information, see Patching managed nodes on demand. Compliance reporting After a Scan operation, you can use the Systems Manager console to view information about which of your managed nodes are out of patch compliance, and which patches are missing from each of those nodes. You can also generate patch compliance reports in .csv format that are sent to an Amazon Simple Storage Service (Amazon S3) bucket of your choice. You can generate one-time reports, or generate reports on a regular schedule. For a single managed node, reports include details of all patches for the node. For a report on all managed nodes, only a summary of how many patches are missing is provided. After a report is generated, you can use a tool like Amazon QuickSight to import and analyze the data. For more information, see Working with patch compliance reports. Note A compliance item generated through the use of a patch policy has an execution type of PatchPolicy. A compliance item not generated in a patch policy operation has an execution type of Command. Integrations Patch Manager 465 AWS Systems Manager User Guide Patch Manager integrates with the following other AWS services: • AWS Identity and Access Management (IAM) – Use IAM to control which users, groups, and roles have access
systems-manager-ug-148
systems-manager-ug.pdf
148
provided. After a report is generated, you can use a tool like Amazon QuickSight to import and analyze the data. For more information, see Working with patch compliance reports. Note A compliance item generated through the use of a patch policy has an execution type of PatchPolicy. A compliance item not generated in a patch policy operation has an execution type of Command. Integrations Patch Manager 465 AWS Systems Manager User Guide Patch Manager integrates with the following other AWS services: • AWS Identity and Access Management (IAM) – Use IAM to control which users, groups, and roles have access to Patch Manager operations. For more information, see How AWS Systems Manager works with IAM and Configure instance permissions required for Systems Manager. • AWS CloudTrail – Use CloudTrail to record an auditable history of patching operation events initiated by users, roles, or groups. For more information, see Logging AWS Systems Manager API calls with AWS CloudTrail. • AWS Security Hub – 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. • AWS Config – Set up recording in AWS Config to view Amazon EC2 instance management data in the Patch Manager Dashboard. For more information, see Viewing patch Dashboard summaries. Topics • Patch policy configurations in Quick Setup • Patch Manager prerequisites • How Patch Manager operations work • SSM Command documents for patching managed nodes • Patch baselines • Using Kernel Live Patching on Amazon Linux 2 managed nodes • Working with Patch Manager resources and compliance using the console • Working with Patch Manager resources using the AWS CLI • AWS Systems Manager Patch Manager tutorials • Troubleshooting Patch Manager Patch policy configurations in Quick Setup AWS recommends the use of patch policies to configure patching for your organization and AWS accounts. Patch policies were introduced in Patch Manager in December, 2022. A patch policy is a configuration you set up using Quick Setup, a tool in AWS Systems Manager. Patch policies provide more extensive and more centralized control over your patching operations Patch Manager 466 AWS Systems Manager User Guide than is available with previous methods of configuring patching. Patch policies can be used with all operating systems supported by Patch Manager, including supported versions of Linux, macOS, and Windows Server. For instructions for creating a patch policy, see Configure patching for instances in an organization using a Quick Setup patch policy. Major features of patch policies Instead of using other methods of patching your nodes, use a patch policy to take advantage of these major features: • Single setup – Setting up patching operations using a maintenance window or State Manager association can require multiple tasks in different parts of the Systems Manager console. Using a patch policy, all your patching operations can be set up in a single wizard. • Multi-account/Multi-Region support – Using a maintenance window, a State Manager association, or the Patch now feature in Patch Manager, you're limited to targeting managed nodes in a single AWS account-AWS Region pair. If you use multiple accounts and multiple Regions, your setup and maintenance tasks can require a great deal of time, because you must perform setup tasks in each account-Region pair. However, if you use AWS Organizations, you can set up one patch policy that applies to all your managed nodes in all AWS Regions in all your AWS accounts. Or, if you choose, a patch policy can apply to only some organizational units (OUs) in the accounts and Regions you choose. A patch policy can also apply to a single local account, if you choose. • Installation support at the organizational level – The existing Host Management configuration option in Quick Setup provides support for a daily scan of your managed nodes for patch compliance. However, this scan is done at a predetermined time and results in patch compliance information only. No patch installations are performed. Using a patch policy, you can specify different schedules for scanning and installing. You can also choose the frequency and time of these operations by using custom CRON or Rate expressions. For example, you could scan for missing patches every day to provide you with regularly updated compliance information. But, your installation schedule could be just once a week to avoid unwanted downtime. • Simplified patch baseline selection – Patch policies still incorporate patch baselines, and there are no changes to the way patch baselines are configured. However, when you create or update a patch policy, you can select the AWS managed or custom baseline you want to use for each operating system (OS) type in a
systems-manager-ug-149
systems-manager-ug.pdf
149
the frequency and time of these operations by using custom CRON or Rate expressions. For example, you could scan for missing patches every day to provide you with regularly updated compliance information. But, your installation schedule could be just once a week to avoid unwanted downtime. • Simplified patch baseline selection – Patch policies still incorporate patch baselines, and there are no changes to the way patch baselines are configured. However, when you create or update a patch policy, you can select the AWS managed or custom baseline you want to use for each operating system (OS) type in a single list. It’s not necessary to specify the default baseline for each OS type in separate tasks. Patch Manager 467 AWS Systems Manager Note User Guide When patching operations based on a patch policy run, they use the AWS- RunPatchBaseline SSM document. For more information, see SSM Command document for patching: AWS-RunPatchBaseline. Related information Centrally deploy patching operations across your AWS Organization using Systems Manager Quick Setup (AWS Cloud Operations and Migrations Blog) Other differences with patch policies Here are some other differences to note when using patch policies instead of previous methods of configuring patching: • No patch groups required – In previous patching operations, you could tag multiple nodes to belong to a patch group, and then specify the patch baseline to use for that patch group. If no patch group was defined, Patch Manager patched instances with the current default patch baseline for the OS type. Using patch policies, it’s no longer necessary to set up and maintain patch groups. Note Patch group functionality is not supported in the console for account-Region pairs that did not already use patch groups before patch policy support was released on December 22, 2022. Patch group functionality is still available in account-Region pairs that began using patch groups before this date. • ‘Configure patching’ page removed – Before the release of patch policies, you could specify defaults for which nodes to patch, a patching schedule, and a patching operation on a Configure patching page. This page has been removed from Patch Manager. These options are now specified in patch policies. • No ‘Patch now’ support – The ability to patch nodes on demand is still limited to a single AWS account-AWS Region pair at a time. For information, see Patching managed nodes on demand. • Patch policies and compliance information – When your managed nodes are scanned for compliance according to a patching policy configuration, compliance data is made available to Patch Manager 468 AWS Systems Manager User Guide you. You can view and work with the data in the same way as with other methods of compliance scanning. Although you can set up a patch policy for an entire organization or multiple organizational units, compliance information is reported individually for each AWS account-AWS Region pair. For more information, see Working with patch compliance reports. • Association compliance status and patch policies – The patching status for a managed node that's under a Quick Setup patch policy matches the status of the State Manager association execution for that node. If the association execution status is Compliant, the patching status for the managed node is also marked Compliant. If the association execution status is Non- Compliant, the patching status for the managed node is also marked Non-Compliant. AWS Regions supported for patch policies Patch policy configurations in Quick Setup are currently supported in the following Regions: • US East (Ohio) (us-east-2) • US East (N. Virginia) (us-east-1) • US West (N. California) (us-west-1) • US West (Oregon) (us-west-2) • Asia Pacific (Mumbai) (ap-south-1) • Asia Pacific (Seoul) (ap-northeast-2) • Asia Pacific (Singapore) (ap-southeast-1) • Asia Pacific (Sydney) (ap-southeast-2) • Asia Pacific (Tokyo) (ap-northeast-1) • Canada (Central) (ca-central-1) • Europe (Frankfurt) (eu-central-1) • Europe (Ireland) (eu-west-1) • Europe (London) (eu-west-2) • Europe (Paris) (eu-west-3) • Europe (Stockholm) (eu-north-1) • South America (São Paulo) (sa-east-1) Patch Manager 469 AWS Systems Manager User Guide Patch Manager prerequisites Make sure that you have met the required prerequisites before using Patch Manager, a tool in AWS Systems Manager. Topics • SSM Agent version • Python version • Connectivity to the patch source • S3 endpoint access • Permissions to install patches locally • Supported operating systems for Patch Manager SSM Agent version Version 2.0.834.0 or later of SSM Agent is running on the managed node you want to manage with Patch Manager. Note An updated version of SSM Agent is released whenever new tools are added to Systems Manager or updates are made to existing tools. Failing to use the latest version of the agent can prevent your managed node from using various Systems Manager tools and features. For that reason, we recommend that you automate the process of keeping SSM Agent up to date on your
systems-manager-ug-150
systems-manager-ug.pdf
150
Permissions to install patches locally • Supported operating systems for Patch Manager SSM Agent version Version 2.0.834.0 or later of SSM Agent is running on the managed node you want to manage with Patch Manager. Note An updated version of SSM Agent is released whenever new tools are added to Systems Manager or updates are made to existing tools. Failing to use the latest version of the agent can prevent your managed node from using various Systems Manager tools and features. For that reason, we recommend that you automate the process of keeping SSM Agent up to date on your machines. For information, see Automating updates to SSM Agent. Subscribe to the SSM Agent Release Notes page on GitHub to get notifications about SSM Agent updates. Python version For macOS and most Linux operating systems (OSs), Patch Manager currently supports Python versions 2.6 - 3.10. The AlmaLinux, Debian Server, Raspberry Pi OS, and Ubuntu Server OSs require a supported version of Python 3 (3.0 - 3.10). Patch Manager 470 AWS Systems Manager Connectivity to the patch source User Guide If your managed nodes don't have a direct connection to the Internet and you're using an Amazon Virtual Private Cloud (Amazon VPC) with a VPC endpoint, you must ensure that the nodes have access to the source patch repositories (repos). On Linux nodes, patch updates are typically downloaded from the remote repos configured on the node. Therefore, the node must be able to connect to the repos so the patching can be performed. For more information, see How security patches are selected. CentOS and CentOS Stream: Enable the EnableNonSecurity flag CentOS 6 and 7 managed nodes use Yum as the package manager. CentOS 8 and CentOS Stream nodes use DNF as the package manager. Both package managers use the concept of an update notice. An update notice is simply a collection of packages that fix specific problems. However, CentOS and CentOS Stream default repos aren't configured with an update notice. This means that Patch Manager doesn't detect packages on default CentOS and CentOS Stream repos. To allow Patch Manager to process packages that aren't contained in an update notice, you must turn on the EnableNonSecurity flag in the patch baseline rules. Windows Server: Ensure connectivity to Windows Update Catalog or Windows Server Update Services (WSUS) Windows Server managed nodes must be able to connect to the Windows Update Catalog or Windows Server Update Services (WSUS). Confirm that your nodes have connectivity to the Microsoft Update Catalog through an internet gateway, NAT gateway, or NAT instance. If you are using WSUS, confirm that the node has connectivity to the WSUS server in your environment. For more information, see Issue: managed node doesn't have access to Windows Update Catalog or WSUS. S3 endpoint access Whether your managed nodes operate in a private or public network, without access to the required AWS managed Amazon Simple Storage Service (Amazon S3) buckets, patching operations fail. For information about the S3 buckets your managed nodes must be able to access, see SSM Agent communications with AWS managed S3 buckets and Improve the security of EC2 instances by using VPC endpoints for Systems Manager. Patch Manager 471 AWS Systems Manager User Guide Permissions to install patches locally On Windows Server and Linux operating systems, Patch Manager assumes the Administrator and root user accounts, respectively, to install patches. On macOS, however, for Brew and Brew Cask, Homebrew doesn't support its commands running under the root user account. As a result, Patch Manager queries for and runs Homebrew commands as either the owner of the Homebrew directory, or as a valid user belonging to the Homebrew directory’s owner group. Therefore, in order to install patches, the owner of the homebrew directory also needs recursive owner permissions for the /usr/local directory. Tip The following command provides this permission for the specified user: sudo chown -R $USER:admin /usr/local Supported operating systems for Patch Manager The Patch Manager tool doesn't support all the same operating systems versions that are supported by other Systems Manager tools. For example, Patch Manager doesn't support CentOS 6.3 or Raspberry Pi OS 8 (Jessie). (For the full list of Systems Manager-supported operating systems, see Supported operating systems for Systems Manager.) Therefore, ensure that the managed nodes you want to use with Patch Manager are running one of the operating systems listed in the following table. Note Patch Manager relies on the patch repositories that are configured on a managed node, such as Windows Update Catalog and Windows Server Update Services for Windows, to retrieve available patches to install. Therefore, for end of life (EOL) operating system versions, if no new updates are available, Patch Manager might not be able to report on the new updates. This can be because no new updates are released by the Linux distribution
systems-manager-ug-151
systems-manager-ug.pdf
151
Systems Manager.) Therefore, ensure that the managed nodes you want to use with Patch Manager are running one of the operating systems listed in the following table. Note Patch Manager relies on the patch repositories that are configured on a managed node, such as Windows Update Catalog and Windows Server Update Services for Windows, to retrieve available patches to install. Therefore, for end of life (EOL) operating system versions, if no new updates are available, Patch Manager might not be able to report on the new updates. This can be because no new updates are released by the Linux distribution maintainer, Microsoft, or Apple, or because the managed node does not have the proper license to access the new updates. Patch Manager reports compliance status against the available patches on the managed node. Therefore, if an instance is running an EOL operating system, and no updates are Patch Manager 472 AWS Systems Manager User Guide available, Patch Manager might report the node as Compliant, depending on the patch baselines configured for the patching operation. Operating system Details Linux macOS • AlmaLinux 8.x, 9.x • Amazon Linux 2012.03–2018.03 • Amazon Linux 2 version 2.0 and all later versions • Amazon Linux 2022 • Amazon Linux 2023 • CentOS 6.5–7.9, 8.x • CentOS Stream 8, 9 • Debian Server 8.x, 9.x, 10.x, 11.x, and 12.x • Oracle Linux 7.5–8.x, 9.x • Raspberry Pi OS (formerly Raspbian) 9 (Stretch) • Red Hat Enterprise Linux (RHEL) 6.5–8.x, 9.x • Rocky Linux 8.x, 9.x • SUSE Linux Enterprise Server (SLES) 12.0 and later 12.x versions; 15.x • Ubuntu Server 14.04 LTS, 16.04 LTS, 18.04 LTS, 20.04 LTS, 20.10 STR, 22.04 LTS, 23.04, 23.10, 24.04, and 24.10 macOS is supported for Amazon EC2 instances only. 11.3.1; 11.4–11.7 (Big Sur) 12.0–12.7 (Monterey) 13.0–13.7 (Ventura) Patch Manager 473 AWS Systems Manager Operating system User Guide Details 14.x (Sonoma) 15.x (Sequoia) macOS OS updates Patch Manager doesn't support operating system (OS) updates or upgrades for macOS, such as from 12.x to 13.x or 13.1 to 13.2. To perform OS version updates on macOS, we recommend using Apple's built-in OS upgrade mechanisms. For more information, see Device Management on the Apple Developer Documentation website. Homebrew support Patch Manager requires Homebrew, the open- source software package management system, to be installed at either of the following default install locations: • /usr/local/bin • /opt/homebrew/bin Patching operations using Patch Manager fail to function correctly when Homebrew is not installed. Homebrew has discontinued support for macOS 10.14.x (Mojave) and 10.15.x (Catalina ). As a result, patching operations using Patch Manager are not supported for these versions. Region support Patch Manager 474 AWS Systems Manager User Guide Operating system Details 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. macOS edge devices SSM Agent for AWS IoT Greengrass core devices is not supported on macOS. You can't use Patch Manager to patch macOS edge devices. Patch Manager 475 AWS Systems Manager User Guide Operating system Details Windows Windows Server 2008 through Windows Server 2025, including R2 versions. Note SSM Agent for AWS IoT Greengras s core devices is not supported on Windows 10. You can't use Patch Manager to patch Windows 10 edge devices. Windows Server 2008 support As of January 14, 2020, Windows Server 2008 is no longer supported for feature or security updates from Microsoft. Legacy Amazon Machine Images (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 Patch Manager with these versions, we recommend also using Extended Security Updates (ESUs) from Microsoft. For more Patch Manager 476 AWS Systems Manager User Guide Operating system Details information, see Windows Server 2012 and 2012 R2 reaching end of support on the Microsoft website. How Patch Manager operations work This section provides technical details that explain how Patch Manager, a tool in AWS Systems Manager, determines which patches to install and how it installs them on each supported operating system. For Linux operating systems, it also provides information about specifying a source repository, in a custom patch baseline, for patches other than the default configured on a managed node. This section also provides details about how patch baseline rules work on different distributions of the Linux operating system. Note The
systems-manager-ug-152
systems-manager-ug.pdf
152
Windows Server 2012 and 2012 R2 reaching end of support on the Microsoft website. How Patch Manager operations work This section provides technical details that explain how Patch Manager, a tool in AWS Systems Manager, determines which patches to install and how it installs them on each supported operating system. For Linux operating systems, it also provides information about specifying a source repository, in a custom patch baseline, for patches other than the default configured on a managed node. This section also provides details about how patch baseline rules work on different distributions of the Linux operating system. Note The information in the following topics applies no matter which method or type of configuration you are using for your patching operations: • A patch policy configured in Quick Setup • A Host Management option configured in Quick Setup • A maintenance window to run a patch Scan or Install task • An on-demand Patch now operation Topics • How package release dates and update dates are calculated • How security patches are selected • How to specify an alternative patch source repository (Linux) • How patches are installed • How patch baseline rules work on Linux-based systems • Patching operation differences between Linux and Windows Server Patch Manager 477 AWS Systems Manager User Guide How package release dates and update dates are calculated Important The information on this page applies to the Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022, and Amazon Linux 2023 operating systems (OSs) for Amazon Elastic Compute Cloud (Amazon EC2) instances. The packages for these OS types are created and maintained by Amazon Web Services. How the manufacturers of other operating systems manage their packages and repositories affect how their release dates and update dates are calculated. For OSs besides Amazon Linux, Amazon Linux 2, Amazon Linux 2022, and Amazon Linux 2023, such as Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES), refer to the manufacturer's documentation for information about how their packages are updated and maintained. In the settings for custom patch baselines you create, for most OS types, you can specify that patches are auto-approved for installation after a certain number of days. AWS provides several predefined patch baselines that include auto-approval dates of 7 days. An auto-approval delay is the number of days to wait after the patch was released, before the patch is automatically approved for patching. For example, you create a rule using the CriticalUpdates classification and configure it for 7 days auto-approval delay. As a result, a new critical patch with a release date or last update date of July 7 is automatically approved on July 14. To avoid unexpected results with auto-approval delays on Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022, and Amazon Linux 2023, it's important to understand how their release dates and update dates are calculated. In most cases, the auto-approval wait time before patches are installed is calculated from an Updated Date value in updateinfo.xml, not a Release Date value. The following are important details about these date calculations: • The Release Date is the date a notice is released. It does not mean the package is necessarily available in the associated repositories yet. • The Update Date is the last date the notice was updated. An update to a notice can represent something as small as a text or description update. It does not mean the package was released from that date or is necessarily available in the associated repositories yet. Patch Manager 478 AWS Systems Manager User Guide This means that a package could have an Update Date value of July 7 but not be available for installation until (for example) July 13. Suppose for this case that a patch baseline that specifies a 7-day auto-approval delay runs in an Install operation on July 14. Because the Update Date value is 7 days prior to the run date, the patches and updates in the package are installed on July 14. The installation happens even though only 1 day has passed since the package became available for actual installation. • A package containing operating system or application patches can be updated more than once after initial release. • A package can be released into the AWS managed repositories but then rolled back if issues are later discovered with it. In some patching operations, these factors might not be important. For example, if a patch baseline is configured to install a patch with severity values of Low and Medium, and a classification of Recommended, any auto-approval delay might have little impact on your operations. However, in cases where the timing of critical or high-severity patches is more important, you might want to exercise more control over when patches are installed. The recommended method for doing this is to use alternative
systems-manager-ug-153
systems-manager-ug.pdf
153
package can be released into the AWS managed repositories but then rolled back if issues are later discovered with it. In some patching operations, these factors might not be important. For example, if a patch baseline is configured to install a patch with severity values of Low and Medium, and a classification of Recommended, any auto-approval delay might have little impact on your operations. However, in cases where the timing of critical or high-severity patches is more important, you might want to exercise more control over when patches are installed. The recommended method for doing this is to use alternative patch source repositories instead of the default repositories for patching operations on a managed node. You can specify alternative patch source repositories when you create a custom patch baseline. In each custom patch baseline, you can specify patch source configurations for up to 20 versions of a supported Linux operating system. For more information, see How to specify an alternative patch source repository (Linux). How security patches are selected The primary focus of Patch Manager, a tool in AWS Systems Manager, is on installing operating systems security-related updates on managed nodes. By default, Patch Manager doesn't install all available patches, but rather a smaller set of patches focused on security. For Linux-based operating system types that report a severity level for patches, Patch Manager uses the severity level reported by the software publisher for the update notice or individual patch. Patch Manager doesn't derive severity levels from third-party sources, such as the Common Vulnerability Scoring System (CVSS), or from metrics released by the National Vulnerability Database (NVD). Patch Manager 479 AWS Systems Manager Note User Guide On all Linux-based systems supported by Patch Manager, you can choose a different source repository configured for the managed node, typically to install nonsecurity updates. For information, see How to specify an alternative patch source repository (Linux). The remainder of this section explains how Patch Manager selects security patches for the different supported operating systems. Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022, and Amazon Linux 2023 Preconfigured repositories are handled differently on Amazon Linux 1 and Amazon Linux 2 than on Amazon Linux 2022 and Amazon Linux 2023. On Amazon Linux 1 and Amazon Linux 2, the Systems Manager patch baseline service uses preconfigured repositories on the managed node. There are usually two preconfigured repositories (repos) on a node: On Amazon Linux 1 • Repo ID: amzn-main/latest Repo name: amzn-main-Base • Repo ID: amzn-updates/latest Repo name: amzn-updates-Base On Amazon Linux 2 • Repo ID: amzn2-core/2/architecture Repo name: Amazon Linux 2 core repository • Repo ID: amzn2extra-docker/2/architecture Repo name: Amazon Extras repo for docker Patch Manager 480 AWS Systems Manager Note architecture can be x86_64 or aarch64. User Guide When you create an Amazon Linux 2023 (AL2023) instance, it contains the updates that were available in the version of AL2023 and the specific AMI you selected. Your AL2023 instance doesn't automatically receive additional critical and important security updates at launch time. Instead, with the deterministic upgrades through versioned repositories feature supported for AL2023, which is turned on by default, you can apply updates based on a schedule that meets your specific needs. For more information, see Deterministic upgrades through versioned repositories in the Amazon Linux 2023 User Guide. On Amazon Linux 2022, the preconfigured repositories are tied to locked versions of package updates. When new Amazon Machine Images (AMIs) for Amazon Linux 2022 are released, they are locked to a specific version. For patch updates, Patch Manager retrieves the latest locked version of the patch update repository and then updates packages on the managed node based on the content of that locked version. On AL2023, the preconfigured repository is the following: • Repo ID: amazonlinux Repo name: Amazon Linux 2023 repository On Amazon Linux 2022 (preview release), the preconfigured repositories are tied to locked versions of package updates. When new Amazon Machine Images (AMIs) for Amazon Linux 2022 are released, they are locked to a specific version. For patch updates, Patch Manager retrieves the latest locked version of the patch update repository and then updates packages on the managed node based on the content of that locked version. On Amazon Linux 2022, the preconfigured repository is the following: • Repo ID: amazonlinux Repo name: Amazon Linux 2022 repository Patch Manager 481 AWS Systems Manager Note User Guide All updates are downloaded from the remote repos configured on the managed node. Therefore, the node must have outbound access to the internet in order to connect to the repos so the patching can be performed. Amazon Linux 1 and Amazon Linux 2 managed nodes use Yum as the package manager. Amazon Linux 2022 and Amazon Linux 2023 use DNF as the package manager. Both package managers use the concept of an update notice as a
systems-manager-ug-154
systems-manager-ug.pdf
154
preconfigured repository is the following: • Repo ID: amazonlinux Repo name: Amazon Linux 2022 repository Patch Manager 481 AWS Systems Manager Note User Guide All updates are downloaded from the remote repos configured on the managed node. Therefore, the node must have outbound access to the internet in order to connect to the repos so the patching can be performed. Amazon Linux 1 and Amazon Linux 2 managed nodes use Yum as the package manager. Amazon Linux 2022 and Amazon Linux 2023 use DNF as the package manager. Both package managers use the concept of an update notice as a file named updateinfo.xml. An update notice is simply a collection of packages that fix specific problems. All packages that are in an update notice are considered Security by Patch Manager. Individual packages aren't assigned classifications or severity levels. For this reason, Patch Manager assigns the attributes of an update notice to the related packages. Note If you select the Include non-security updates check box in the Create patch baseline page, then packages that aren't classified in an updateinfo.xml file (or a package that contains a file without properly formatted Classification, Severity, and Date values) can be included in the prefiltered list of patches. However, in order for a patch to be applied, the patch must still meet the user-specified patch baseline rules. For more information about the Include non-security updates option, see How patches are installed and How patch baseline rules work on Linux-based systems. CentOS and CentOS Stream On CentOS and CentOS Stream, the Systems Manager patch baseline service uses preconfigured repositories (repos) on the managed node. The following list provides examples for a fictitious CentOS 8.2 Amazon Machine Image (AMI): • Repo ID: example-centos-8.2-base Repo name: Example CentOS-8.2 - Base • Repo ID: example-centos-8.2-extras Repo name: Example CentOS-8.2 - Extras Patch Manager 482 AWS Systems Manager User Guide • Repo ID: example-centos-8.2-updates Repo name: Example CentOS-8.2 - Updates • Repo ID: example-centos-8.x-examplerepo Repo name: Example CentOS-8.x – Example Repo Packages Note All updates are downloaded from the remote repos configured on the managed node. Therefore, the node must have outbound access to the internet in order to connect to the repos so the patching can be performed. CentOS 6 and 7 managed nodes use Yum as the package manager. CentOS 8 and CentOS Stream nodes use DNF as the package manager. Both package managers use the concept of an update notice. An update notice is simply a collection of packages that fix specific problems. However, CentOS and CentOS Stream default repos aren't configured with an update notice. This means that Patch Manager doesn't detect packages on default CentOS and CentOS Stream repos. To allow Patch Manager to process packages that aren't contained in an update notice, you must turn on the EnableNonSecurity flag in the patch baseline rules. Note CentOS and CentOS Stream update notices are supported. Repos with update notices can be downloaded after launch. Debian Server and Raspberry Pi OS On Debian Server and Raspberry Pi OS (formerly Raspbian), the Systems Manager patch baseline service uses preconfigured repositories (repos) on the instance. These preconfigured repos are used to pull an updated list of available package upgrades. For this, Systems Manager performs the equivalent of a sudo apt-get update command. Packages are then filtered from debian-security codename repos. This means that on each version of Debian Server, Patch Manager only identifies upgrades that are part of the associated repo for that version, as follows: Patch Manager 483 AWS Systems Manager User Guide • Debian Server 8: debian-security jessie • Debian Server 9: debian-security stretch • Debian Server 10: debian-security buster • Debian Server 11: debian-security bullseye • Debian Server 12: debian-security bookworm Note On Debian Server 8 only: Because some Debian Server 8.* managed nodes refer to an obsolete package repository (jessie-backports), Patch Manager performs additional steps to ensure that patching operations succeed. For more information, see How patches are installed. Oracle Linux On Oracle Linux, the Systems Manager patch baseline service uses preconfigured repositories (repos) on the managed node. There are usually two preconfigured repos on a node. Oracle Linux 7: • Repo ID: ol7_UEKR5/x86_64 Repo name: Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64) • Repo ID: ol7_latest/x86_64 Repo name: Oracle Linux 7Server Latest (x86_64) Oracle Linux 8: • Repo ID: ol8_baseos_latest Repo name: Oracle Linux 8 BaseOS Latest (x86_64) • Repo ID: ol8_appstream Repo name: Oracle Linux 8 Application Stream (x86_64) Patch Manager 484 AWS Systems Manager • Repo ID: ol8_UEKR6 User Guide Repo name: Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64) Oracle Linux 9: • Repo ID: ol9_baseos_latest Repo name: Oracle Linux 9 BaseOS Latest (x86_64) • Repo ID: ol9_appstream Repo name: Oracle Linux 9 Application Stream Packages(x86_64) • Repo ID: ol9_UEKR7 Repo name: Oracle Linux
systems-manager-ug-155
systems-manager-ug.pdf
155
7Server (x86_64) • Repo ID: ol7_latest/x86_64 Repo name: Oracle Linux 7Server Latest (x86_64) Oracle Linux 8: • Repo ID: ol8_baseos_latest Repo name: Oracle Linux 8 BaseOS Latest (x86_64) • Repo ID: ol8_appstream Repo name: Oracle Linux 8 Application Stream (x86_64) Patch Manager 484 AWS Systems Manager • Repo ID: ol8_UEKR6 User Guide Repo name: Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64) Oracle Linux 9: • Repo ID: ol9_baseos_latest Repo name: Oracle Linux 9 BaseOS Latest (x86_64) • Repo ID: ol9_appstream Repo name: Oracle Linux 9 Application Stream Packages(x86_64) • Repo ID: ol9_UEKR7 Repo name: Oracle Linux UEK Release 7 (x86_64) Note All updates are downloaded from the remote repos configured on the managed node. Therefore, the node must have outbound access to the internet in order to connect to the repos so the patching can be performed. Oracle Linux managed nodes use Yum as the package manager, and Yum uses the concept of an update notice as a file named updateinfo.xml. An update notice is simply a collection of packages that fix specific problems. Individual packages aren't assigned classifications or severity levels. For this reason, Patch Manager assigns the attributes of an update notice to the related packages and installs packages based on the Classification filters specified in the patch baseline. Note If you select the Include non-security updates check box in the Create patch baseline page, then packages that aren't classified in an updateinfo.xml file (or a package that contains a file without properly formatted Classification, Severity, and Date values) can Patch Manager 485 AWS Systems Manager User Guide be included in the prefiltered list of patches. However, in order for a patch to be applied, the patch must still meet the user-specified patch baseline rules. AlmaLinux, RHEL, and Rocky Linux On AlmaLinux, Red Hat Enterprise Linux, and Rocky Linux the Systems Manager patch baseline service uses preconfigured repositories (repos) on the managed node. There are usually three preconfigured repos on a node. All updates are downloaded from the remote repos configured on the managed node. Therefore, the node must have outbound access to the internet in order to connect to the repos so the patching can be performed. Note If you select the Include non-security updates check box in the Create patch baseline page, then packages that aren't classified in an updateinfo.xml file (or a package that contains a file without properly formatted Classification, Severity, and Date values) can be included in the prefiltered list of patches. However, in order for a patch to be applied, the patch must still meet the user-specified patch baseline rules. Red Hat Enterprise Linux 7 managed nodes use Yum as the package manager. AlmaLinux, Red Hat Enterprise Linux 8, and Rocky Linux managed nodes use DNF as the package manager. Both package managers use the concept of an update notice as a file named updateinfo.xml. An update notice is simply a collection of packages that fix specific problems. Individual packages aren't assigned classifications or severity levels. For this reason, Patch Manager assigns the attributes of an update notice to the related packages and installs packages based on the Classification filters specified in the patch baseline. RHEL 7 Note The following repo IDs are associated with RHUI 2. RHUI 3 launched in December 2019 and introduced a different naming scheme for Yum repository IDs. Depending on the RHEL-7 AMI you create your managed nodes from, you might need to update Patch Manager 486 AWS Systems Manager User Guide your commands. For more information, see Repository IDs for RHEL 7 in AWS Have Changed on the Red Hat Customer Portal. • Repo ID: rhui-REGION-client-config-server-7/x86_64 Repo name: Red Hat Update Infrastructure 2.0 Client Configuration Server 7 • Repo ID: rhui-REGION-rhel-server-releases/7Server/x86_64 Repo name: Red Hat Enterprise Linux Server 7 (RPMs) • Repo ID: rhui-REGION-rhel-server-rh-common/7Server/x86_64 Repo name: Red Hat Enterprise Linux Server 7 RH Common (RPMs) AlmaLinux, 8 RHEL 8, and Rocky Linux 8 • Repo ID: rhel-8-appstream-rhui-rpms Repo name: Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs) • Repo ID: rhel-8-baseos-rhui-rpms Repo name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs) • Repo ID: rhui-client-config-server-8 Repo name: Red Hat Update Infrastructure 3 Client Configuration Server 8 AlmaLinux 9, RHEL 9, and Rocky Linux 9 • Repo ID: rhel-9-appstream-rhui-rpms Repo name: Red Hat Enterprise Linux 9 for x86_64 - AppStream from RHUI (RPMs) • Repo ID: rhel-9-baseos-rhui-rpms Repo name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS from RHUI (RPMs) • Repo ID: rhui-client-config-server-9 Patch Manager 487 AWS Systems Manager User Guide Repo name: Red Hat Enterprise Linux 9 Client Configuration SLES On SUSE Linux Enterprise Server (SLES) managed nodes, the ZYPP library gets the list of available patches (a collection of packages) from the following locations: • List of repositories: etc/zypp/repos.d/* • Package
systems-manager-ug-156
systems-manager-ug.pdf
156
Server 8 AlmaLinux 9, RHEL 9, and Rocky Linux 9 • Repo ID: rhel-9-appstream-rhui-rpms Repo name: Red Hat Enterprise Linux 9 for x86_64 - AppStream from RHUI (RPMs) • Repo ID: rhel-9-baseos-rhui-rpms Repo name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS from RHUI (RPMs) • Repo ID: rhui-client-config-server-9 Patch Manager 487 AWS Systems Manager User Guide Repo name: Red Hat Enterprise Linux 9 Client Configuration SLES On SUSE Linux Enterprise Server (SLES) managed nodes, the ZYPP library gets the list of available patches (a collection of packages) from the following locations: • List of repositories: etc/zypp/repos.d/* • Package information: /var/cache/zypp/raw/* SLES managed nodes use Zypper as the package manager, and Zypper uses the concept of a patch. A patch is simply a collection of packages that fix a specific problem. Patch Manager handles all packages referenced in a patch as security-related. Because individual packages aren't given classifications or severity, Patch Manager assigns the packages the attributes of the patch that they belong to. Ubuntu Server On Ubuntu Server, the Systems Manager patch baseline service uses preconfigured repositories (repos) on the managed node. These preconfigured repos are used to pull an updated list of available package upgrades. For this, Systems Manager performs the equivalent of a sudo apt-get update command. Packages are then filtered from codename-security repos, where the codename is unique to the release version, such as trusty for Ubuntu Server 14. Patch Manager only identifies upgrades that are part of these repos: • Ubuntu Server 14.04 LTS: trusty-security • Ubuntu Server 16.04 LTS: xenial-security • Ubuntu Server 18.04 LTS: bionic-security • Ubuntu Server 20.04 LTS: focal-security • Ubuntu Server 20.10 STR: groovy-security • Ubuntu Server 22.04 LTS (jammy-security) • Ubuntu Server 23.04 (lunar-security) Patch Manager 488 AWS Systems Manager Windows Server User Guide On Microsoft Windows operating systems, Patch Manager retrieves a list of available updates that Microsoft publishes to Microsoft Update and are automatically available to Windows Server Update Services (WSUS). Note Patch Manager only makes available patches for Windows Server operating system versions that are supported for Patch Manager. For example, Patch Manager can't be used to patch Windows RT. Patch Manager continually monitors for new updates in every AWS Region. The list of available updates is refreshed in each Region at least once per day. When the patch information from Microsoft is processed, Patch Manager removes updates that were replaced by later updates from its patch list . Therefore, only the most recent update is displayed and made available for installation. For example, if KB4012214 replaces KB3135456, only KB4012214 is made available as an update in Patch Manager. Similarly, Patch Manager can install only patches that are available on the managed node during the time of the patching operation. By default, Windows Server 2019 and Windows Server 2022 remove updates that are replaced by later updates. As a result, if you use the ApproveUntilDate parameter in a Windows Server patch baseline, but the date selected in the ApproveUntilDate parameter is before the date of the latest patch, then the following scenario occurs: • The superseded patch is removed from the node and therefore can't be installed using Patch Manager. • The latest, replacement patch is present on the node but not yet approved for installation per the ApproveUntilDate parameter's specified date. This means that the managed node is compliant in terms of Systems Manager operations, even though a critical patch from the previous month might not be installed. This same scenario can occur when using the ApproveAfterDays parameter. Because of the Microsoft superseded patch behavior, it is possible to set a number (generally greater than 30 days) so that patches for Windows Server are never installed if the latest available patch from Microsoft is released before the number of days in ApproveAfterDays has elapsed. Note that this system behavior Patch Manager 489 AWS Systems Manager User Guide doesn't apply if you have modified your Windows Group Policy Object (GPO) settings to make the superseded patch available on your managed nodes. Note In some cases, Microsoft releases patches for applications that don't specify an updated date and time. In these cases, an updated date and time of 01/01/1970 is supplied by default. How to specify an alternative patch source repository (Linux) When you use the default repositories configured on a managed node for patching operations, Patch Manager, a tool in AWS Systems Manager, scans for or installs security-related patches. This is the default behavior for Patch Manager. For complete information about how Patch Manager selects and installs security patches, see How security patches are selected. On Linux systems, however, you can also use Patch Manager to install patches that aren't related to security, or that are in a different source repository than the default one configured on the managed node. You can specify alternative patch
systems-manager-ug-157
systems-manager-ug.pdf
157
an alternative patch source repository (Linux) When you use the default repositories configured on a managed node for patching operations, Patch Manager, a tool in AWS Systems Manager, scans for or installs security-related patches. This is the default behavior for Patch Manager. For complete information about how Patch Manager selects and installs security patches, see How security patches are selected. On Linux systems, however, you can also use Patch Manager to install patches that aren't related to security, or that are in a different source repository than the default one configured on the managed node. You can specify alternative patch source repositories when you create a custom patch baseline. In each custom patch baseline, you can specify patch source configurations for up to 20 versions of a supported Linux operating system. For example, suppose that your Ubuntu Server fleet includes both Ubuntu Server 14.04 and Ubuntu Server 16.04 managed nodes. In this case, you can specify alternate repositories for each version in the same custom patch baseline. For each version, you provide a name, specify the operating system version type (product), and provide a repository configuration. You can also specify a single alternative source repository that applies to all versions of a supported operating system. Note Running a custom patch baseline that specifies alternative patch repositories for a managed node doesn't make them the new default repositories on the operating system. After the patching operation is complete, the repositories previously configured as the defaults for the node's operating system remain the defaults. Patch Manager 490 AWS Systems Manager User Guide For a list of example scenarios for using this option, see Sample uses for alternative patch source repositories later in this topic. For information about default and custom patch baselines, see Predefined and custom patch baselines. Example: Using the console To specify alternative patch source repositories when you're working in the Systems Manager console, use the Patch sources section on the Create patch baseline page. For information about using the Patch sources options, see Creating a custom patch baseline for Linux. Example: Using the AWS CLI For an example of using the --sources option with the AWS Command Line Interface (AWS CLI), see Create a patch baseline with custom repositories for different OS versions. Topics • Important considerations for alternative repositories • Sample uses for alternative patch source repositories Important considerations for alternative repositories Keep in mind the following points as you plan your patching strategy using alternative patch repositories. Only specified repositories are used for patching Specifying alternative repositories doesn't mean specifying additional repositories. You can choose to specify repositories other than those configured as defaults on a managed node. However, you must also specify the default repositories as part of the alternative patch source configuration if you want their updates to be applied. For example, on Amazon Linux 2 managed nodes, the default repositories are amzn2-core and amzn2extra-docker. If you want to include the Extra Packages for Enterprise Linux (EPEL) repository in your patching operations, you must specify all three repositories as alternative repositories. Patch Manager 491 AWS Systems Manager Note User Guide Running a custom patch baseline that specifies alternative patch repositories for a managed node doesn't make them the new default repositories on the operating system. After the patching operation is complete, the repositories previously configured as the defaults for the node's operating system remain the defaults. Patching behavior for YUM-based distributions depends on the updateinfo.xml manifest When you specify alternative patch repositories for YUM-based distributions, such as Amazon Linux 1 or Amazon Linux 2, Red Hat Enterprise Linux, or CentOS, patching behavior depends on whether the repository includes an update manifest in the form of a complete and correctly formatted updateinfo.xml file. This file specifies the release date, classifications, and severities of the various packages. Any of the following will affect the patching behavior: • If you filter on Classification and Severity, but they aren't specified in updateinfo.xml, the package won't be included by the filter. This also means that packages without an updateinfo.xml file won't be included in patching. • If you filter on ApprovalAfterDays, but the package release date isn't in Unix Epoch format (or has no release date specified), the package won't be included by the filter. • There is an exception if you select the Include non-security updates check box in the Create patch baseline page. In this case, packages without an updateinfo.xml file (or that contains this file without properly formatted Classification, Severity, and Date values) will be included in the prefiltered list of patches. (They must still meet the other patch baseline rule requirements in order to be installed.) Sample uses for alternative patch source repositories Example 1 – Nonsecurity Updates for Ubuntu Server You're already using Patch Manager to install security patches on a fleet of Ubuntu Server
systems-manager-ug-158
systems-manager-ug.pdf
158
be included by the filter. • There is an exception if you select the Include non-security updates check box in the Create patch baseline page. In this case, packages without an updateinfo.xml file (or that contains this file without properly formatted Classification, Severity, and Date values) will be included in the prefiltered list of patches. (They must still meet the other patch baseline rule requirements in order to be installed.) Sample uses for alternative patch source repositories Example 1 – Nonsecurity Updates for Ubuntu Server You're already using Patch Manager to install security patches on a fleet of Ubuntu Server managed nodes using the AWS-provided predefined patch baseline AWS- UbuntuDefaultPatchBaseline. You can create a new patch baseline that is based on this default, but specify in the approval rules that you want nonsecurity related updates that are part of the default distribution to be installed as well. When this patch baseline is run against your nodes, patches for both security and nonsecurity issues are applied. You can also choose to approve nonsecurity patches in the patch exceptions you specify for a baseline. Patch Manager 492 AWS Systems Manager User Guide Example 2 - Personal Package Archives (PPA) for Ubuntu Server Your Ubuntu Server managed nodes are running software that is distributed through a Personal Package Archives (PPA) for Ubuntu. In this case, you create a patch baseline that specifies a PPA repository that you have configured on the managed node as the source repository for the patching operation. Then use Run Command to run the patch baseline document on the nodes. Example 3 – Internal Corporate Applications on Amazon Linux You need to run some applications needed for industry regulatory compliance on your Amazon Linux managed nodes. You can configure a repository for these applications on the nodes, use YUM to initially install the applications, and then update or create a new patch baseline to include this new corporate repository. After this you can use Run Command to run the AWS- RunPatchBaseline document with the Scan option to see if the corporate package is listed among the installed packages and is up to date on the managed node. If it isn't up to date, you can run the document again using the Install option to update the applications. How patches are installed Patch Manager, a tool in AWS Systems Manager, uses the appropriate built-in mechanism for an operating system type to install updates on a managed node. For example, on Windows Server, the Windows Update API is used, and on Amazon Linux 2 the yum package manager is used. The remainder of this section explains how Patch Manager installs patches on an operating system. Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022, and Amazon Linux 2023 On Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022, and Amazon Linux 2023 managed nodes, the patch installation workflow is as follows: 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. 2. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 3. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. Patch Manager 493 AWS Systems Manager User Guide Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. If nonsecurity updates are included, patches from other repositories are considered as well. 4. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 5. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 6. If multiple versions of a patch are approved, the latest version is applied. 7. The YUM update API (Amazon Linux 1, Amazon Linux 2) or the DNF update API (Amazon Linux 2022, Amazon Linux 2023) is applied to approved patches as follows: • For predefined default patch baselines provided by AWS, only patches specified in updateinfo.xml are applied (security updates only). This is because the Include nonsecurity updates check box is not selected. The predefined baselines are equivalent to a custom baseline with the following: • The Include nonsecurity updates check box is not selected •
systems-manager-ug-159
systems-manager-ug.pdf
159
won't be applied. 6. If multiple versions of a patch are approved, the latest version is applied. 7. The YUM update API (Amazon Linux 1, Amazon Linux 2) or the DNF update API (Amazon Linux 2022, Amazon Linux 2023) is applied to approved patches as follows: • For predefined default patch baselines provided by AWS, only patches specified in updateinfo.xml are applied (security updates only). This is because the Include nonsecurity updates check box is not selected. The predefined baselines are equivalent to a custom baseline with the following: • The Include nonsecurity updates check box is not selected • A SEVERITY list of [Critical, Important] • A CLASSIFICATION list of [Security, Bugfix] For Amazon Linux 1 and Amazon Linux 2, the equivalent yum command for this workflow is: sudo yum update-minimal --sec-severity=Critical,Important --bugfix -y For Amazon Linux 2022 and Amazon Linux 2023, the equivalent dnf command for this workflow is: sudo dnf upgrade-minimal --sec-severity=Critical --sec-severity=Important -- bugfix -y Patch Manager 494 AWS Systems Manager User Guide If the Include nonsecurity updates check box is selected, patches in updateinfo.xml and those not in updateinfo.xml are all applied (security and nonsecurity updates). For Amazon Linux 1 and Amazon Linux 2, if a baseline with Include nonsecurity updates is selected, has a SEVERITY list of [Critical, Important] and a CLASSIFICATION list of [Security, Bugfix], the equivalent yum command is: sudo yum update --security --sec-severity=Critical,Important --bugfix -y For Amazon Linux 2022, and Amazon Linux 2023, the equivalent dnf command is: sudo dnf upgrade --security --sec-severity=Critical --sec-severity=Important -- bugfix -y Note For Amazon Linux 2022 and Amazon Linux 2023, a patch severity level of Medium is equivalent to a severity of Moderate that might be defined in some external repositories. If you include Medium severity patches in the patch baseline, Moderate severity patches from external patches are also installed on the instances. When you query for compliance data using the API action DescribeInstancePatches, filtering for the severity level Medium reports patches with severity levels of both Medium and Moderate. Amazon Linux 2022 and Amazon Linux 2023 also support the patch severity level None, which is recognized by the DNF package manager. 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) CentOS and CentOS Stream On CentOS and CentOS Stream managed nodes, the patch installation workflow is as follows: Patch Manager 495 AWS Systems Manager User Guide 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 2. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. If nonsecurity updates are included, patches from other repositories are considered as well. 3. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 4. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 5. If multiple versions of a patch are approved, the latest version is applied. 6. The YUM update API (on CentOS 6.x and 7.x versions) or the DNF update (on CentOS 8 and CentOS Stream) is applied to approved patches. 7. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Debian Server and Raspberry Pi OS On Debian Server and Raspberry Pi OS (formerly Raspbian) instances, the patch installation workflow is as follows: Patch Manager 496 AWS Systems Manager User Guide 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. 2. If an update is available for python3-apt (a
systems-manager-ug-160
systems-manager-ug.pdf
160
document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Debian Server and Raspberry Pi OS On Debian Server and Raspberry Pi OS (formerly Raspbian) instances, the patch installation workflow is as follows: Patch Manager 496 AWS Systems Manager User Guide 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. 2. If an update is available for python3-apt (a Python library interface to libapt), it is upgraded to the latest version. (This nonsecurity package is upgraded even if you did not select the Include nonsecurity updates option.) Important On Debian Server 8 only: Because some Debian Server 8.* managed nodes refer to an obsolete package repository (jessie-backports), Patch Manager performs the following additional steps to ensure that patching operations succeed: a. On your managed node, the reference to the jessie-backports repository is commented out from the source location list (/etc/apt/sources.list.d/ jessie-backports). As a result, no attempt is made to download patches from that location. b. A Stretch security update signing key is imported. This key provides the necessary permissions for the update and install operations on Debian Server 8.* distributions. c. The apt-get operation is run at this point to ensure that the latest version of python3-apt is installed before the patching process begins. d. After the installation process is complete, the reference to the jessie- backports repository is restored and the signing key is removed from the apt sources keyring. This is done to leave the system configuration as it was before the patching operation. The next time Patch Manager updates the system, the same process is repeated. 3. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 4. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. Patch Manager 497 AWS Systems Manager Note User Guide Because it isn't possible to reliably determine the release dates of update packages for Debian Server, the auto-approval options aren't supported for this operating system. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. If nonsecurity updates are included, patches from other repositories are considered as well. Note For Debian Server and Raspberry Pi OS, patch candidate versions are limited to patches included in debian-security. 5. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 6. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 7. The APT library is used to upgrade packages. Note Patch Manager does not support using the APT Pin-Priority option to assign priorities to packages. Patch Manager aggregates available updates from all enabled repositories and selects the most recent update that matches the baseline for each installed package. 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, Patch Manager 498 AWS Systems Manager User Guide the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) macOS On macOS managed nodes, the patch installation workflow is as follows: 1. The /Library/Receipts/InstallHistory.plist property list is a record of software that has been installed and upgraded using the softwareupdate and installer package managers. Using the pkgutil command line tool (for installer) and the softwareupdate package manager, CLI commands are run to parse this list. For installer, the response to the CLI commands includes package name, version, volume, location, and install-time details, but only the package name and version are used by Patch Manager. For softwareupdate, the response to the CLI commands includes the package name (display name), version, and date, but only the package name and version are used by Patch Manager. For Brew and Brew Cask, Homebrew doesn't support its commands running under the root user. As a result, Patch Manager queries for and runs Homebrew commands as either the owner of the Homebrew directory or as a valid user belonging to the Homebrew directory’s owner group. The commands are similar to softwareupdate and installer and are run through a Python subprocess to gather package data, and
systems-manager-ug-161
systems-manager-ug.pdf
161
are used by Patch Manager. For softwareupdate, the response to the CLI commands includes the package name (display name), version, and date, but only the package name and version are used by Patch Manager. For Brew and Brew Cask, Homebrew doesn't support its commands running under the root user. As a result, Patch Manager queries for and runs Homebrew commands as either the owner of the Homebrew directory or as a valid user belonging to the Homebrew directory’s owner group. The commands are similar to softwareupdate and installer and are run through a Python subprocess to gather package data, and the output is parsed to identify package names and versions. 2. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 3. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. 4. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 5. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 6. If multiple versions of a patch are approved, the latest version is applied. Patch Manager 499 AWS Systems Manager User Guide 7. Invokes the appropriate package CLI on the managed node to process approved patches as follows: Note installer lacks the functionality to check for and install updates. Therefore, for installer, Patch Manager only reports which packages are installed. As a result, installer packages are never reported as Missing. • For predefined default patch baselines provided by AWS, and for custom patch baselines where the Include non-security updates check box is not selected, only security updates are applied. • For custom patch baselines where the Include non-security updates check box is selected, both security and nonsecurity updates are applied. 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Oracle Linux On Oracle Linux managed nodes, the patch installation workflow is as follows: 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. 2. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 3. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. Patch Manager 500 AWS Systems Manager User Guide If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. If nonsecurity updates are included, patches from other repositories are considered as well. 4. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 5. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 6. If multiple versions of a patch are approved, the latest version is applied. 7. On version 7 managed nodes, the YUM update API is applied to approved patches as follows: • For predefined default patch baselines provided by AWS, and for custom patch baselines where the Include non-security updates check box is not selected, only patches specified in updateinfo.xml are applied (security updates only). The equivalent yum command for this workflow is: sudo yum update-minimal --sec-severity=Important,Moderate --bugfix -y • For custom patch baselines where the Include non-security updates check box is selected, both patches in updateinfo.xml and those not in updateinfo.xml are applied (security and nonsecurity updates). The equivalent yum command for this workflow is: sudo yum update --security --bugfix -y On version 8 and 9 managed nodes, the DNF update API is applied to approved patches as follows: • For predefined default patch baselines provided by AWS, and for custom patch baselines where the Include non-security updates check box is not selected, only patches specified in updateinfo.xml are applied (security updates only). The equivalent yum command for this workflow is: Patch Manager 501 AWS Systems Manager User Guide sudo dnf upgrade-minimal --security --sec-severity=Moderate --sec- severity=Important • For custom patch
systems-manager-ug-162
systems-manager-ug.pdf
162
updateinfo.xml are applied (security and nonsecurity updates). The equivalent yum command for this workflow is: sudo yum update --security --bugfix -y On version 8 and 9 managed nodes, the DNF update API is applied to approved patches as follows: • For predefined default patch baselines provided by AWS, and for custom patch baselines where the Include non-security updates check box is not selected, only patches specified in updateinfo.xml are applied (security updates only). The equivalent yum command for this workflow is: Patch Manager 501 AWS Systems Manager User Guide sudo dnf upgrade-minimal --security --sec-severity=Moderate --sec- severity=Important • For custom patch baselines where the Include non-security updates check box is selected, both patches in updateinfo.xml and those not in updateinfo.xml are applied (security and nonsecurity updates). The equivalent yum command for this workflow is: sudo dnf upgrade --security --bugfix 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) AlmaLinux, RHEL, and Rocky Linux On AlmaLinux, Red Hat Enterprise Linux, and Rocky Linux managed nodes, the patch installation workflow is as follows: 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. 2. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 3. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. If nonsecurity updates are included, patches from other repositories are considered as well. Patch Manager 502 AWS Systems Manager User Guide 4. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 5. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 6. If multiple versions of a patch are approved, the latest version is applied. 7. The YUM update API (on RHEL 7) or the DNF update API (on AlmaLinux 8 and 9, RHEL 8 and 9, and Rocky Linux 8 and 9) is applied to approved patches according to the following rules: Scenario 1: Non-security updates excluded • Applies to: Predefined default patch baselines provided by AWS and custom patch baselines. • Include non-security updates check box: Not selected. • Patches applied: Patches specified in updateinfo.xml (security updates only) are applied only if they both match the patch baseline configuration and are found in the configured repos. In some cases, a patch specified in updateinfo.xml might no longer be available in a configured repo. Configured repos usually have only the latest version of a patch, which is a cumulative roll-up of all prior updates, but the latest version might not match the patch baseline rules and is omitted from the patching operation. • Commands: For RHEL 7, the equivalent yum command for this workflow is: sudo yum update-minimal --sec-severity=Critical,Important --bugfix -y For AlmaLinux, RHEL 8, and Rocky Linux , the equivalent dnf commands for this workflow are: sudo dnf update-minimal --sec-severity=Critical --bugfix -y ; \ sudo dnf update-minimal --sec-severity=Important --bugfix -y Scenario 2: Non-security updates included • Apples to: Custom patch baselines. Patch Manager 503 AWS Systems Manager User Guide • Include non-security updates check box: Selected. • Patches applied: Patches in updateinfo.xml and those not in updateinfo.xml are applied (security and nonsecurity updates). • Commands: For RHEL 7, the equivalent yum command for this workflow is: sudo yum update --security --bugfix -y For AlmaLinux 8 and 9, RHEL 8 and 9, and Rocky Linux 8 and 9, the equivalent dnf command for this workflow is: sudo dnf update --security --bugfix -y 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) SLES On SUSE Linux Enterprise Server (SLES) managed nodes, the patch installation workflow is as follows: 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service
systems-manager-ug-163
systems-manager-ug.pdf
163
and 9, RHEL 8 and 9, and Rocky Linux 8 and 9, the equivalent dnf command for this workflow is: sudo dnf update --security --bugfix -y 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) SLES On SUSE Linux Enterprise Server (SLES) managed nodes, the patch installation workflow is as follows: 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. 2. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 3. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. Patch Manager 504 AWS Systems Manager User Guide If nonsecurity updates are included, patches from other repositories are considered as well. 4. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 5. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 6. If multiple versions of a patch are approved, the latest version is applied. 7. The Zypper update API is applied to approved patches. 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Ubuntu Server On Ubuntu Server managed nodes, the patch installation workflow is as follows: 1. If a list of patches is specified using an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL using the InstallOverrideList parameter for the AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation documents, the listed patches are installed and steps 2-7 are skipped. 2. If an update is available for python3-apt (a Python library interface to libapt), it is upgraded to the latest version. (This nonsecurity package is upgraded even if you did not select the Include nonsecurity updates option.) 3. Apply GlobalFilters as specified in the patch baseline, keeping only the qualified packages for further processing. 4. Apply ApprovalRules as specified in the patch baseline. Each approval rule can define a package as approved. Note Because it's not possible to reliably determine the release dates of update packages for Ubuntu Server, the auto-approval options aren't supported for this operating system. Patch Manager 505 AWS Systems Manager User Guide Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. If nonsecurity updates are included, patches from other repositories are considered as well. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. Note For each version of Ubuntu Server, patch candidate versions are limited to patches that are part of the associated repo for that version, as follows: • Ubuntu Server 14.04 LTS: trusty-security • Ubuntu Server 16.04 LTS: xenial-security • Ubuntu Server 18.04 LTS: bionic-security • Ubuntu Server 20.04 LTS): focal-security • Ubuntu Server 20.10 STR: groovy-security • Ubuntu Server 22.04 LTS: jammy-security • Ubuntu Server 23.04: lunar-lobster 5. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 6. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 7. The APT library is used to upgrade packages. Note Patch Manager does not support using the APT Pin-Priority option to assign priorities to packages. Patch Manager aggregates available updates from all enabled Patch Manager 506 AWS Systems Manager User
systems-manager-ug-164
systems-manager-ug.pdf
164
Server 23.04: lunar-lobster 5. Apply ApprovedPatches as specified in the patch baseline. The approved patches are approved for update even if they're discarded by GlobalFilters or if no approval rule specified in ApprovalRules grants it approval. 6. Apply RejectedPatches as specified in the patch baseline. The rejected patches are removed from the list of approved patches and won't be applied. 7. The APT library is used to upgrade packages. Note Patch Manager does not support using the APT Pin-Priority option to assign priorities to packages. Patch Manager aggregates available updates from all enabled Patch Manager 506 AWS Systems Manager User Guide repositories and selects the most recent update that matches the baseline for each installed package. 8. The managed node is rebooted if any updates were installed. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Windows Server When a patching operation is performed on a Windows Server managed node, the node requests a snapshot of the appropriate patch baseline from Systems Manager. This snapshot contains the list of all updates available in the patch baseline that were approved for deployment. This list of updates is sent to the Windows Update API, which determines which of the updates are applicable to the managed node and installs them as needed. Windows allows only the latest available version of a KB to be installed. Patch Manager installs the latest version of a KB when it, or any previous version of the KB, matches the applied patch baseline. If any updates are installed, the managed node is rebooted afterwards, as many times as necessary to complete all necessary patching. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) The summary of the patching operation can be found in the output of the Run Command request. Additional logs can be found on the managed node in the %PROGRAMDATA%\Amazon \PatchBaselineOperations\Logs folder. Because the Windows Update API is used to download and install KBs, all Group Policy settings for Windows Update are respected. No Group Policy settings are required to use Patch Manager, but any settings that you have defined will be applied, such as to direct managed nodes to a Windows Server Update Services (WSUS) server. Note By default, Windows downloads all KBs from Microsoft's Windows Update site because Patch Manager uses the Windows Update API to drive the download and installation of KBs. As a result, the managed node must be able to reach the Microsoft Windows Update site or patching will fail. Alternatively, you can configure a WSUS server to serve as a KB repository and configure your managed nodes to target that WSUS server using Group Policies. Patch Manager 507 AWS Systems Manager User Guide Patch Manager might reference KB IDs when creating custom patch baselines for Windows Server, such as when an Approved patches list or Rejected patches list is included the the baseline configuration. Only updates that are assigned a KB ID in Microsoft Windows Update or a WSUS server are installed by Patch Manager. Updates that lack a KB ID are not included in patching operations. For information about creating custom patch baselines, see the following topics: • Creating a custom patch baseline for Windows Server • Create a patch baseline (CLI) • Package name formats for Windows operating systems How patch baseline rules work on Linux-based systems The rules in a patch baseline for Linux distributions operate differently based on the distribution type. Unlike patch updates on Windows Server managed nodes, rules are evaluated on each node to take the configured repos on the instance into consideration. Patch Manager, a tool in AWS Systems Manager, uses the native package manager to drive the installation of patches approved by the patch baseline. For Linux-based operating system types that report a severity level for patches, Patch Manager uses the severity level reported by the software publisher for the update notice or individual patch. Patch Manager doesn't derive severity levels from third-party sources, such as the Common Vulnerability Scoring System (CVSS), or from metrics released by the National Vulnerability Database (NVD). Topics • How patch baseline rules work on Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022 and Amazon Linux 2023 • How patch baseline rules work on CentOS and CentOS Stream • How patch baseline rules work on Debian Server and Raspberry Pi OS • How patch baseline rules work on macOS • How patch baseline rules work on Oracle Linux • How patch baseline rules work on AlmaLinux, RHEL, and Rocky Linux • How patch baseline rules work on SUSE Linux Enterprise Server • How patch baseline rules
systems-manager-ug-165
systems-manager-ug.pdf
165
or from metrics released by the National Vulnerability Database (NVD). Topics • How patch baseline rules work on Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022 and Amazon Linux 2023 • How patch baseline rules work on CentOS and CentOS Stream • How patch baseline rules work on Debian Server and Raspberry Pi OS • How patch baseline rules work on macOS • How patch baseline rules work on Oracle Linux • How patch baseline rules work on AlmaLinux, RHEL, and Rocky Linux • How patch baseline rules work on SUSE Linux Enterprise Server • How patch baseline rules work on Ubuntu Server Patch Manager 508 AWS Systems Manager User Guide How patch baseline rules work on Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022 and Amazon Linux 2023 Note Amazon Linux 2023 (AL2023) uses versioned repositories that can be locked to a specific version through one or more system settings. For all patching operations on AL2023 EC2 instances, Patch Manager uses the latest repository versions, independent of the system configuration. For more information, see Deterministic upgrades through versioned repositories in the Amazon Linux 2023 User Guide. On Amazon Linux 1, Amazon Linux 2, Amazon Linux 2022 and Amazon Linux 2023, the patch selection process is as follows: 1. On the managed node, the YUM library (Amazon Linux 1 and, Amazon Linux 2) or the DNF library (Amazon Linux 2022 and Amazon Linux 2023) accesses the updateinfo.xml file for each configured repo. If no updateinfo.xml file is found, whether patches are installed depend on settings for Include non-security updates and Auto-approval. For example, if non-security updates are permitted, they're installed when the auto-approval time arrives. 2. Each update notice in updateinfo.xml includes several attributes that denote the properties of the packages in the notice, as described in the following table. Update notice attributes Attribute type Description Corresponds to the value of the Classification key attribute in the patch baseline's PatchFilt er data type. Denotes the type of package included in the update notice. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Patch Manager 509 AWS Systems Manager Attribute severity update_id references User Guide Description Create patch baseline page or Edit patch baseline page in the Systems Manager console. Corresponds to the value of the Severity key attribute in the patch baseline's PatchFilt er data type. Denotes the severity of the packages included in the update notice. Usually only applicable for Security update notices. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Denotes the advisory ID, such as ALAS-2017 -867. The advisory ID can be used in the ApprovedPatches or RejectedPatches attribute in the patch baseline. Contains additional information about the update notice, such as a CVE ID (format: CVE-2017-1234567). The CVE ID can be used in the ApprovedPatches or RejectedPatches attribute in the patch baseline. Patch Manager 510 AWS Systems Manager Attribute updated User Guide Description Corresponds to ApproveAfterDays in the patch baseline. Denotes the released date (updated date) of the packages included in the update notice. A comparison between the current timestamp and the value of this attribute plus the ApproveAfterDays is used to determine if the patch is approved for deployment. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. 3. The product of the managed node is determined by SSM Agent. This attribute corresponds to the value of the Product key attribute in the patch baseline's PatchFilter data type. 4. Packages are selected for the update according to the following guidelines. Security option Patch selection Pre-defined default patch baselines provided by AWS and custom patch baselines where the Include non-security updates check box is not selected For each update notice in updateinf o.xml , the patch baseline is used as a filter, allowing only the qualified packages to be included in the update. If multiple packages are applicable after applying the patch baseline definition, the latest version is used. For Amazon Linux 1 and Amazon Linux 2, the equivalent yum command for this workflow is: sudo yum update-minimal --sec-sev erity=Critical,Important --bugfix - y Patch Manager 511 AWS Systems Manager User Guide Security option Patch selection For Amazon Linux 2022 and Amazon Linux 2023, the equivalent dnf command for this workflow is: sudo dnf upgrade-minimal --sec-sev erity=Critical --sec-severity=Imp ortant --bugfix -y Custom patch baselines where the Include non-security updates check box is selected with a SEVERITY
systems-manager-ug-166
systems-manager-ug.pdf
166
qualified packages to be included in the update. If multiple packages are applicable after applying the patch baseline definition, the latest version is used. For Amazon Linux 1 and Amazon Linux 2, the equivalent yum command for this workflow is: sudo yum update-minimal --sec-sev erity=Critical,Important --bugfix - y Patch Manager 511 AWS Systems Manager User Guide Security option Patch selection For Amazon Linux 2022 and Amazon Linux 2023, the equivalent dnf command for this workflow is: sudo dnf upgrade-minimal --sec-sev erity=Critical --sec-severity=Imp ortant --bugfix -y Custom patch baselines where the Include non-security updates check box is selected with a SEVERITY list of [Critical, Important] and a CLASSIFICATION list of In addition to applying the security updates that were selected from updateinfo.xml , Patch Manager applies nonsecurity updates that otherwise meet the patch filtering rules. [Security, Bugfix] For Amazon Linux and Amazon Linux 2, the equivalent yum command for this workflow is: sudo yum update --security --sec-sev erity=Critical,Important --bugfix - y For Amazon Linux 2022 and Amazon Linux 2023, the equivalent dnf command for this workflow is: sudo dnf upgrade --security --sec-sev erity=Critical --sec-severity=Imp ortant --bugfix -y For information about patch compliance status values, see Patch compliance state values. Patch Manager 512 AWS Systems Manager User Guide How patch baseline rules work on CentOS and CentOS Stream The CentOS and CentOS Stream default repositories do not include an updateinfo.xml file. However, custom repositories that you create or use might include this file. In this topic, references to updateinfo.xml apply only to these custom repositories. On CentOS and CentOS Stream, the patch selection process is as follows: 1. On the managed node, the YUM library (on CentOS 6.x and 7.x versions) or the DNF library (on CentOS 8.x and CentOS Stream) accesses the updateinfo.xml file, if it exists in a custom repository, for each configured repo. If there is no updateinfo.xml found, which always includes the default repos, whether patches are installed depends on settings for Include non-security updates and Auto-approval. For example, if non-security updates are permitted, they're installed when the auto-approval time arrives. 2. If updateinfo.xml is present, each update notice in the file includes several attributes that denote the properties of the packages in the notice, as described in the following table. Update notice attributes Attribute type severity Patch Manager Description Corresponds to the value of the Classification key attribute in the patch baseline's PatchFilt er data type. Denotes the type of package included in the update notice. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Corresponds to the value of the Severity key attribute in the patch baseline's PatchFilt 513 AWS Systems Manager Attribute update_id references updated User Guide Description er data type. Denotes the severity of the packages included in the update notice. Usually only applicable for Security update notices. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Denotes the advisory ID, such as CVE-2019- 17055. The advisory ID can be used in the ApprovedPatches or RejectedPatches attribute in the patch baseline. Contains additional information about the update notice, such as a CVE ID (format: CVE-2019-17055) or a Bugzilla ID (format: 1463241). The CVE ID and Bugzilla ID can be used in the ApprovedPatches or RejectedP atches attribute in the patch baseline. Corresponds to ApproveAfterDays in the patch baseline. Denotes the released date (updated date) of the packages included in the update notice. A comparison between the current timestamp and the value of this attribute plus the ApproveAfterDays is used to determine if the patch is approved for deployment. Patch Manager 514 AWS Systems Manager User Guide For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. 3. In all cases, the product of the managed node is determined by SSM Agent. This attribute corresponds to the value of the Product key attribute in the patch baseline's PatchFilter data type. 4. Packages are selected for the update according to the following guidelines. Security option Patch selection Pre-defined default patch baselines provided by AWS and custom patch baselines where the Include non-security updates check box is not selected For each update notice in updateinf o.xml , if it exists in a custom repository, the patch baseline is used as a filter, allowing only the qualified packages to be included in the update. If multiple packages
systems-manager-ug-167
systems-manager-ug.pdf
167
the managed node is determined by SSM Agent. This attribute corresponds to the value of the Product key attribute in the patch baseline's PatchFilter data type. 4. Packages are selected for the update according to the following guidelines. Security option Patch selection Pre-defined default patch baselines provided by AWS and custom patch baselines where the Include non-security updates check box is not selected For each update notice in updateinf o.xml , if it exists in a custom repository, the patch baseline is used as a filter, allowing only the qualified packages to be included in the update. If multiple packages are applicable after applying the patch baseline definition, the latest version is used. For CentOS 6 and 7 where updateinf o.xml is present, the equivalent yum command for this workflow is: sudo yum update-minimal --sec-sev erity=Critical,Important --bugfix - y For CentOS 8 and CentOS Stream where updateinfo.xml is present, the equivalen t dnf command for this workflow is: sudo dnf upgrade-minimal --sec-sev erity=Critical --sec-severity=Imp ortant --bugfix -y Custom patch baselines where the Include non-security updates check box is selected with a SEVERITY list of [Critical, In addition to applying the security updates that were selected from updateinfo.xml , if it exists in a custom repository, Patch Patch Manager 515 AWS Systems Manager User Guide Security option Patch selection Important] and a CLASSIFICATION list of Manager applies nonsecurity updates that [Security, Bugfix] otherwise meet the patch filtering rules. For CentOS 6 and 7 where updateinf o.xml is present, the equivalent yum command for this workflow is: sudo yum update --sec-severity=Cri tical,Important --bugfix -y For CentOS 8 and CentOS Stream where updateinfo.xml is present, the equivalen t dnf command for this workflow is: sudo dnf upgrade --security --sec-sev erity=Critical --sec-severity=Imp ortant --bugfix -y For default repos and custom repos without updateinfo.xml , you must select the Include non-security updates check box in order to update operating system (OS) packages. For information about patch compliance status values, see Patch compliance state values. How patch baseline rules work on Debian Server and Raspberry Pi OS On Debian Server and Raspberry Pi OS (formerly Raspbian), the patch baseline service offers filtering on the Priority and Section fields. These fields are typically present for all Debian Server and Raspberry Pi OS packages. To determine whether a patch is selected by the patch baseline, Patch Manager does the following: 1. On Debian Server and Raspberry Pi OS systems, the equivalent of sudo apt-get update is run to refresh the list of available packages. Repos aren't configured and the data is pulled from repos configured in a sources list. Patch Manager 516 AWS Systems Manager User Guide 2. If an update is available for python3-apt (a Python library interface to libapt), it is upgraded to the latest version. (This nonsecurity package is upgraded even if you did not select the Include nonsecurity updates option.) Important On Debian Server 8 only: Because Debian Server 8.* operating systems refer to an obsolete package repository (jessie-backports), Patch Manager performs the following additional steps to ensure that patching operations succeed: a. On your managed node, the reference to the jessie-backports repository is commented out from the source location list (/etc/apt/sources.list.d/ jessie-backports). As a result, no attempt is made to download patches from that location. b. A Stretch security update signing key is imported. This key provides the necessary permissions for the update and install operations on Debian Server 8.* distributions. c. The apt-get operation is run at this point to ensure that the latest version of python3-apt is installed before the patching process begins. d. After the installation process is complete, the reference to the jessie-backports repository is restored and the signing key is removed from the apt sources keyring. This is done to leave the system configuration as it was before the patching operation. 3. Next, the GlobalFilters, ApprovalRules, ApprovedPatches and RejectedPatches lists are applied. Note Because it isn't possible to reliably determine the release dates of update packages for Debian Server, the auto-approval options aren't supported for this operating system. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. In this case, for Debian Server, patch candidate versions are limited to patches included in the following repos: Patch Manager 517 AWS Systems Manager User Guide These repos are named as follows: • Debian Server 8: debian-security jessie • Debian Server and Raspberry Pi OS 9: debian-security stretch • Debian Server 10: debian-security buster • Debian Server 11: debian-security bullseye • Debian Server
systems-manager-ug-168
systems-manager-ug.pdf
168
implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. In this case, for Debian Server, patch candidate versions are limited to patches included in the following repos: Patch Manager 517 AWS Systems Manager User Guide These repos are named as follows: • Debian Server 8: debian-security jessie • Debian Server and Raspberry Pi OS 9: debian-security stretch • Debian Server 10: debian-security buster • Debian Server 11: debian-security bullseye • Debian Server 12: debian-security bookworm If nonsecurity updates are included, patches from other repositories are considered as well. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. To view the contents of the Priority and Section fields, run the following aptitude command: Note You might need to first install Aptitude on Debian Server systems. aptitude search -F '%p %P %s %t %V#' '~U' In the response to this command, all upgradable packages are reported in this format: name, priority, section, archive, candidate version For information about patch compliance status values, see Patch compliance state values. How patch baseline rules work on macOS On macOS, the patch selection process is as follows: 1. On the managed node, Patch Manager accesses the parsed contents of the InstallHistory.plist file and identifies package names and versions. For details about the parsing process, see the macOS section in How patches are installed. 2. The product of the managed node is determined by SSM Agent. This attribute corresponds to the value of the Product key attribute in the patch baseline's PatchFilter data type. Patch Manager 518 AWS Systems Manager User Guide 3. Packages are selected for the update according to the following guidelines. Security option Patch selection Pre-defined default patch baselines provided by AWS and custom patch baselines where the Include non-security updates check box is not selected Custom patch baselines where the Include non-security updates check box is selected For each available package update, the patch baseline is used as a filter, allowing only the qualified packages to be included in the update. If multiple packages are applicable after applying the patch baseline definition, the latest version is used. In addition to applying the security updates that were identified by using InstallHi , Patch Manager applies story.plist nonsecurity updates that otherwise meet the patch filtering rules. For information about patch compliance status values, see Patch compliance state values. How patch baseline rules work on Oracle Linux On Oracle Linux, the patch selection process is as follows: 1. On the managed node, the YUM library accesses the updateinfo.xml file for each configured repo. Note The updateinfo.xml file might not be available if the repo isn't one managed by Oracle. If there is no updateinfo.xml found, whether patches are installed depend on settings for Include non-security updates and Auto-approval. For example, if non- security updates are permitted, they're installed when the auto-approval time arrives. 2. Each update notice in updateinfo.xml includes several attributes that denote the properties of the packages in the notice, as described in the following table. Patch Manager 519 AWS Systems Manager Update notice attributes Attribute type severity User Guide Description Corresponds to the value of the Classification key attribute in the patch baseline's PatchFilt er data type. Denotes the type of package included in the update notice. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Corresponds to the value of the Severity key attribute in the patch baseline's PatchFilt er data type. Denotes the severity of the packages included in the update notice. Usually only applicable for Security update notices. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Patch Manager 520 AWS Systems Manager Attribute update_id references updated User Guide Description Denotes the advisory ID, such as CVE-2019- 17055. The advisory ID can be used in the ApprovedPatches or RejectedPatches attribute in the patch baseline. Contains additional information about the update notice, such as a CVE ID (format: CVE-2019-17055) or a Bugzilla ID (format: 1463241). The CVE ID and Bugzilla ID can be used in the ApprovedPatches or RejectedP atches attribute in the patch baseline. Corresponds to ApproveAfterDays in the patch baseline. Denotes the released date (updated date) of the packages
systems-manager-ug-169
systems-manager-ug.pdf
169
baseline page in the Systems Manager console. Patch Manager 520 AWS Systems Manager Attribute update_id references updated User Guide Description Denotes the advisory ID, such as CVE-2019- 17055. The advisory ID can be used in the ApprovedPatches or RejectedPatches attribute in the patch baseline. Contains additional information about the update notice, such as a CVE ID (format: CVE-2019-17055) or a Bugzilla ID (format: 1463241). The CVE ID and Bugzilla ID can be used in the ApprovedPatches or RejectedP atches attribute in the patch baseline. Corresponds to ApproveAfterDays in the patch baseline. Denotes the released date (updated date) of the packages included in the update notice. A comparison between the current timestamp and the value of this attribute plus the ApproveAfterDays is used to determine if the patch is approved for deployment. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. 3. The product of the managed node is determined by SSM Agent. This attribute corresponds to the value of the Product key attribute in the patch baseline's PatchFilter data type. 4. Packages are selected for the update according to the following guidelines. Security option Patch selection Pre-defined default patch baselines provided by AWS and custom patch baselines where the Include non-security updates check box is not selected For each update notice in updateinf o.xml , the patch baseline is used as a filter, allowing only the qualified packages to be included in the update. If multiple packages Patch Manager 521 AWS Systems Manager User Guide Security option Patch selection are applicable after applying the patch baseline definition, the latest version is used. For version 7 managed nodes, the equivalent yum command for this workflow is: sudo yum update-minimal --sec-sev erity=Important,Moderate --bugfix - y For version 8 and 9 managed nodes, the equivalent dnf command for this workflow is: sudo dnf upgrade-minimal --security --sec-severity=Moderate --sec-sev erity=Important Custom patch baselines where the Include non-security updates check box is selected with a SEVERITY list of [Critical, Important] and a CLASSIFICATION list of In addition to applying the security updates that were selected from updateinfo.xml , Patch Manager applies nonsecurity updates that otherwise meet the patch filtering rules. [Security, Bugfix] For version 7 managed nodes, the equivalent yum command for this workflow is: sudo yum update --security --sec-sev erity=Critical,Important --bugfix - y For version 8 and 9 managed nodes, the equivalent dnf command for this workflow is: sudo dnf upgrade --security --sec-sev erity=Critical, --sec-severity=Imp ortant --bugfix y Patch Manager 522 AWS Systems Manager User Guide For information about patch compliance status values, see Patch compliance state values. How patch baseline rules work on AlmaLinux, RHEL, and Rocky Linux On AlmaLinux, Red Hat Enterprise Linux (RHEL), and Rocky Linux, the patch selection process is as follows: 1. On the managed node, the YUM library (RHEL 7) or the DNF library (AlmaLinux 8 and 9, RHEL 8 and 9, and Rocky Linux 8 and 9) accesses the updateinfo.xml file for each configured repo. Note The updateinfo.xml file might not be available if the repo isn't one managed by Red Hat. If there is no updateinfo.xml found, no patch will be applied. 2. Each update notice in updateinfo.xml includes several attributes that denote the properties of the packages in the notice, as described in the following table. Update notice attributes Attribute type severity Description Corresponds to the value of the Classification key attribute in the patch baseline's PatchFilt er data type. Denotes the type of package included in the update notice. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Corresponds to the value of the Severity key attribute in the patch baseline's PatchFilt er data type. Denotes the severity of the packages included in the update notice. Patch Manager 523 AWS Systems Manager Attribute update_id references updated User Guide Description Usually only applicable for Security update notices. You can view the list of supported values by using the AWS CLI command describe- patch-properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Denotes the advisory ID, such as RHSA-2017 :0864. The advisory ID can be used in the ApprovedPatches or RejectedPatches attribute in the patch baseline. Contains additional information about the update notice, such as a CVE ID (format: CVE-2017-1000371) or a Bugzilla ID (format: 1463241). The CVE ID and Bugzilla ID can be used in the ApprovedPatches or RejectedP atches attribute in the patch baseline. Corresponds to ApproveAfterDays in
systems-manager-ug-170
systems-manager-ug.pdf
170
or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Denotes the advisory ID, such as RHSA-2017 :0864. The advisory ID can be used in the ApprovedPatches or RejectedPatches attribute in the patch baseline. Contains additional information about the update notice, such as a CVE ID (format: CVE-2017-1000371) or a Bugzilla ID (format: 1463241). The CVE ID and Bugzilla ID can be used in the ApprovedPatches or RejectedP atches attribute in the patch baseline. Corresponds to ApproveAfterDays in the patch baseline. Denotes the released date (updated date) of the packages included in the update notice. A comparison between the current timestamp and the value of this attribute plus the ApproveAfterDays is used to determine if the patch is approved for deployment. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. Patch Manager 524 AWS Systems Manager User Guide 3. The product of the managed node is determined by SSM Agent. This attribute corresponds to the value of the Product key attribute in the patch baseline's PatchFilter data type. 4. Packages are selected for the update according to the following guidelines. Security option Patch selection Pre-defined default patch baselines provided by AWS and custom patch baselines where the Include non-security updates check box is not selected in any rule For each update notice in updateinf o.xml , the patch baseline is used as a filter, allowing only the qualified packages to be included in the update. If multiple packages are applicable after applying the patch baseline definition, the latest version is used. For RHEL 7, the equivalent yum command for this workflow is: sudo yum update-minimal --sec-sev erity=Critical,Important --bugfix - y For AlmaLinux 8 and 9, RHEL 8 and 9, and Rocky Linux 8 and 9, the equivalent dnf command for this workflow is: sudo dnf upgrade-minimal --sec-sev erity=Critical --sec-severity=Imp ortant --bugfix -y Custom patch baselines where the Include non-security updates check box is selected with a SEVERITY list of [Critical, Important] and a CLASSIFICATION list of In addition to applying the security updates that were selected from updateinfo.xml , Patch Manager applies nonsecurity updates that otherwise meet the patch filtering rules. [Security, Bugfix] For RHEL 7, the equivalent yum command for this workflow is: Patch Manager 525 AWS Systems Manager User Guide Security option Patch selection sudo yum update --security --sec-sev erity=Critical,Important --bugfix - y For AlmaLinux 8 and 9, RHEL 8 and 9, and Rocky Linux 8 and 9, the equivalent dnf command for this workflow is: sudo dnf upgrade --sec-severity=Cri tical --sec-severity=Important -- bugfix -y For information about patch compliance status values, see Patch compliance state values. How patch baseline rules work on SUSE Linux Enterprise Server On SLES, each patch includes the following attributes that denote the properties of the packages in the patch: • Category: Corresponds to the value of the Classification key attribute in the patch baseline's PatchFilter data type. Denotes the type of patch included in the update notice. You can view the list of supported values by using the AWS CLI command describe-patch- properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. • Severity: Corresponds to the value of the Severity key attribute in the patch baseline's PatchFilter data type. Denotes the severity of the patches. You can view the list of supported values by using the AWS CLI command describe-patch- properties or the API operation DescribePatchProperties. You can also view the list in the Approval rules area of the Create patch baseline page or Edit patch baseline page in the Systems Manager console. Patch Manager 526 AWS Systems Manager User Guide The product of the managed node is determined by SSM Agent. This attribute corresponds to the value of the Product key attribute in the patch baseline's PatchFilter data type. For each patch, the patch baseline is used as a filter, allowing only the qualified packages to be included in the update. If multiple packages are applicable after applying the patch baseline definition, the latest version is used. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. How patch baseline rules work on Ubuntu Server On Ubuntu Server, the patch baseline service offers filtering on the Priority and Section fields. These fields are typically present for all Ubuntu Server packages. To determine whether a patch is selected by the patch baseline, Patch Manager does the following: 1. On Ubuntu Server systems, the equivalent of sudo apt-get update is
systems-manager-ug-171
systems-manager-ug.pdf
171
If multiple packages are applicable after applying the patch baseline definition, the latest version is used. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. How patch baseline rules work on Ubuntu Server On Ubuntu Server, the patch baseline service offers filtering on the Priority and Section fields. These fields are typically present for all Ubuntu Server packages. To determine whether a patch is selected by the patch baseline, Patch Manager does the following: 1. On Ubuntu Server systems, the equivalent of sudo apt-get update is run to refresh the list of available packages. Repos aren't configured and the data is pulled from repos configured in a sources list. 2. If an update is available for python3-apt (a Python library interface to libapt), it is upgraded to the latest version. (This nonsecurity package is upgraded even if you did not select the Include nonsecurity updates option.) 3. Next, the GlobalFilters, ApprovalRules, ApprovedPatches and RejectedPatches lists are applied. Note Because it's not possible to reliably determine the release dates of update packages for Ubuntu Server, the auto-approval options aren't supported for this operating system. Approval rules, however, are also subject to whether the Include nonsecurity updates check box was selected when creating or last updating a patch baseline. If nonsecurity updates are excluded, an implicit rule is applied in order to select only packages with upgrades in security repos. For each package, the candidate version of the package (which is typically the latest version) must be part of a security repo. In this case, for Ubuntu Server, patch candidate versions are limited to patches included in the following repos: • Ubuntu Server 14.04 LTS: trusty-security Patch Manager 527 AWS Systems Manager User Guide • Ubuntu Server 16.04 LTS: xenial-security • Ubuntu Server 18.04 LTS: bionic-security • Ubuntu Server 20.04 LTS: focal-security • Ubuntu Server 20.10 STR: groovy-security • Ubuntu Server 22.04 LTS (jammy-security) • Ubuntu Server 23.04 (lunar-security) If nonsecurity updates are included, patches from other repositories are considered as well. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists. To view the contents of the Priority and Section fields, run the following aptitude command: Note You might need to first install Aptitude on Ubuntu Server 16 systems. aptitude search -F '%p %P %s %t %V#' '~U' In the response to this command, all upgradable packages are reported in this format: name, priority, section, archive, candidate version For information about patch compliance status values, see Patch compliance state values. Patching operation differences between Linux and Windows Server This topic describes important differences between Linux and Windows Server patching in Patch Manager, a tool in AWS Systems Manager. Note To patch Linux managed nodes, your nodes must be running SSM Agent version 2.0.834.0 or later. An updated version of SSM Agent is released whenever new tools are added to Systems Manager or updates are made to existing tools. Failing to use the latest version of the Patch Manager 528 AWS Systems Manager User Guide agent can prevent your managed node from using various Systems Manager tools and features. For that reason, we recommend that you automate the process of keeping SSM Agent up to date on your machines. For information, see Automating updates to SSM Agent. Subscribe to the SSM Agent Release Notes page on GitHub to get notifications about SSM Agent updates. Difference 1: Patch evaluation Patch Manager uses different processes on Windows managed nodes and Linux managed nodes in order to evaluate which patches should be present. Linux For Linux patching, Systems Manager evaluates patch baseline rules and the list of approved and rejected patches on each managed node. Systems Manager must evaluate patching on each node because the service retrieves the list of known patches and updates from the repositories that are configured on the managed node. Windows For Windows patching, Systems Manager evaluates patch baseline rules and the list of approved and rejected patches directly in the service. It can do this because Windows patches are pulled from a single repository (Windows Update). Difference 2: Not Applicable patches Due to the large number of available packages for Linux operating systems, Systems Manager doesn't report details about patches in the Not Applicable state. A Not Applicable patch is, for example, a patch for Apache software when the instance doesn't have Apache installed. Systems Manager does report the number of Not Applicable patches in the summary, but if you call the DescribeInstancePatches API for a managed node, the returned data doesn't include patches with a state of Not Applicable. This behavior is different from Windows. Difference 3: SSM document support The AWS-ApplyPatchBaseline Systems Manager document (SSM document) doesn't support Linux managed nodes.
systems-manager-ug-172
systems-manager-ug.pdf
172
the large number of available packages for Linux operating systems, Systems Manager doesn't report details about patches in the Not Applicable state. A Not Applicable patch is, for example, a patch for Apache software when the instance doesn't have Apache installed. Systems Manager does report the number of Not Applicable patches in the summary, but if you call the DescribeInstancePatches API for a managed node, the returned data doesn't include patches with a state of Not Applicable. This behavior is different from Windows. Difference 3: SSM document support The AWS-ApplyPatchBaseline Systems Manager document (SSM document) doesn't support Linux managed nodes. For applying patch baselines to Linux, macOS, and Windows Server managed nodes, the recommended SSM document is AWS-RunPatchBaseline. For more Patch Manager 529 AWS Systems Manager User Guide information, see SSM Command documents for patching managed nodes and SSM Command document for patching: AWS-RunPatchBaseline. Difference 4: Application patches The primary focus of Patch Manager is applying patches to operating systems. However, you can also use Patch Manager to apply patches to some applications on your managed nodes. Linux On Linux operating systems, Patch Manager uses the configured repositories for updates, and doesn't differentiate between operating systems and application patches. You can use Patch Manager to define which repositories to fetch updates from. For more information, see How to specify an alternative patch source repository (Linux). Windows On Windows Server managed nodes, you can apply approval rules, as well as Approved and Rejected patch exceptions, for applications released by Microsoft, such as Microsoft Word 2016 and Microsoft Exchange Server 2016. For more information, see Working with custom patch baselines. Difference 5: Rejected patch list options in custom patch baselines When you create a custom patch baseline, you can specify one or more patches for a Rejected patches list. For Linux managed nodes, you can also choose to allow them to be installed if they're dependencies for another patch allowed by the baseline. Windows Server, however, doesn't support the concept of patch dependencies. You can add a patch to the Rejected patches list in a custom baseline for Windows Server, but the result depends on (1) whether or not the rejected patch is already installed on a managed node, and (2) which option you choose for Rejected patches action. Refer to the following table for details about rejected patch options on Windows Server. Installation status Option: "Allow as dependenc y" Option: "Block" Patch is already installed Reported status: INSTALLED Reported status: INSTALLED _OTHER _REJECTED Patch is not already installed Patch skipped Patch skipped Patch Manager 530 AWS Systems Manager User Guide Each patch for Windows Server that Microsoft releases typically contains all the information needed for the installation to succeed. Occasionally, however, a prerequisite package might be required, which you must install manually. Patch Manager doesn't report information about these prerequisites. For related information, see Windows Update issues troubleshooting on the Microsoft website. SSM Command documents for patching managed nodes This topic describes the nine Systems Manager documents (SSM documents) available to help you keep your managed nodes patched with the latest security-related updates. We recommend using just five of these documents in your patching operations. Together, these five SSM documents provide you with a full range of patching options using AWS Systems Manager. Four of these documents were released later than the four legacy SSM documents they replace and represent expansions or consolidations of functionality. Recommended SSM documents for patching We recommend using the following five SSM documents in your patching operations. • AWS-ConfigureWindowsUpdate • AWS-InstallWindowsUpdates • AWS-RunPatchBaseline • AWS-RunPatchBaselineAssociation • AWS-RunPatchBaselineWithHooks Legacy SSM documents for patching The following four legacy SSM documents are still available for use in some AWS Regions but are no longer updated, can't be guaranteed to work in all scenarios, and might no longer be supported in the future. We recommend that you do not use them in your patching operations. • AWS-ApplyPatchBaseline • AWS-FindWindowsUpdates • AWS-InstallMissingWindowsUpdates • AWS-InstallSpecificWindowsUpdates Patch Manager 531 AWS Systems Manager User Guide Refer to the following sections for more information about using these SSM documents in your patching operations. Topics • SSM documents recommended for patching managed nodes • Legacy SSM documents for patching managed nodes • SSM Command document for patching: AWS-RunPatchBaseline • SSM Command document for patching: AWS-RunPatchBaselineAssociation • SSM Command document for patching: AWS-RunPatchBaselineWithHooks • Sample scenario for using the InstallOverrideList parameter in AWS-RunPatchBaseline or AWS- RunPatchBaselineAssociation • Using the BaselineOverride parameter SSM documents recommended for patching managed nodes The following five SSM documents are recommended for use in your managed node patching operations. Recommended SSM documents • AWS-ConfigureWindowsUpdate • AWS-InstallWindowsUpdates • AWS-RunPatchBaseline • AWS-RunPatchBaselineAssociation • AWS-RunPatchBaselineWithHooks AWS-ConfigureWindowsUpdate Supports configuring basic Windows Update functions and using them to install updates automatically (or to turn off automatic updates). Available in all AWS Regions. This SSM document prompts Windows Update
systems-manager-ug-173
systems-manager-ug.pdf
173
patching: AWS-RunPatchBaseline • SSM Command document for patching: AWS-RunPatchBaselineAssociation • SSM Command document for patching: AWS-RunPatchBaselineWithHooks • Sample scenario for using the InstallOverrideList parameter in AWS-RunPatchBaseline or AWS- RunPatchBaselineAssociation • Using the BaselineOverride parameter SSM documents recommended for patching managed nodes The following five SSM documents are recommended for use in your managed node patching operations. Recommended SSM documents • AWS-ConfigureWindowsUpdate • AWS-InstallWindowsUpdates • AWS-RunPatchBaseline • AWS-RunPatchBaselineAssociation • AWS-RunPatchBaselineWithHooks AWS-ConfigureWindowsUpdate Supports configuring basic Windows Update functions and using them to install updates automatically (or to turn off automatic updates). Available in all AWS Regions. This SSM document prompts Windows Update to download and install the specified updates and reboot managed nodes as needed. Use this document with State Manager, a tool in AWS Systems Manager, to ensure Windows Update maintains its configuration. You can also run it manually using Run Command, a tool in AWS Systems Manager, to change the Windows Update configuration. Patch Manager 532 AWS Systems Manager User Guide The available parameters in this document support specifying a category of updates to install (or whether to turn off automatic updates), as well as specifying the day of the week and time of day to run patching operations. This SSM document is most useful if you don't need strict control over Windows updates and don't need to collect compliance information. Replaces legacy SSM documents: • None AWS-InstallWindowsUpdates Installs updates on a Windows Server managed node. Available in all AWS Regions. This SSM document provides basic patching functionality in cases where you either want to install a specific update (using the Include Kbs parameter), or want to install patches with specific classifications or categories but don't need patch compliance information. Replaces legacy SSM documents: • AWS-FindWindowsUpdates • AWS-InstallMissingWindowsUpdates • AWS-InstallSpecificWindowsUpdates The three legacy documents perform different functions, but you can achieve the same results by using different parameter settings with the newer SSM document AWS- InstallWindowsUpdates. These parameter settings are described in Legacy SSM documents for patching managed nodes. AWS-RunPatchBaseline Installs patches on your managed nodes or scans nodes to determine whether any qualified patches are missing. Available in all AWS Regions. AWS-RunPatchBaseline allows you to control patch approvals using the patch baseline specified as the "default" for an operating system type. Reports patch compliance information that you can view using the Systems Manager Compliance tools. These tools provide you with insights on the patch compliance state of your managed nodes, such as which nodes are missing patches and what those patches are. When you use AWS-RunPatchBaseline, patch compliance information Patch Manager 533 AWS Systems Manager User Guide is recorded using the PutInventory API command. For Linux operating systems, compliance information is provided for patches from both the default source repository configured on a managed node and from any alternative source repositories you specify in a custom patch baseline. For more information about alternative source repositories, see How to specify an alternative patch source repository (Linux). For more information about the Systems Manager Compliance tools, see AWS Systems Manager Compliance. Replaces legacy documents: • AWS-ApplyPatchBaseline The legacy document AWS-ApplyPatchBaseline applies only to Windows Server managed nodes, and doesn't provide support for application patching. The newer AWS-RunPatchBaseline provides the same support for both Windows and Linux systems. Version 2.0.834.0 or later of SSM Agent is required in order to use the AWS-RunPatchBaseline document. For more information about the AWS-RunPatchBaseline SSM document, see SSM Command document for patching: AWS-RunPatchBaseline. AWS-RunPatchBaselineAssociation Installs patches on your instances or scans instances to determine whether any qualified patches are missing. Available in all commercial AWS Regions. AWS-RunPatchBaselineAssociation differs from AWS-RunPatchBaseline in a few important ways: • AWS-RunPatchBaselineAssociation is intended for use primarily with State Manager associations created using Quick Setup, a tool in AWS Systems Manager. Specifically, when you use the Quick Setup Host Management configuration type, if you choose the option Scan instances for missing patches daily, the system uses AWS-RunPatchBaselineAssociation for the operation. In most cases, however, when setting up your own patching operations, you should choose AWS-RunPatchBaseline or AWS-RunPatchBaselineWithHooks instead of AWS- RunPatchBaselineAssociation. For more information, see the following topics: • AWS Systems Manager Quick Setup Patch Manager 534 AWS Systems Manager User Guide • SSM Command document for patching: AWS-RunPatchBaselineAssociation • AWS-RunPatchBaselineAssociation supports the use of tags to identify which patch baseline to use with a set of targets when it runs. • For patching operations that use AWS-RunPatchBaselineAssociation, patch compliance data is compiled in terms of a specific State Manager association. The patch compliance data collected when AWS-RunPatchBaselineAssociation runs is recorded using the PutComplianceItems API command instead of the PutInventory command. This prevents compliance data that isn't associated with this particular association from being overwritten. For Linux operating systems, compliance information is provided for patches from both the default source repository configured on an instance and from any alternative source repositories
systems-manager-ug-174
systems-manager-ug.pdf
174
supports the use of tags to identify which patch baseline to use with a set of targets when it runs. • For patching operations that use AWS-RunPatchBaselineAssociation, patch compliance data is compiled in terms of a specific State Manager association. The patch compliance data collected when AWS-RunPatchBaselineAssociation runs is recorded using the PutComplianceItems API command instead of the PutInventory command. This prevents compliance data that isn't associated with this particular association from being overwritten. For Linux operating systems, compliance information is provided for patches from both the default source repository configured on an instance and from any alternative source repositories you specify in a custom patch baseline. For more information about alternative source repositories, see How to specify an alternative patch source repository (Linux). For more information about the Systems Manager Compliance tools, see AWS Systems Manager Compliance. Replaces legacy documents: • None For more information about the AWS-RunPatchBaselineAssociation SSM document, see SSM Command document for patching: AWS-RunPatchBaselineAssociation. AWS-RunPatchBaselineWithHooks Installs patches on your managed nodes or scans nodes to determine whether any qualified patches are missing, with optional hooks you can use to run SSM documents at three points during the patching cycle. Available in all commercial AWS Regions. Not supported on macOS. AWS-RunPatchBaselineWithHooks differs from AWS-RunPatchBaseline in its Install operation. AWS-RunPatchBaselineWithHooks supports lifecycle hooks that run at designated points during managed node patching. Because patch installations sometimes require managed nodes to reboot, the patching operation is divided into two events, for a total of three hooks that support custom functionality. The first hook is before the Install with NoReboot operation. The second hook is after the Install with NoReboot operation. The third hook is available after the reboot of the node. Patch Manager 535 AWS Systems Manager Replaces legacy documents: • None User Guide For more information about the AWS-RunPatchBaselineWithHooks SSM document, see SSM Command document for patching: AWS-RunPatchBaselineWithHooks. Legacy SSM documents for patching managed nodes The following four SSM documents are still available in some AWS Regions. However, they are no longer updated and might be no longer supported in the future, so we don't recommend their use. Instead, use the documents described in SSM documents recommended for patching managed nodes. Legacy SSM Documents • AWS-ApplyPatchBaseline • AWS-FindWindowsUpdates • AWS-InstallMissingWindowsUpdates • AWS-InstallSpecificWindowsUpdates AWS-ApplyPatchBaseline Supports only Windows Server managed nodes, but doesn't include support for patching applications that is found in its replacement, AWS-RunPatchBaseline. Not available in AWS Regions launched after August 2017. Note The replacement for this SSM document, AWS-RunPatchBaseline, requires version 2.0.834.0 or a later version of SSM Agent. You can use the AWS-UpdateSSMAgent document to update your managed nodes to the latest version of the agent. AWS-FindWindowsUpdates Replaced by AWS-InstallWindowsUpdates, which can perform all the same actions. Not available in AWS Regions launched after April 2017. Patch Manager 536 AWS Systems Manager User Guide To achieve the same result that you would from this legacy SSM document, use the following parameter configuration with the recommended replacement document, AWS- InstallWindowsUpdates: • Action = Scan • Allow Reboot = False AWS-InstallMissingWindowsUpdates Replaced by AWS-InstallWindowsUpdates, which can perform all the same actions. Not available in any AWS Regions launched after April 2017. To achieve the same result that you would from this legacy SSM document, use the following parameter configuration with the recommended replacement document, AWS- InstallWindowsUpdates: • Action = Install • Allow Reboot = True AWS-InstallSpecificWindowsUpdates Replaced by AWS-InstallWindowsUpdates, which can perform all the same actions. Not available in any AWS Regions launched after April 2017. To achieve the same result that you would from this legacy SSM document, use the following parameter configuration with the recommended replacement document, AWS- InstallWindowsUpdates: • Action = Install • Allow Reboot = True • Include Kbs = comma-separated list of KB articles SSM Command document for patching: AWS-RunPatchBaseline AWS Systems Manager supports AWS-RunPatchBaseline, a Systems Manager document (SSM document) for Patch Manager, a tool in AWS Systems Manager. This SSM document performs patching operations on managed nodes for both security related and other types of updates. When Patch Manager 537 AWS Systems Manager User Guide the document is run, it uses the patch baseline specified as the "default" for an operating system type if no patch group is specified. Otherwise, it uses the patch baseline that is associated with the patch group. For information about patch groups, see Patch groups. You can use the document AWS-RunPatchBaseline to apply patches for both operating systems and applications. (On Windows Server, application support is limited to updates for applications released by Microsoft.) This document supports Linux, macOS, and Windows Server managed nodes. The document will perform the appropriate actions for each platform. Note Patch Manager also supports the legacy SSM document AWS-ApplyPatchBaseline. However, this document supports patching on Windows managed nodes only. We encourage you to use AWS-RunPatchBaseline instead because it supports patching on
systems-manager-ug-175
systems-manager-ug.pdf
175
uses the patch baseline that is associated with the patch group. For information about patch groups, see Patch groups. You can use the document AWS-RunPatchBaseline to apply patches for both operating systems and applications. (On Windows Server, application support is limited to updates for applications released by Microsoft.) This document supports Linux, macOS, and Windows Server managed nodes. The document will perform the appropriate actions for each platform. Note Patch Manager also supports the legacy SSM document AWS-ApplyPatchBaseline. However, this document supports patching on Windows managed nodes only. We encourage you to use AWS-RunPatchBaseline instead because it supports patching on Linux, macOS, and Windows Server managed nodes. Version 2.0.834.0 or later of SSM Agent is required in order to use the AWS-RunPatchBaseline document. Windows Server On Windows Server managed nodes, the AWS-RunPatchBaseline document downloads and invokes a PowerShell module, which in turn downloads a snapshot of the patch baseline that applies to the managed node. This patch baseline snapshot contains a list of approved patches that is compiled by querying the patch baseline against a Windows Server Update Services (WSUS) server. This list is passed to the Windows Update API, which controls downloading and installing the approved patches as appropriate. Linux On Linux managed nodes, the AWS-RunPatchBaseline document invokes a Python module, which in turn downloads a snapshot of the patch baseline that applies to the managed node. This patch baseline snapshot uses the defined rules and lists of approved and blocked patches to drive the appropriate package manager for each node type: • Amazon Linux 1, Amazon Linux 2, CentOS, Oracle Linux, and RHEL 7 managed nodes use YUM. For YUM operations, Patch Manager requires Python 2.6 or a later supported version (2.6 - 3.10). Patch Manager 538 AWS Systems Manager User Guide • RHEL 8 managed nodes use DNF. For DNF operations, Patch Manager requires a supported version of Python 2 or Python 3 (2.6 - 3.10). (Neither version is installed by default on RHEL 8. You must install one or the other manually.) • Debian Server, Raspberry Pi OS, and Ubuntu Server instances use APT. For APT operations, Patch Manager requires a supported version of Python 3 (3.0 - 3.10). • SUSE Linux Enterprise Server managed nodes use Zypper. For Zypper operations, Patch Manager requires Python 2.6 or a later supported version (2.6 - 3.10). macOS On macOS managed nodes, the AWS-RunPatchBaseline document invokes a Python module, which in turn downloads a snapshot of the patch baseline that applies to the managed node. Next, a Python subprocess invokes the AWS Command Line Interface (AWS CLI) on the node to retrieve the installation and update information for the specified package managers and to drive the appropriate package manager for each update package. Each snapshot is specific to an AWS account, patch group, operating system, and snapshot ID. The snapshot is delivered through a presigned Amazon Simple Storage Service (Amazon S3) URL, which expires 24 hours after the snapshot is created. After the URL expires, however, if you want to apply the same snapshot content to other managed nodes, you can generate a new presigned Amazon S3 URL up to 3 days after the snapshot was created. To do this, use the get-deployable-patch- snapshot-for-instance command. After all approved and applicable updates have been installed, with reboots performed as necessary, patch compliance information is generated on a managed node and reported back to Patch Manager. Note If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption. For information about viewing patch compliance data, see About patch compliance. Patch Manager 539 AWS Systems Manager User Guide AWS-RunPatchBaseline parameters AWS-RunPatchBaseline supports six parameters. The Operation parameter is required. The InstallOverrideList, BaselineOverride, and RebootOption parameters are optional. Snapshot-ID is technically optional, but we recommend that you supply a custom value for it when you run AWS-RunPatchBaseline outside of a maintenance window. Patch Manager can supply the custom value automatically when the document is run as part of a maintenance window operation. Parameters • Parameter name: Operation • Parameter name: AssociationId • Parameter name: Snapshot ID • Parameter name: InstallOverrideList • Parameter name: RebootOption • Parameter name: BaselineOverride Parameter name: Operation Usage: Required. Options: Scan | Install. Scan When you choose the Scan option, AWS-RunPatchBaseline determines the patch compliance state of the managed node and reports this information back to Patch Manager. Scan doesn't prompt updates to be installed or managed nodes to be rebooted. Instead, the operation identifies where updates are missing that are approved and applicable to the node. Install When you choose the Install option, AWS-RunPatchBaseline attempts to install the approved and applicable updates that are missing from the managed node. Patch compliance information generated as part of an Install operation doesn't list
systems-manager-ug-176
systems-manager-ug.pdf
176
name: BaselineOverride Parameter name: Operation Usage: Required. Options: Scan | Install. Scan When you choose the Scan option, AWS-RunPatchBaseline determines the patch compliance state of the managed node and reports this information back to Patch Manager. Scan doesn't prompt updates to be installed or managed nodes to be rebooted. Instead, the operation identifies where updates are missing that are approved and applicable to the node. Install When you choose the Install option, AWS-RunPatchBaseline attempts to install the approved and applicable updates that are missing from the managed node. Patch compliance information generated as part of an Install operation doesn't list any missing updates, but might report updates that are in a failed state if the installation of the update didn't succeed for any reason. Whenever an update is installed on a managed node, the node is rebooted to ensure the update is both installed and active. (Exception: If the RebootOption parameter is Patch Manager 540 AWS Systems Manager User Guide set to NoReboot in the AWS-RunPatchBaseline document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Note If a patch specified by the baseline rules is installed before Patch Manager updates the managed node, the system might not reboot as expected. This can happen when a patch is installed manually by a user or installed automatically by another program, such as the unattended-upgrades package on Ubuntu Server. Parameter name: AssociationId Usage: Optional. AssociationId is the ID of an existing association in State Manager, a tool in AWS Systems Manager. It's used by Patch Manager to add compliance data to a specified association. This association is related to a patching operation that's set up in a patch policy in Quick Setup. Note With the AWS-RunPatchBaseline, if an AssociationId value is provided along with a patch policy baseline override, patching is done as a PatchPolicy operation and the ExecutionType value reported in AWS:ComplianceItem is also PatchPolicy. If no AssociationId value is provided, patching is done as a Command operation and the ExecutionType value report in on the AWS:ComplianceItem submitted is also Command. If you don't already have an association you want to use, you can create one by running create- association the command. Parameter name: Snapshot ID Usage: Optional. Snapshot ID is a unique ID (GUID) used by Patch Manager to ensure that a set of managed nodes that are patched in a single operation all have the exact same set of approved patches. Although the parameter is defined as optional, our best practice recommendation depends on whether Patch Manager 541 AWS Systems Manager User Guide or not you're running AWS-RunPatchBaseline in a maintenance window, as described in the following table. AWS-RunPatchBaseline best practices Mode Best practice Details Running AWS-RunPa tchBaseline inside a maintenance window for you. Don't supply a Snapshot ID. Patch Manager will supply it If you use a maintenan ce window to run AWS- RunPatchBaseline shouldn't provide your own , you generated Snapshot ID. In this scenario, Systems Manager provides a GUID value based on the maintenance window execution ID. This ensures that a correct ID is used for all the invocations of AWS- in RunPatchBaseline that maintenance window. If you do specify a value in this scenario, note that the snapshot of the patch baseline might not remain in place for more than 3 days. After that, a new snapshot will be generated even if you specify the same ID after the snapshot expires. When you aren't using a maintenance window to run AWS-RunPatchBaseli ne , we recommend that you generate and specify a unique Snapshot ID for each patch baseline, particula Running AWS-RunPa tchBaseline outside of a maintenance window Generate and specify a custom GUID value for the Snapshot ID.¹ Patch Manager 542 AWS Systems Manager User Guide Mode Best practice Details rly if you're running the AWS-RunPatchBaseli ne document on multiple managed nodes in the same operation. If you don't specify an ID in this scenario, Systems Manager generates a different Snapshot ID for each managed node the command is sent to. This might result in varying sets of patches being specified among the managed nodes. For instance, say that you're running the AWS- RunPatchBaseline document directly through Run Command, a tool in AWS Systems Manager, and targeting a group of 50 managed nodes. Specifying a custom Snapshot ID results in the generation of a single baseline snapshot that is used to evaluate and patch all the nodes, ensuring that they end up in a consistent state. ¹ You can use any tool capable of generating a GUID to generate a value for the Snapshot ID parameter. For example, in PowerShell, you can use the New-Guid cmdlet to generate a GUID in the format of 12345699-9405-4f69-bc5e-9315aEXAMPLE . Patch Manager 543 AWS Systems Manager User Guide Parameter name: InstallOverrideList Usage:
systems-manager-ug-177
systems-manager-ug.pdf
177
Command, a tool in AWS Systems Manager, and targeting a group of 50 managed nodes. Specifying a custom Snapshot ID results in the generation of a single baseline snapshot that is used to evaluate and patch all the nodes, ensuring that they end up in a consistent state. ¹ You can use any tool capable of generating a GUID to generate a value for the Snapshot ID parameter. For example, in PowerShell, you can use the New-Guid cmdlet to generate a GUID in the format of 12345699-9405-4f69-bc5e-9315aEXAMPLE . Patch Manager 543 AWS Systems Manager User Guide Parameter name: InstallOverrideList Usage: Optional. Using InstallOverrideList, you specify an https URL or an Amazon S3 path-style URL to a list of patches to be installed. This patch installation list, which you maintain in YAML format, overrides the patches specified by the current default patch baseline. This provides you with more granular control over which patches are installed on your managed nodes. Important The InstallOverrideList file name can't contain the following characters: backtick (`), single quote ('), double quote ("), and dollar sign ($). The patching operation behavior when using the InstallOverrideList parameter differs between Linux & macOS managed nodes and Windows Server managed nodes. On Linux & macOS, Patch Manager attempts to apply patches included in the InstallOverrideList patch list that are present in any repository enabled on the node, whether or not the patches match the patch baseline rules. On Windows Server nodes, however, patches in the InstallOverrideList patch list are applied only if they also match the patch baseline rules. Be aware that compliance reports reflect patch states according to what’s specified in the patch baseline, not what you specify in an InstallOverrideList list of patches. In other words, Scan operations ignore the InstallOverrideList parameter. This is to ensure that compliance reports consistently reflect patch states according to policy rather than what was approved for a specific patching operation. For a description of how you might use the InstallOverrideList parameter to apply different types of patches to a target group, on different maintenance window schedules, while still using a single patch baseline, see Sample scenario for using the InstallOverrideList parameter in AWS- RunPatchBaseline or AWS-RunPatchBaselineAssociation. Valid URL formats Patch Manager 544 AWS Systems Manager Note User Guide If your file is stored in a publicly available bucket, you can specify either an https URL format or an Amazon S3 path-style URL. If your file is stored in a private bucket, you must specify an Amazon S3 path-style URL. • https URL format: https://s3.aws-api-domain/amzn-s3-demo-bucket/my-windows-override-list.yaml • Amazon S3 path-style URL: s3://amzn-s3-demo-bucket/my-windows-override-list.yaml Valid YAML content formats The formats you use to specify patches in your list depends on the operating system of your managed node. The general format, however, is as follows: patches: - id: '{patch-d}' title: '{patch-title}' {additional-fields}:{values} Although you can provide additional fields in your YAML file, they're ignored during patch operations. In addition, we recommend verifying that the format of your YAML file is valid before adding or updating the list in your S3 bucket. For more information about the YAML format, see yaml.org. For validation tool options, perform a web search for "yaml format validators". Linux id The id field is required. Use it to specify patches using the package name and architecture. For example: 'dhclient.x86_64'. You can use wildcards in id to indicate multiple packages. For example: 'dhcp*' and 'dhcp*1.*'. Patch Manager 545 AWS Systems Manager Title User Guide The title field is optional, but on Linux systems it does provide additional filtering capabilities. If you use title, it should contain the package version information in the one of the following formats: YUM/SUSE Linux Enterprise Server (SLES): {name}.{architecture}:{epoch}:{version}-{release} APT {name}.{architecture}:{version} For Linux patch titles, you can use one or more wildcards in any position to expand the number of package matches. For example: '*32:9.8.2-0.*.rc1.57.amzn1'. For example: • apt package version 1.2.25 is currently installed on your managed node, but version 1.2.27 is now available. • You add apt.amd64 version 1.2.27 to the patch list. It depends on apt utils.amd64 version 1.2.27, but apt-utils.amd64 version 1.2.25 is specified in the list. In this case, apt version 1.2.27 will be blocked from installation and reported as “Failed- NonCompliant.” Windows Server id The id field is required. Use it to specify patches using Microsoft Knowledge Base IDs (for example, KB2736693) and Microsoft Security Bulletin IDs (for example, MS17-023). Any other fields you want to provide in a patch list for Windows are optional and are for your own informational use only. You can use additional fields such as title, classification, severity, or anything else for providing more detailed information about the specified patches. macOS id Patch Manager 546 AWS Systems Manager User Guide The id field is required. The value for the id field can be supplied using either a {package- name}.{package-version}
systems-manager-ug-178
systems-manager-ug.pdf
178
The id field is required. Use it to specify patches using Microsoft Knowledge Base IDs (for example, KB2736693) and Microsoft Security Bulletin IDs (for example, MS17-023). Any other fields you want to provide in a patch list for Windows are optional and are for your own informational use only. You can use additional fields such as title, classification, severity, or anything else for providing more detailed information about the specified patches. macOS id Patch Manager 546 AWS Systems Manager User Guide The id field is required. The value for the id field can be supplied using either a {package- name}.{package-version} format or a {package_name} format. Sample patch lists • Amazon Linux patches: - id: 'kernel.x86_64' - id: 'bind*.x86_64' title: '32:9.8.2-0.62.rc1.57.amzn1' - id: 'glibc*' - id: 'dhclient*' title: '*12:4.1.1-53.P1.28.amzn1' - id: 'dhcp*' title: '*10:3.1.1-50.P1.26.amzn1' • CentOS patches: - id: 'kernel.x86_64' - id: 'bind*.x86_64' title: '32:9.8.2-0.62.rc1.57.amzn1' - id: 'glibc*' - id: 'dhclient*' title: '*12:4.1.1-53.P1.28.amzn1' - id: 'dhcp*' title: '*10:3.1.1-50.P1.26.amzn1' • Debian Server patches: Patch Manager 547 User Guide AWS Systems Manager - id: 'apparmor.amd64' title: '2.10.95-0ubuntu2.9' - id: 'cryptsetup.amd64' title: '*2:1.6.6-5ubuntu2.1' - id: 'cryptsetup-bin.*' title: '*2:1.6.6-5ubuntu2.1' - id: 'apt.amd64' title: '*1.2.27' - id: 'apt-utils.amd64' title: '*1.2.25' • macOS patches: - id: 'XProtectPlistConfigData' - id: 'MRTConfigData.1.61' - id: 'Command Line Tools for Xcode.11.5' - id: 'Gatekeeper Configuration Data' • Oracle Linux patches: - id: 'audit-libs.x86_64' title: '*2.8.5-4.el7' - id: 'curl.x86_64' title: '*.el7' - id: 'grub2.x86_64' title: 'grub2.x86_64:1:2.02-0.81.0.1.el7' - id: 'grub2.x86_64' title: 'grub2.x86_64:1:*-0.81.0.1.el7' Patch Manager 548 AWS Systems Manager User Guide • Red Hat Enterprise Linux (RHEL) patches: - id: 'NetworkManager.x86_64' title: '*1:1.10.2-14.el7_5' - id: 'NetworkManager-*.x86_64' title: '*1:1.10.2-14.el7_5' - id: 'audit.x86_64' title: '*0:2.8.1-3.el7' - id: 'dhclient.x86_64' title: '*.el7_5.1' - id: 'dhcp*.x86_64' title: '*12:5.2.5-68.el7' • SUSE Linux Enterprise Server (SLES) patches: - id: 'amazon-ssm-agent.x86_64' - id: 'binutils' title: '*0:2.26.1-9.12.1' - id: 'glibc*.x86_64' title: '*2.19*' - id: 'dhcp*' title: '0:4.3.3-9.1' - id: 'lib*' • Ubuntu Server patches: - id: 'apparmor.amd64' Patch Manager 549 AWS Systems Manager User Guide title: '2.10.95-0ubuntu2.9' - id: 'cryptsetup.amd64' title: '*2:1.6.6-5ubuntu2.1' - id: 'cryptsetup-bin.*' title: '*2:1.6.6-5ubuntu2.1' - id: 'apt.amd64' title: '*1.2.27' - id: 'apt-utils.amd64' title: '*1.2.25' • Windows patches: - id: 'KB4284819' title: '2018-06 Cumulative Update for Windows Server 2016 (1709) for x64- based Systems (KB4284819)' - id: 'KB4284833' - id: 'KB4284835' title: '2018-06 Cumulative Update for Windows Server 2016 (1803) for x64- based Systems (KB4284835)' - id: 'KB4284880' - id: 'KB4338814' Parameter name: RebootOption Usage: Optional. Options: RebootIfNeeded | NoReboot Default: RebootIfNeeded Patch Manager 550 AWS Systems Manager Warning User Guide The default option is RebootIfNeeded. Be sure to select the correct option for your use case. For example, if your managed nodes must reboot immediately to complete a configuration process, choose RebootIfNeeded. Or, if you need to maintain managed node availability until a scheduled reboot time, choose NoReboot. Important We don’t recommend using Patch Manager for patching cluster instances in Amazon EMR (previously called Amazon Elastic MapReduce). In particular, don’t select the RebootIfNeeded option for the RebootOption parameter. (This option is available in the SSM Command documents for patching AWS-RunPatchBaseline, AWS- RunPatchBaselineAssociation, and AWS-RunPatchBaselineWithHooks.) The underlying commands for patching using Patch Manager use yum and dnf commands. Therefore, the operations result in incompatibilities because of how packages are installed. For information about the preferred methods for updating software on Amazon EMR clusters, see Using the default AMI for Amazon EMR in the Amazon EMR Management Guide. RebootIfNeeded When you choose the RebootIfNeeded option, the managed node is rebooted in either of the following cases: • Patch Manager installed one or more patches. Patch Manager doesn't evaluate whether a reboot is required by the patch. The system is rebooted even if the patch doesn't require a reboot. • Patch Manager detects one or more patches with a status of INSTALLED_PENDING_REBOOT during the Install operation. The INSTALLED_PENDING_REBOOT status can mean that the option NoReboot was selected the last time the Install operation was run, or that a patch was installed outside of Patch Manager since the last time the managed node was rebooted. Patch Manager 551 AWS Systems Manager User Guide Rebooting managed nodes in these two cases ensures that updated packages are flushed from memory and keeps patching and rebooting behavior consistent across all operating systems. NoReboot When you choose the NoReboot option, Patch Manager doesn't reboot a managed node even if it installed patches during the Install operation. This option is useful if you know that your managed nodes don't require rebooting after patches are applied, or you have applications or processes running on a node that shouldn't be disrupted by a patching operation reboot. It's also useful when you want more control over the timing of managed node reboots, such as by using a maintenance window. If you choose the NoReboot option and a patch is installed, the patch is assigned a status of InstalledPendingReboot. The managed node itself,
systems-manager-ug-179
systems-manager-ug.pdf
179
NoReboot option, Patch Manager doesn't reboot a managed node even if it installed patches during the Install operation. This option is useful if you know that your managed nodes don't require rebooting after patches are applied, or you have applications or processes running on a node that shouldn't be disrupted by a patching operation reboot. It's also useful when you want more control over the timing of managed node reboots, such as by using a maintenance window. If you choose the NoReboot option and a patch is installed, the patch is assigned a status of InstalledPendingReboot. The managed node itself, however, is marked as Non- Compliant. After a reboot occurs and a Scan operation is run, the managed node status is updated to Compliant. Important The NoReboot option only prevents operating system-level restarts. Service-level restarts can still occur as part of the patching process. For example, when Docker is updated, dependent services such as Amazon Elastic Container Service might automatically restart even with NoReboot enabled. If you have critical services that must not be disrupted, consider additional measures such as temporarily removing instances from service or scheduling patching during maintenance windows. Patch installation tracking file: To track patch installation, especially patches that were installed since the last system reboot, Systems Manager maintains a file on the managed node. Important Don't delete or modify the tracking file. If this file is deleted or corrupted, the patch compliance report for the managed node is inaccurate. If this happens, reboot the node and run a patch Scan operation to restore the file. This tracking file is stored in the following locations on your managed nodes: • Linux operating systems: Patch Manager 552 AWS Systems Manager User Guide • /var/log/amazon/ssm/patch-configuration/patch-states-configuration.json • /var/log/amazon/ssm/patch-configuration/patch-inventory-from-last- operation.json • Windows Server operating system: • C:\ProgramData\Amazon\PatchBaselineOperations\State \PatchStatesConfiguration.json • C:\ProgramData\Amazon\PatchBaselineOperations\State \PatchInventoryFromLastOperation.json Parameter name: BaselineOverride Usage: Optional. You can define patching preferences at runtime using the BaselineOverride parameter. This baseline override is maintained as a JSON object in an S3 bucket. It ensures patching operations use the provided baselines that match the host operating system instead of applying the rules from the default patch baseline Important The BaselineOverride file name can't contain the following characters: backtick (`), single quote ('), double quote ("), and dollar sign ($). For more information about how to use the BaselineOverride parameter, see Using the BaselineOverride parameter. SSM Command document for patching: AWS-RunPatchBaselineAssociation Like the AWS-RunPatchBaseline document, AWS-RunPatchBaselineAssociation performs patching operations on instances for both security related and other types of updates. You can also use the document AWS-RunPatchBaselineAssociation to apply patches for both operating systems and applications. (On Windows Server, application support is limited to updates for applications released by Microsoft.) This document supports Amazon Elastic Compute Cloud (Amazon EC2) instances for Linux, macOS, and Windows Server. It does not support non-EC2 nodes in a hybrid and multicloud environment. Patch Manager 553 AWS Systems Manager User Guide The document will perform the appropriate actions for each platform, invoking a Python module on Linux and macOS instances, and a PowerShell module on Windows instances. AWS-RunPatchBaselineAssociation, however, differs from AWS-RunPatchBaseline in the following ways: • AWS-RunPatchBaselineAssociation is intended for use primarily with State Manager associations created using Quick Setup, a tool in AWS Systems Manager. Specifically, when you use the Quick Setup Host Management configuration type, if you choose the option Scan instances for missing patches daily, the system uses AWS-RunPatchBaselineAssociation for the operation. In most cases, however, when setting up your own patching operations, you should choose AWS-RunPatchBaseline or AWS-RunPatchBaselineWithHooks instead of AWS- RunPatchBaselineAssociation. • When you use the AWS-RunPatchBaselineAssociation document, you can specify a tag key pair in the document's BaselineTags parameter field. If a custom patch baseline in your AWS account shares these tags, Patch Manager, a tool in AWS Systems Manager, uses that tagged baseline when it runs on the target instances instead of the currently specified "default" patch baseline for the operating system type. Note If you choose to use AWS-RunPatchBaselineAssociation in patching operations other than those set up using Quick Setup, and you want to use its optional BaselineTags parameter, you must provide some additional permissions to the instance profile for Amazon Elastic Compute Cloud (Amazon EC2) instances. For more information, see Parameter name: BaselineTags. Both of the following formats are valid for your BaselineTags parameter: Key=tag-key,Values=tag-value Key=tag-key,Values=tag-value1,tag-value2,tag-value3 Patch Manager 554 AWS Systems Manager Important User Guide Tag keys and values can't contain the following characters: backtick (`), single quote ('), double quote ("), and dollar sign ($). • When AWS-RunPatchBaselineAssociation runs, the patch compliance data it collects is recorded using the PutComplianceItems API command instead of the PutInventory command, which is used by AWS-RunPatchBaseline. This difference means that the patch compliance information that is stored and reported per a specific association. Patch compliance data generated outside of this association isn't overwritten.
systems-manager-ug-180
systems-manager-ug.pdf
180
Parameter name: BaselineTags. Both of the following formats are valid for your BaselineTags parameter: Key=tag-key,Values=tag-value Key=tag-key,Values=tag-value1,tag-value2,tag-value3 Patch Manager 554 AWS Systems Manager Important User Guide Tag keys and values can't contain the following characters: backtick (`), single quote ('), double quote ("), and dollar sign ($). • When AWS-RunPatchBaselineAssociation runs, the patch compliance data it collects is recorded using the PutComplianceItems API command instead of the PutInventory command, which is used by AWS-RunPatchBaseline. This difference means that the patch compliance information that is stored and reported per a specific association. Patch compliance data generated outside of this association isn't overwritten. • The patch compliance information reported after running AWS- RunPatchBaselineAssociation indicates whether or not an instance is in compliance. It doesn't include patch-level details, as demonstrated by the output of the following AWS Command Line Interface (AWS CLI) command. The command filters on Association as the compliance type: aws ssm list-compliance-items \ --resource-ids "i-02573cafcfEXAMPLE" \ --resource-types "ManagedInstance" \ --filters "Key=ComplianceType,Values=Association,Type=EQUAL" \ --region us-east-2 The system returns information like the following. { "ComplianceItems": [ { "Status": "NON_COMPLIANT", "Severity": "UNSPECIFIED", "Title": "MyPatchAssociation", "ResourceType": "ManagedInstance", "ResourceId": "i-02573cafcfEXAMPLE", "ComplianceType": "Association", "Details": { "DocumentName": "AWS-RunPatchBaselineAssociation", "PatchBaselineId": "pb-0c10e65780EXAMPLE", "DocumentVersion": "1" }, "ExecutionSummary": { Patch Manager 555 AWS Systems Manager User Guide "ExecutionTime": 1590698771.0 }, "Id": "3e5d5694-cd07-40f0-bbea-040e6EXAMPLE" } ] } If a tag key pair value has been specified as a parameter for the AWS- RunPatchBaselineAssociation document, Patch Manager searches for a custom patch baseline that matches the operating system type and has been tagged with that same tag-key pair. This search isn't limited to the current specified default patch baseline or the baseline assigned to a patch group. If no baseline is found with the specified tags, Patch Manager next looks for a patch group, if one was specified in the command that runs AWS-RunPatchBaselineAssociation. If no patch group is matched, Patch Manager falls back to the current default patch baseline for the operating system account. If more than one patch baseline is found with the tags specified in the AWS- RunPatchBaselineAssociation document, Patch Manager returns an error message indicating that only one patch baseline can be tagged with that key-value pair in order for the operation to proceed. Note On Linux instances, the appropriate package manager for each instance type is used to install packages: • Amazon Linux 1, Amazon Linux 2, CentOS, Oracle Linux, and RHEL instances use YUM. For YUM operations, Patch Manager requires Python 2.6 or a later supported version (2.6 - 3.10). • Debian Server, Raspberry Pi OS, and Ubuntu Server instances use APT. For APT operations, Patch Manager requires a supported version of Python 3 (3.0 - 3.10). • SUSE Linux Enterprise Server instances use Zypper. For Zypper operations, Patch Manager requires Python 2.6 or a later supported version (2.6 - 3.10). After a scan is complete, or after all approved and applicable updates have been installed, with reboots performed as necessary, patch compliance information is generated on an instance and reported back to the Patch Compliance service. Patch Manager 556 AWS Systems Manager Note User Guide If the RebootOption parameter is set to NoReboot in the AWS- RunPatchBaselineAssociation document, the instance isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption. For information about viewing patch compliance data, see About patch compliance. AWS-RunPatchBaselineAssociation parameters AWS-RunPatchBaselineAssociation supports five parameters. The Operation and AssociationId parameters are required. The InstallOverrideList, RebootOption, and BaselineTags parameters are optional. Parameters • Parameter name: Operation • Parameter name: BaselineTags • Parameter name: AssociationId • Parameter name: InstallOverrideList • Parameter name: RebootOption Parameter name: Operation Usage: Required. Options: Scan | Install. Scan When you choose the Scan option, AWS-RunPatchBaselineAssociation determines the patch compliance state of the instance and reports this information back to Patch Manager. Scan doesn't prompt updates to be installed or instances to be rebooted. Instead, the operation identifies where updates are missing that are approved and applicable to the instance. Install When you choose the Install option, AWS-RunPatchBaselineAssociation attempts to install the approved and applicable updates that are missing from the instance. Patch Patch Manager 557 AWS Systems Manager User Guide compliance information generated as part of an Install operation doesn't list any missing updates, but might report updates that are in a failed state if the installation of the update didn't succeed for any reason. Whenever an update is installed on an instance, the instance is rebooted to ensure the update is both installed and active. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaselineAssociation document, the instance isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Note If a patch specified by the baseline rules is installed before Patch Manager updates the instance, the system might not reboot as expected. This can happen when a patch is installed manually by a user
systems-manager-ug-181
systems-manager-ug.pdf
181
in a failed state if the installation of the update didn't succeed for any reason. Whenever an update is installed on an instance, the instance is rebooted to ensure the update is both installed and active. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaselineAssociation document, the instance isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Note If a patch specified by the baseline rules is installed before Patch Manager updates the instance, the system might not reboot as expected. This can happen when a patch is installed manually by a user or installed automatically by another program, such as the unattended-upgrades package on Ubuntu Server. Parameter name: BaselineTags Usage: Optional. BaselineTags is a unique tag key-value pair that you choose and assign to an individual custom patch baseline. You can specify one or more values for this parameter. Both of the following formats are valid: Key=tag-key,Values=tag-value Key=tag-key,Values=tag-value1,tag-value2,tag-value3 Important Tag keys and values can't contain the following characters: backtick (`), single quote ('), double quote ("), and dollar sign ($). The BaselineTags value is used by Patch Manager to ensure that a set of instances that are patched in a single operation all have the exact same set of approved patches. When the patching operation runs, Patch Manager checks to see if a patch baseline for the operating system type is tagged with the same key-value pair you specify for BaselineTags. If there is a match, this custom patch baseline is used. If there isn't a match, a patch baseline is identified according to any Patch Manager 558 AWS Systems Manager User Guide patch group specified for the patching operating. If there is none, the AWS managed predefined patch baseline for that operating system is used. Additional permission requirements If you use AWS-RunPatchBaselineAssociation in patching operations other than those set up using Quick Setup, and you want to use the optional BaselineTags parameter, you must add the following permissions to the instance profile for Amazon Elastic Compute Cloud (Amazon EC2) instances. Note Quick Setup and AWS-RunPatchBaselineAssociation don't support on-premises servers and virtual machines (VMs). { "Effect": "Allow", "Action": [ "ssm:DescribePatchBaselines", "tag:GetResources" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "ssm:GetPatchBaseline", "ssm:DescribeEffectivePatchesForPatchBaseline" ], "Resource": "patch-baseline-arn" } Replace patch-baseline-arn with the Amazon Resource Name (ARN) of the patch baseline to which you want to provide access, in the format arn:aws:ssm:us- east-2:123456789012:patchbaseline/pb-0c10e65780EXAMPLE. Parameter name: AssociationId Usage: Required. Patch Manager 559 AWS Systems Manager User Guide AssociationId is the ID of an existing association in State Manager, a tool in AWS Systems Manager. It's used by Patch Manager to add compliance data to a specified association. This association is related to a patch Scan operation enabled in a Host Management configuration created in Quick Setup. By sending patching results as association compliance data instead of inventory compliance data, existing inventory compliance information for your instances isn't overwritten after a patching operation, nor for other association IDs. If you don't already have an association you want to use, you can create one by running create-association the command. For example: Linux & macOS aws ssm create-association \ --name "AWS-RunPatchBaselineAssociation" \ --association-name "MyPatchHostConfigAssociation" \ --targets "Key=instanceids,Values=[i-02573cafcfEXAMPLE,i-07782c72faEXAMPLE,i-07782c72faEXAMPLE]" \ --parameters "Operation=Scan" \ --schedule-expression "cron(0 */30 * * * ? *)" \ --sync-compliance "MANUAL" \ --region us-east-2 Windows Server aws ssm create-association ^ --name "AWS-RunPatchBaselineAssociation" ^ --association-name "MyPatchHostConfigAssociation" ^ --targets "Key=instanceids,Values=[i-02573cafcfEXAMPLE,i-07782c72faEXAMPLE,i-07782c72faEXAMPLE]" ^ --parameters "Operation=Scan" ^ --schedule-expression "cron(0 */30 * * * ? *)" ^ --sync-compliance "MANUAL" ^ --region us-east-2 Parameter name: InstallOverrideList Usage: Optional. Using InstallOverrideList, you specify an https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL to a list of patches to be installed. This patch installation list, which Patch Manager 560 AWS Systems Manager User Guide you maintain in YAML format, overrides the patches specified by the current default patch baseline. This provides you with more granular control over which patches are installed on your instances. Important The InstallOverrideList file name can't contain the following characters: backtick (`), single quote ('), double quote ("), and dollar sign ($). The patching operation behavior when using the InstallOverrideList parameter differs between Linux & macOS managed nodes and Windows Server managed nodes. On Linux & macOS, Patch Manager attempts to apply patches included in the InstallOverrideList patch list that are present in any repository enabled on the node, whether or not the patches match the patch baseline rules. On Windows Server nodes, however, patches in the InstallOverrideList patch list are applied only if they also match the patch baseline rules. Be aware that compliance reports reflect patch states according to what’s specified in the patch baseline, not what you specify in an InstallOverrideList list of patches. In other words, Scan operations ignore the InstallOverrideList parameter. This is to ensure that compliance reports consistently reflect patch states according to
systems-manager-ug-182
systems-manager-ug.pdf
182
attempts to apply patches included in the InstallOverrideList patch list that are present in any repository enabled on the node, whether or not the patches match the patch baseline rules. On Windows Server nodes, however, patches in the InstallOverrideList patch list are applied only if they also match the patch baseline rules. Be aware that compliance reports reflect patch states according to what’s specified in the patch baseline, not what you specify in an InstallOverrideList list of patches. In other words, Scan operations ignore the InstallOverrideList parameter. This is to ensure that compliance reports consistently reflect patch states according to policy rather than what was approved for a specific patching operation. Valid URL formats Note If your file is stored in a publicly available bucket, you can specify either an https URL format or an Amazon S3 path-style URL. If your file is stored in a private bucket, you must specify an Amazon S3 path-style URL. • https URL format example: https://s3.amazonaws.com/amzn-s3-demo-bucket/my-windows-override-list.yaml • Amazon S3 path-style URL example: s3://amzn-s3-demo-bucket/my-windows-override-list.yaml Patch Manager 561 AWS Systems Manager Valid YAML content formats User Guide The formats you use to specify patches in your list depends on the operating system of your instance. The general format, however, is as follows: patches: - id: '{patch-d}' title: '{patch-title}' {additional-fields}:{values} Although you can provide additional fields in your YAML file, they're ignored during patch operations. In addition, we recommend verifying that the format of your YAML file is valid before adding or updating the list in your S3 bucket. For more information about the YAML format, see yaml.org. For validation tool options, perform a web search for "yaml format validators". • Microsoft Windows id The id field is required. Use it to specify patches using Microsoft Knowledge Base IDs (for example, KB2736693) and Microsoft Security Bulletin IDs (for example, MS17-023). Any other fields you want to provide in a patch list for Windows are optional and are for your own informational use only. You can use additional fields such as title, classification, severity, or anything else for providing more detailed information about the specified patches. • Linux id The id field is required. Use it to specify patches using the package name and architecture. For example: 'dhclient.x86_64'. You can use wildcards in id to indicate multiple packages. For example: 'dhcp*' and 'dhcp*1.*'. title The title field is optional, but on Linux systems it does provide additional filtering capabilities. If you use title, it should contain the package version information in the one of the following formats: Patch Manager 562 AWS Systems Manager User Guide YUM/SUSE Linux Enterprise Server (SLES): {name}.{architecture}:{epoch}:{version}-{release} APT {name}.{architecture}:{version} For Linux patch titles, you can use one or more wildcards in any position to expand the number of package matches. For example: '*32:9.8.2-0.*.rc1.57.amzn1'. For example: • apt package version 1.2.25 is currently installed on your instance, but version 1.2.27 is now available. • You add apt.amd64 version 1.2.27 to the patch list. It depends on apt utils.amd64 version 1.2.27, but apt-utils.amd64 version 1.2.25 is specified in the list. In this case, apt version 1.2.27 will be blocked from installation and reported as “Failed- NonCompliant.” Other fields Any other fields you want to provide in a patch list for Linux are optional and are for your own informational use only. You can use additional fields such as classification, severity, or anything else for providing more detailed information about the specified patches. Sample patch lists • Windows patches: - id: 'KB4284819' title: '2018-06 Cumulative Update for Windows Server 2016 (1709) for x64- based Systems (KB4284819)' - id: 'KB4284833' - id: 'KB4284835' Patch Manager 563 AWS Systems Manager User Guide title: '2018-06 Cumulative Update for Windows Server 2016 (1803) for x64- based Systems (KB4284835)' - id: 'KB4284880' - id: 'KB4338814' • APT patches: - id: 'apparmor.amd64' title: '2.10.95-0ubuntu2.9' - id: 'cryptsetup.amd64' title: '*2:1.6.6-5ubuntu2.1' - id: 'cryptsetup-bin.*' title: '*2:1.6.6-5ubuntu2.1' - id: 'apt.amd64' title: '*1.2.27' - id: 'apt-utils.amd64' title: '*1.2.25' • Amazon Linux patches: - id: 'kernel.x86_64' - id: 'bind*.x86_64' title: '32:9.8.2-0.62.rc1.57.amzn1' - id: 'glibc*' - id: 'dhclient*' title: '*12:4.1.1-53.P1.28.amzn1' - id: 'dhcp*' title: '*10:3.1.1-50.P1.26.amzn1' Patch Manager 564 AWS Systems Manager User Guide • Red Hat Enterprise Linux (RHEL) patches: - id: 'NetworkManager.x86_64' title: '*1:1.10.2-14.el7_5' - id: 'NetworkManager-*.x86_64' title: '*1:1.10.2-14.el7_5' - id: 'audit.x86_64' title: '*0:2.8.1-3.el7' - id: 'dhclient.x86_64' title: '*.el7_5.1' - id: 'dhcp*.x86_64' title: '*12:5.2.5-68.el7' • SUSE Linux Enterprise Server (SLES) patches: - id: 'amazon-ssm-agent.x86_64' - id: 'binutils' title: '*0:2.26.1-9.12.1' - id: 'glibc*.x86_64' title: '*2.19*' - id: 'dhcp*' title: '0:4.3.3-9.1' - id: 'lib*' • Ubuntu Server patches: - id: 'apparmor.amd64' Patch Manager 565 AWS Systems Manager User Guide title: '2.10.95-0ubuntu2.9' - id: 'cryptsetup.amd64' title: '*2:1.6.6-5ubuntu2.1' - id: 'cryptsetup-bin.*' title: '*2:1.6.6-5ubuntu2.1' - id: 'apt.amd64' title: '*1.2.27' - id: 'apt-utils.amd64' title: '*1.2.25' • Windows patches: - id: 'KB4284819' title: '2018-06 Cumulative Update for Windows Server 2016 (1709) for x64- based Systems
systems-manager-ug-183
systems-manager-ug.pdf
183
'*1:1.10.2-14.el7_5' - id: 'audit.x86_64' title: '*0:2.8.1-3.el7' - id: 'dhclient.x86_64' title: '*.el7_5.1' - id: 'dhcp*.x86_64' title: '*12:5.2.5-68.el7' • SUSE Linux Enterprise Server (SLES) patches: - id: 'amazon-ssm-agent.x86_64' - id: 'binutils' title: '*0:2.26.1-9.12.1' - id: 'glibc*.x86_64' title: '*2.19*' - id: 'dhcp*' title: '0:4.3.3-9.1' - id: 'lib*' • Ubuntu Server patches: - id: 'apparmor.amd64' Patch Manager 565 AWS Systems Manager User Guide title: '2.10.95-0ubuntu2.9' - id: 'cryptsetup.amd64' title: '*2:1.6.6-5ubuntu2.1' - id: 'cryptsetup-bin.*' title: '*2:1.6.6-5ubuntu2.1' - id: 'apt.amd64' title: '*1.2.27' - id: 'apt-utils.amd64' title: '*1.2.25' • Windows patches: - id: 'KB4284819' title: '2018-06 Cumulative Update for Windows Server 2016 (1709) for x64- based Systems (KB4284819)' - id: 'KB4284833' - id: 'KB4284835' title: '2018-06 Cumulative Update for Windows Server 2016 (1803) for x64- based Systems (KB4284835)' - id: 'KB4284880' - id: 'KB4338814' Parameter name: RebootOption Usage: Optional. Options: RebootIfNeeded | NoReboot Default: RebootIfNeeded Patch Manager 566 AWS Systems Manager Warning User Guide The default option is RebootIfNeeded. Be sure to select the correct option for your use case. For example, if your instances must reboot immediately to complete a configuration process, choose RebootIfNeeded. Or, if you need to maintain instances availability until a scheduled reboot time, choose NoReboot. Important The NoReboot option only prevents operating system-level restarts. Service-level restarts can still occur as part of the patching process. For example, when Docker is updated, dependent services such as Amazon Elastic Container Service might automatically restart even with NoReboot enabled. If you have critical services that must not be disrupted, consider additional measures such as temporarily removing instances from service or scheduling patching during maintenance windows. Important We don’t recommend using Patch Manager for patching cluster instances in Amazon EMR (previously called Amazon Elastic MapReduce). In particular, don’t select the RebootIfNeeded option for the RebootOption parameter. (This option is available in the SSM Command documents for patching AWS-RunPatchBaseline, AWS- RunPatchBaselineAssociation, and AWS-RunPatchBaselineWithHooks.) The underlying commands for patching using Patch Manager use yum and dnf commands. Therefore, the operations result in incompatibilities because of how packages are installed. For information about the preferred methods for updating software on Amazon EMR clusters, see Using the default AMI for Amazon EMR in the Amazon EMR Management Guide. RebootIfNeeded When you choose the RebootIfNeeded option, the instance is rebooted in either of the following cases: • Patch Manager installed one or more patches. Patch Manager 567 AWS Systems Manager User Guide Patch Manager doesn't evaluate whether a reboot is required by the patch. The system is rebooted even if the patch doesn't require a reboot. • Patch Manager detects one or more patches with a status of INSTALLED_PENDING_REBOOT during the Install operation. The INSTALLED_PENDING_REBOOT status can mean that the option NoReboot was selected the last time the Install operation was run, or that a patch was installed outside of Patch Manager since the last time the managed node was rebooted. Rebooting instances in these two cases ensures that updated packages are flushed from memory and keeps patching and rebooting behavior consistent across all operating systems. NoReboot When you choose the NoReboot option, Patch Manager doesn't reboot an instance even if it installed patches during the Install operation. This option is useful if you know that your instances don't require rebooting after patches are applied, or you have applications or processes running on an instance that shouldn't be disrupted by a patching operation reboot. It's also useful when you want more control over the timing of instance reboots, such as by using a maintenance window. Patch installation tracking file: To track patch installation, especially patches that have been installed since the last system reboot, Systems Manager maintains a file on the managed instance. Important Don't delete or modify the tracking file. If this file is deleted or corrupted, the patch compliance report for the instance is inaccurate. If this happens, reboot the instance and run a patch Scan operation to restore the file. This tracking file is stored in the following locations on your managed instances: • Linux operating systems: • /var/log/amazon/ssm/patch-configuration/patch-states-configuration.json • /var/log/amazon/ssm/patch-configuration/patch-inventory-from-last- operation.json Patch Manager 568 AWS Systems Manager User Guide • Windows Server operating system: • C:\ProgramData\Amazon\PatchBaselineOperations\State \PatchStatesConfiguration.json • C:\ProgramData\Amazon\PatchBaselineOperations\State \PatchInventoryFromLastOperation.json SSM Command document for patching: AWS-RunPatchBaselineWithHooks AWS Systems Manager supports AWS-RunPatchBaselineWithHooks, a Systems Manager document (SSM document) for Patch Manager, a tool in AWS Systems Manager. This SSM document performs patching operations on managed nodes for both security related and other types of updates. AWS-RunPatchBaselineWithHooks differs from AWS-RunPatchBaseline in the following ways: • A wrapper document – AWS-RunPatchBaselineWithHooks is a wrapper for AWS- RunPatchBaseline and relies on AWS-RunPatchBaseline for some of its operations. • The Install operation – AWS-RunPatchBaselineWithHooks supports lifecycle hooks that run at designated points during managed node patching. Because patch installations sometimes require managed nodes to reboot, the patching operation is divided into two events, for a total of three hooks that support custom
systems-manager-ug-184
systems-manager-ug.pdf
184
for Patch Manager, a tool in AWS Systems Manager. This SSM document performs patching operations on managed nodes for both security related and other types of updates. AWS-RunPatchBaselineWithHooks differs from AWS-RunPatchBaseline in the following ways: • A wrapper document – AWS-RunPatchBaselineWithHooks is a wrapper for AWS- RunPatchBaseline and relies on AWS-RunPatchBaseline for some of its operations. • The Install operation – AWS-RunPatchBaselineWithHooks supports lifecycle hooks that run at designated points during managed node patching. Because patch installations sometimes require managed nodes to reboot, the patching operation is divided into two events, for a total of three hooks that support custom functionality. The first hook is before the Install with NoReboot operation. The second hook is after the Install with NoReboot operation. The third hook is available after the reboot of the managed node. • No custom patch list support – AWS-RunPatchBaselineWithHooks doesn't support the InstallOverrideList parameter. • SSM Agent support – AWS-RunPatchBaselineWithHooks requires that SSM Agent 3.0.502 or later be installed on the managed node to patch. When the document is run, it uses the patch baseline currently specified as the "default" for an operating system type if no patch group is specified. Otherwise, it uses the patch baselines that is associated with the patch group. For information about patch groups, see Patch groups. You can use the document AWS-RunPatchBaselineWithHooks to apply patches for both operating systems and applications. (On Windows Server, application support is limited to updates for applications released by Microsoft.) Patch Manager 569 AWS Systems Manager User Guide This document supports Linux and Windows Server managed nodes. The document will perform the appropriate actions for each platform. Note AWS-RunPatchBaselineWithHooks isn't supported on macOS. Linux On Linux managed nodes, the AWS-RunPatchBaselineWithHooks document invokes a Python module, which in turn downloads a snapshot of the patch baseline that applies to the managed node. This patch baseline snapshot uses the defined rules and lists of approved and blocked patches to drive the appropriate package manager for each node type: • Amazon Linux 1, Amazon Linux 2, CentOS, Oracle Linux, and RHEL 7 managed nodes use YUM. For YUM operations, Patch Manager requires Python 2.6 or a later supported version (2.6 - 3.10). • RHEL 8 managed nodes use DNF. For DNF operations, Patch Manager requires a supported version of Python 2 or Python 3 (2.6 - 3.10). (Neither version is installed by default on RHEL 8. You must install one or the other manually.) • Debian Server, Raspberry Pi OS, and Ubuntu Server instances use APT. For APT operations, Patch Manager requires a supported version of Python 3 (3.0 - 3.10). • SUSE Linux Enterprise Server managed nodes use Zypper. For Zypper operations, Patch Manager requires Python 2.6 or a later supported version (2.6 - 3.10). Windows Server On Windows Server managed nodes, the AWS-RunPatchBaselineWithHooks document downloads and invokes a PowerShell module, which in turn downloads a snapshot of the patch baseline that applies to the managed node. This patch baseline snapshot contains a list of approved patches that is compiled by querying the patch baseline against a Windows Server Update Services (WSUS) server. This list is passed to the Windows Update API, which controls downloading and installing the approved patches as appropriate. Each snapshot is specific to an AWS account, patch group, operating system, and snapshot ID. The snapshot is delivered through a presigned Amazon Simple Storage Service (Amazon S3) URL, which Patch Manager 570 AWS Systems Manager User Guide expires 24 hours after the snapshot is created. After the URL expires, however, if you want to apply the same snapshot content to other managed nodes, you can generate a new presigned Amazon S3 URL up to three days after the snapshot was created. To do this, use the get-deployable-patch- snapshot-for-instance command. After all approved and applicable updates have been installed, with reboots performed as necessary, patch compliance information is generated on an managed node and reported back to Patch Manager. If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaselineWithHooks document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption. Important While the NoReboot option prevents operating system restarts, it does not prevent service-level restarts that might occur when certain packages are updated. For example, updating packages like Docker may trigger automatic restarts of dependent services (such as container orchestration services) even when NoReboot is specified. For information about viewing patch compliance data, see About patch compliance. AWS-RunPatchBaselineWithHooks operational steps When the AWS-RunPatchBaselineWithHooks runs, the following steps are performed: 1. Scan - A Scan operation using AWS-RunPatchBaseline is run on the managed node, and a compliance report is generated and uploaded. 2. Verify local patch states - A script is run to determine what steps will be performed based on the selected operation and Scan result from Step 1. a.
systems-manager-ug-185
systems-manager-ug.pdf
185
packages are updated. For example, updating packages like Docker may trigger automatic restarts of dependent services (such as container orchestration services) even when NoReboot is specified. For information about viewing patch compliance data, see About patch compliance. AWS-RunPatchBaselineWithHooks operational steps When the AWS-RunPatchBaselineWithHooks runs, the following steps are performed: 1. Scan - A Scan operation using AWS-RunPatchBaseline is run on the managed node, and a compliance report is generated and uploaded. 2. Verify local patch states - A script is run to determine what steps will be performed based on the selected operation and Scan result from Step 1. a. If the selected operation is Scan, the operation is marked complete. The operation concludes. b. If the selected operation is Install, Patch Manager evaluates the Scan result from Step 1 to determine what to run next: i. If no missing patches are detected, and no pending reboots required, the operation proceeds directly to the final step (Step 8), which includes a hook you have provided. Any steps in between are skipped. Patch Manager 571 AWS Systems Manager User Guide ii. If no missing patches are detected, but there are pending reboots required and the selected reboot option is NoReboot, the operation proceeds directly to the final step (Step 8), which includes a hook you have provided. Any steps in between are skipped. iii. Otherwise, the operation proceeds to the next step. 3. Pre-patch hook operation - The SSM document you have provided for the first lifecycle hook, PreInstallHookDocName, is run on the managed node. 4. Install with NoReboot - An Install operation with the reboot option of NoReboot using AWS- RunPatchBaseline is run on the managed node, and a compliance report is generated and uploaded. 5. Post-install hook operation - The SSM document you have provided for the second lifecycle hook, PostInstallHookDocName, is run on the managed node. 6. Verify reboot - A script runs to determine whether a reboot is needed for the managed node and what steps to run: a. If the selected reboot option is NoReboot, the operation proceeds directly to the final step (Step 8), which includes a hook you have provided. Any steps in between are skipped. b. If the selected reboot option is RebootIfNeeded, Patch Manager checks whether there are any pending reboots required from the inventory collected in Step 4. This means that the operation continues to Step 7 and the managed node is rebooted in either of the following cases: i. Patch Manager installed one or more patches. (Patch Manager doesn't evaluate whether a reboot is required by the patch. The system is rebooted even if the patch doesn't require a reboot.) ii. Patch Manager detects one or more patches with a status of INSTALLED_PENDING_REBOOT during the Install operation. The INSTALLED_PENDING_REBOOT status can mean that the option NoReboot was selected the last time the Install operation was run, or that a patch was installed outside of Patch Manager since the last time the managed node was rebooted. If no patches meeting these criteria are found, the managed node patching operation is complete, and the operation proceeds directly to the final step (Step 8), which includes a hook you have provided. Any steps in between are skipped. 7. Reboot and report - An installation operation with the reboot option of RebootIfNeeded runs on the managed node using AWS-RunPatchBaseline, and a compliance report is generated and uploaded. Patch Manager 572 AWS Systems Manager User Guide 8. Post-reboot hook operation - The SSM document you have provided for the third lifecycle hook, OnExitHookDocName, is run on the managed node. For a Scan operation, if Step 1 fails, the process of running the document stops and the step is reported as failed, although subsequent steps are reported as successful. For an Install operation, if any of the aws:runDocument steps fail during the operation, those steps are reported as failed, and the operation proceeds directly to the final step (Step 8), which includes a hook you have provided. Any steps in between are skipped. This step is reported as failed, the last step reports the status of its operation result, and all steps in between are reported as successful. AWS-RunPatchBaselineWithHooks parameters AWS-RunPatchBaselineWithHooks supports six parameters. The Operation parameter is required. The RebootOption, PreInstallHookDocName, PostInstallHookDocName, and OnExitHookDocName parameters are optional. Snapshot-ID is technically optional, but we recommend that you supply a custom value for it when you run AWS-RunPatchBaselineWithHooks outside of a maintenance window. Let Patch Manager supply the value automatically when the document is run as part of a maintenance window operation. Parameters • Parameter name: Operation • Parameter name: Snapshot ID • Parameter name: RebootOption • Parameter name: PreInstallHookDocName • Parameter name: PostInstallHookDocName • Parameter name: OnExitHookDocName Parameter name: Operation Usage: Required. Patch Manager 573 AWS Systems Manager Options: Scan | Install. Scan User Guide When
systems-manager-ug-186
systems-manager-ug.pdf
186
parameter is required. The RebootOption, PreInstallHookDocName, PostInstallHookDocName, and OnExitHookDocName parameters are optional. Snapshot-ID is technically optional, but we recommend that you supply a custom value for it when you run AWS-RunPatchBaselineWithHooks outside of a maintenance window. Let Patch Manager supply the value automatically when the document is run as part of a maintenance window operation. Parameters • Parameter name: Operation • Parameter name: Snapshot ID • Parameter name: RebootOption • Parameter name: PreInstallHookDocName • Parameter name: PostInstallHookDocName • Parameter name: OnExitHookDocName Parameter name: Operation Usage: Required. Patch Manager 573 AWS Systems Manager Options: Scan | Install. Scan User Guide When you choose the Scan option, the systems uses the AWS-RunPatchBaseline document to determine the patch compliance state of the managed node and reports this information back to Patch Manager. Scan doesn't prompt updates to be installed or managed nodes to be rebooted. Instead, the operation identifies where updates are missing that are approved and applicable to the node. Install When you choose the Install option, AWS-RunPatchBaselineWithHooks attempts to install the approved and applicable updates that are missing from the managed node. Patch compliance information generated as part of an Install operation doesn't list any missing updates, but might report updates that are in a failed state if the installation of the update didn't succeed for any reason. Whenever an update is installed on a managed node, the node is rebooted to ensure the update is both installed and active. (Exception: If the RebootOption parameter is set to NoReboot in the AWS-RunPatchBaselineWithHooks document, the managed node isn't rebooted after Patch Manager runs. For more information, see Parameter name: RebootOption.) Note If a patch specified by the baseline rules is installed before Patch Manager updates the managed node, the system might not reboot as expected. This can happen when a patch is installed manually by a user or installed automatically by another program, such as the unattended-upgrades package on Ubuntu Server. Parameter name: Snapshot ID Usage: Optional. Snapshot ID is a unique ID (GUID) used by Patch Manager to ensure that a set of managed nodes that are patched in a single operation all have the exact same set of approved patches. Although the parameter is defined as optional, our best practice recommendation depends on whether or not you're running AWS-RunPatchBaselineWithHooks in a maintenance window, as described in the following table. Patch Manager 574 AWS Systems Manager User Guide AWS-RunPatchBaselineWithHooks best practices Mode Best practice Details Running AWS-RunPa tchBaselineWithHoo ks inside a maintenance window for you. Don't supply a Snapshot ID. Patch Manager will supply it If you use a maintenance window to run AWS-RunPa tchBaselineWithHoo ks , you shouldn't provide your own generated Snapshot ID. In this scenario, Systems Manager provides a GUID value based on the maintenan ce window execution ID. This ensures that a correct ID is used for all the invocations of AWS-RunPatchBaseli neWithHooks in that maintenance window. If you do specify a value in this scenario, note that the snapshot of the patch baseline might not remain in place for more than 3 days. After that, a new snapshot will be generated even if you specify the same ID after the snapshot expires. When you aren't using a maintenance window to run AWS-RunPatchBaseli neWithHooks , we recommend that you generate and specify a unique Snapshot ID for each patch baseline, particularly if you're running the AWS-RunPa Running AWS-RunPa tchBaselineWithHoo ks outside of a maintenance window Generate and specify a custom GUID value for the Snapshot ID.¹ Patch Manager 575 AWS Systems Manager User Guide Mode Best practice Details tchBaselineWithHoo ks document on multiple managed nodes in the same operation. If you don't specify an ID in this scenario, Systems Manager generates a different Snapshot ID for each managed node the command is sent to. This might result in varying sets of patches being specified among the nodes. For instance, say that you're running the AWS-RunPa tchBaselineWithHoo ks document directly through Run Command, a tool inAWS Systems Manager, and targeting a group of 50 managed nodes. Specifyin g a custom Snapshot ID results in the generation of a single baseline snapshot that is used to evaluate and patch all the managed nodes, ensuring that they end up in a consistent state. ¹ You can use any tool capable of generating a GUID to generate a value for the Snapshot ID parameter. For example, in PowerShell, you can use the New-Guid cmdlet to generate a GUID in the format of 12345699-9405-4f69-bc5e-9315aEXAMPLE . Parameter name: RebootOption Usage: Optional. Patch Manager 576 AWS Systems Manager User Guide Options: RebootIfNeeded | NoReboot Default: RebootIfNeeded Warning The default option is RebootIfNeeded. Be sure to select the correct option for your use case. For example, if your managed nodes must reboot immediately to complete a configuration process, choose RebootIfNeeded. Or, if you need to
systems-manager-ug-187
systems-manager-ug.pdf
187
a consistent state. ¹ You can use any tool capable of generating a GUID to generate a value for the Snapshot ID parameter. For example, in PowerShell, you can use the New-Guid cmdlet to generate a GUID in the format of 12345699-9405-4f69-bc5e-9315aEXAMPLE . Parameter name: RebootOption Usage: Optional. Patch Manager 576 AWS Systems Manager User Guide Options: RebootIfNeeded | NoReboot Default: RebootIfNeeded Warning The default option is RebootIfNeeded. Be sure to select the correct option for your use case. For example, if your managed nodes must reboot immediately to complete a configuration process, choose RebootIfNeeded. Or, if you need to maintain managed node availability until a scheduled reboot time, choose NoReboot. Important We don’t recommend using Patch Manager for patching cluster instances in Amazon EMR (previously called Amazon Elastic MapReduce). In particular, don’t select the RebootIfNeeded option for the RebootOption parameter. (This option is available in the SSM Command documents for patching AWS-RunPatchBaseline, AWS- RunPatchBaselineAssociation, and AWS-RunPatchBaselineWithHooks.) The underlying commands for patching using Patch Manager use yum and dnf commands. Therefore, the operations result in incompatibilities because of how packages are installed. For information about the preferred methods for updating software on Amazon EMR clusters, see Using the default AMI for Amazon EMR in the Amazon EMR Management Guide. RebootIfNeeded When you choose the RebootIfNeeded option, the managed node is rebooted in either of the following cases: • Patch Manager installed one or more patches. Patch Manager doesn't evaluate whether a reboot is required by the patch. The system is rebooted even if the patch doesn't require a reboot. • Patch Manager detects one or more patches with a status of INSTALLED_PENDING_REBOOT during the Install operation. Patch Manager 577 AWS Systems Manager User Guide The INSTALLED_PENDING_REBOOT status can mean that the option NoReboot was selected the last time the Install operation was run, or that a patch was installed outside of Patch Manager since the last time the managed node was rebooted. Rebooting managed nodes in these two cases ensures that updated packages are flushed from memory and keeps patching and rebooting behavior consistent across all operating systems. NoReboot When you choose the NoReboot option, Patch Manager doesn't reboot a managed node even if it installed patches during the Install operation. This option is useful if you know that your managed nodes don't require rebooting after patches are applied, or you have applications or processes running on a node that shouldn't be disrupted by a patching operation reboot. It's also useful when you want more control over the timing of managed node reboots, such as by using a maintenance window. Note If you choose the NoReboot option and a patch is installed, the patch is assigned a status of InstalledPendingReboot. The managed node itself, however, is marked as Non-Compliant. After a reboot occurs and a Scan operation is run, the node status is updated to Compliant. Patch installation tracking file: To track patch installation, especially patches that were installed since the last system reboot, Systems Manager maintains a file on the managed node. Important Don't delete or modify the tracking file. If this file is deleted or corrupted, the patch compliance report for the managed node is inaccurate. If this happens, reboot the node and run a patch Scan operation to restore the file. This tracking file is stored in the following locations on your managed nodes: • Linux operating systems: • /var/log/amazon/ssm/patch-configuration/patch-states-configuration.json Patch Manager 578 AWS Systems Manager User Guide • /var/log/amazon/ssm/patch-configuration/patch-inventory-from-last- operation.json • Windows Server operating system: • C:\ProgramData\Amazon\PatchBaselineOperations\State \PatchStatesConfiguration.json • C:\ProgramData\Amazon\PatchBaselineOperations\State \PatchInventoryFromLastOperation.json Parameter name: PreInstallHookDocName Usage: Optional. Default: AWS-Noop. The value to provide for the PreInstallHookDocName parameter is the name or Amazon Resource Name (ARN) of an SSM document of your choice. You can provide the name of an AWS managed document or the name or ARN of a custom SSM document that you have created or that has been shared with you. (For an SSM document that has been shared with you from a different AWS account, you must specify the full resource ARN, such as arn:aws:ssm:us- east-2:123456789012:document/MySharedDocument.) The SSM document you specify is run before the Install operation and performs any actions supported by SSM Agent, such as a shell script to check application health check before patching is performed on the managed node. (For a list of actions, see Command document plugin reference). The default SSM document name is AWS-Noop, which doesn't perform any operation on the managed node. For information about creating a custom SSM document, see Creating SSM document content. Parameter name: PostInstallHookDocName Usage: Optional. Default: AWS-Noop. The value to provide for the PostInstallHookDocName parameter is the name or Amazon Resource Name (ARN) of an SSM document of your choice. You can provide the name of an AWS managed document or the name or ARN of a custom SSM document that you