From 15dc9c7b45f0007558b30d6ea83ecc41737f3653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Bl=C3=A1zquez?= Date: Tue, 17 Dec 2024 19:39:34 +0100 Subject: [PATCH] Implement feature flag to toggle Asset Inventory plugin (#203844) ## Summary Closes https://github.com/elastic/kibana/issues/201705. Reuse security_solution's config to control visibility of Asset Inventory plugin. ### Definition of done - [x] Use the existing `xpack.securitySolution.enableExperimental` configuration to add a new feature flag - Done in `x-pack/plugins/security_solution/common/experimental_features.ts` - [x] Implement the feature flag `xpack.securitySolution.enableExperimental: ['assetInventoryStoreEnabled']`. - This can only be done locally in `kibana.dev.yml`, but I can add it to `kibana.yml` instead. - [x] Update any relevant documentation to explain how to enable the feature. - Updated plugin's `README` file. ### How to test In your [kibana.yml](https://github.com/elastic/kibana/blob/main/config/kibana.yml) file, add the following entry at the bottom: ``` xpack.securitySolution.enableExperimental: ['assetInventoryStoreEnabled'] ``` ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .../solutions/security/plugins/asset_inventory/README.md | 8 ++++++++ .../security_solution/common/experimental_features.ts | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/x-pack/solutions/security/plugins/asset_inventory/README.md b/x-pack/solutions/security/plugins/asset_inventory/README.md index e1dd9d4ac8900..313a45cec6f76 100755 --- a/x-pack/solutions/security/plugins/asset_inventory/README.md +++ b/x-pack/solutions/security/plugins/asset_inventory/README.md @@ -8,6 +8,14 @@ Centralized asset inventory experience within the Elastic Security solution. A c See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. +### Feature flag + +First, enable the `assetInventoryStoreEnabled` experimental feature flag by adding the following to your `kibana.dev.yml`: + +```yml +xpack.securitySolution.enableExperimental: ['assetInventoryStoreEnabled'] +``` + ## Testing For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide/en/kibana/current/development-tests.html) for more details diff --git a/x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts b/x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts index 428a48cf4b7be..b09e8cae5391c 100644 --- a/x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts @@ -266,8 +266,12 @@ export const allowedExperimentalValues = Object.freeze({ /** * Enables CrowdStrike's RunScript RTR command */ - crowdstrikeRunScriptEnabled: false, + + /** + * Enables the Asset Inventory feature + */ + assetInventoryStoreEnabled: false, }); type ExperimentalConfigKeys = Array;