AWS code-library documentation change
Summary
Added PowerShell V5 examples for retrieving/decrypting Windows instance passwords
Security assessment
Documents sensitive credential handling but does not address a specific vulnerability. Shows proper use of encryption for password retrieval, which is security-related functionality.
Diff
diff --git a/code-library/latest/ug/ec2_example_ec2_GetPasswordData_section.md b/code-library/latest/ug/ec2_example_ec2_GetPasswordData_section.md index de7a44698..239678831 100644 --- a//code-library/latest/ug/ec2_example_ec2_GetPasswordData_section.md +++ b//code-library/latest/ug/ec2_example_ec2_GetPasswordData_section.md @@ -197,0 +198,41 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example decrypts the password that Amazon EC2 assigned to the Administrator account for the specified Windows instance. As a pem file was specified, the setting of the -Decrypt switch is automatically assumed.** + + + Get-EC2PasswordData -InstanceId i-12345678 -PemFile C:\path\my-key-pair.pem + + +**Output:** + + + mYZ(PA9?C)Q + +**Example 2: (Windows PowerShell only) Inspects the instance to determine the name of the keypair used to launch the instance and then attempts to find the corresponding keypair data in the configuration store of the AWS Toolkit for Visual Studio. If the keypair data is found the password is decrypted.** + + + Get-EC2PasswordData -InstanceId i-12345678 -Decrypt + + +**Output:** + + + mYZ(PA9?C)Q + +**Example 3: Returns the encrypted password data for the instance.** + + + Get-EC2PasswordData -InstanceId i-12345678 + + +**Output:** + + + iVz3BAK/WAXV.....dqt8WeMA== + + * For API details, see [GetPasswordData](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +