监控 API
您可以使用威胁情报监控 API 来创建、搜索和更新您的威胁情报源的监控器。
创建或更新威胁情报监控器
创建或更新威胁情报监控器。
端点
POST
方法用于创建新的监控器。 PUT
方法用于更新监控器。
POST _plugins/_security_analytics/threat_intel/monitors
PUT _plugins/_security_analytics/threat_intel/monitors/<monitor_id>
请求正文字段
您可以在请求正文中指定以下字段。
字段 | 类型 | 描述 |
---|---|---|
名称 | 字符串 | 监控器的名称。必填。 |
schedule | 对象 | 决定监控器运行频率的计划。必填。 |
schedule.period | 对象 | 关于计划频率的信息。必填。 |
schedule.period.interval | 整数 | 监控器运行的间隔。必填。 |
schedule.period.unit | 字符串 | 间隔的时间单位。 |
enabled | 对象 | 创建监控器的用户信息。必填。 |
user.backend_roles | 数组 | 与用户关联的后端角色。可选。 |
user.roles | 数组 | 与用户关联的角色。可选。 |
user.custom_attribute_names | 数组 | 与用户关联的自定义属性名称。可选。 |
user.user_requested_tenant | 字符串 | 用户请求的租户。可选。 |
索引 | 数组 | 用于监控器的日志数据源。必填。 |
per_ioc_type_scan_input_list | 数组 | 根据威胁指标 (IOC) 类型扫描的输入列表。必填。 |
per_ioc_type_scan_input_list.ioc_type | 字符串 | IOC 的类型(例如,哈希)。必填。 |
per_ioc_type_scan_input_list.index_to_fields_map | 对象 | 包含给定 IOC 类型值的索引字段映射。必填。 |
per_ioc_type_scan_input_list.index_to_fields_map.<index> | 数组 | 指定索引中包含的字段列表。必填。 |
triggers | 数组 | 告警的触发器设置。必填。 |
triggers.data_sources | 数组 | 与触发器关联的数据源列表。必填。 |
triggers.name | 字符串 | 触发器的名称。必填。 |
triggers.severity | 字符串 | 触发器的严重级别(例如,高、中或低)。必填。 |
示例请求
以下部分提供了监控 API 的示例请求。
创建监控器
{
"name": "Threat intel monitor",
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"enabled": false,
"user": {
"name": "",
"backend_roles": [],
"roles": [],
"custom_attribute_names": [],
"user_requested_tenant": null
},
"indices": [
"windows"
],
"per_ioc_type_scan_input_list": [
{
"ioc_type": "hashes",
"index_to_fields_map": {
"windows": [
"file_hash"
]
}
}
],
"triggers": [
{
"data_sources": [
"windows",
"random"
],
"name": "regwarg",
"severity": "high"
}
]
}
更新监控器
{
"name": "Threat intel monitor",
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"enabled": false,
"user": {
"name": "",
"backend_roles": [],
"roles": [],
"custom_attribute_names": [],
"user_requested_tenant": null
},
"indices": [
"windows"
],
"per_ioc_type_scan_input_list": [
{
"ioc_type": "hashes",
"index_to_fields_map": {
"windows": [
"file_hash"
]
}
}
],
"triggers": [
{
"data_sources": [
"windows",
"random"
],
"name": "regwarg",
"severity": "high"
}
]
}
示例响应
{
"id": "B8p88ZAB1vBjq44wkjEy",
"name": 1,
"seq_no": 0,
"primary_term": 1,
"monitor": {
"id": "B8p88ZAB1vBjq44wkjEy",
"name": "Threat intel monitor",
"per_ioc_type_scan_input_list": [
{
"ioc_type": "hashes",
"index_to_fields_map": {
"windows": [
"file_hash"
]
}
}
],
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"enabled": false,
"user": {
"name": "",
"backend_roles": [],
"roles": [],
"custom_attribute_names": [],
"user_requested_tenant": null
},
"indices": [
"windows"
],
"triggers": [
{
"data_sources": [
"windows",
"random"
],
"ioc_types": [],
"actions": [],
"id": "afdd80cc-a669-4487-98a0-d84bea8e1e39",
"name": "regwarg",
"severity": "high"
}
]
}
}
删除监控器
删除现有威胁情报监控器。
端点
DELETE /_plugins/_security_analytics/threat_intel/monitors/<monitor_id>
请求示例
DELETE /_plugins/_security_analytics/threat_intel/monitors/B8p88ZAB1vBjq44wkjEy
示例响应
{
"_id" : "B8p88ZAB1vBjq44wkjEy",
"_version" : 1
}
搜索监控器
使用查询搜索现有监控器。请求正文需要一个搜索查询。有关查询选项,请参阅查询 DSL。
请求示例
以下示例请求使用监控器的 ID 进行匹配查询以搜索监控器
POST /_plugins/_security_analytics/detectors/_search
{
"query": {
"match": {
"_id": "HMqq_5AB1vBjq44wpTIN"
}
}
}
示例响应
{
"took": 11,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 2.0,
"hits": [
{
"_index": ".opendistro-alerting-config",
"_id": "HMqq_5AB1vBjq44wpTIN",
"_version": 1,
"_seq_no": 8,
"_primary_term": 1,
"_score": 2.0,
"_source": {
"id": "HMqq_5AB1vBjq44wpTIN",
"name": "Threat intel monitor",
"per_ioc_type_scan_input_list": [
{
"ioc_type": "hashes",
"index_to_fields_map": {
"windows": [
"file_hash"
]
}
}
],
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"enabled": false,
"user": {
"name": "",
"backend_roles": [],
"roles": [],
"custom_attribute_names": [],
"user_requested_tenant": null
},
"indices": [
"windows"
],
"triggers": [
{
"data_sources": [
"windows",
"random"
],
"ioc_types": [],
"actions": [],
"id": "63426758-c82d-4c87-a52c-f86ee6a8a06d",
"name": "regwarg",
"severity": "high"
}
]
}
}
]
}
}