AWS systems-manager documentation change
Summary
Added examples demonstrating secure credential handling for patch snapshots
Security assessment
Emphasizes using instance profile credentials instead of hardcoded credentials, which is a security best practice. However, doesn't address a specific vulnerability.
Diff
diff --git a/systems-manager/latest/userguide/example_ssm_GetDeployablePatchSnapshotForInstance_section.md b/systems-manager/latest/userguide/example_ssm_GetDeployablePatchSnapshotForInstance_section.md index 7b1ebd0c7..ef4b29cc0 100644 --- a//systems-manager/latest/userguide/example_ssm_GetDeployablePatchSnapshotForInstance_section.md +++ b//systems-manager/latest/userguide/example_ssm_GetDeployablePatchSnapshotForInstance_section.md @@ -80,0 +81,34 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example displays the current snapshot for the patch baseline used by an Instance. This command must be run from the instance using the instance credentials. To ensure it uses the instance credentials, the example passes an`Amazon.Runtime.InstanceProfileAWSCredentials` object to the Credentials parameter.** + + + $credentials = [Amazon.Runtime.InstanceProfileAWSCredentials]::new() + Get-SSMDeployablePatchSnapshotForInstance -SnapshotId "4681775b-098f-4435-a956-0ef33373ac11" -InstanceId "i-0cb2b964d3e14fd9f" -Credentials $credentials + + +**Output:** + + + InstanceId SnapshotDownloadUrl + ---------- ------------------- + i-0cb2b964d3e14fd9f https://patch-baseline-snapshot-us-west-2.s3-us-west-2.amazonaws.com/853d0d3db0f0cafe...1692/4681775b-098f-4435... + +**Example 2: This example shows how to get the full SnapshotDownloadUrl. This command must be run from the instance using the instance credentials. To ensure it uses the instance credentials, the example configures the PowerShell session to use an`Amazon.Runtime.InstanceProfileAWSCredentials` object.** + + + Set-AWSCredential -Credential ([Amazon.Runtime.InstanceProfileAWSCredentials]::new()) + (Get-SSMDeployablePatchSnapshotForInstance -SnapshotId "4681775b-098f-4435-a956-0ef33373ac11" -InstanceId "i-0cb2b964d3e14fd9f").SnapshotDownloadUrl + + +**Output:** + + + https://patch-baseline-snapshot-us-west-2.s3-us-west-2.amazonaws.com/853d0d3db0f0cafe... + + * For API details, see [GetDeployablePatchSnapshotForInstance](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +