Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: IAM policy document: normalize wildcard principals #9720

Closed
wants to merge 0 commits into from
Closed

provider/aws: IAM policy document: normalize wildcard principals #9720

wants to merge 0 commits into from

Conversation

apparentlymart
Copy link
Contributor

There are three equivalent forms for expressing "everyone" (including anonymous) in IAM policies:

  • "Principals": "*"
  • "Principals": {"AWS": "*"}
  • "Principals": {"*": "*"}

The more-constrained syntax used by our aws_iam_policy_document data source means that the user can only express the latter two of these directly. However, when returning IAM policies from the API AWS likes to normalize to the first form, causing unresolvable diffs.

This fixes #9335 by handling the "everyone" case as a special case, serializing it in JSON as the "*"shorthand form.

This change does not address the normalization of hand-written policies containing such elements. A similar change would need to be made in the external package github.com/jen20/awspolicyequivalence in order to avoid the issue for hand-written policies.

@jen20
Copy link
Contributor

jen20 commented Nov 1, 2016

👍 - I will also make the change in AWS Policy Equivalence.

@ghost
Copy link

ghost commented Apr 20, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IAM Policy document and * Principals
2 participants