AWS IAM documentation change
Summary
Added PowerShell V5 example with policy document decoding for Get-IAMPolicyVersion
Security assessment
Shows technical handling of URL-encoded policies but doesn't address policy security or vulnerabilities
Diff
diff --git a/IAM/latest/UserGuide/iam_example_iam_GetPolicyVersion_section.md b/IAM/latest/UserGuide/iam_example_iam_GetPolicyVersion_section.md index 7f2fc49b8..602827ccf 100644 --- a//IAM/latest/UserGuide/iam_example_iam_GetPolicyVersion_section.md +++ b//IAM/latest/UserGuide/iam_example_iam_GetPolicyVersion_section.md @@ -99,0 +100,35 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example returns the policy document for the`v2` version of the policy whose ARN is `arn:aws:iam::123456789012:policy/MyManagedPolicy`. The policy document in the `Document` property is URL encoded and is decoded in this example with the `UrlDecode` .NET method.** + + + $results = Get-IAMPolicyVersion -PolicyArn arn:aws:iam::123456789012:policy/MyManagedPolicy -VersionId v2 + $results + + +**Output:** + + + CreateDate Document IsDefaultVersion VersionId + ---------- -------- ---------------- --------- + 2/12/2015 9:39:53 AM %7B%0A%20%20%22Version%22%3A%20%222012-10... True v2 + + [System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility") + $policy = [System.Web.HttpUtility]::UrlDecode($results.Document) + $policy + { + "Version": "2012-10-17", + "Statement": + { + "Effect": "Allow", + "Action": "*", + "Resource": "*" + } + } + + * For API details, see [GetPolicyVersion](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +