IBM Cloud Docs
为 Security and Compliance Center 设置数据存储和处理

为 Security and Compliance Center 设置数据存储和处理

自 2025 年 7 月 17 日起,您不能在本产品的此版本中创建新实例。 Security and Compliance Center Workload Protection 的更新体验中提供了所有功能。 更多信息,请参阅 过渡文档

使用 IBM Cloud® Security and Compliance Center时,必须配置要如何处理数据。 有关可用于服务的数据类型的更多详细信息,请参阅 了解数据加密

准备工作

开始之前,请确保您具有更新 Security and Compliance Center的设置所需的访问级别。 要管理设置,您需要 Manager 服务角色或更高版本

存储区需求

用于存储结果的存储区不需要任何特定设置或命名格式。 但是,建议您在标准套餐和智能层上使用存储区。

Security and Compliance Center 与 Cloud Object Storage 之间的所有流量都通过专用网络完成。 在控制台中检索用于显示目的的数据不会使您付出任何代价。 但是,如果在存储数据后选择直接从 Cloud Object Storage 下载数据,那么将产生数据传输成本。 有关更多信息,请参阅 Cloud Object Storage 定价

配置存储

必须先配置 Cloud Object Storage 存储区,在此存储区中服务可以转发结果数据以进行长期存储,然后才能开始评估资源以实现合规性。

数据的处理是在实例的位置中配置的。 例如,如果在 us-south 区域中供应 Security and Compliance Center 实例,那么将在其中处理数据。

要连接 Cloud Object Storage 存储区,可以使用 Security and Compliance Center UI。

  1. 在 IBM Cloud 控制台中,转到 Resource list 页面并选择 Security and Compliance Center 实例。
  2. 在 Security and Compliance Center 实例中,转到 Settings 页面。
  3. 存储器 磁贴上,单击 连接
  4. 如果未在 Cloud Object Storage 与 Security and Compliance Center之间启用服务到服务策略,那么将显示通知。 必须先启用策略,然后才能继续。 如果已启用策略,那么您将看不到通知,并且可以跳至步骤 5。 要启用策略,请执行以下步骤。
    1. 单击授权
    2. 已为 Cloud Object Storage选择 目标服务
    3. 缺省情况下,会选择所需的 写入者 角色。
    4. 点击回顾。 然后,单击“分配”。
  5. 选择 Cloud Object Storage 的实例以及要使用的存储区。
  6. 然后,单击连接

如果断开 Cloud Object Storage 实例的连接或选择新的存储区,那么 Security and Compliance Center 无法读取任何现有结果数据。 如果没有已连接的 Cloud Object Storage 存储区,那么无法完成评估。

使用 API 配置存储

必须先配置 Cloud Object Storage 存储区,在此存储区中服务可以转发结果数据以进行长期存储,然后才能开始评估资源以实现合规性。

数据的处理是在实例的位置中配置的。 例如,如果在 us-south 区域中供应 Security and Compliance Center 实例,那么将在其中处理数据。

要配置 Cloud Object Storage 存储区的设置,可以使用 Security and Compliance Center API。

curl -X PATCH
   --location --header "Authorization: Bearer {iam_token}"
   --header "Accept: application/json"
   --header "Content-Type: application/json-patch+json"
   --data '{
               "event_notifications": {
                  "instance_crn": "crn:v1:staging:public:event-notifications:us-south:a/130003ea8bfa43c5aacea07a86da3000:1c858449-3537-45b8-9d39-2707115b4cc7::"
                  },
               "object_storage": {
                  "instance_crn": "crn:v1:staging:public:cloud-object-storage:global:a/130003ea8bfa43c5aacea07a86da3000:1c858449-3537-45b8-9d39-2707115b4cc7::",
                  "bucket": "scc-bucket"
               }
            }'
   "https://us-south.compliance.cloud.ibm.com/instances/{instance_id}/v3/settings"
eventNotificationsModel := &securityandcompliancecenterapiv3.EventNotifications{
  InstanceCrn: &eventNotificationsCrnForUpdateSettingsLink,
  SourceDescription: core.StringPtr("This source is used for integration with IBM Cloud Security and Compliance Center."),
  SourceName: core.StringPtr("compliance"),
}

objectStorageModel := &securityandcompliancecenterapiv3.ObjectStorage{
  InstanceCrn: &objectStorageCrnForUpdateSettingsLink,
  Bucket: &objectStorageBucketForUpdateSettingsLink,
  BucketLocation: &objectStorageLocationForUpdateSettingsLink,
}

updateSettingsOptions := securityAndComplianceCenterApiService.NewUpdateSettingsOptions()
updateSettingsOptions.SetEventNotifications(eventNotificationsModel)
updateSettingsOptions.SetObjectStorage(objectStorageModel)
updateSettingsOptions.SetXCorrelationID("1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5")

