「Vault」:修訂間差異
跳至導覽
跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
行 20: | 行 20: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
讀取<code>role-id</code>: | 接下來是 讀取<code>role-id</code>: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
行 31: | 行 31: | ||
vault write -f auth/approle/role/example_role/secret-id | vault write -f auth/approle/role/example_role/secret-id | ||
</syntaxhighlight> | </syntaxhighlight> | ||
其中的<code>secret_id</code>就是我們要的,而<code>secret_id_accessor</code>則是拿來renew用的。 | |||
=== 使用 === | === 使用 === |
於 2020年12月29日 (二) 09:14 的修訂
Vault是一套由HashiCorp開發的密碼管理軟體。
概要
Vault可以拿來存放各類credential資料,像是Key或是Password,這個方法比Twelve-Factor App methodology所提到的方法(利用環境變數)安全許多。
AppRole[1]
建立
先產生AppRole:
vault write auth/approle/role/example_role token_policies="example_policy1,example_policy2"
如果還在測試而沒有HTTPS的情況下,可以加上-address=http://127.0.0.1:8200/
(或是對應的位置):
vault write -address=http://127.0.0.1:8200/ auth/approle/role/example_role token_policies="example_policy1,example_policy2"
接下來是讀取role-id
:
vault read auth/approle/role/example_role/role-id
產生對應的secret-id
:
vault write -f auth/approle/role/example_role/secret-id
其中的secret_id
就是我們要的,而secret_id_accessor
則是拿來renew用的。
使用
這邊使用HTTPie產生JSON request:
http https://vault.example.com/v1/auth/approle/login role_id=x secret_id=y
回傳的client_token
就可以拿來使用。
相關連結
參考文獻
- ↑ AppRole Pull Authentication. [2020-07-29] (English).
外部連結
- 官方網站 (英文)