Vault Workshop 05: Authentication
如果你希望追蹤最新的草稿,請見鐵人賽2023 本 workshop 也接受網友的許願清單,如果有興趣的題目可於第一篇底下留言,筆者會盡力實現,但不做任何保證 整篇 Workshop 會使用的範例與原始碼,放在 Github Repository: vault-playground Day 05:Authentication 在前面的文章中,你已經創建了第一個秘密,了解了秘密引擎,並在以開發模式啟動的 Vault 服務器中探索了動態秘密。 接下來的內容中,我們將深入研究使用 Vault token 和 GitHub 憑證進行身份驗證。 Token 身份驗證 Token 身份驗證已自動啟用。當你啟動開發模式服務器時,輸出顯示了 Root token。Vault CLI 從 $VAULT_TOKEN 環境變數中讀取 Root token。這個根 token 可以在 Vault 內執行任何操作,因為它被分配了 Root policy 權限。允許的權限中包含創建新的 token。 現在,讓我們創建一個新的 token。 啟動全新的 dev Vault Server vault server -dev output,server log 回傳 dev 模式的警告 WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory and starts unsealed with a single unseal key. The root token is already authenticated to the CLI, so you can immediately begin using Vault. # 警告!已啟用開發模式!在此模式下,Vault完全運行在內存中,使用單個unseal key解封。 # root token已被CLI驗證,因此你可以立即開始使用Vault。 You may need to set the following environment variables: $ export VAULT_ADDR='http://127.0.0.1:8200' # 以下顯示了unseal key 和 root token,以防你想要封存/解封Vault,或重新進行身份驗證。 The unseal key and root token are displayed below in case you want to seal/unseal the Vault or re-authenticate. # dev 模式預設配置的 unseal key 與 root token Unseal Key: QDUA...im4= Root Token: hvs.J30e...0DJaN # 開發模式絕不應在生產安裝中使用! Development mode should NOT be used in production installations! 依據提示 export 需要的變數 ...