AWS code-library documentation change
Summary
Added PowerShell V5 example for policy context key analysis
Security assessment
Documents policy evaluation capabilities but does not fix a security issue. Context keys relate to security policy management but no vulnerability addressed.
Diff
diff --git a/code-library/latest/ug/iam_example_iam_GetContextKeysForPrincipalPolicy_section.md b/code-library/latest/ug/iam_example_iam_GetContextKeysForPrincipalPolicy_section.md index 878858cbf..4c5025eca 100644 --- a//code-library/latest/ug/iam_example_iam_GetContextKeysForPrincipalPolicy_section.md +++ b//code-library/latest/ug/iam_example_iam_GetContextKeysForPrincipalPolicy_section.md @@ -61,0 +62,16 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example fetches all the context keys present in the provided policy json and the policies attached to IAM entity(user/role etc.). For -PolicyInputList you can provide multiple values list as comma separated values.** + + + $policy1 = '{"Version":"2012-10-17","Statement":{"Effect":"Allow","Action":"dynamodb:*","Resource":"arn:aws:dynamodb:us-west-2:123456789012:table/","Condition":{"DateGreaterThan":{"aws:CurrentTime":"2015-08-16T12:00:00Z"}}}}' + $policy2 = '{"Version":"2012-10-17","Statement":{"Effect":"Allow","Action":"dynamodb:*","Resource":"arn:aws:dynamodb:us-west-2:123456789012:table/"}}' + Get-IAMContextKeysForPrincipalPolicy -PolicyInputList $policy1,$policy2 -PolicySourceArn arn:aws:iam::852640994763:user/TestUser + + + * For API details, see [GetContextKeysForPrincipalPolicy](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +