构建定制概要文件
自 2025 年 7 月 17 日起,您不能在本产品的此版本中创建新实例。 Security and Compliance Center Workload Protection 的更新体验中提供了所有功能。 更多信息,请参阅 过渡文档。
通过 IBM Cloud® Security and Compliance Center,您可以利用根据行业标准组织的预定义概要文件,也可以选择从现有库创建特定于您的使用情况的概要文件。
配置文件是一组可进行合规性评估的控制措施。 在 Security and Compliance Center中,可以使用预定义概要文件,也可以通过选择已添加到控制库的控件来创建概要文件。 控件已具有与其关联的规范和评估,但您可以选择创建自己的规范和评估。 要了解有关每个实体的更多信息,请参阅 关键概念。
准备工作
开始之前,请确保您具有创建和管理概要文件所需的访问级别。 要管理配置文件,您需要 Writer 服务角色或更高版本。
构建概要文件
您可以使用控制库作为指南,通过控制台创建概要文件。
-
在 IBM Cloud 控制台中,转到 Resource list 页面并选择 Security and Compliance Center 实例。
-
在 Security and Compliance Center 实例中,转到 Profiles 页面并单击 Create。
-
提供概要文件详细信息,包括 名称,版本和 (可选) 描述。
必须以 SemVer 格式指定概要文件的版本。 例如,
1.0.2
或2.1.3-alpha
。 -
单击下一步。
-
添加控件。
- 单击 添加 以查看可用的控制库。
- 选择要从中拉取控件的库。
由于无法从不推荐的控制库版本创建定制概要文件,因此请使用最新版本。 如果您未准确看到您要查找的内容,那么可以始终创建定制控制库,该库将显示在屏幕中。
- 选择要评估的控件。 要查看关联的评估,可以单击“眼睛”图标。
- 选择所有控件后,单击 添加。
- 可选: 如果要将控件从另一个库拉入到概要文件中,请重复上述步骤并选择另一个概要文件。
- 复审所选控件,然后单击 下一步。
-
通过展开每行来定义参数值,以查看每个规范所需的输入。
所选控件可能没有任何需要参数输入的评估。 如果是这样,将显示一条消息,指示您跳至下一步。
-
查看您的选择,然后单击“创建”。
使用 API 构建概要文件
您可以使用控制库作为指南,通过 API 创建概要文件。
curl -X POST
--location --header "Authorization: Bearer {iam_token}"
--header "Accept: application/json"
--header "Content-Type: application/json"
--data '{
"profile_name": "test_profile1",
"profile_description": "test_description1",
"profile_type": "custom",
"profile_version": "1.0.0",
"version_group_label": "58a5922f-0763-485b-91ef-92cca4125d9d",
"controls": [
{
"control_library_id": "e98a56ff-dc24-41d4-9875-1e188e2da6cd",
"control_id": "1fa45e17-9322-4e6c-bbd6-1c51db08e790"
}
],
"default_parameters": [
{
"assessment_type": "Automated",
"assessment_id": "rule-a637949b-7e51-46c4-afd4-b96619001bf1",
"parameter_name": "session_invalidation_in_seconds",
"parameter_default_value": "120",
"parameter_display_name": "Sign out due to inactivity in seconds",
"parameter_type": "numeric"
}
]
}'
"https://us-south.compliance.cloud.ibm.com/instances/{instance_id}/v3/profiles"
(securityAndComplianceCenterApi *SecurityAndComplianceCenterApiV3) CreateProfile(createProfileOptions *CreateProfileOptions) (result *Profile, response *core.DetailedResponse, err error)
ProfileControlsPrototype profileControlsPrototypeModel = new ProfileControlsPrototype.Builder()
.controlLibraryId(controlLibraryIdLink)
.controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790")
.build();
DefaultParametersPrototype defaultParametersPrototypeModel = new DefaultParametersPrototype.Builder()
.assessmentType("Automated")
.assessmentId("rule-a637949b-7e51-46c4-afd4-b96619001bf1")
.parameterName("session_invalidation_in_seconds")
.parameterDefaultValue("120")
.parameterDisplayName("Sign out due to inactivity in seconds")
.parameterType("numeric")
.build();
CreateProfileOptions createProfileOptions = new CreateProfileOptions.Builder()
.profileName("test_profile1")
.profileDescription("test_description1")
.profileType("custom")
.controls(java.util.Arrays.asList(profileControlsPrototypeModel))
.defaultParameters(java.util.Arrays.asList(defaultParametersPrototypeModel))
.build();
Response<Profile> response = securityAndComplianceCenterApiService.createProfile(createProfileOptions).execute();
Profile profile = response.getResult();
System.out.println(profile);
// Request models needed by this operation.
// ProfileControlsPrototype
const profileControlsPrototypeModel = {
control_library_id: controlLibraryIdLink,
control_id: '1fa45e17-9322-4e6c-bbd6-1c51db08e790',
};
// DefaultParametersPrototype
const defaultParametersPrototypeModel = {
assessment_type: 'Automated',
assessment_id: 'rule-a637949b-7e51-46c4-afd4-b96619001bf1',
parameter_name: 'session_invalidation_in_seconds',
parameter_default_value: '120',
parameter_display_name: 'Sign out due to inactivity in seconds',
parameter_type: 'numeric',
};
const params = {
profileName: 'test_profile1',
profileDescription: 'test_description1',
profileType: 'custom',
controls: [profileControlsPrototypeModel],
defaultParameters: [defaultParametersPrototypeModel],
};
let res;
try {
res = await securityAndComplianceCenterApiService.createProfile(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
profile_controls_prototype_model = {
'control_library_id': control_library_id_link,
'control_id': '1fa45e17-9322-4e6c-bbd6-1c51db08e790',
}
default_parameters_prototype_model = {
'assessment_type': 'Automated',
'assessment_id': 'rule-a637949b-7e51-46c4-afd4-b96619001bf1',
'parameter_name': 'session_invalidation_in_seconds',
'parameter_default_value': '120',
'parameter_display_name': 'Sign out due to inactivity in seconds',
'parameter_type': 'numeric',
}
response = security_and_compliance_center_api_service.create_profile(
profile_name='test_profile1',
profile_description='test_description1',
profile_type='custom',
controls=[profile_controls_prototype_model],
default_parameters=[default_parameters_prototype_model],
)
profile = response.get_result()
print(json.dumps(profile, indent=2))
成功响应将返回一个布尔值,用于确认 success
为 true
。 有关必需和可选请求参数的更多信息,请查看 API 文档。
使用 CLI 构建概要文件
您可以使用控制库作为指南,通过 CLI 创建概要文件。 有关更多信息,请参阅 CLI 参考。
ibmcloud security-compliance profile create
--profile-name=test_profile1
--profile-description=test_description1
--profile-type=custom
--controls='[
{
"control_library_id": "e98a56ff-dc24-41d4-9875-1e188e2da6cd",
"control_id": "1fa45e17-9322-4e6c-bbd6-1c51db08e790"
}
]'
--default-parameters='[
{
"assessment_type": "Automated",
"assessment_id": "rule-a637949b-7e51-46c4-afd4-b96619001bf1",
"parameter_name": "session_invalidation_in_seconds",
"parameter_default_value": "120",
"parameter_display_name": "Sign out due to inactivity in seconds",
"parameter_type": "numeric"
}
]'
--x-correlation-id=exampleString
--x-request-id=exampleString
使用 Terraform 构建概要文件
您可以使用控制库作为指南来创建具有 Terraform 的概要文件。
resource "ibm_scc_profile" "scc_profile_instance" {
controls {
control_library_id = "e98a56ff-dc24-41d4-9875-1e188e2da6cd"
control_id = "5C453578-E9A1-421E-AD0F-C6AFCDD67CCF"
control_library_version = "control_library_version"
control_name = "control_name"
control_description = "control_description"
control_category = "control_category"
control_parent = "control_parent"
control_requirement = true
control_docs {
control_docs_id = "control_docs_id"
control_docs_type = "control_docs_type"
}
control_specifications_count = 1
control_specifications {
control_specification_id = "f3517159-889e-4781-819a-89d89b747c85"
responsibility = "user"
component_id = "f3517159-889e-4781-819a-89d89b747c85"
componenet_name = "componenet_name"
environment = "environment"
control_specification_description = "control_specification_description"
assessments_count = 1
assessments {
assessment_id = "assessment_id"
assessment_method = "assessment_method"
assessment_type = "assessment_type"
assessment_description = "assessment_description"
parameter_count = 1
parameters {
parameter_name = "parameter_name"
parameter_display_name = "parameter_display_name"
parameter_type = "string"
}
}
}
}
default_parameters {
assessment_type = "assessment_type"
assessment_id = "assessment_id"
parameter_name = "parameter_name"
parameter_default_value = "parameter_default_value"
parameter_display_name = "parameter_display_name"
parameter_type = "string"
}
profile_description = "profile_description"
profile_name = "profile_name"
profile_type = "predefined"
}
有关更多信息,请查看 Terraform 参考。
后续步骤
现在,您具有概要文件,请通过创建附件来开始评估资源。 从概要文件详细信息页面,单击要评估的概要文件的溢出菜单。 然后,单击 连接。