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: Add cognito-idp:AdminCreateUser for mobileclient tests #37

Merged
merged 1 commit into from
May 19, 2020

Conversation

palpatim
Copy link
Member

@palpatim palpatim commented May 19, 2020

Adds AdminCreateUser to mobileclient user pool for integ tests. Fixes linting & formatting.

Consumed by aws-amplify/aws-sdk-ios#2612

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -353,7 +350,9 @@ def create_custom_auth_lambda_configuration(

def update_common_stack_with_test_policy(self, common_stack: CommonStack):
stack_policy = aws_iam.PolicyStatement(
effect=aws_iam.Effect.ALLOW, actions=["cognito-identity:*"], resources=["*"]
effect=aws_iam.Effect.ALLOW,
actions=["cognito-identity:*", "cognito-idp:AdminCreateUser"],
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is carry over from how things worked before, but, is there any way to reduce blast radius by only allowing specific actions on cognito-identity?

Copy link
Member Author

Choose a reason for hiding this comment

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

In this specific case, it turns out this action statement is redundant: we already declare cognito-identity:* in another area of the stack.

More generally, it's challenging to limit cognito-identity because the tests themselves use many admin functions to do resource setup & tear down for the tests themselves. I've added a backlog item to reduce scope on that and other permissions: #38

@palpatim palpatim merged commit 7905307 into master May 19, 2020
@palpatim palpatim deleted the palpatim/add-admin-create-user branch May 19, 2020 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants