wordpress站長免費(fèi)的十大免費(fèi)貨源網(wǎng)站
Vault系列之:創(chuàng)建令牌
- 一、Vault令牌
- 二、令牌認(rèn)證
- 三、創(chuàng)建一個(gè)新的令牌
- 四、使用令牌登陸
- 五、 撤銷令牌
一、Vault令牌
- Vault令牌是Vault服務(wù)器提供的一種身份驗(yàn)證方式,用于授權(quán)和訪問Vault中存儲(chǔ)的資源。
- Vault令牌可以是客戶端令牌或服務(wù)令牌??蛻舳肆钆剖怯蒝ault分配給用戶的,用于訪問Vault中的資源。
- 服務(wù)令牌是由Vault分配給應(yīng)用程序的,用于訪問Vault中的資源。Vault令牌具有過期時(shí)間和訪問權(quán)限,可以有效地保護(hù)Vault中的敏感數(shù)據(jù)。
二、令牌認(rèn)證
令牌認(rèn)證是自動(dòng)啟用的。當(dāng)啟動(dòng)開發(fā)服務(wù)器時(shí),輸出會(huì)顯示一個(gè)根令牌。Vault CLI從$VAULT_TOKEN環(huán)境變量中讀取根令牌。根令牌可以在Vault中執(zhí)行任何操作,因?yàn)樗环峙淞烁呗?。其中一個(gè)功能是創(chuàng)建新的令牌。
三、創(chuàng)建一個(gè)新的令牌
vault token create
Key Value
--- -----
token hvs.dkPVP2ASg3mx11XJSixcifCt
token_accessor SCPWThvb7qkB7EgB48OMRxtz
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
令牌已創(chuàng)建,輸出以鍵值對(duì)的形式描述了此令牌。創(chuàng)建的令牌在此處顯示為hvs.dkPVP2ASg3mx11XJSixcifCt。
該令牌是根令牌的子令牌,默認(rèn)情況下,它會(huì)繼承其父令牌的策略。
四、使用令牌登陸
令牌是核心的認(rèn)證方法??梢允褂蒙傻牧钆频卿沄ault,當(dāng)提示時(shí),通過復(fù)制并粘貼令牌來完成登錄。
vault login hvs.dkPVP2ASg3mx11XJSixcifCt
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.Key Value
--- -----
token hvs.dkPVP2ASg3mx11XJSixcifCt
token_accessor SCPWThvb7qkB7EgB48OMRxtz
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
五、 撤銷令牌
vault token revoke hvs.dkPVP2ASg3mx11XJSixcifCt
Success! Revoked token (if it existed)