【问题标题】:Vault (HashiCorp) - curl equivalent of "vault read"Vault (HashiCorp) - curl 相当于“vault read”
【发布时间】:2021-04-18 12:04:03
【问题描述】:

请提一个关于 Hashicorp Vault 的小问题。

我在 Vault 中有一个秘密,在 cubbyhole/mytestkey

如果我登录到 Web UI,我可以在 cubbyhole 下看到密钥 mytestkey 及其值

如果我使用 Vault CLI,运行 vault read /cubbyhole/mytestkey,我会得到结果。

vault read /cubbyhole/mytestkey
Key     Value
---     -----
mytestkey    mytestvalue

但是,当我通过 curl 使用时(令牌应该是正确的,因为我使用它来连接到 Vault Web UI),我得到:

curl -vik -H "X-Vault-Token: token" https://remote-vault/cubbyhole/mytestkey
HTTP 404

请问我的 curl 命令有什么问题?路径问题?正确的应该是什么?

谢谢

【问题讨论】:

    标签: hashicorp-vault


    【解决方案1】:

    您的 REST API 端点缺少 API 的端口和版本。您可以将其更新为:

    curl -vik -H "X-Vault-Token: token" https://remote-vault:8200/v1/cubbyhole/mytestkey
    

    如果在非默认 8200 上运行,则修改端口。

    您可以在relevant documentation找到更多信息。

    【讨论】:

      猜你喜欢
      • 2021-05-07
      • 2017-01-20
      • 2019-11-23
      • 2016-04-22
      • 1970-01-01
      • 2019-07-20
      • 1970-01-01
      • 2017-05-16
      • 2019-07-28
      相关资源
      最近更新 更多