默认情况下,Security Command Center 会对静态客户内容进行加密。Security Command Center 会为您处理加密,您无需执行任何其他操作。此选项称为“Google 默认加密”。
如果您想要控制加密密钥,则可以将 Cloud KMS 中客户管理的加密密钥 (CMEK) 与集成 CMEK 的服务(包括 Security Command Center)搭配使用。使用 Cloud KMS 密钥时,您可以控制其保护级别、位置、轮替时间表、使用和访问权限以及加密边界。 使用 Cloud KMS 还可让您跟踪密钥使用情况、查看审核日志以及控制密钥生命周期。 这样您就可以在 Cloud KMS 中控制和管理用于保护数据的对称密钥加密密钥 (KEK),而不是由 Google 拥有和管理这些密钥。
使用 CMEK 设置资源后,访问 Security Command Center 资源的体验与使用 Google 默认加密功能类似。如需详细了解加密选项,请参阅客户管理的加密密钥 (CMEK)。
为了支持职责分离并更好地控制对密钥的访问权限,我们建议您在不包含其他 Google Cloud 资源的项目中创建和管理密钥。
如需将 CMEK 与 Security Command Center 搭配使用,您必须在为组织激活 Security Command Center 时配置 CMEK。您无法在项目级层激活期间配置 CMEK。如需了解详情,请参阅为组织激活 Security Command Center 标准版或高级版。
在 Security Command Center 中使用 CMEK 时,您的项目可能会消耗 Cloud KMS 加密请求配额。当在 Security Command Center 中读取或写入数据时,使用 CMEK 加密的实例会消耗配额。 仅当您使用硬件 (Cloud HSM) 或外部 (Cloud EKM) 密钥时,使用 CMEK 密钥执行的加密和解密操作才会影响 Cloud KMS 配额。 如需了解详情,请参阅 Cloud KMS 配额。CMEK 会加密 Security Command Center 和 Security Command Center API 中的以下数据:
- 发现结果
- 通知配置
- BigQuery Export
- 忽略配置
准备工作
在为 Security Command Center 设置 CMEK 之前,请执行以下操作:
安装并初始化 Google Cloud CLI:
-
Install the Google Cloud CLI.
-
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
创建启用了 Cloud KMS 的 Google Cloud 项目。这是您的密钥项目。
创建位于正确位置的密钥环。密钥环位置必须与您计划激活 Security Command Center 的位置相对应。如需了解哪些密钥环位置对应于每个 Security Command Center 位置,请参阅本文档密钥位置部分中的表格。如需详细了解如何创建密钥环,请参阅创建密钥环。
在密钥环上创建 Cloud KMS 密钥。如需详细了解如何在密钥环上创建密钥,请参阅创建密钥。
为确保 Cloud Security Command Center 服务账号具有加密和解密数据所需的权限,请让您的管理员为 Cloud Security Command Center 服务账号授予 Cloud KMS 密钥的 Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter
) IAM 角色。
您的管理员也可以通过自定义角色或其他预定义角色向 Cloud Security Command Center 服务账号授予所需的权限。
密钥位置
Cloud KMS 密钥的位置必须与您激活 Security Command Center 的位置相对应。使用下表确定哪个 Cloud KMS 密钥位置对应于哪个 Security Command Center 位置。
Security Command Center 位置 | Cloud KMS 密钥位置 |
---|---|
eu |
europe |
global |
us |
sa |
me-central2 |
us |
us |
如果您在激活 Security Command Center 时未启用数据驻留,则 Security Command Center 位置使用 global
,Cloud KMS 密钥位置使用 us
。如需详细了解数据驻留,请参阅规划数据驻留。
限制
如果您要激活的组织包含一个或多个已启用 Security Command Center 的项目,则无法为该组织的 Security Command Center 使用 CMEK。
激活 Security Command Center 后,您无法更改 Cloud KMS 密钥或切换到Google-owned and Google-managed encryption key 。
您可以轮替密钥,这样 Security Command Center 就会使用新的密钥版本。 不过,部分 Security Command Center 功能在 30 天内仍会继续使用旧密钥。
为 Security Command Center 设置 CMEK
如需将 CMEK 与 Security Command Center 搭配使用,请执行以下操作:
- 在为组织设置 Security Command Center 期间,在选择服务页面上,选择数据加密下的更改数据加密密钥管理解决方案(可选)。 系统会打开加密选项。
- 选择 Cloud KMS 密钥。
- 选择一个项目。
- 选择一个密钥。您可以从任何 Google Cloud 项目(包括您要激活的组织中的项目)中选择密钥。列表中仅显示位于兼容位置的密钥。如需详细了解 Security Command Center 的 CMEK 密钥位置,请参阅密钥位置部分中的表格。
授予该角色并完成 Security Command Center 设置后,Security Command Center 会使用您选择的 Cloud KMS 密钥加密您的数据。
检查 CMEK 配置
如需检查您是否已成功为 Security Command Center 设置 CMEK,请执行以下操作:
- 在 Security Command Center 中,选择设置。
- 前往层级详细信息标签页。
- 在设置详情 > 数据加密中,如果已为 Security Command Center 设置 CMEK,则密钥名称会显示为数据加密后面的链接。
价格
虽然在 Security Command Center 标准版和高级版中启用 CMEK 不会产生额外费用,但当 Security Command Center 使用您的 CMEK 加密和解密数据时,Cloud KMS 会收取费用。如需了解详情,请参阅 Cloud KMS 价格。
恢复对 Security Command Center 的访问权限
启用 CMEK 后,Security Command Center 服务账号需要有权访问您的 Cloud KMS 密钥才能正常运行。请勿撤消服务账号对 CMEK 的权限、停用 CMEK 或安排销毁 CMEK。这些操作都会导致以下 Security Command Center 功能停止运行:
- 发现结果
- 持续导出配置
- BigQuery Export
- 忽略规则
如果您在 Cloud KMS 密钥不可用时尝试使用 Security Command Center,则会在 Security Command Center 中看到错误消息,或者在 API 中看到 FAILED_PRECONDITION
错误。
由于 Cloud KMS 密钥,您可能会失去 Security Command Center 功能,原因如下:
- 服务账号上密钥的 Cloud KMS CryptoKey Encrypter/Decrypter 角色可能已被撤消。您可以在密钥被撤消后恢复对 Security Command Center 的访问权限。
- Cloud KMS 密钥可能已停用。您可以在密钥停用后恢复对 Security Command Center 的访问权限。
- 密钥可能已安排销毁。您可以在密钥被安排销毁后恢复对 Security Command Center 的访问权限。
在密钥被撤消后恢复对 Security Command Center 的访问权限
如需恢复对 Security Command Center 中密钥的访问权限,请向 Cloud Security Command Center 服务账号授予密钥的 Cloud KMS CryptoKey Encrypter/Decrypter 角色:
gcloud kms keys add-iam-policy-binding KEY_NAME \
--keyring KEY_RING \
--location LOCATION \
--member=serviceAccount:service-org-ORG_NUMBER@security-center-api.iam.gserviceaccount.com \
--role=roles/cloudkms.cryptoKeyEncrypterDecrypter
替换以下内容:
- KEY_RING:Cloud KMS 密钥的密钥环
- LOCATION:Cloud KMS 密钥的位置
- KEY_NAME:Cloud KMS 密钥的名称
- ORG_NUMBER:您的组织编号
在密钥被停用后恢复对 Security Command Center 的访问权限
如需详细了解如何启用已停用的密钥,请参阅启用密钥版本。
在密钥被安排销毁后恢复对 Security Command Center 的访问权限
如需详细了解如何恢复已计划销毁的密钥,请参阅销毁和恢复密钥版本。
密钥销毁后,您无法恢复该密钥,也无法恢复对 Security Command Center 的访问权限。