秘密CLI(遺留)

重要的

這個文檔已經退休了,可能不會被更新。

這個信息適用於遺留數據磚CLI版本0.17及以下。磚建議你使用新磚CLI的版本0.200及以上。看到磚CLI。找到你的版本的磚CLI,運行- v

遺留在磚磚CLI不可用的穀歌雲。

你跑磚CLI子命令,添加他們的秘密秘密。這些子命令調用秘密的API

更多信息的秘密,明白了保密管理

請注意

秘密CLI需要磚CLI是0.7.1或以上。

磚的秘密——幫助
用法:磚秘密[選項]命令(ARGS)……效用與秘密API進行交互。選項:- v、版本(版本)——概要文本使用CLI連接配置文件。默認的配置文件是“默認”。- h,幫助顯示此消息並退出。命令:創建範圍創建了一個秘密的範圍。選擇:——範圍的名稱秘密範圍範圍。——initial-manage-principal初始本金可以管理創建的秘密範圍。如果指定了,最初的ACL使用管理權限範圍適用於分配給提供的主要(用戶或組)。唯一的支持主要是“用戶”,在工作區中包含所有用戶。 If not specified, the initial ACL with MANAGE permission applied to the scope is assigned to request issuer's user identity. delete Deletes a secret. Options: --scope SCOPE The name of the secret scope. --key KEY The name of secret key. delete-acl Deletes an access control rule for a principal. Options: --scope SCOPE The name of the scope. --principal PRINCIPAL The name of the principal. delete-scope Deletes a secret scope. Options: --scope SCOPE The name of the secret scope. get-acl Gets the details for an access control rule. Options: --scope SCOPE The name of the secret scope. --principal PRINCIPAL The name of the principal. --output FORMAT JSON or TABLE. Set to TABLE by default. list Lists all the secrets in a scope. Options: --scope SCOPE The name of the secret scope. --output FORMAT JSON or TABLE. Set to TABLE by default. list-acls Lists all access control rules for a given secret scope. Options: --scope SCOPE The name of the secret scope. --output FORMAT JSON or TABLE. Set to TABLE by default. list-scopes Lists all secret scopes. --output FORMAT JSON or TABLE. Set to TABLE by default. put Puts a secret in a scope. Options: --scope SCOPE The name of the secret scope. --key KEY The name of the secret key. --string-value TEXT Read value from string and stored in UTF-8 (MB4) form --binary-file PATH Read value from binary-file and stored as bytes. put-acl Creates or overwrites an access control rule for a principal applied to a given secret scope. Options: --scope SCOPE The name of the secret scope. --principal PRINCIPAL The name of the principal. --permission [MANAGE|WRITE|READ] The permission to apply. write Puts a secret in a scope. "write" is an alias for "put". Options: --scope SCOPE The name of the secret scope. --key KEY The name of the secret key. --string-value TEXT Read value from string and stored in UTF-8 (MB4) form --binary-file PATH Read value from binary-file and stored as bytes. write-acl Creates or overwrites an access control rule for a principal applied to a given secret scope. "write-acl" is an alias for "put-acl". Options: --scope SCOPE The name of the secret scope. --principal PRINCIPAL The name of the principal. --permission [MANAGE|WRITE|READ] The permission to apply.

創建一個秘密範圍

顯示使用文檔,運行秘密創建範圍——幫助

磚秘密創建範圍——我的領域範圍

如果成功,沒有顯示輸出。

刪除一個秘密

顯示使用文檔,運行秘密刪除——幫助

磚秘密的刪除我的領域範圍,關鍵我的鑰匙

如果成功,沒有顯示輸出。

撤銷ACL的本金

顯示使用文檔,運行秘密delete-acl——幫助

磚秘密delete-acl——我的領域範圍——主體someone@example.com

如果成功,沒有顯示輸出。

刪除一個秘密的範圍

顯示使用文檔,運行秘密delete-scope——幫助

磚秘密delete-scope——我的領域範圍

如果成功,沒有顯示輸出。

獲得主要的ACL

顯示使用文檔,運行秘密get-acl——幫助

磚秘密get-acl——我的領域範圍——主體someone@example.com——JSON輸出
{“主要”:“sonmeone@example.com”,“許可”:“管理”}

列出密鑰存儲在一個秘密的範圍

顯示使用文檔,運行秘密列表——幫助

磚的秘密——我的領域範圍列表JSON輸出
{“秘密”:({“關鍵”:“我的鑰匙”,“last_updated_timestamp”: 1621284092605}]}

請注意

你不能訪問秘密值通過使用磚CLI。訪問秘密值,您必須使用磚實用工具秘密的效用在磚筆記本。

一個秘密的acl範圍列表

顯示使用文檔,運行秘密list-acls——幫助

磚秘密list-acls——我的領域範圍,JSON輸出
{“物品”:({“主要”:“someone@example.com”,“許可”:“管理”}]}

在工作區中列出所有可用的秘密範圍

顯示使用文檔,運行秘密list-scopes——幫助

磚秘密list-scopes——JSON輸出
{“範圍”:[{“名稱”:“我的領域”,“backend_type”:“磚”}]}

創建或更新一個秘密

顯示使用文檔,運行秘密——幫助秘密——幫助

有三種方法來存儲一個秘密。最簡單的方法是使用——字符串值選擇;這個秘密將存儲在utf - 8 (MB4)形式。你應該小心使用這個選項,因為你的秘密可能存儲在你的在純文本命令行曆史。

磚秘密的把我的領域範圍,關鍵我的鑰匙——字符串值自己的價值

或者:

磚的秘密寫——我的領域範圍,關鍵我的鑰匙——字符串值自己的價值

如果成功,沒有顯示輸出。

您還可以使用——二進製文件選項提供一個秘密存儲在一個文件中。文件內容將讀取和存儲為字節。

磚秘密的把我的領域範圍,關鍵我的鑰匙——二進製文件my-secret.txt

或者:

磚的秘密寫——我的領域範圍,關鍵我的鑰匙——二進製文件my-secret.txt

如果成功,沒有顯示輸出。

如果你不指定一個選項,將打開一個編輯器讓你輸入你的秘密。按照說明顯示在編輯器中輸入您的秘密。

磚的秘密——我的領域範圍,關鍵我的鑰匙

或者:

磚秘密寫——我的領域範圍,關鍵我的鑰匙
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#不編輯上麵的線。它下麵的一切將被忽略。#請輸入你的秘密值高於線。文本將被存儲#utf - 8(MB4)形式和任何落後於新的線將被剝奪。#不保存退出將中止寫作的秘密。

給予一個秘密或改變ACL範圍為本金

顯示使用文檔,運行秘密put-acl——幫助秘密write-acl——幫助

磚秘密put-acl——我的領域範圍——主體someone@example.com——權限管理

或者:

磚秘密write-acl——我的領域範圍——主體someone@example.com——權限管理

如果成功,沒有顯示輸出。