PolicyUniverse, currently at version 1.5.1.20231109, is a Python library for parsing and processing AWS IAM Policies, Statements, ARNs, and wildcards. It provides classes to parse AWS IAM and Resource Policies, expand wildcards using AWS permission data, and minify policies to help users stay under AWS policy size limits. The project, open-sourced by Netflix-Skunkworks, sees releases as needed, with its latest update in November 2023.
pip install policyuniverseVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to parse an AWS IAM policy document using the `Policy` class, retrieve its principals, check for internet accessibility, and get a summary of actions.
Ensure that policies intended for minification only contain 'Allow' effects, or handle 'Deny' statements separately.
Only use policy minification when strictly necessary to comply with AWS policy size constraints. Otherwise, manage policies in their more human-readable expanded form.
Ensure that policies intended for minification using `policyuniverse` only contain 'Allow' effects, or handle 'Deny' statements separately by not applying the minification function to them.
Install the `policyuniverse` library using pip: `pip install policyuniverse`.
Consult the `policyuniverse` documentation or source code to verify the correct attribute or method names available for the `Policy` object (e.g., `.principals`, `.actions_expanded`, `.is_internet_accessible()`). For example, to get principals, use `policy_object.principals` instead of a hypothetical `policy_object.get_principals()`.
Review the policy document to ensure it strictly adheres to the AWS IAM policy JSON specification, including the presence of 'Version' and 'Statement' keys, and valid values for 'Effect', 'Action', 'Resource', and other policy elements.
No dependency data recorded yet.