AWS IAM documentation change
Summary
Added PowerShell V5 example for Get-IAMUserPolicy with policy document decoding
Security assessment
Shows how to inspect user permissions policies which are security-critical, but doesn't fix any specific issue
Diff
diff --git a/IAM/latest/UserGuide/iam_example_iam_GetUserPolicy_section.md b/IAM/latest/UserGuide/iam_example_iam_GetUserPolicy_section.md index 3fe425490..cadd1820e 100644 --- a//IAM/latest/UserGuide/iam_example_iam_GetUserPolicy_section.md +++ b//IAM/latest/UserGuide/iam_example_iam_GetUserPolicy_section.md @@ -93,0 +94,39 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example retrieves the details of the inline policy named`Davids_IAM_Admin_Policy` that is embedded in the IAM user named `David`. The policy document is URL encoded.** + + + $results = Get-IAMUserPolicy -PolicyName Davids_IAM_Admin_Policy -UserName David + $results + + +**Output:** + + + PolicyDocument PolicyName UserName + -------------- ---------- -------- + %7B%0A%20%20%22Version%22%3A%20%222012-10-17%22%2C%... Davids_IAM_Admin_Policy David + + [System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility") + [System.Web.HttpUtility]::UrlDecode($results.PolicyDocument) + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "iam:*" + ], + "Resource": [ + "*" + ] + } + ] + } + + * For API details, see [GetUserPolicy](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +