源 API
威胁情报源 API 更新并返回与威胁情报源配置相关的任务信息。
创建或更新威胁情报源
创建或更新威胁情报源并从该源加载威胁指标 (IOC)。
端点
POST _plugins/_security_analytics/threat_intel/sources
PUT _plugins/_security_analytics/threat_intel/sources/<source_id>
请求正文字段
字段 | 类型 | 描述 |
---|---|---|
类型 | 字符串 | 威胁情报源的类型,例如 S3_CUSTOM 或 IOC_UPLOAD 。 |
名称 | 字符串 | 威胁情报源的名称。 |
格式 | 字符串 | 威胁情报数据的格式,例如 STIX2 。 |
描述 | 字符串 | 威胁情报源的描述。 |
已启用 | 布尔型 | 指示是否已启用从源定期刷新 IOC。 |
IOC 类型 | 字符串数组 | 源支持的 STIX2 IOC 类型,例如 hashes 、domain-name 、ipv4-addr 或 ipv6-addr 。 |
来源 | 对象 | 威胁情报数据的来源信息。 |
source.ioc_upload | 对象 | 关于 IOC 上传的信息。适用于 IOC_UPLOAD 类型。 |
source.ioc_upload.file_name | 字符串 | 包含 IOC 的文件名,例如 test 。适用于 IOC_UPLOAD 类型。 |
source.ioc_upload.iocs | 对象数组 | 以 STIX2 格式列出的 IOC 列表。适用于 IOC_UPLOAD 类型。 |
source_config.source.s3 | 对象 | 有关 Amazon 简单存储服务 (Amazon S3) 源的信息。适用于 S3_CUSTOM 类型。 |
source_config.source.s3.bucket_name | 字符串 | S3 存储桶的名称,例如 threat-intel-s3-test-bucket 。适用于 S3_CUSTOM 类型。 |
source_config.source.s3.object_key | 字符串 | S3 存储桶中对象的键,例如 alltypess3object 。适用于 S3_CUSTOM 类型。 |
source_config.source.s3.region | 字符串 | S3 存储桶所在的 AWS 区域。示例:us-west-2 。适用于 S3_CUSTOM 类型。 |
source_config.source.s3.role_arn | 字符串 | 用于访问 S3 存储桶的角色的 Amazon 资源名称 (ARN),例如 arn:aws:iam::248279774929:role/threat_intel_s3_test_role 。适用于 S3_CUSTOM 类型。 |
IOC 字段 (STIX2)
以下字段修改 ioc_types
选项。
字段 | 类型 | 描述 |
---|---|---|
ID | 字符串 | IOC 的唯一标识符,例如 1 。 |
名称 | 字符串 | IOC 的人类可读名称,例如 ioc-name 。 |
类型 | 字符串 | IOC 的类型,例如 hashes 。 |
值 | 字符串 | IOC 的值,可以是哈希值,例如 gof 。 |
严重性 | 字符串 | IOC 的严重性级别。示例:thvvz 。 |
创建时间 | 整数/字符串 | IOC 的创建时间戳,可以是 UNIX 纪元格式或 ISO_8601 格式,例如 1719519073 或 2024-06-20T01:06:20.562008Z 。 |
修改时间 | 整数/字符串 | IOC 最后修改的时间戳,可以是 UNIX 纪元格式或 ISO_8601 格式,例如 1719519073 或 2024-06-20T01:06:20.562008Z 。 |
描述 | 字符串 | IOC 的描述。 |
标签 | 字符串数组 | 与 IOC 相关的任何标签或标记。 |
feed_id | 字符串 | IOC 所属 feed 的唯一标识符。 |
spec_version | 字符串 | 用于 IOC 的规范版本。 |
版本 | 整数 | IOC 的版本号。 |
响应正文字段
字段 | 数据类型 | 描述 |
---|---|---|
_id | 字符串 | 威胁情报源的唯一标识符。 |
_version | 整数 | 威胁情报源的版本号。 |
source_config | 对象 | 威胁情报源的配置详情。 |
source_config.name | 字符串 | 威胁情报源的名称。 |
source_config.format | 字符串 | 威胁情报数据的格式。 |
source_config.type | 字符串 | 威胁情报源的类型。 |
source_config.ioc_types | 字符串数组 | 源支持的 IOC 类型。 |
source_config.description | 字符串 | 威胁情报源的描述。 |
source_config.created_by_user | 字符串或 null | 创建威胁情报源的用户。 |
source_config.created_at | 字符串 (DateTime) | 威胁情报源的创建日期和时间。 |
source_config.source | 对象 | 包含威胁情报数据来源的信息。 |
source_config.source.ioc_upload | 对象 | 关于 IOC 上传的信息。 |
source_config.source.ioc_upload.file_name | 字符串 | 上传的文件名。示例:test 。 |
source_config.source.ioc_upload.iocs | 对象数组 | 有关 IOC 上传的任何附加信息。当 IOC 成功存储时,这显示为空数组。 |
source_config.enabled | 布尔型 | 指示威胁情报源是否已启用。 |
source_config.enabled_time | 字符串或 null | 源启用的日期和时间。 |
source_config.last_update_time | 字符串 (DateTime) | 威胁情报源最后更新的日期和时间。 |
source_config.schedule | 字符串或 null | 威胁情报源的计划。 |
source_config.state | 字符串 | 威胁情报源的当前状态。 |
source_config.refresh_type | 字符串 | 应用于源的刷新类型。 |
source_config.last_refreshed_user | 字符串或 null | 上次刷新源的用户。 |
source_config.last_refreshed_time | 字符串 (DateTime) | 源上次刷新的日期和时间。 |
示例请求
以下示例请求展示了如何使用 Source API。
IOC_UPLOAD 类型
POST _plugins/_security_analytics/threat_intel/sources/
{
"type": "IOC_UPLOAD",
"name": "my_custom_feed",
"format": "STIX2",
"description": "this is the description",
"store_type": "OS",
"enabled": "false",
"ioc_types": [
"hashes"
],
"source": {
"ioc_upload": {
"file_name": "test",
"iocs": [
{
"id": "1",
"name": "uldzafothwgik",
"type": "hashes",
"value": "gof",
"severity": "thvvz",
"created": 1719519073,
"modified": 1719519073,
"description": "first one here",
"labels": [
"ik"
],
"feed_id": "jl",
"spec_version": "gavvnespe",
"version": -4356924786557562654
},
{
"id": "2",
"name": "uldzafothwgik",
"type": "hashes",
"value": "example-has00001",
"severity": "thvvz",
"created": "2024-06-20T01:06:20.562008Z",
"modified": "2024-06-20T02:06:20.56201Z",
"description": "first one here",
"labels": [
"ik"
],
"feed_id": "jl",
"spec_version": "gavvnespe",
"version": -4356924786557562654
}
]
}
}
}
S3_CUSTOM 类型源
POST _plugins/_security_analytics/threat_intel/sources/
{
"type": "S3_CUSTOM",
"name": "example-ipv4-from-SAP-account",
"format": "STIX2",
"store_type": "OS",
"enabled": "true",
"schedule": {
"interval": {
"start_time": 1717097122,
"period": "10",
"unit": "DAYS"
}
},
"source": {
"s3": {
"bucket_name": "threat-intel-s3-test-bucket",
"object_key": "alltypess3object",
"region": "us-west-2",
"role_arn": "arn:aws:iam::248279774929:role/threat_intel_s3_test_role"
}
},
"ioc_types": [
"domain-name",
"ipv4-addr"
]
}
示例响应
以下示例响应展示了 OpenSearch 在成功请求后返回的内容。
IOC_UPLOAD 类型
{
"_id": "2c0u7JAB9IJUg27gcjUp",
"_version": 2,
"source_config": {
"name": "my_custom_feed",
"format": "STIX2",
"type": "IOC_UPLOAD",
"ioc_types": [
"hashes"
],
"description": "this is the description",
"created_by_user": null,
"created_at": "2024-07-25T23:16:25.257697Z",
"source": {
"ioc_upload": {
"file_name": "test",
"iocs": []
}
},
"enabled": false,
"enabled_time": null,
"last_update_time": "2024-07-25T23:16:26.011774Z",
"schedule": null,
"state": "AVAILABLE",
"refresh_type": "FULL",
"last_refreshed_user": null,
"last_refreshed_time": "2024-07-25T23:16:25.522735Z"
}
}
S3_CUSTOM 类型源
{
"id": "rGO5zJABLVyN2kq1wbFS",
"version": 206,
"name": "example-ipv4-from-SAP-account",
"format": "STIX2",
"type": "S3_CUSTOM",
"ioc_types": [
"domain-name",
"ipv4-addr"
],
"created_by_user": {
"name": "admin",
"backend_roles": [],
"roles": [
"security_manager",
"all_access"
],
"custom_attribute_names": []
},
"created_at": "2024-07-19T20:40:44.114Z",
"source": {
"s3": {
"bucket_name": "threat-intel-s3-test-bucket",
"object_key": "alltypess3object",
"region": "us-west-2",
"role_arn": "arn:aws:iam::248279774929:role/threat_intel_s3_test_role"
}
},
"enabled": true,
"enabled_time": "2024-07-19T20:40:44.114Z",
"last_update_time": "2024-07-25T20:58:18.213Z",
"schedule": {
"interval": {
"start_time": 1717097122,
"period": 10,
"unit": "Days"
}
},
"state": "AVAILBLE",
"refresh_type": "FULL",
"last_refreshed_user": {
"name": "admin",
"backend_roles": [],
"roles": [
"security_manager",
"all_access"
],
"custom_attribute_names": [],
"user_requested_tenant": null
},
"last_refreshed_time": "2024-07-25T20:58:17.131Z"
}
获取威胁情报源配置详情
检索威胁情报源配置详情。
端点
GET /_plugins/_security_analytics/threat_intel/sources/<source-id>
请求示例
GET /_plugins/_security_analytics/threat_intel/sources/<source-id>
示例响应
{
"_id": "a-jnfjkAF_uQjn8Weo4",
"_version": 2,
"source_config": {
"name": "my_custom_feed_2",
"format": "STIX2",
"type": "S3_CUSTOM",
"ioc_types": [
"ipv4_addr",
"hashes"
],
"description": "this is the description",
"created_by_user": null,
"created_at": "2024-06-27T00:52:56.373Z",
"source": {
"s3": {
"bucket_name": "threat-intel-s3-test-bucket",
"object_key": "bd",
"region": "us-west-2",
"role_arn": "arn:aws:iam::540654354201:role/threat_intel_s3_test_role"
}
},
"enabled": true,
"enabled_time": "2024-06-27T00:52:56.373Z",
"last_update_time": "2024-06-27T00:52:57.824Z",
"schedule": {
"interval": {
"start_time": 1717097122,
"period": 1,
"unit": "Days"
}
},
"state": "AVAILABLE",
"refresh_type": "FULL",
"last_refreshed_user": null,
"last_refreshed_time": "2024-06-27T00:52:56.533Z"
}
}
搜索威胁情报源
根据搜索查询搜索匹配的威胁情报源。请求体需要一个搜索查询。有关查询选项,请参阅 查询 DSL。
端点
POST /_plugins/_security_analytics/threat_intel/sources/_search
请求示例
POST /_plugins/_security_analytics/threat_intel/sources/_search
{
"query": {
"match": {
"source_config.type": "S3_CUSTOM"
}
}
}
示例响应
{
"took": 20,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1.0,
"hits": [
{
"_index": ".opensearch-sap--job",
"_id": "YEAuV5ABx0lQn6qhY5C1",
"_version": 2,
"_seq_no": 1,
"_primary_term": 1,
"_score": 1.0,
"_source": {
"source_config": {
"name": "my_custom_feed_2",
"format": "STIX2",
"type": "S3_CUSTOM",
"description": "this is the description",
"created_by_user": null,
"source": {
"s3": {
"bucket_name": "threat-intelligence-s3-test-bucket",
"object_key": "bd",
"region": "us-west-2",
"role_arn": "arn:aws:iam::540654354201:role/threat_intel_s3_test_role"
}
},
"created_at": 1719449576373,
"enabled_time": 1719449576373,
"last_update_time": 1719449577824,
"schedule": {
"interval": {
"start_time": 1717097122,
"period": 1,
"unit": "Days"
}
},
"state": "AVAILABLE",
"refresh_type": "FULL",
"last_refreshed_time": 1719449576533,
"last_refreshed_user": null,
"enabled": true,
"ioc_types": [
"ip",
"hash"
]
}
}
}
]
}
}
删除威胁情报源 API
删除威胁情报源。
端点
DELETE /_plugins/_security_analytics/threat_intel/sources/<source-id>
请求示例
DELETE /_plugins/_security_analytics/threat_intel/sources/2c0u7JAB9IJUg27gcjUp
示例响应
{
"_id": "2c0u7JAB9IJUg27gcjUp"
}
刷新源
从威胁情报源下载所有 IOC。仅支持 S3_CUSTOM
类型源。
端点
POST /_plugins/_security_analytics/threat_intel/sources/<source-id>/_refresh
请求示例
POST /_plugins/_security_analytics/threat_intel/sources/IJAXz4QBrmVplM4JYxx_/_refresh
示例响应
{
"acknowledged": true
}