HTTP Event Collector (HEC) 是一种向 SentinelOne Singularity Data Lake 发送日志数据的可靠方法。Cloudflare Logpush 支持通过 Cloudflare 仪表板或 API 将日志直接推送到 SentinelOne HEC。
-
在 Cloudflare 仪表板中,前往账户或域名(也称为 zone)级别的 Logpush(日志推送) 页面。
账户级别:Go to Logpush ↗
域名(也称为 zone)级别:Go to Logpush ↗
-
根据你的选择,可分别访问账户范围数据集与 zone 范围数据集。
-
选择 Create a Logpush job(创建 Logpush 作业)。
-
在 Select a destination(选择目标) 中,选择 SentinelOne。
-
输入或选择以下目标信息:
- SentinelOne HEC URL
- Auth Token - Event Collector 令牌。
- Source Type(源类型) - 例如,
marketplace-cloudflare-latest。
输入完目标详细信息后,选择 Continue(继续)。
-
选择要推送到存储服务的数据集。
-
在下一步中,需要配置 logpush 作业:
- 输入 Job name(作业名称)。
- 在 If logs match(如果日志匹配) 下,可选择要包含和/或从日志中排除的事件。更多信息请参阅 Filters。并非所有数据集都提供此选项。
- 在 Send the following fields(发送以下字段) 中,可选择将所有日志推送到存储目标,或有选择地选择要推送的日志。
-
在 Advanced Options(高级选项) 中,可以:
- 选择日志中时间戳字段的格式(
RFC3339(默认)、Unix或UnixNano)。 - 为日志选择采样率,或推送随机采样百分比的日志。
- 为
CVE-2021-44228启用脱敏。此选项会将每次出现的${替换为x{。
- 选择日志中时间戳字段的格式(
-
配置完 logpush 作业后,选择 Submit(提交)。
要设置 SentinelOne Logpush 作业:
- 使用相应的端点 URL 和身份验证参数创建作业。
- 启用作业以开始推送日志。
在尝试读取或配置 Logpush 任务之前,请确保已启用 Log Share 权限。更多信息请参阅角色部分。
要创建作业,请向 Logpush jobs 端点发送包含以下字段的 POST 请求:
- name(可选)- 使用你的域名作为作业名称。
- destination_conf - 由端点 URL、源类型、授权标头组成的日志目标,格式如下字符串。
- <SENTINELONE_ENDPOINT_URL>:带端口的 SentinelOne 原始 HTTP Event Collector URL。例如:
sentinelone://ingest.us1.sentinelone.net/services/collector/raw。在配置和设置 Logpush 作业时,Cloudflare 要求 SentinelOne 端点为/services/collector/raw。 - <SENTINELONE_AUTH_TOKEN>:URL 编码的 SentinelOne 授权令牌。例如:
Bearer 0e6d94e8c-5792-4ad1-be3c-29bcaee0197d。 - <SOURCE_TYPE>:SentinelOne 源类型。例如:
marketplace-cloudflare-latest。
- <SENTINELONE_ENDPOINT_URL>:带端口的 SentinelOne 原始 HTTP Event Collector URL。例如:
"https://<SENTINELONE_ENDPOINT_URL>?sourcetype=<SOURCE_TYPE>&header_Authorization=<SENTINELONE_AUTH_TOKEN>"-
dataset - 要接收的日志类别。支持的数据集完整列表请参阅 Datasets。
-
output_options(可选)- 有关配置字段、采样率和时间戳格式,请参阅 Log Output Options。对于时间戳,Cloudflare 建议使用
timestamps=rfc3339。
使用 cURL 的示例请求:
Required API token permissions
At least one of the following token permissions is required:Logs Write
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/logpush/jobs" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"name": "<DOMAIN_NAME>",
"destination_conf": "sentinelone://<SENTINELONE_ENDPOINT_URL>?sourcetype=<SOURCE_TYPE>&header_Authorization=<SENTINELONE_AUTH_TOKEN>",
"output_options": {
"field_names": [
"ClientIP",
"ClientRequestHost",
"ClientRequestMethod",
"ClientRequestURI",
"EdgeEndTimestamp",
"EdgeResponseBytes",
"EdgeResponseStatus",
"EdgeStartTimestamp",
"RayID"
],
"timestamp_format": "rfc3339"
},
"dataset": "http_requests",
"enabled": true
}'响应:
{
"errors": [],
"messages": [],
"result": {
"id": <JOB_ID>,
"dataset": "http_requests",
"kind": "",
"enabled": true,
"name": "<DOMAIN_NAME>",
"output_options": {
"field_names": ["ClientIP", "ClientRequestHost", "ClientRequestMethod", "ClientRequestURI", "EdgeEndTimestamp","EdgeResponseBytes", "EdgeResponseStatus", "EdgeStartTimestamp", "RayID"],
"timestamp_format": "rfc3339"
},
"destination_conf": "sentinelone://<SENTINELONE_ENDPOINT_URL>?sourcetype=<SOURCE_TYPE>&header_Authorization=<SENTINELONE_AUTH_TOKEN>",
"last_complete": null,
"last_error": null,
"error_message": null
},
"success": true
}有关更新作业(包括启用和禁用),请参阅 Manage Logpush with cURL。
故障排除信息请参阅 Logpush FAQ。