WTFender / aws-sso-extender

Browser Extension for AWS SSO / Identity Center
https://wtfender.com/posts/aws-sso-extender
MIT License
55 stars 9 forks source link

Problems with large number of accounts and roles (maybe problem with Firefox containers) #49

Closed iptizer closed 12 months ago

iptizer commented 1 year ago

Extension Version

1.4.4

Description

Observed behaviour:

Expected behaviour:

Browsers

Firefox

OS

Mac

WTFender commented 1 year ago

Thanks for the report! I'll check this out soon.

Are you missing any of these checkboxes in your extension permissions?

242330111-d5e03aae-d879-4c4d-9f53-d5d3b3d9c63a
iptizer commented 1 year ago

Yes. Even more, I also have Access your data for *://eu-central-1.console.aws.amazon.com

But it is working now again. What I did was:

=> I needed to reconfigure, but then everything is working now.

To be clear. The roles have not been visible in the following screen:

20230606_roles_awsconsole

Question: In case this happens again. What can I do to deliver the required information? Is there a way to export debug logs?

WTFender commented 1 year ago

Thanks for the additional info.

I haven't tried replicating yet, but if you see it again, you can export your user config and send it over - I can import that to replicate.

There isn't any sensitive info in your config, but it may have your name, company, etc., if you want to email that instead wtfender.cs[at]gmail.com.

Screenshot 2023-07-06 at 10 05 39 AM
morganhowarth-fd commented 12 months ago

I can replicate this on Firefox + macOS (with or without FF containers), we have 97 accounts on AWS SSO and only 20-23 show up.

If I refresh our SSO page, some accounts appear and some disappear. I have tried uninstalling the plugin and adding it back to no avail. The issue persists.

hreeder commented 12 months ago

Confirming I have this on Chrome + macOS too.

With such a large number of accounts, when I initially load the SSO account select page AWS gives back a HTTP 429 (too many requests) error while trying to fetch roles for a selected account. Does the extension have any handling for this scenario?

djablonski-moia commented 12 months ago

With 110+ accounts, I also get a different (but always significantly lower) number of accounts imported in my list. Though I did not validate the 429 theory, it would fit, since CLI toomling (aws-sso-cli) is having the same issue, but successfully solves this with retries.

WTFender commented 12 months ago

I'm pretty sure I'm not doing any sort of back off or throttling when pulling each account's details, which sounds like the culprit. I will try to get a fix out in the next few days.

https://github.com/WTFender/aws-sso-extender/blob/main/src/entry/aws-sso.ts#L64-L66

gcamillo commented 12 months ago

Hello there 👋

I can consistently reproduce the described issue over here.

I have tested it with two different accounts: One with a very small number of assignments and another one with a large number of them, on both applications and roles. When the extension loads, it attempts to make all the API calls all at once for these, which then causes the endpoint to respond with lots of 429s on the latter, so the app looks like it has crashed, as shown bellow:

ScreenShot 2023-07-20 at 14 16 18

The fix comes in two parts:

image

Now, this has one minor issue: Accounts that have lots of assignments can take a while to be fully loaded. On my tests, with about ~800 different assignments it took roughly ~80 seconds to have all the requests fulfilled. While this is happening, the extensions UI hasn't reflected anything like "hold tight, we're still loading data" but instead nudged me to log back in. This might be something that you want to address later on.

Here's the PR that fixes it: https://github.com/WTFender/aws-sso-extender/pull/54

Thank you!

WTFender commented 12 months ago

@gcamillo Thanks for the fix! Just published to the stores.

And thank you all for the feedback; I'll figure out some high volume tests 😅