TylerBrock / saw

Fast, multi-purpose tool for AWS CloudWatch Logs
MIT License
1.41k stars 79 forks source link

Adding support MFA (assumerole) #3

Closed perriea closed 6 years ago

perriea commented 6 years ago

All in the title :)

TylerBrock commented 6 years ago

Awesome, thank you!

Question about the change: Is this something that is usually enabled always as opposed to a flag or special configuration option?

I guess if MFA is required it does the right thing requesting input from stdin and otherwise doesn’t change anything but I want to make sure my assumption is correct.

perriea commented 6 years ago

The AWS sdk looks if you have the line mfa_serial on the selected profile. It's pretty clean.

Without MFA :

./saw get PROD_FRONT_APP_LGROUP --start -24h --profile profile_test --region eu-west-1 
2018-06-28 19:06:12,402 ERROR [XNIO-2 task-42] ExceptionMapperStandardImpl: HHH000346: Error during managed flush [org.hibernate.PersistentObjectException: detached entity passed to persist: com.ulysse.domain.Colis]

With MFA :

./saw get PROD_FRONT_APP_LGROUP --start -24h --profile profile_mfa --region eu-west-1 
Assume Role MFA token code: 693662
2018-06-28 19:06:12,402 ERROR [XNIO-2 task-42] ExceptionMapperStandardImpl: HHH000346: Error during managed flush [org.hibernate.PersistentObjectException: detached entity passed to persist: com.ulysse.domain.Colis]

In my case it works well 👍

TylerBrock commented 6 years ago

Killer. Thanks for the code and taking the time to explain. I’m sure a lot of people will appreciate this.

TylerBrock commented 6 years ago

I’ll cut v0.1.6 for this feature shortly.

perriea commented 6 years ago

@TylerBrock wait a bit I'll clean some parts ;)

TylerBrock commented 6 years ago

Whoops I thought you were done? Was there something we missed?

perriea commented 6 years ago

No, I will propose other things in another issue. It's definitely closed.