x-pack/solutions/security/plugins/entity_store/README.md
Central place for Entities management and logs extraction.
The Entity AI Summary is persisted to the entity metadata datastream
(.entities.v2.metadata.security_{namespace}), not to the entity latest index.
Its access-control model separates generation from display:
entity-analytics sub-privilege — and an Enterprise
license. The persisted document is written with the Kibana internal user
(asInternalUser), so a user does not need their own write privilege on the
metadata index to generate and persist a summary..entities.v2.metadata.security_*. With read access the persisted summary is shown
(including the original generated_by / generated_at, so a second user sees the
first user's generation); without it the flyout gracefully falls back to on-demand
generation and nothing is persisted for that view.Serverless project roles already grant the required access (see
src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/security/roles.yml):
viewer / t1_analyst get read on .entities.v2.metadata.security_*, while
editor / t2_analyst / detections_admin get read + write.
To see a persisted AI summary on self-managed or Elastic Cloud Hosted deployments, a user needs, in addition to the Security Solution Kibana feature privileges:
read on the entity metadata indices .entities.v2.metadata.security_*.No metadata write privilege is required for any user, because persistence always goes through the Kibana internal user. Users lacking metadata read still get on-demand generation (graceful degradation).
Note: Elasticsearch built-in roles (e.g.
detections_admin) are defined in the Elasticsearch repository, not in this fork. Whether they already include.entities.v2.metadata.security_*read is a verification item against a live cluster, not something enforced here. Kibana test fixtures cover the model via custom roles (seesecurity_solution/test/scout/entity_analytics/api/tests/ai_summary).
The Entity Store plugin exposes an Entity Maintainers Framework so that other plugins can register recurring tasks that run in the context of the entity store. Registration is part of the plugin setup contract: consumers call registerEntityMaintainer during their plugin’s setup phase and supply a configuration object.
From the setup contract:
interface EntityStoreSetupContract {
registerEntityMaintainer: RegisterEntityMaintainer;
}
RegisterEntityMaintainer accepts a RegisterEntityMaintainerConfig:
interface RegisterEntityMaintainerConfig {
id: string;
description?: string;
interval: string;
initialState: EntityMaintainerState;
run: EntityMaintainerTaskMethod;
setup?: EntityMaintainerTaskMethod;
}
5m, 1h).setup or run has executed.run. Useful for one-time initialization.The framework schedules all registered maintainers when the Entity Store is installed for a given space.
The framework is namespace aware: each Kibana space gets its own task instance per maintainer (e.g. one task per id per namespace). Registration is global, scheduling is per namespace at install time.
Both methods must return the state object they manage so the framework can store it and expose it in the context for the next iteration.
Both run and setup receive a single context argument with:
namespace, runs (execution count), lastSuccessTimestamp, lastErrorTimestamp.run (or by setup on the first run, or initialState before any execution).Consumers implement their maintenance logic in run (and optionally in setup) using this context and return the updated state so the framework can keep it for the next run.