Google Cloud Storage HMAC 凭证
在 AutoSSL 中管理并使用 Google Cloud Storage HMAC 凭证。
概览
AutoSSL 通过 S3 兼容接口向 Cloud Storage 发起请求时,需要 Google Cloud Storage HMAC 凭证进行身份验证。添加 HMAC 凭证后,你授权 AutoSSL 代为把 SSL 证书文件上传到 Cloud Storage 存储桶。
HMAC 密钥只适用于 Cloud Storage 的 S3 兼容 XML API。此凭证类型不支持服务账号 JSON 密钥文件。
配置参数
| 参数 | 说明 |
|---|---|
| HMAC Access ID | Cloud Storage 的 HMAC Access ID,通常以 GOOG 开头。 |
| HMAC Secret | 对应的 HMAC 密钥。AutoSSL 会在保存前对其进行安全加密。 |
重要
以后如果要修改 HMAC Secret,必须重新填写完整的密钥。
如何获取 HMAC 凭证
- 登录 Google Cloud 控制台。
- 进入 Cloud Storage > Settings > Interoperability。
- 在 Service account HMAC keys 部分,点击 Create a key for a service account。
- 选择应拥有该 HMAC 密钥的服务账号,点击 Create key。
- 复制 Access key 和 Secret,在 AutoSSL 中分别填入 HMAC Access ID 和 HMAC Secret。
更详细的说明见 Google Cloud 管理 HMAC 密钥的文档。
安全建议
为提高 HMAC 凭证的安全性,强烈建议:
- 使用服务账号:为专用服务账号创建 HMAC 密钥,不要使用用户账号。
- 最小权限:只授予服务账号访问目标存储桶所需的权限(例如针对特定存储桶前缀的
storage.objectCreator)。 - 定期轮换:定期轮换 HMAC 密钥,降低凭证泄露的风险。
支持的部署目标
Google Cloud Storage HMAC 凭证用于 AutoSSL 中的以下部署服务商:
- Google Cloud Storage:把证书文件上传到 Cloud Storage 存储桶,并保留版本目录和 latest 路径。