I'm working on a project in Python that uses the azure.storage.filedatalake module in order to upload files to my gen 2 datalake.
In my project I'm using the URL for these files (as they are mostly images I need to serve to a frontend webpage). In order to make sure only some users have access to some files, I'm using SAS-tokens on these files.
Seeing as SAS-tokens are supposed to have an expiration time, my idea is, that every time a user logs in to my system, a SAS token is generated and saved on their session. This token can last for example 6 hours. If they relogin to my site a new SAS is generated for them. However their old SAS will still be valid for another 6 hours, and that token is until then simple unused, but valid.
- Is it a security concern that previously used SAS tokens still exist until their expiration, or just a non-issue and how its supposed to work?
- Would it be better if each user got generated a SAS token personal to them, that lasted indefinitely?
- Is there a security concern from me showing the users SAS token on the webpage-frontend? (As it is needed in the link for the file)