Skip to content

Commit

Permalink
fixed console command to work with roles
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenGietz committed May 8, 2020
1 parent b724efd commit 7e6eb39
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion last_update.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2020-05-07
2020-05-08
36 changes: 23 additions & 13 deletions pacu.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,19 +723,29 @@ def print_web_console_url(self):

sts = self.get_boto3_client('sts')

res = sts.get_federation_token(
Name=active_session.key_alias,
Policy=json.dumps({
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Allow',
'Action': '*',
'Resource': '*'
}
]
})
)
if active_session.session_token:
# Roles cant use get_federation_token
res = {
'Credentials': {
'AccessKeyId': active_session.access_key_id,
'SecretAccessKey': active_session.secret_access_key,
'SessionToken': active_session.session_token
}
}
else:
res = sts.get_federation_token(
Name=active_session.key_alias,
Policy=json.dumps({
'Version': '2012-10-17',
'Statement': [
{
'Effect': 'Allow',
'Action': '*',
'Resource': '*'
}
]
})
)

params = {
'Action': 'getSigninToken',
Expand Down

0 comments on commit 7e6eb39

Please sign in to comment.