rest - 确保对 Vault Secrets 管理的 REST 调用安全

标签 rest ssh tls1.2 hashicorp-vault

我一直在尝试弄清楚如何做到这一点。从本质上讲,Vault 的 REST 调用没有安全选项。我想让这些剩余调用在 a 点和 b 点之间尽可能靠近的地方进行加密。我的想法如下:

  • 使用 SSH 隧道
  • 使用 Stunnel 等 TLS 隧道

我目前在 Docker 容器中拥有 Vault,所以还有其他值得一提的事情。有没有人遇到过这种情况,怎么处理的?

更新:因此,使用 Python API (HVAC),我收到以下错误:

requests.exceptions.SSLError: HTTPSConnectionPool(host='0.0.0.0',
port=8200): Max retries exceeded with url: /v1/secret (Caused by
SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_record',
'wrong version number')],)",),))

使用以下命令:

import os
import hvac
client = hvac.Client(url='https://0.0.0.0:8200', token='my-token-here')

最佳答案

Vault有TLS enabled by default ,因此您的所有 REST 调用都已加密。如果您在使用 https 时遇到问题,请查看 VAULT_CACERTVAULT_CAPATH 环境变量的文档。

来自 Vault 的文档。

VAULT_CACERT

Path to a PEM-encoded CA certificate file on the local disk. This file is used to verify the Vault server's SSL certificate. This environment variable takes precedence over VAULT_CAPATH.

VAULT_CAPATH Path to a directory of PEM-encoded CA certificate files on the local disk. These certificates are used to verify the Vault server's SSL certificate.

您可以使用 tcpdumpwireshark 等工具来确保您的请求确实已加密。

关于rest - 确保对 Vault Secrets 管理的 REST 调用安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52413545/

相关文章:

c# - "StandardOut has not been redirected or the process hasn' t started yet”在 C# 中读取控制台命令输出时

azure - Azure Web 应用程序中某些 URL 的 TLS 1.0

java - Android 设备上的嵌入式 Web 服务

rest - 如何正确发出 REST API 请求以获取 Magento 2 中日期范围内的完整订单

ajax - 有了 websockets,AJAX 有没有位置?

java - 使用休息来发出请求

macos - 使用ssh从远程复制文件到本地

bash - 压缩通过 SSH 连接到另一台机器的 Mysqldump

hyperledger-fabric - 我们可以在 Hyperledger Fabric 中运行没有 tls 的 RAFT 排序节点吗?

ssl - 通过存储与 Wireshark 一起使用的 SSL key 在 golang 中解密 TLS