在 HashiCorp Vault 文档中,"Lease IDs" 被多次提及。我如何找到一个?

In the HashiCorp Vault docs, "Lease IDs" are mentioned several times. How do I find one?

在 Vault Web UI 中,在 "Access" 下,它显示了通过 "Lease ID" 查找租约的能力:If you know the id of a lease, enter it above to lookup details of the lease.

首先如何获得 "the id of a lease"?

在 Vault CLI 中,我的租约选项似乎只有 renewrevoke

~ |   vault lease lookup
Usage: vault lease <subcommand> [options] [args]

  This command groups subcommands for interacting with leases. Users can revoke
  or renew leases.

  Renew a lease:

      $ vault lease renew database/creds/readonly/2f6a614c...

  Revoke a lease:

      $ vault lease revoke database/creds/readonly/2f6a614c...

Subcommands:
    renew     Renews the lease of a secret
    revoke    Revokes leases and secrets

如果我只需要获取租约 ID,我该如何从 CLI 中获取?

好吧,就像 CLI 中的许多 "missing commands" 一样,稍微阅读 API 文档解决了这个问题。

不,没有 vault lease lookupvault lease list 命令。

但事实证明,对 sys/leases/lookup 的有据可查的 LIST HTTP 请求有点对应于同一 sys/leases/lookup 路径上的 vault list

~ |   vault list sys/leases
No value found at sys/leases/
~ |   vault list sys/leases/lookup
Keys
----
auth/
~ |   vault list sys/leases/lookup/auth
Keys
----
approle/
token/
userpass/
~ |  

今天通过查看以下文档来探索您的租约:

什么是租约?
https://www.vaultproject.io/guides/identity/lease
https://www.vaultproject.io/docs/concepts/lease.html

Vault API 租赁物品:https://www.vaultproject.io/api/system/leases.html
用于租赁内容的 Vault CLI:https://www.vaultproject.io/docs/commands/lease/index.html