settings, response, err := securityAndComplianceCenterApiService.UpdateSettings(updateSettingsOptions)
if err != nil {
  panic(err)
}
b, _ := json.MarshalIndent(settings, "", "  ")
fmt.Println(string(b))
EventNotifications eventNotificationsModel = new EventNotifications.Builder()
  .instanceCrn(eventNotificationsCrnForUpdateSettingsLink)
  .sourceDescription("This source is used for integration with IBM Cloud Security and Compliance Center.")
  .sourceName("compliance")
  .build();
ObjectStorage objectStorageModel = new ObjectStorage.Builder()
  .instanceCrn(objectStorageCrnForUpdateSettingsLink)
  .bucket(objectStorageBucketForUpdateSettingsLink)
  .bucketLocation(objectStorageLocationForUpdateSettingsLink)
  .build();
UpdateSettingsOptions updateSettingsOptions = new UpdateSettingsOptions.Builder()
  .eventNotifications(eventNotificationsModel)
  .objectStorage(objectStorageModel)
  .xCorrelationId(xCorrelationIdLink)
  .build();

Response<Settings> response = securityAndComplianceCenterApiService.updateSettings(updateSettingsOptions).execute();
Settings settings = response.getResult();

System.out.println(settings);
// Request models needed by this operation.

// EventNotifications
const eventNotificationsModel = {
  instance_crn: eventNotificationsCrnForUpdateSettingsLink,
  source_description: 'This source is used for integration with IBM Cloud Security and Compliance Center.',
  source_name: 'compliance',
};

// ObjectStorage
const objectStorageModel = {
  instance_crn: objectStorageCrnForUpdateSettingsLink,
  bucket: objectStorageBucketForUpdateSettingsLink,
  bucket_location: objectStorageLocationForUpdateSettingsLink,
};

const params = {
  eventNotifications: eventNotificationsModel,
  objectStorage: objectStorageModel,
  xCorrelationId: '1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5',
};

let res;
try {
  res = await securityAndComplianceCenterApiService.updateSettings(params);
  console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
  console.warn(err);
}
event_notifications_model = {
  'instance_crn': event_notifications_crn_for_update_settings_link,
  'source_description': 'This source is used for integration with IBM Cloud Security and Compliance Center.',
  'source_name': 'compliance',
}

object_storage_model = {
  'instance_crn': object_storage_crn_for_update_settings_link,
  'bucket': object_storage_bucket_for_update_settings_link,
  'bucket_location': object_storage_location_for_update_settings_link,
}

response = security_and_compliance_center_api_service.update_settings(
  event_notifications=event_notifications_model,
  object_storage=object_storage_model,
  x_correlation_id='1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5',
)
settings = response.get_result()

print(json.dumps(settings, indent=2))

如果断开 Cloud Object Storage 实例的连接或选择新的存储区,那么 Security and Compliance Center 无法读取任何现有结果数据。 如果没有已连接的 Cloud Object Storage 存储区,那么无法完成评估。

成功响应将返回 Event Notifications 和 Cloud Object Storage 设置以及其他元数据。 有关必需和可选请求参数的更多信息,请查看 API 文档

使用 CLI 配置存储器

必须先配置 Cloud Object Storage 存储区,在此存储区中服务可以转发结果数据以进行长期存储,然后才能开始评估资源以实现合规性。

要连接 Cloud Object Storage 存储区,可以使用 Security and Compliance Center CLI。 有关更多信息,请参阅 CLI 参考

ibmcloud security-compliance setting update
--event-notifications='{
  "instance_crn": "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::",
  "updated_on": "2019-01-01T12:00:00.000Z",
  "source_id": "crn:v1:staging:public:event-notifications:us-south:a/ff88f007f9ff4622aac4fbc0eda36255:b8b07245-0bbe-4478-b11c-0dce523105fd::",
  "source_description": "This source is used for integration with IBM Cloud Security and Compliance Center.",
  "source_name": "compliance"
  }'
--object-storage='{
  "instance_crn": "crn:v1:staging:public:cloud-object-storage:global:a/ff88f007f9ff4622aac4fbc0eda36255:7199ae60-a214-4dd8-9bf7-ce571de49d01::",
  "bucket": "px-scan-results",
  "bucket_location": "us-south",
  "bucket_endpoint": "exampleString",
  "updated_on": "2019-01-01T12:00:00.000Z"
  }'
--x-correlation-id=1a2b3c4d-5e6f-4a7b-8c9d-e0f1a2b3c4d5
--x-request-id=exampleString

如果断开 Cloud Object Storage 实例的连接或选择新的存储区,那么 Security and Compliance Center 无法读取任何现有结果数据。 如果没有已连接的 Cloud Object Storage 存储区,那么无法完成评估。