`az login` 如何存储凭据信息?

How does `az login` store credential information?

我想知道当我在后台使用 az login 登录到 Azure 时会发生什么。我仍然登录了很长时间,这意味着允许访问的机器上存储了一些东西。

获得硬盘驱动器访问权限的对手是否有可能以明文形式读取 password/token 来冒充我?

P.S。我指的不是作为 az login 命令本身一部分的凭据,而是命令在幕后保存的数据。

好问题!

为了安全起见,您可以按照本网站上的步骤加密您的登录数据:https://www.sqlshack.com/different-ways-to-login-to-azure-automation-using-powershell/

好问题!

它不存储您的登录凭据,而是存储身份验证刷新令牌。 Microsoft 或您的租户管理员可以更改令牌。

参考:

None of your login information is stored by Azure CLI. Instead, an authentication refresh token is generated by Azure and stored. As of August 2018 this token is revoked after 90 days of inactivity, but this value can be changed by Microsoft or your tenant administrator. Once the token is revoked you get a message from the CLI saying you need to login again.

https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli

CLI 存储令牌和其他详细信息,如您的个人资料、会话详细信息等。详细信息存储在您的主文件夹中。

%HOMEPATH% > .azure

从 运行 命令(在 Windows OS 中)导航到 "%HOMEPATH%",然后打开“.Azure”文件夹。您将能够找到您要查找的文件。

当你感觉“受到攻击”时,可以考虑清理“.azure”文件夹