Skip to content

Add cross-cluster source to metadata_united transform for remote Elasticsearch output support#756

Merged
szwarckonrad merged 2 commits into
mainfrom
defend-remote-output-ccs-metadata-transform-reopen
Jul 6, 2026
Merged

Add cross-cluster source to metadata_united transform for remote Elasticsearch output support#756
szwarckonrad merged 2 commits into
mainfrom
defend-remote-output-ccs-metadata-transform-reopen

Conversation

@szwarckonrad

Copy link
Copy Markdown
Contributor

Unblocks elastic/kibana#271559

Re-applies #747 (reverted in #749 after it broke Fleet's serverless package install). The Fleet-side fix that strips the *: source on serverless (elastic/kibana#275649) is now merged, so this transform change is safe to ship again. The change is identical to #747.

Change Summary

Adds a cross-cluster (*:) source to the metadata_united transform so it also reads metrics-endpoint.metadata_current from connected remote clusters:

"source": { "index": [
  "metrics-endpoint.metadata_current_default*",
  "*:metrics-endpoint.metadata_current_default*",
  ".fleet-agents*"
]}

When Elastic Defend agents ship to a remote Elasticsearch output, endpoint metadata lands on the remote (data) cluster while .fleet-agents stays on the managing cluster. With only the local current index in scope, the join produced agent-only documents and the Endpoint list came up empty. Reading the remote metadata_current over CCS lets the join run on the managing cluster and populates the united index.

@szwarckonrad szwarckonrad requested a review from a team as a code owner July 6, 2026 18:38
@szwarckonrad szwarckonrad requested review from gergoabraham and pzl July 6, 2026 18:38
- version: "9.5.0-next"
changes:
- description: TBD
- description: Add cross-cluster search source to the metadata_united transform for Elastic Defend remote Elasticsearch output support

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can leave off the changelog, the entries are grabbed at release time via automation

@szwarckonrad szwarckonrad merged commit 0c8e41b into main Jul 6, 2026
4 checks passed
tomsonpl pushed a commit to elastic/kibana that referenced this pull request Jul 9, 2026
…output (#276749)

Flips the `defendRemoteOutputCcs` experimental flag on by default,
enabling the CCS read paths for Elastic Defend when an agent ships to a
remote Elasticsearch output. The read-path awareness shipped behind this
flag in #271559; this turns it on for 9.5. CCS is stateful-only, so on
serverless / no-remote clusters it is a no-op (the flag gates a
`_remote/info` check that finds no remotes).

<details>
<summary>LLM description</summary>

One-line change: `defendRemoteOutputCcs: false -> true` in
`common/experimental_features.ts`. This lets
`EndpointAppContextService.isCcsEnabled()` actually consult connected
remotes (it short-circuits to `false` when the flag is off). Downstream,
endpoint read paths (metadata list/by-id, response-action reads, policy
responses, suggestions + endpoint fields, workflow insights) apply
`prefixIndexPatternsWithCcs` only when a remote cluster is connected.

Depends on `elastic/endpoint-package#756` (the `*:` metadata_united
transform, merged) for the endpoint list, and
`elastic/elasticsearch#152211` (fleet-server-remote grants, merged) for
response-action completion. No other refs to the flag; no test asserts
its default; snapshots clean; the `isCcsEnabled` unit tests set the flag
explicitly.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants