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

Fix condition key name of Amazon SNS topic policies #805

Closed

Conversation

kurochan
Copy link

Fix condition key case from AWS:SourceOwner to aws:SourceOwner.

According to the document, there should be start with aws: instead of AWS:.

https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html

Global condition keys are condition keys with an aws: prefix.

https://docs.aws.amazon.com/sns/latest/dg/sns-access-policy-use-cases.html

The aws:SourceAccount and aws:SourceOwner condition keys are similar in that they both identify a resource owner.

@CLAassistant
Copy link

CLAassistant commented Jul 15, 2021

CLA assistant check
All committers have signed the CLA.

@kurochan
Copy link
Author

kurochan commented Jul 16, 2021

Hi @AkhtarAmir, could you please review this PR?

@@ -86,7 +86,7 @@ module.exports = {
var conditionExists = (statement.Condition ? true : false);
// Is it a string condition (StringEquals)? Is the SourceOwner open to everyone?
var conditionString = ((statement.Condition && statement.Condition.StringEquals &&
(statement.Condition.StringEquals['AWS:SourceOwner'] || !statement.Condition.StringEquals['AWS:SourceOwner'] == '*')) ? true : false);
(statement.Condition.StringEquals['aws:SourceOwner'] || !statement.Condition.StringEquals['aws:SourceOwner'] == '*')) ? true : false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make it case insensitive?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed 43d90e2.

@kurochan
Copy link
Author

kurochan commented Aug 25, 2021

@AkhtarAmir also, I found a bug and fixed dd01a28.

@kurochan
Copy link
Author

kurochan commented Aug 26, 2021

I'm working on fixing errors 🏃

@AkhtarAmir
Copy link
Contributor

Hey @kurochan! we have a change request to add a setting to be able to provide policy conditions just like we do for KMS Key Policy plugin and that has been done and in this PR #876
Thanks for submitting this anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants