spcl / serverless-benchmarks

SeBS: serverless benchmarking suite for automatic performance analysis of FaaS platforms.
https://mcopik.github.io/projects/sebs/
BSD 3-Clause "New" or "Revised" License
150 stars 68 forks source link

Ensure proper handling of credentials #97

Closed mcopik closed 1 year ago

mcopik commented 2 years ago

We cache credentials for future access. However, we should:

punitkashyup commented 1 year ago

Hi @mcopik , Can I work on this?

mcopik commented 1 year ago

@punitkashyup Absolutely, please feel free to start on the issue :-)

Let me know if you have any questions or concerns - happy to help.

rahulsurwade08 commented 1 year ago

Hey @mcopik ,Can you elaborate the issue so that I could understand it further?. Thanks!

mcopik commented 1 year ago

@rahulsurwade08 @punitkashyup We use a cache where we store all information about cloud resources - functions, storage accounts and buckets, permissions, etc. This helps us to deploy experiments as we do not have to retrieve everything on every single launch of sebs.

Currently, we cache credentials together with the cloud config, which is not a good practice. For example, see the class sebs.{platform}.config.Credentials. If you deploy a function, you will be able to examine the JSON files created in cache directory.

We should not cache those credentials. However, we want to avoid the situation when we build the cache, then the user switches between cloud accounts and attempts to use sebs with different credentials and a different account. In such a situation, our cache is not only useless but will also return weird errors. Thus, we should store in the cache the account ID. When we connect to the cloud with uncached credentials, we should check if the account ID matches the one in cache - if not, then we should throw an error that clearly explains to the user that the cache is invalid.