关联引擎 API
关联引擎 API 允许你创建新的关联规则、查看特定时间窗口内的发现结果和关联,以及执行其他任务。
创建日志类型之间的关联规则
此 API 用于创建关联规则:
json
POST /_plugins/_security_analytics/correlation/rules请求字段
| 字段 | 类型 | 描述 |
|---|---|---|
index | 字符串 | 用作日志源的索引名称。 |
query | 字符串 | 用于筛选安全日志进行关联的查询。 |
category | 字符串 | 与日志源关联的日志类型。 |
示例请求
json
POST /_plugins/_security_analytics/correlation/rules
{
"correlate": [
{
"index": "vpc_flow",
"query": "dstaddr:4.5.6.7 or dstaddr:4.5.6.6",
"category": "network"
},
{
"index": "windows",
"query": "winlog.event_data.SubjectDomainName:NTAUTHORI*",
"category": "windows"
},
{
"index": "ad_logs",
"query": "ResultType:50126",
"category": "ad_ldap"
},
{
"index": "app_logs",
"query": "endpoint:/customer_records.txt",
"category": "others_application"
}
]
}示例响应
json
{
"_id": "DxKEUIkBpIjg64IK4nXg",
"_version": 1,
"rule": {
"name": null,
"correlate": [
{
"index": "vpc_flow",
"query": "dstaddr:4.5.6.7 or dstaddr:4.5.6.6",
"category": "network"
},
{
"index": "windows",
"query": "winlog.event_data.SubjectDomainName:NTAUTHORI*",
"category": "windows"
},
{
"index": "ad_logs",
"query": "ResultType:50126",
"category": "ad_ldap"
},
{
"index": "app_logs",
"query": "endpoint:/customer_records.txt",
"category": "others_application"
}
]
}
}响应字段
| 字段 | 类型 | 描述 |
|---|---|---|
_id | 字符串 | 新规则的 ID。 |
列出时间窗口内的所有发现结果及其关联
此 API 提供指定时间窗口内所有发现结果及其关联的列表:
json
GET /_plugins/_security_analytics/correlations?start_timestamp=<start time in milliseconds>&end_timestamp=<end time in milliseconds>查询参数
| 参数 | 类型 | 描述 |
|---|---|---|
start_timestamp | 数字 | 时间窗口的开始时间,以毫秒为单位。 |
end_timestamp | 数字 | 时间窗口的结束时间,以毫秒为单位。 |
示例请求
json
GET /_plugins/_security_analytics/correlations?start_timestamp=1689289210000&end_timestamp=1689300010000示例响应
json
{
"findings": [
{
"finding1": "931de5f0-a276-45d5-9cdb-83e1045a3630",
"logType1": "network",
"finding2": "1e6f6a12-83f1-4a38-9bb8-648f196859cc",
"logType2": "test_windows",
"rules": [
"nqI2TokBgL5wWFPZ6Gfu"
]
}
]
}响应字段
| 字段 | 类型 | 描述 |
|---|---|---|
finding1 | 字符串 | 关联中第一个发现结果的 ID。 |
logType1 | 字符串 | 与第一个发现结果关联的日志类型。 |
finding2 | 字符串 | 关联中第二个发现结果的 ID。 |
logType2 | 字符串 | 与第二个发现结果关联的日志类型。 |
rules | 数组 | 与关联发现结果关联的关联规则 ID 列表。 |
列出属于某日志类型的发现结果的关联
此 API 用于列出特定发现结果及其关联的日志类型的关联:
json
GET /_plugins/_security_analytics/findings/correlate?finding=425dce0b-f5ee-4889-b0c0-7d15669f0871&detector_type=ad_ldap&nearby_findings=20&time_window=10m查询参数
| 参数 | 类型 | 描述 |
|---|---|---|
finding | 字符串 | 发现结果 ID。 |
detector_type | 字符串 | 检测器的日志类型。 |
nearby_findings | 数字 | 相对于给定发现结果 ID 的附近发现结果数量。 |
time_window | 字符串 | 设置一个时间窗口,所有关联必须在该时间窗口内一起发生。 |
示例请求
json
GET /_plugins/_security_analytics/findings/correlate?finding=425dce0b-f5ee-4889-b0c0-7d15669f0871&detector_type=ad_ldap&nearby_findings=20&time_window=10m示例响应
json
{
"findings": [
{
"finding": "5c661104-aaa9-484b-a91f-9cad4ae6d5f5",
"detector_type": "others_application",
"score": 0.000015182109564193524
},
{
"finding": "2485b623-6573-42f4-a055-9b927e38a65f",
"detector_type": "ad_ldap",
"score": 0.000001615897872397909
},
{
"finding": "051e00ad-5996-4c41-be20-f992451d1331",
"detector_type": "windows",
"score": 0.000016230604160227813
},
{
"finding": "f11ca8a3-50d7-4074-a951-51439aa9e67b",
"detector_type": "s3",
"score": 0.000001759401811796124
},
{
"finding": "9b86980e-5fb7-4c5a-bd1b-879a1e3baf12",
"detector_type": "network",
"score": 0.0000016306962606904563
},
{
"finding": "e7dea5a1-164f-48f9-880e-4ba33e508713",
"detector_type": "network",
"score": 0.00001632626481296029
}
]
}响应字段
| 字段 | 类型 | 描述 |
|---|---|---|
finding | 字符串 | 发现结果 ID。 |
detector_type | 字符串 | 与发现结果关联的日志类型。 |
score | 数字 | 关联发现结果的关联分数。该分数基于相关规则定义的威胁场景中相关发现结果的接近程度。 |