gpt4 book ai didi

azure - Azure Blob 存储中的静态网站 : How to enable Azure AD Authentication?

转载 作者:行者123 更新时间:2023-12-03 14:48:34 24 4
gpt4 key购买 nike

我通过 Azure 存储帐户的 BLOB 存储中的 $web 容器托管一个静态网站。该容器中的缩小版 JS 包含敏感数据,例如 azure-tables key 。

根据documentation :

You can modify the public access level of the $web container, but this has no impact on the primary static website endpoint because these files are served through anonymous access requests. That means public (read-only) access to all files.

是否有任何方法可以限制对网站内容的访问(尤其是 $web 容器中的缩小版 JS)?

最佳答案

首先,无论 JS 多么精简,在网站代码中存储数据访问 token 都是非常糟糕的做法。任何具有网站读取权限的人都可能有意或无意地泄露访问 token 。这包括能够在浏览器中打开和查看该网站。

如果您已经在考虑身份验证,那么 Azure Blob 存储服务并不能解决这个问题。您可能需要一两个免费的 Azure Web 应用程序(一个用于前端,一个用于后端)。服务器端代码比浏览器代码安全得多,并且支持正确的用户输入验证等功能。此外,如果您使用的是 Azure Web 应用,只需单击一下即可启用 Azure AD 身份验证。

可以generate SAS tokens要求用户在访问 Blob 之前通过 Azure AD 进行身份验证,但我个人还没有尝试过。

关于azure - Azure Blob 存储中的静态网站 : How to enable Azure AD Authentication?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57523314/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com