security-ml-integrations
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSecurity ML Integration Package Management
安全 ML 集成包管理
Install, check, or troubleshoot a security ML package. Supported packages: (Network Beaconing
Identification), (Data Exfiltration Detection), (Domain Generation Algorithm Detection), (Lateral
Movement Detection), (Privileged Access Detection), (Living off the Land Attack Detection).
<!-- begin-partial: preamble -->beaconingdeddgalmdpadproblemchild安装、检查或排查安全 ML 包。支持的包:(Network Beaconing Identification)、(Data Exfiltration Detection)、(Domain Generation Algorithm Detection)、(Lateral Movement Detection)、(Privileged Access Detection)、(Living off the Land Attack Detection)。
<!-- begin-partial: preamble -->beaconingdeddgalmdpadproblemchildEnvironment Configuration
环境配置
This skill executes Elasticsearch operations through the CLI. If the
CLI is not installed, tell the user what it is needed for. Do
not guess credentials, call the HTTP API directly, or attempt other workarounds.
elasticelasticThis skill references operations in HTTP-shorthand form (e.g., , , ,
, ). The Operations table at the end of this document
maps each shorthand to the equivalent CLI command — always use the CLI rather than calling the HTTP API
directly.
<!-- end-partial: preamble -->
GET /GET /_cat/indicesGET /{index}/_mappingGET /{index}/_settings/index.modePOST /_queryelasticPackage source patterns, shared template fields, and ingest-pipeline wiring live in
package capabilities.
此 skill 通过 CLI 执行 Elasticsearch 操作。如果未安装 CLI,告知用户安装它的用途。不要猜测凭据、直接调用 HTTP API 或尝试其他变通方案。
elasticelastic此 skill 以 HTTP 简写形式引用操作(例如 、、、、)。文档末尾的操作表将每种简写映射到对应的 CLI 命令——始终使用 CLI,而不是直接调用 HTTP API。
<!-- end-partial: preamble -->
GET /GET /_cat/indicesGET /{index}/_mappingGET /{index}/_settings/index.modePOST /_queryelastic包源模式、共享模板字段和 ingest pipeline 连接配置位于 package capabilities。
Process
流程
-
Classify the request. Status, README, or install. Status and README stay read-only — do not install, start transforms, deploy jobs, or enable rules. After identifying the package, branch: status usesonly (title, version, status); README adds
GET kbn:/api/fleet/epm/packages/{package}and returns that document; install continues.GET kbn:/api/fleet/epm/packages/{package}/{version}/docs/README.md -
Identify the package. Map the user's words to one of the six package names above. If the name is ambiguous, ask before calling any API. Load that package's row from package capabilities — omit fields that are empty for that package.
-
Gather environment state before any mutation. Install only.first — continue only for
GET /_license,platinum,enterprise, or Serverless. Iftrialreturns 403, report missingGET /_ml/infoand stop. Then collect:manage_ml- Package: for name, title, version, and
GET kbn:/api/fleet/epm/packages/{package}.status - Source data: with
POST /{source_patterns}/_searchandsize: 0. If every pattern has zero hits, warn that jobs will not produce useful anomalies.track_total_hits: true - Shared template (DGA, PAD, ProblemChild only): . Exists → plan a merge of the fields in the reference. 404 → plan a create with only those fields.
GET /_component_template/{name} - Shared pipeline (DGA, PAD, ProblemChild only): . Exists → plan to append a processor. 404 → plan a single-processor pipeline.
GET /_ingest/pipeline/{name} - Transforms: (skip if the package has no transform pattern). Record each
GET /_transform/{pattern},id, and thedest.indexalias (.allwheredest.aliasesis false).move_on_creation - Data views: and check whether the package's data-view pattern already exists.
GET kbn:/api/data_views - ML capacity: (total memory) and
GET /_ml/info(sum memory of opened jobs).GET /_ml/anomaly_detectors/_all/_statsfor job count and per-job memory. If jobs do not fit, say so and suggest prioritizing job groups — do not deploy anyway without the user accepting the risk.GET kbn:/internal/ml/modules/get_module/{module_id} - Rules: and
GET kbn:/api/detection_engine/rules/prepackaged/_statusfiltered by the package detection tag.POST kbn:/internal/detection_engine/prebuilt_rules/installation/_review
- Package:
-
Present a plan and wait for confirmation. Show package identity and status, source-data hits (warn if all zero), template/pipeline merge-or-create, transform count and states, data-view presence, ML memory fit, and rule count. Do not call any write API until the user confirms. If they decline, stop.
-
Install the Fleet package, then apply shared mappings. After confirmation:
- to install assets (transforms may be deferred until started).
POST kbn:/api/fleet/epm/packages/{package} - If the package uses a component template: with the merged or new body. Then
PUT /_component_template/{name}on the rollover target so new indices pick up mappings.POST /{data_stream}/_rollover - If the package uses an ingest pipeline: with appended or new processors. Use the installed package version in the versioned pipeline name.
PUT /_ingest/pipeline/{name}
Skip template, pipeline, and rollover when the package row has no values for them (beaconing, ded, lmd). -
Start transforms and create destination aliases. Skip this block (except) when the package has no transform pattern. Fleet's first checkpoint often skips
.ml-anomalies-sharedaliases. After install,.allagain if IDs were missing. Reset only if the transform is new, never started, failed, or the user asked to rebuild:GET /_transform/{pattern},POST /_transform/{id}/_stop,POST /_transform/{id}/_resetwith the existing description,POST /_transform/{id}/_update,POST /_transform/{id}/_start. If alreadyPOST /_transform/{id}/_schedule_nowwithstarted, skip reset; restamp via the existing description and ensurecheckpointing.last.checkpoint >= 1aliases exist. Then.allto add thePOST /_aliasesalias (and.allif the dest defines it) on.latest. If a data-view pattern is missing,dest.index. Also ensure a hiddenPOST kbn:/api/data_views/data_viewdata view exists (.ml-anomalies-shared) so package dashboards resolve.POST kbn:/api/data_views/data_view -
Confirm the first transform checkpoint before ML. If the package row has no transform pattern, skip this step and continue to jobs. Otherwise call. Proceed only when each transform is
GET /_transform/{pattern}/_statsandstarted; do not usecheckpointing.last.checkpoint >= 1as a substitute. Zero documents with a completed checkpoint is acceptable when source patterns are empty — destination aliases still let datafeeds start. Otherwise tell the user transforms must finish processing and wait for confirmation before the next step. Never set up the ML module against missing dest indices.documents_processed -
Deploy ML jobs, then detection rules. After transforms are confirmed (or skipped):
- with
POST kbn:/internal/ml/modules/setup/{module_id}andstartDatafeed: trueset to the package data-view pattern, or source patterns when that cell is empty. Do not put spaces after commas inindexPatternName— the setup API splits on commas without trimming. Correct:indexPatternName.logs-*,ml_okta_multiple_user_sessions_pad.all,ml_windows_privilege_type_pad.all - Initialize the detection engine if needed (), install the prebuilt rules package (
POST kbn:/api/detection_engine/index), review the package-tagged rules, then callPOST kbn:/api/fleet/epm/packages/security_detection_enginewithPOST kbn:/internal/detection_engine/prebuilt_rules/installation/_perform(one entry per reviewed rule). Enable the package's ML rules with{"mode":"SPECIFIC_RULES","rules":[{"rule_id":"<rule_id>","version":<version>}]}(POST kbn:/api/detection_engine/rules/_bulk_actionthendisableon immutable ML rules tagged with the package detection tag so API keys are stamped with the calling user).enable
-
Report created versus skipped. Package version and asset count; template/pipeline/rollover created, updated, or skipped; transforms started; data views created or already present; ML jobs and datafeeds started (and any that failed, with the mapping or index reason); rules installed and enabled.
-
对请求进行分类。 分为状态、README 或安装。状态和 README 查询保持只读——不得安装、启动 transform、部署作业或启用规则。确定包后分支处理:状态查询仅使用(title、version、status);README 查询还使用
GET kbn:/api/fleet/epm/packages/{package}并返回该文档;安装则继续后续步骤。GET kbn:/api/fleet/epm/packages/{package}/{version}/docs/README.md -
确定包。 将用户的表述映射到上述六个包名之一。如果名称存在歧义,在调用任何 API 前询问用户。从 package capabilities 加载该包的条目——省略该包为空的字段。
-
在任何变更操作之前收集环境状态。 仅限安装流程。首先执行——只有许可证为
GET /_license、platinum、enterprise或 Serverless 时才继续。如果trial返回 403,报告缺少GET /_ml/info权限并停止。然后收集:manage_ml- 包:执行 ,获取 name、title、version 和
GET kbn:/api/fleet/epm/packages/{package}。status - 源数据:执行 ,并设置
POST /{source_patterns}/_search和size: 0。如果每个模式的命中数均为零,警告作业将无法生成有意义的异常。track_total_hits: true - 共享 template(仅 DGA、PAD、ProblemChild):执行 。存在 → 计划合并参考文档中的字段。404 → 计划仅使用这些字段进行创建。
GET /_component_template/{name} - 共享 pipeline(仅 DGA、PAD、ProblemChild):执行 。存在 → 计划追加 processor。404 → 计划创建单 processor pipeline。
GET /_ingest/pipeline/{name} - Transforms:执行 (如果包没有 transform 模式则跳过)。记录每个
GET /_transform/{pattern}、id和dest.index别名(.all中dest.aliases为 false 的项)。move_on_creation - Data views:执行 ,检查包的 data view 模式是否已存在。
GET kbn:/api/data_views - ML 容量:执行 (总内存)和
GET /_ml/info(已打开作业的内存总和)。执行GET /_ml/anomaly_detectors/_all/_stats,获取作业数量和每个作业的内存。如果作业无法容纳,明确告知用户,并建议优先处理作业组——除非用户接受风险,否则不要部署。GET kbn:/internal/ml/modules/get_module/{module_id} - 规则:执行 ,并执行
GET kbn:/api/detection_engine/rules/prepackaged/_status,按包的 detection tag 过滤。POST kbn:/internal/detection_engine/prebuilt_rules/installation/_review
- 包:执行
-
展示计划并等待确认。 显示包身份和状态、源数据命中数(如果全部为零则发出警告)、template/pipeline 的合并或创建方案、transform 数量和状态、data view 是否存在、ML 内存是否足够,以及规则数量。在用户确认前,不得调用任何写 API。 如果用户拒绝,则停止。
-
安装 Fleet 包,然后应用共享映射。 确认后:
- 执行 安装资产(transform 可能会延迟到启动后再处理)。
POST kbn:/api/fleet/epm/packages/{package} - 如果包使用 component template:使用合并后或新建的请求体执行 。然后在 rollover 目标上执行
PUT /_component_template/{name},以便新索引采用更新后的映射。POST /{data_stream}/_rollover - 如果包使用 ingest pipeline:使用追加后的 processor 或新的 processor 执行 。在版本化 pipeline 名称中使用已安装的包版本。
PUT /_ingest/pipeline/{name}
当包条目中 template、pipeline 和 rollover 的值均为空时,跳过这些步骤(beaconing、ded、lmd)。 - 执行
-
启动 transforms 并创建目标别名。 当包没有 transform 模式时,跳过此块,但除外。Fleet 的首次 checkpoint 通常会跳过
.ml-anomalies-shared别名。安装后,如果之前缺少 ID,再次执行.all。仅当 transform 是新建的、从未启动、失败,或用户要求重建时才重置:执行GET /_transform/{pattern}、POST /_transform/{id}/_stop、POST /_transform/{id}/_reset并保留现有 description,以及POST /_transform/{id}/_update、POST /_transform/{id}/_start。如果已经处于POST /_transform/{id}/_schedule_now状态且started,则跳过重置;通过现有 description 重新标记,并确保checkpointing.last.checkpoint >= 1别名存在。然后执行.all,在POST /_aliases上添加dest.index别名(如果.all定义了dest,也一并添加)。如果缺少 data view 模式,执行.latest。还要确保存在隐藏的POST kbn:/api/data_views/data_viewdata view(.ml-anomalies-shared),以便包的 dashboard 正常解析。POST kbn:/api/data_views/data_view -
在启动 ML 前确认首个 transform checkpoint。 如果包条目没有 transform 模式,跳过此步骤并继续处理作业。否则执行。仅当每个 transform 都处于
GET /_transform/{pattern}/_stats状态且started时继续;不要使用checkpointing.last.checkpoint >= 1作为替代指标。即使源模式为空,零文档但 checkpoint 已完成也是可接受的——目标别名仍可让 datafeed 启动。否则告知用户 transforms 必须完成处理,并在进入下一步前等待确认。绝不基于缺失的目标索引设置 ML 模块。documents_processed -
部署 ML 作业,然后部署检测规则。 确认(或跳过)transforms 后:
- 执行 ,设置
POST kbn:/internal/ml/modules/setup/{module_id},并将startDatafeed: true设置为包的 data view 模式;如果相应字段为空,则使用源模式。不要在indexPatternName的逗号后添加空格——setup API 按逗号拆分时不会 trim。正确示例:indexPatternName。logs-*,ml_okta_multiple_user_sessions_pad.all,ml_windows_privilege_type_pad.all - 根据需要初始化 detection engine(),安装预构建规则包(
POST kbn:/api/detection_engine/index),审查带包标签的规则,然后调用POST kbn:/api/fleet/epm/packages/security_detection_engine并传入POST kbn:/internal/detection_engine/prebuilt_rules/installation/_perform(每个已审查规则一个条目)。通过{"mode":"SPECIFIC_RULES","rules":[{"rule_id":"<rule_id>","version":<version>}]}启用包的 ML 规则(对带包 detection tag 的不可变 ML 规则先执行POST kbn:/api/detection_engine/rules/_bulk_action,再执行disable,以便 API key 标记调用用户)。enable
- 执行
-
报告已创建与已跳过的内容。 包版本和资产数量;template/pipeline/rollover 是已创建、已更新还是已跳过;已启动的 transforms;已创建或已存在的 data views;已启动的 ML 作业和 datafeeds(以及任何失败的作业及其映射或索引原因);已安装并启用的规则。
Examples
示例
Install PAD
安装 PAD
User: "Install PAD"
- Gather state for . Package not installed, zero source hits,
padalready has ProblemChild fields, nologs-endpoint.events.process@custompipeline, two stopped transforms, 15 jobs fit in available memory, tagged rules available.@custom - Present the plan: warn about empty source data; merge ; create the PAD pipeline processor; start both transforms; create the PAD data view. Wait for confirm.
process.command_line_entropy - After confirm: , merge-and-
POST kbn:/api/fleet/epm/packages/padthe shared template,PUTthe pipeline, restamp via existing description (reset only if transforms are new or stopped),PUTfor eachPOST /_aliasesalias..all - . If checkpoint 1 is done (even with 0 docs), continue; otherwise wait for the user.
GET /_transform/*pad*/_stats - with a no-space
POST kbn:/internal/ml/modules/setup/pad-ml, then install and enable rules taggedindexPatternName.Use Case: Privileged Access Detection - Report each section as created, updated, or skipped.
用户:"Install PAD"
- 为 收集状态。包尚未安装,源命中数为零,
pad已包含 ProblemChild 字段,没有logs-endpoint.events.process@custompipeline,两个 transforms 处于停止状态,15 个作业可容纳于可用内存中,并且存在带标签的规则。@custom - 展示计划:警告源数据为空;合并 ;创建 PAD pipeline processor;启动两个 transforms;创建 PAD data view。等待确认。
process.command_line_entropy - 确认后:执行 ,合并并
POST kbn:/api/fleet/epm/packages/pad共享 template,PUTpipeline,通过现有 description 重新标记(仅当 transforms 为新建或已停止时才重置),并为每个PUT别名执行.all。POST /_aliases - 执行 。如果 checkpoint 1 已完成(即使为 0 个文档),则继续;否则等待用户。
GET /_transform/*pad*/_stats - 执行 ,并使用不含空格的
POST kbn:/internal/ml/modules/setup/pad-ml,然后安装并启用标签为indexPatternName的规则。Use Case: Privileged Access Detection - 将每个部分报告为已创建、已更新或已跳过。
Install beaconing (no template or pipeline)
安装 beaconing(无 template 或 pipeline)
User: "Set up beaconing"
- Gather state. Omit template, pipeline, and rollover — the beaconing row has none.
- Present a shorter plan (package, one transform, data view, jobs, rules). Wait for confirm.
- Install the package, start the transform, create if missing, confirm checkpoint, set up
ml_beaconing*, enable rules taggedbeaconing-ml.Use Case: Network Beaconing Identification
用户:"Set up beaconing"
- 收集状态。省略 template、pipeline 和 rollover——beaconing 条目中没有这些配置。
- 展示简化计划(包、一个 transform、data view、作业、规则)。等待确认。
- 安装包、启动 transform、在缺失时创建 、确认 checkpoint、设置
ml_beaconing*,并启用标签为beaconing-ml的规则。Use Case: Network Beaconing Identification
Status only
仅查询状态
User: "Is beaconing installed?"
- only.
GET kbn:/api/fleet/epm/packages/beaconing - Report title, version, and status. A README request also fetches and returns the docs README. Do not install or start anything.
用户:"Is beaconing installed?"
- 仅执行 。
GET kbn:/api/fleet/epm/packages/beaconing - 报告 title、version 和 status。README 请求还会获取并返回文档 README。不得安装或启动任何内容。
Guidelines
准则
- Gather environment state before every install. Do not skip the pre-flight reads.
- Stay read-only on status and README questions.
- Wait for explicit confirmation before any write. Check license before the Fleet POST.
- Pause after transforms until (0 docs is acceptable when source patterns are empty). Skip transform and package data-view steps when those capability cells are empty.
checkpointing.last.checkpoint >= 1 - Never overwrite shared templates or pipelines. PAD and ProblemChild share
@custom— merge fields and append processors.logs-endpoint.events.process@custom - Put no spaces after commas in ML .
indexPatternName - Cite Fleet package APIs as . Do not use a
kbn:/api/fleet/...prefix.fleet: - Restamp a Fleet transform by setting to the existing text, then start. Do not use
--description.--body '{}' - On serverless, may return 410. Continue with opened-job stats from
GET /_ml/info; do not abort the install.GET /_ml/anomaly_detectors/_all/_stats
- 每次安装前收集环境状态。不得跳过预检读取。
- 状态和 README 查询保持只读。
- 任何写操作前等待明确确认。在 Fleet POST 前检查许可证。
- 在 transforms 后暂停,直到 (源模式为空时 0 个文档可接受)。当相应能力条目为空时,跳过 transform 和包 data view 步骤。
checkpointing.last.checkpoint >= 1 - 绝不覆盖共享的 template 或 pipeline。PAD 和 ProblemChild 共用
@custom——合并字段并追加 processor。logs-endpoint.events.process@custom - ML 的逗号后不要添加空格。
indexPatternName - 将 Fleet 包 API 引用为 。不要使用
kbn:/api/fleet/...前缀。fleet: - 通过将 设置为现有文本来重新标记 Fleet transform,然后启动。不要使用
--description。--body '{}' - 在 serverless 环境中,可能返回 410。继续使用
GET /_ml/info获取已打开作业的统计信息;不要中止安装。GET /_ml/anomaly_detectors/_all/_stats
Operations
操作
| HTTP API (shorthand) | |
|---|---|
| |
| CLI gap — package-file fetch 404s on registry paths; keep this shorthand as the contract |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| CLI gap — ML module get is an internal Kibana API; keep this shorthand as the contract |
| CLI gap — ML module setup is an internal Kibana API; keep this shorthand as the contract |
| CLI gap — no generated prepackaged-status command; keep this shorthand as the contract |
| CLI gap — no generated detection-engine index command; keep this shorthand as the contract |
| |
| CLI gap — prebuilt-rule review is an internal Kibana API; keep this shorthand as the contract |
| CLI gap — prebuilt-rule install is an internal Kibana API; keep this shorthand as the contract |
| CLI gap — generated |
Internal ML-module APIs, prebuilt-rules /, detection-engine index, and rules disable/enable have no
usable generated CLI commands yet. Keep the HTTP shorthand as the contract; do not add skill-owned scripts as a
workaround. Generated Fleet EPM get/install commands exist — use those instead of the shorthand.
_review_perform| HTTP API(简写) | |
|---|---|
| |
| CLI 缺口——在 registry 路径上获取 package 文件会返回 404;保留此简写形式作为约定 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| CLI 缺口——ML module get 是 Kibana 内部 API;保留此简写形式作为约定 |
| CLI 缺口——ML module setup 是 Kibana 内部 API;保留此简写形式作为约定 |
| CLI 缺口——没有生成的 prepackaged-status 命令;保留此简写形式作为约定 |
| CLI 缺口——没有生成的 detection-engine index 命令;保留此简写形式作为约定 |
| |
| CLI 缺口——prebuilt-rule review 是 Kibana 内部 API;保留此简写形式作为约定 |
| CLI 缺口——prebuilt-rule install 是 Kibana 内部 API;保留此简写形式作为约定 |
| CLI 缺口——生成的 |
内部 ML-module API、预构建规则 /、detection-engine index 以及规则 disable/enable 目前没有可用的自动生成 CLI 命令。保留 HTTP 简写形式作为约定;不要添加 skill 自有脚本作为变通方案。已生成 Fleet EPM get/install 命令——请使用这些命令,而不是简写形式。
_review_perform