policy
policy
命令包含一组与 Vault 交互操作策略的子命令。用户可以编写、读取和列出 Vault 中的策略。
有关策略的详细信息,请阅读相关章节。
例子
列出所有启用的策略:
$ vault policy list
从本地磁盘文件读取内容后创建名为 "my-policy" 的策略:
$ vault policy write my-policy ./my-policy.hcl
删除名为 "my-policy" 的策略:
$ vault policy delete my-policy
可用子命令
Usage: vault policy <subcommand> [options] [args]
# ...
Subcommands:
delete Deletes a policy by name
list Lists the installed policies
read Prints the contents of a policy
write Uploads a named policy from a file
每种子命令的详细使用方法,请阅读对应的章节。