G token:我应该如何 /何时生成Azuredatalakeg2SAS令牌

关于G token的问题,在is sas still used中经常遇到, 我正在开发一个使用 azure.storage.filedatalake 模块的 Python 项目,以便将文件上传到我的第 2 代 datalake。

我正在开发一个使用 azure.storage.filedatalake 模块的 Python 项目,以便将文件上传到我的第 2 代 datalake。

在我的项目中,我使用这些文件的 URL(因为它们主要是我需要服务于前端网页的图像)。为了确保只有一些用户可以访问某些文件,我在这些文件上使用 SAS 令牌。

看到 SAS 令牌应该有一个到期时间,我的想法是,每次用户登录到我的系统时,都会生成一个 SAS 令牌并保存在他们的会话中。这个令牌可以持续例如 6 小时。如果他们重新登录到我的网站,将为他们生成一个新的 SAS。然而,他们的旧 SAS 仍然有效 6 小时,直到那时令牌是简单的未使用,但有效。

这是一个安全问题,以前使用的 SAS 令牌仍然存在,直到它们到期,或者只是一个非问题,它应该如何工作?

如果每个用户都生成了一个对他们个人的 SAS 令牌,它会无限期地持续下去吗?

是否有一个安全问题,从我显示在网页前端的用户 SAS 令牌?(因为它是在文件的链接需要)

1

是的,在 SAS 令牌过期之前,安全问题一直存在。尽可能使用用户委派 SAS。用户委派 SAS 为服务 SAS 或帐户 SAS 提供了更高的安全性。用户委派 SAS 使用 Azure AD 凭据进行保护,因此您无需将帐户密钥与代码一起存储。

为每个用户生成个人 SAS 很好,但不建议无限地持续使用它。即使这样做,也需要define a stored access policy for a service SAS。存储访问策略为您提供了撤消服务 SAS 权限的选项,而无需重新生成存储帐户密钥。在将来(或无限)为这些设置过期,并确保定期更新以将其移动到更远的将来。

根据best practices when using SAS,在 ad hoc SAS 服务 SAS 或帐户 SAS 上使用短期过期时间。这样,即使 SAS 受到损害,它也仅在短时间内有效。如果您不能引用存储的访问策略,这种做法尤其重要。短期过期时间还通过限制可用于上载到 Blob 的时间来限制可写入 Blob 的数据量。

是的,在网页前端显示 SAS 令牌可能会导致安全问题,并可能导致您的敏感数据暴露。如果 SAS 泄露,则获取它的任何人都可以使用它,这可能会危及您的存储帐户。

You can generate the SAS token by following below path:
Settings => Shared access signature => Select the options required and click on generate SAS and connection string and copy the SAS token. enter image description here

何时使用共享访问签名?

使用 SAS 将对存储帐户中的资源的安全访问权限授予对这些资源没有其他权限的任何客户端。

SAS 很有用的一个常见方案是用户将自己的数据读写到您的存储帐户的服务。在存储帐户存储用户数据的方案中,有两种典型的设计模式:

s upload and download data via a front-end proxy service, which performs authentication. This front-end proxy service allows the validation of business rules. But for large amounts of data, or high-volume transactions, creating a service that can scale to match demand may be expensive or difficult. enter image description here

A lightweight service authenticates the client as needed and then generates a SAS. Once the client application receives the SAS, it can access storage account resources directly. Access permissions are defined by the SAS and for the interval allowed by the SAS. The SAS mitigates the need for routing all data through the front-end proxy service. enter image description here

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(129)
Linux温度监控:我正在创建这个温度监控系统
上一篇
Linux查看主机ip:如何从IP(Linux)获取主机名
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(45条)