-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Telemetry] Move indices metadata out of security solution #212875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
f3b01ab
Move indices metadata out of security solution
szaffarano e5f3ee8
Update task frequency
szaffarano c4714b3
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine 1b924b1
Fix code validation
szaffarano 63cec37
Re-enable security_solution task
szaffarano 8976167
Merge remote-tracking branch 'upstream/main' into szaffarano/indices-…
szaffarano 9c8a4ee
Fix ftr test
szaffarano 260b7e5
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 1dddebb
Merge remote-tracking branch 'upstream/main' into szaffarano/indices-…
szaffarano c45831f
Move indices metadata to its own plugin
szaffarano c66d3c3
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine bb17508
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine c27ac4c
Fix tsconfig
szaffarano bd9c15e
Fix type
szaffarano 96ec5e1
Delete dead code
szaffarano bf4434d
Fix check
szaffarano db90eac
Code style
szaffarano 8c34ee9
Fix check
szaffarano b814413
Fix FTR
szaffarano beee4a2
Code style
szaffarano fbd5bf1
Add configuration logic
szaffarano bcd6634
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine ae64d85
Fix lint
szaffarano 214f353
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 7d2735e
Improve error handling
szaffarano 4c1ed32
Default config to zero to start disabled
szaffarano 1544deb
Fix logic
szaffarano 2536b28
Sync code
szaffarano e4a98f8
Fix schema
szaffarano c980832
Update event ids
szaffarano af1cfe9
Code style
szaffarano 60eae23
Code structure
szaffarano 6925854
Update test
szaffarano da9c6e9
Update plugin config
szaffarano 744d828
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 75ebef8
Add more tests
szaffarano 163946a
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 2fb89a3
Merge branch 'main' into szaffarano/indices-metadata-poc
szaffarano 7a94a21
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 450acf0
Update task interval
szaffarano beed08b
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 022c9f1
Add enabled config
szaffarano 462b0e0
Simplify error handling
szaffarano 7a4db53
Update README.md
szaffarano b635989
Add tests for IndicesMetadataService
szaffarano 64a1da2
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine 3f7af01
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 1fda147
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 54b1745
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 859bd7a
Merge branch 'main' into szaffarano/indices-metadata-poc
elasticmachine 63e9868
Update config artifact id
szaffarano 6b37720
Update pub key config
szaffarano f9e5954
Add debug log
szaffarano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
x-pack/platform/plugins/private/indices_metadata/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Indices Metadata Plugin | ||
|
|
||
| Plugin for managing and retrieving metadata about indices in | ||
| Kibana. This plugin collects and processes metadata from Elasticsearch indices, | ||
| data streams, ILM policies, and index templates. | ||
|
|
||
| ## Overview | ||
|
|
||
| The Indices Metadata plugin is owned by the Security Solution team and provides: | ||
|
|
||
| 1. **Automated metadata collection** — Runs scheduled tasks to gather indices | ||
| metadata | ||
| 2. **Analytics integration** — Sends telemetry events for indices statistics | ||
| and configurations | ||
| 3. **Data stream monitoring** — Tracks data streams and their associated | ||
| metadata | ||
|
|
||
| ## Features | ||
|
|
||
| - **Index Statistics Collection**: Gathers comprehensive statistics about indices | ||
| - **Data Stream Monitoring**: Tracks data streams and their metadata | ||
| - **ILM Policy Tracking**: Monitors Index Lifecycle Management policies and statistics | ||
| - **Index Template Management**: Collects information about index templates | ||
| - **Settings Monitoring**: Retrieves and tracks index settings | ||
| - **Task Scheduling**: Runs collection tasks every 24 hours via Task Manager | ||
|
|
||
| ## Configuration | ||
|
|
||
| The plugin's configuration prefix is `xpack.indicesMetadata` | ||
|
|
||
| ### Plugin Configuration Options | ||
|
|
||
| - `enabled`: Whether the plugin is enabled (default: `true`) | ||
| - `cdn.url` — URL for artifact downloads | ||
| - `cdn.publicKey` — Public key for artifact verification | ||
| - `cdn.requestTimeout` — Timeout for CDN requests | ||
|
|
||
| ### Configuration Example | ||
|
|
||
| `kibana.yml` | ||
|
|
||
| ```yaml | ||
| xpack.indicesMetadata: | ||
| enabled: false | ||
| cdn: | ||
| url: 'https://artifacts.elastic.co' | ||
| publicKey: '...' | ||
| requestTimeout: 30000 | ||
| ``` | ||
|
|
||
| ## Dependencies | ||
|
|
||
| - **Required Plugins**: `taskManager` | ||
| - **Owner**: `@elastic/security-solution` | ||
|
|
||
| ## Development | ||
|
|
||
| This plugin is server-side only and depends on: | ||
|
|
||
| - Task Manager for scheduled metadata collection | ||
| - Analytics service for telemetry | ||
| - Elasticsearch client for metadata retrieval | ||
|
|
||
| See the [Kibana contributing | ||
| guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for | ||
| instructions setting up your development environment. |
21 changes: 21 additions & 0 deletions
21
x-pack/platform/plugins/private/indices_metadata/jest.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| module.exports = { | ||
| preset: '@kbn/test', | ||
| rootDir: '../../../../..', | ||
| roots: ['<rootDir>/x-pack/platform/plugins/private/indices_metadata'], | ||
| coverageDirectory: | ||
| '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/private/indices_metadata', | ||
| coverageReporters: ['text', 'html'], | ||
| collectCoverageFrom: [ | ||
| '<rootDir>/x-pack/platform/plugins/private/indices_metadata/{common,public,server}/**/*.{ts,tsx}', | ||
| ], | ||
| globals: { | ||
| Uint8Array: Uint8Array, | ||
| }, | ||
| }; |
25 changes: 25 additions & 0 deletions
25
x-pack/platform/plugins/private/indices_metadata/kibana.jsonc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "type": "plugin", | ||
| "id": "@kbn/indices-metadata-plugin", | ||
| "owner": [ | ||
| "@elastic/security-solution" | ||
| ], | ||
| "group": "platform", | ||
| "visibility": "private", | ||
| "description": "Indices metadata plugin for managing and retrieving metadata about indices in Kibana.", | ||
| "plugin": { | ||
| "id": "indicesMetadata", | ||
| "server": true, | ||
| "browser": false, | ||
| "configPath": [ | ||
| "xpack", | ||
| "indicesMetadata" | ||
| ], | ||
| "requiredPlugins": [ | ||
| "taskManager" | ||
| ], | ||
| "requiredBundles": [], | ||
| "optionalPlugins": [], | ||
| "extraPublicDirs": [] | ||
| } | ||
| } |
26 changes: 26 additions & 0 deletions
26
x-pack/platform/plugins/private/indices_metadata/server/config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { schema, TypeOf } from '@kbn/config-schema'; | ||
| import { PluginConfigDescriptor } from '@kbn/core/server'; | ||
|
|
||
| const pluginConfigSchema = schema.object({ | ||
| enabled: schema.boolean({ defaultValue: true }), | ||
| cdn: schema.maybe( | ||
| schema.object({ | ||
| url: schema.maybe(schema.string()), | ||
| publicKey: schema.maybe(schema.string()), | ||
| requestTimeout: schema.maybe(schema.number()), | ||
| }) | ||
| ), | ||
| }); | ||
|
|
||
| export type PluginConfig = TypeOf<typeof pluginConfigSchema>; | ||
|
|
||
| export const config: PluginConfigDescriptor<PluginConfig> = { | ||
| schema: pluginConfigSchema, | ||
| }; | ||
14 changes: 14 additions & 0 deletions
14
x-pack/platform/plugins/private/indices_metadata/server/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { PluginInitializerContext } from '@kbn/core/server'; | ||
| import { IndicesMetadataPlugin } from './plugin'; | ||
|
|
||
| export { config } from './config'; | ||
| export async function plugin(context: PluginInitializerContext) { | ||
| return new IndicesMetadataPlugin(context); | ||
| } |
39 changes: 39 additions & 0 deletions
39
x-pack/platform/plugins/private/indices_metadata/server/lib/constants.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { IndicesMetadataConfiguration } from './services/indices_metadata.types'; | ||
| import type { CdnConfig } from './services/artifact.types'; | ||
|
|
||
| export const DEFAULT_CDN_CONFIG: CdnConfig = { | ||
| url: 'https://artifacts.security.elastic.co', | ||
| pubKey: ` | ||
| -----BEGIN PUBLIC KEY----- | ||
| MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA6AB2sJ5M1ImN/bkQ7Te6 | ||
| uI7vMXjN2yupEmh2rYz4gNzWS351d4JOhuQH3nzxfKdayHgusP/Kq2MXVqALH8Ru | ||
| Yu2AF08GdvYlQXPgEVI+tB/riekwU7PXZHdA1dY5/mEZ8SUSM25kcDJ3vTCzFTlL | ||
| gl2RNAdkR80d9nhvNSWlhWMwr8coQkr6NmujVU/Wa0w0EXbN1arjcG4qzbOCaR+b | ||
| cgQ9LRUoFfK9w+JJHDNjOI7rOmaIDA6Ep4oeDLy5AcGCE8bNmQzxZhRW7NvlNUGS | ||
| NTgU0CZTatVsL9AyP15W3k635Cpmy2SMPX+d/CFgvr8QPxtqdrz3q9iOeU3a1LMY | ||
| gDcFVmSzn5zieQEPfo/FcQID/gnCmkX0ADVMf1Q20ew66H7UCOejGaerbFZXYnTz | ||
| 5AgQBWF2taOSSE7gDjGAHereeKp+1PR+tCkoDZIrPEjo0V6+KaTMuYS3oZj1/RZN | ||
| oTjQrdfeDj02mEIL+XkcWKAp03PYlWylVwgTMa178DDVuTWtS5lZL8j5LijlH9+6 | ||
| xH8o++ghwfxp6ENLKDZPV5IvHHG7Vth9HScoPTQWQ+s8Bt26QENPUV2AbyxbJykY | ||
| mJfTDke3bEemHZzRbAmwiQ7VpJjJ4OfLGRy8Pp2AHo8kYIvWyM5+aLMxcxUaYdA9 | ||
| 5SxoDOgcDBA4lLb6XFLYiDUCAwEAAQ== | ||
| -----END PUBLIC KEY----- | ||
| `, | ||
| requestTimeout: 10_000, | ||
| }; | ||
|
|
||
| export const DEFAULT_INDICES_METADATA_CONFIGURATION: IndicesMetadataConfiguration = { | ||
| datastreams_threshold: 0, | ||
| ilm_policy_query_size: 0, | ||
| ilm_stats_query_size: 0, | ||
| index_query_size: 0, | ||
| indices_settings_threshold: 0, | ||
| indices_threshold: 0, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.