Skip to content

$PROFILE_OPT empty when working with assumed roles #938

@DB-Vincent

Description

@DB-Vincent

Hi,

I'm trying to get Prowler working with assumed roles when executing the ./prowler -c checkXX -M html -p awsProfileWithSwitchRole -r region -A targetAccountId -R AssumedRole from my local machine. The issue is that I get 'Unable to locate credentials. You can configure credentials by running "aws configure".' and 'parse error: Invalid numeric literal at line 2, column 7' error messages.

From what we've found so far we can say the following things:

  • The 'Unable to locate credentials. You can configure credentials by running "aws configure".' errors are not handled in include/assume_role
  • The 'assume_role()'-function gets executed multiple times. The first time it gets executed correctly, but the executions after that execute it with the '$PROFILE_OPT' variable empty.
  • With the provided hotfix (https://gist.github.com/toniblyx/f93e68c58e766be3be09a861d19ec718), no errors are shown, but the checks are executed on the 'awsProfileWithSwitchRole'-account and not on the 'targetAccountId'-account (as it should).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions