收集 Security Command Center 姿态违规日志
本文档介绍了如何使用 Cloud Storage 将 Security Command Center 姿态违规日志导出并注入到 Google Security Operations 中。解析器会将检测结果中的原始 JSON 数据转换为统一数据模型 (UDM)。它会提取相关字段、重构数据、将其映射到 UDM 字段,并执行各种验证和丰富操作,以确保数据质量和一致性。
准备工作
确保您满足以下前提条件:
- 您的 Google Cloud 环境中已启用 Security Command Center。
- Google SecOps 实例。
- 对 Security Command Center 和 Cloud Logging 的特权访问权限。
创建 Cloud Storage 存储桶
- 登录 Google Cloud 控制台。
前往 Cloud Storage 存储分区页面。
点击创建。
在创建存储桶页面上,输入您的存储桶信息。完成以下每一步后,点击继续以继续执行后续步骤:
在开始使用部分中,执行以下操作:
- 输入符合存储桶名称要求的唯一名称,例如 gcp-scc-posture-violation-logs。
如需启用分层命名空间,请点击展开箭头以展开优化文件导向型和数据密集型工作负载部分,然后选择在此存储桶上启用分层命名空间。
如需添加存储桶标签,请点击展开箭头以展开标签部分。
点击添加标签,然后为标签指定键和值。
在选择数据存储位置部分中,执行以下操作:
- 选择位置类型。
使用位置类型菜单选择一个位置,用于永久存储存储桶中的对象数据。
如需设置跨存储桶复制,请展开设置跨存储桶复制部分。
在为数据选择一个存储类别部分中,为存储桶选择默认存储类别,或者选择 Autoclass 对存储桶数据进行自动存储类别管理。
在选择如何控制对对象的访问权限部分中,选择不强制执行禁止公开访问,然后为存储桶对象选择访问权限控制模型。
在选择如何保护对象数据部分中,执行以下操作:
- 在数据保护下,选择您要为存储桶设置的任何选项。
- 如需选择对象数据的加密方式,请点击标有数据加密的展开箭头,然后选择数据加密方法。
点击创建。
配置 Security Command Center 日志记录
- 登录 Google Cloud 控制台。
前往 Security Command Center 页面。
选择您的组织。
点击设置。
点击连续导出标签页。
在导出名称下,点击 Logging 导出。
在接收器下,开启将发现结果记录到 Logging。
在记录项目下,输入或搜索要在其中记录发现结果的项目。
点击保存。
配置 Security Command Center 姿态违规日志导出
- 登录 Google Cloud 控制台。
- 前往日志记录 > 日志路由器。
- 点击创建接收器。
提供以下配置参数:
- 接收器名称:输入一个有意义的名称,例如
scc-posture-violation-logs-sink。 - 接收器目标位置:选择 Cloud Storage 存储空间,然后输入存储桶的 URI,例如
gs://gcp-scc-posture-violation-logs/。 日志过滤条件:
logName="projects/<your-project-id>/logs/cloudsecurityscanner.googleapis.com%2Fposture_violations" resource.type="cloud_security_center_posture_violation"设置导出选项:包含所有日志条目。
- 接收器名称:输入一个有意义的名称,例如
点击创建。
配置 Cloud Storage 权限
- 前往 IAM 和管理> IAM。
- 找到 Cloud Logging 服务账号。
- 授予对相应存储桶的 roles/storage.admin。
设置 Feed
如需配置 Feed,请按以下步骤操作:
- 依次前往 SIEM 设置 > Feed。
- 点击添加新 Feed。
- 在下一页上,点击配置单个 Feed。
- 在 Feed 名称字段中,输入 Feed 的名称,例如 Security Command Center 姿态违规日志。
- 选择 Google Cloud Storage V2 作为来源类型。
- 选择 Security Command Center 姿态违规作为日志类型。
- 点击Chronicle 服务账号字段旁边的获取服务账号。
- 点击下一步。
为以下输入参数指定值:
- 存储分区 URI:Cloud Storage 存储桶网址;例如
gs://gcp-scc-posture-violation-logs/。此网址必须以尾随正斜杠 (/) 结尾。 来源删除选项:根据您的偏好选择删除选项。
文件存在时间上限:包含在过去指定天数内修改的文件。默认值为 180 天。
- 存储分区 URI:Cloud Storage 存储桶网址;例如
点击下一步。
在最终确定界面中查看新的 Feed 配置,然后点击提交。
UDM 映射表
| 日志字段 | UDM 映射 | 逻辑 |
|---|---|---|
| 类别 | read_only_udm.metadata.product_event_type | 直接映射。 |
| changed_policy | read_only_udm.security_result.rule_name | 直接映射。 |
| cloudProvider | read_only_udm.target.resource.attribute.cloud.environment | 直接映射。 |
| createTime | read_only_udm.security_result.detection_fields[createTime] |
直接映射。 |
| finding.risks.riskCategory | read_only_udm.security_result.detection_fields[risk_category] |
直接映射。 |
| mute | read_only_udm.security_result.detection_fields[mute] |
直接映射。 |
| name | read_only_udm.metadata.product_log_id | 直接映射。 |
| originalProviderId | read_only_udm.target.resource.attribute.labels[original_provider_id] |
直接映射。 |
| 父级 | read_only_udm.target.resource_ancestors[0].name | 直接映射。 |
| parentDisplayName | read_only_udm.metadata.description | 直接映射。 |
| propertyDataTypes.changed_policy.primitiveDataType | read_only_udm.security_result.rule_labels[changed_policy_primitive_data_type] |
直接映射。 |
| propertyDataTypes.policy_drift_details.listValues.propertyDataTypes[0].structValue.fields.drift_details.structValue.fields.detected_configuration.primitiveDataType | read_only_udm.security_result.rule_labels[detected_configuration_primitive_data_type] |
直接映射。 |
| propertyDataTypes.policy_drift_details.listValues.propertyDataTypes[0].structValue.fields.drift_details.structValue.fields.expected_configuration.primitiveDataType | read_only_udm.security_result.rule_labels[expected_configuration_primitive_data_type] |
直接映射。 |
| propertyDataTypes.policy_drift_details.listValues.propertyDataTypes[0].structValue.fields.field_name.primitiveDataType | read_only_udm.security_result.rule_labels[field_name_primitive_data_type] |
直接映射。 |
| propertyDataTypes.posture_deployment_name.primitiveDataType | read_only_udm.security_result.detection_fields[posture_deployment_name_primitiveDataType] |
直接映射。 |
| propertyDataTypes.posture_deployment_resource.primitiveDataType | read_only_udm.security_result.detection_fields[posture_deployment_resource_primitiveDataType] |
直接映射。 |
| propertyDataTypes.posture_name.primitiveDataType | read_only_udm.security_result.detection_fields[posture_name_primitiveDataType] |
直接映射。 |
| propertyDataTypes.posture_revision_id.primitiveDataType | read_only_udm.security_result.detection_fields[posture_revision_id_primitiveDataType] |
直接映射。 |
| resource.cloudProvider | read_only_udm.target.resource.attribute.cloud.environment | 直接映射。 |
| resource.displayName | read_only_udm.target.resource.attribute.labels[resource_displayName] |
直接映射。 |
| resource.gcpMetadata.organization | read_only_udm.target.resource.attribute.labels[resource_organization] |
直接映射。 |
| resource.gcpMetadata.parent | read_only_udm.target.resource.attribute.labels[resource_parent] |
直接映射。 |
| resource.gcpMetadata.parentDisplayName | read_only_udm.target.resource.attribute.labels[resource_parentDisplayName] |
直接映射。 |
| resource.gcpMetadata.project | read_only_udm.target.resource.attribute.labels[resource_project] |
直接映射。 |
| resource.gcpMetadata.projectDisplayName | read_only_udm.target.resource.attribute.labels[resource_projectDisplayName] |
直接映射。 |
| resource.organization | read_only_udm.target.resource.attribute.labels[resource_organization] |
直接映射。 |
| resource.resourcePath.nodes.displayName | read_only_udm.target.resource_ancestors.name | 直接映射。 |
| resource.resourcePath.nodes.id | read_only_udm.target.resource_ancestors.product_object_id | 直接映射。 |
| resource.resourcePath.nodes.nodeType | read_only_udm.target.resource_ancestors.resource_subtype | 直接映射。 |
| resource.resourcePathString | read_only_udm.target.resource.attribute.labels[resource_path_string] |
直接映射。 |
| resource.service | read_only_udm.target.resource_ancestors[10].name | 直接映射。 |
| resource.type | read_only_udm.target.resource.attribute.labels[resource_type] |
直接映射。 |
| resourceName | read_only_udm.target.resource.name | 直接映射。 |
| securityPosture.changedPolicy | read_only_udm.security_result.rule_labels[changed_policy] |
直接映射。 |
| securityPosture.name | read_only_udm.security_result.detection_fields[security_posture_name] |
直接映射。 |
| securityPosture.policyDriftDetails[0].detectedValue | read_only_udm.security_result.rule_labels[policy_drift_details_detected_value] |
直接映射。 |
| securityPosture.policyDriftDetails[0].expectedValue | read_only_udm.security_result.rule_labels[policy_drift_details_expected_value] |
直接映射。 |
| securityPosture.policyDriftDetails[0].field | read_only_udm.security_result.rule_labels[policy_drift_details_field] |
直接映射。 |
| securityPosture.policySet | read_only_udm.security_result.rule_set | 直接映射。 |
| securityPosture.postureDeployment | read_only_udm.security_result.detection_fields[posture_deployment] |
直接映射。 |
| securityPosture.postureDeploymentResource | read_only_udm.security_result.detection_fields[posture_deployment_resource] |
直接映射。 |
| securityPosture.revisionId | read_only_udm.security_result.detection_fields[security_posture_revision_id] |
直接映射。 |
| 和程度上减少 | read_only_udm.security_result.severity | 直接映射。 |
| sourceProperties.categories[0] | read_only_udm.security_result.detection_fields[source_properties_categories] |
直接映射。 |
| sourceProperties.changed_policy | read_only_udm.security_result.rule_name | 直接映射。 |
| sourceProperties.name | read_only_udm.target.application | 直接映射。 |
| sourceProperties.policy_drift_details[0].drift_details.detected_configuration | read_only_udm.security_result.rule_labels[policy_drift_details_detected_configuration] |
直接映射。 |
| sourceProperties.policy_drift_details[0].drift_details.expected_configuration | read_only_udm.security_result.rule_labels[policy_drift_details_expected_configuration] |
直接映射。 |
| sourceProperties.policy_drift_details[0].field_name | read_only_udm.security_result.rule_labels[policy_drift_details_field_name] |
直接映射。 |
| sourceProperties.posture_deployment | read_only_udm.security_result.detection_fields[source_properties_posture_deployment_name] |
直接映射。 |
| sourceProperties.posture_deployment_name | read_only_udm.security_result.detection_fields[source_properties_posture_deployment_name] |
直接映射。 |
| sourceProperties.posture_deployment_resource | read_only_udm.security_result.detection_fields[source_properties_posture_deployment_resource] |
直接映射。 |
| sourceProperties.posture_name | read_only_udm.target.application | 直接映射。 |
| sourceProperties.posture_revision_id | read_only_udm.security_result.detection_fields[source_properties_posture_revision_id] |
直接映射。 |
| sourceProperties.revision_id | read_only_udm.security_result.detection_fields[source_properties_posture_revision_id] |
直接映射。 |
| state | read_only_udm.security_result.detection_fields[state] |
直接映射。 |
| read_only_udm.metadata.vendor_name | 解析器会映射静态值 Google。 |
|
| read_only_udm.metadata.product_name | 解析器会映射静态值 Security Command Center。 |
|
| read_only_udm.target.resource.resource_type | 解析器会映射静态值 CLUSTER。 |
|
| read_only_udm.security_result.about.investigation.status | 解析器会映射静态值 NEW。 |
|
| read_only_udm.security_result.alert_state | 解析器会映射静态值 ALERTING。 |
|
| read_only_udm.metadata.event_type | 解析器映射到 GENERIC_EVENT 作为默认值。如果字段“category”等于“SECURITY_POSTURE_DRIFT”,且“client_device_present”和“token_target.application”不为空,则映射到“SERVICE_MODIFICATION”。如果字段“category”等于“SECURITY_POSTURE_POLICY_DRIFT”“SECURITY_POSTURE_POLICY_DELETE”“SECURITY_POSTURE_DETECTOR_DRIFT”或“SECURITY_POSTURE_DETECTOR_DELETE”,并且“network_edr_not_present”为 false,“client_device_present”为 true,则映射到“SCAN_UNCATEGORIZED”。如果“token_metadata.event_type”字段等于“GENERIC_EVENT”,并且“network_edr_not_present”为 false,“client_device_present”为 true,则映射到“STATUS_UPDATE”。 |
|
| read_only_udm.target.resource_ancestors[1].resource_type | 解析器会映射静态值 CLOUD_PROJECT。 |
|
| read_only_udm.target.resource.product_object_id | 解析器从“父”字段中提取第二个和第三个“/”字符之间的值。 | |
| read_only_udm.target.resource_ancestors[1].name | 解析器从“resourceName”字段中提取第四个和第五个“/”字符之间的值。 | |
| read_only_udm.security_result.url_back_to_product | 解析器会使用从日志中提取的组织 ID、来源 ID 和发现 ID 动态构建网址。 | |
| securityMarks.name | read_only_udm.security_result.detection_fields[securityMarks_name] |
直接映射。 |
需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。