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

Assuming role broken in 7e9a5dc #659

Closed
ghost opened this issue Sep 23, 2020 · 1 comment
Closed

Assuming role broken in 7e9a5dc #659

ghost opened this issue Sep 23, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 23, 2020

Hi,

the IAM Assume Role -function seems to have broken in this commit: 7e9a5dc

It looks like moving the AWS_PARTITION-variable inside the getWhoami -function seems to have broken it for some reason. With the commit applied, trying to assume a role leads to this error:

./prowler -g cislevel1 -A 01234567890 -R ExampleRole -M json

An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:iam::01234567890:user/example-user is not authorized to perform: sts:AssumeRole on resource: arn::iam::01234567890:role/ExampleRole

As you can see, the 'aws' -partition in the assumed role ARN is left empty, so it looks like the variable is not set properly. Slicing the partition from the CALLER_ARN -variable still works, so that hasn't changed.

A quick fix for this that worked, at least for me, was moving the CALLER_ARN, USER_ID and AWS_PARTITION -variables outside the getWhoami -function. This way the partition variable gets set correctly.

@toniblyx
Copy link
Member

Thanks for the heads up @fraktal-topi sending a fix now

@toniblyx toniblyx reopened this Sep 24, 2020
toniblyx added a commit that referenced this issue Sep 24, 2020
QuantumBJump pushed a commit to QuantumBJump/prowler that referenced this issue Oct 2, 2020
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

No branches or pull requests

1 participant