kibana/x-pack/test
Pablo Machado 5363883a8d
[SecuritySolution] Create PrivMon index import flow (#224822)
Depends on https://github.com/elastic/kibana/pull/221610

This PR adds the import index workflow to privileged user monitoring and
API changes required to support it.

### API Enhancements

* **New API for privilege monitoring index creation**: Added a new API
endpoint (`PUT /api/entity_analytics/monitoring/privileges/indices`) to
create indices for privilege monitoring with support for `standard` and
`lookup` modes. This includes the implementation of request and response
schemas (`create_indidex.gen.ts`, `create_indidex.schema.yaml`).
[[1]](diffhunk://#diff-68329bb90dea945f343e1637990d5d05bc159e0aa2511ef1e45d37ed1a6cda51R1-R41)
[[2]](diffhunk://#diff-e979499654a27b3c1930d63c5b1002113c1c3f53f84ce27a4d75a5c492717a96R1-R42)
* **Updated privilege monitoring health response**: Modified the health
response schema to include a `status` field and an optional `error`
object for detailed error handling
(`privilege_monitoring/health.gen.ts`,
`privilege_monitoring/health.schema.yaml`).
[[1]](diffhunk://#diff-00f39a3e65a336eaddf7d3203d1370d910f5ecd2062b6cc21d9c06922c12884eR19-R28)
[[2]](diffhunk://#diff-83afa72b7a1fc48f3cc063e9fb855190d3525228bc0488fb8b871e112b90e961L22-R33)

### Frontend Integration

* **Introduce the create index modal that opens when the create index
button is clicked.
* **Onboarding modal improvements**: Updated the `AddDataSourcePanel`
component to handle index creation more robustly by passing callbacks to
the modal (`add_data_source.tsx`).
* **Error handling in UI**: Enhanced the `PrivilegedUserMonitoring`
component to display error callouts when privilege monitoring data fails
to load (`privileged_user_monitoring/index.tsx`).
[[1]](diffhunk://#diff-273ad32c97dcf15c6c6054fd7c5516d587132674578d25986b235cd174c75789R22-R26)
[[2]](diffhunk://#diff-273ad32c97dcf15c6c6054fd7c5516d587132674578d25986b235cd174c75789R38-R51)

### How to test it?
* Go to the priv mon page with an empty cluster
* Click on the data source by the index button
* Search for available indices, it should return indices with
`user.name.keyword` fields
* Click 'create index' and create a new index 
* Choose the created index and click 'Add privileged users'
* You should be redirected to the dashboard (The API is currently not
working)




### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] 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)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-24 10:09:06 +01:00
..
accessibility [UA] Forwardport 8.x UA commits into main (#218957) 2025-05-05 12:55:47 +02:00
api_integration [SecuritySolution] Create PrivMon index import flow (#224822) 2025-06-24 10:09:06 +01:00
api_integration_basic [ska][x-pack] relocate api_integration tests [2] (#219293) 2025-04-29 12:21:55 +02:00
apm_cypress [APM] Migrate APM Cypress tests to on_merge from on_merge_unsupported_ftrs (#203991) 2025-01-16 12:57:50 +01:00
banners_functional [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
cases_api_integration [ResponseOps][Cases] Populate total alerts and comments in the cases saved objects (#223992) 2025-06-23 19:56:01 +03:00
cloud_integration [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
common Add an API endpoint to bulk fill rule gaps (#220866) 2025-06-18 23:21:15 +02:00
custom_branding Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
dataset_quality_api_integration [Dataset Quality] Fix ES Promotion forward compatibility test failures for ES 9.0 (#224786) 2025-06-24 10:39:44 +02:00
defend_workflows_cypress [EDR Workflows] Workflow Insights - Cypress (#204562) 2025-01-31 14:43:08 +01:00
disable_ems
examples skip flaky suite (#156106) 2025-06-06 18:30:49 +01:00
fleet_api_integration [Security][9.1] Security roles siemV3 migration for Global Artifact Management (#219566) 2025-06-23 16:14:13 +02:00
fleet_cypress [Fleet] Fix elastic-agent docker image path (#210008) 2025-02-11 22:04:03 +01:00
fleet_functional [Fleet] Fix failing/flaky tests (#189559) 2024-07-31 14:14:30 -04:00
fleet_packages [Fleet] Remove deprecated Symantec package from install_all_packages_job (#193029) 2024-09-17 11:35:00 +02:00
fleet_tasks [Fleet] Add automatic agent upgrades functional tests (#220829) 2025-05-20 09:33:23 +02:00
ftr_apis [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
functional [Dataset Quality] Indicate if failure store isn't enabled for data stream (#221644) 2025-06-24 09:49:36 +02:00
functional_basic [ML] Moves job and trained model management features into Stack Management (#204290) 2025-04-08 19:52:16 +02:00
functional_cloud [CLOUD] Save search project subtype from Cloud (#218972) 2025-06-03 12:53:56 +03:00
functional_cors [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
functional_embedded [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
functional_execution_context [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
functional_gen_ai/inference [inference] add support for temperature parameter (#206479) 2025-01-14 14:05:21 +01:00
functional_search [Search] Stateful Index Details FTR refactors (#220716) 2025-05-21 08:41:16 -05:00
functional_solution_sidenav [Breadcrumbs] Hide "deployment" in breadcrumb when on-prem (#220110) 2025-05-06 12:43:47 -07:00
functional_with_es_ssl [Security Solution] Discover Security Profile Changes + Event timeline redirection (#204756) 2025-06-24 01:39:29 +01:00
licensing_plugin [FIPS] Skips license check test for FIPS test suite (#216056) 2025-04-01 22:23:35 +01:00
load [ON-WEEK][POC] Playwright (#190803) 2024-09-06 13:09:18 +02:00
localization [Lens] speed up functional test suite by setting the time picker via ui settings (#199479) 2024-11-12 17:40:47 +01:00
observability_ai_assistant_api_integration [Obs AI Assistant] Specify embedding model during onboarding for the Knowledge Base (#218448) 2025-05-05 10:13:10 +02:00
observability_ai_assistant_functional Remove is_correction and confidence attributes from kb entry (#222814) 2025-06-13 16:46:05 +01:00
observability_api_integration [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
observability_functional [Observability] [Serverless] Introduce custom roles (#219861) 2025-06-13 22:03:49 -04:00
observability_onboarding_api_integration [Oblt Onboarding] Unify API keys naming (#220074) 2025-05-20 10:17:08 +02:00
osquery_cypress [EDR Workflows][Osquery][Cypress] Fallback for KibanaStatus error response when fetching kibana version (#218240) 2025-04-16 10:43:10 +02:00
plugin_api_perf [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
plugin_functional SKA: Relocate /test to /src/platform/test (#210956) 2025-03-14 16:57:23 +00:00
profiling_cypress [Profiling] Migrate Profiling Cypress tests to on_merge from on_merge_unsupported_ftrs (#206727) 2025-01-21 17:09:42 +01:00
reporting_api_integration [Response Ops][Reporting] Scheduled Reports (#221028) 2025-06-19 15:20:18 +02:00
reporting_functional Separate export menu from share (#217109) 2025-06-02 17:54:38 +02:00
rule_registry [ResponseOps][Alerting] Do not return alerts from internally managed rule types (#223453) 2025-06-20 11:42:01 +02:00
saved_object_tagging Fix tagging listing integration test (#218431) 2025-04-17 13:56:18 +02:00
saved_objects_field_count [kbn-scout] add test config category to reporting (#210167) 2025-02-12 11:17:04 +01:00
scalability SKA: Relocate /test to /src/platform/test (#210956) 2025-03-14 16:57:23 +00:00
screenshot_creation [SKA] relocate alerting_api_integration tests (#222603) 2025-06-13 12:28:51 +02:00
search_sessions_integration Unskip discover async search test (#204827) 2025-03-11 09:24:22 -07:00
security_api_integration [Security][9.1] Security roles siemV3 migration for Global Artifact Management (#219566) 2025-06-23 16:14:13 +02:00
security_functional [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
security_solution_api_integration [SecuritySolution] Create PrivMon index import flow (#224822) 2025-06-24 10:09:06 +01:00
security_solution_cypress [Security Solution] Discover Security Profile Changes + Event timeline redirection (#204756) 2025-06-24 01:39:29 +01:00
security_solution_endpoint skip flaky suite (#219465) 2025-06-09 23:59:43 +01:00
security_solution_ftr [Docs] Replace @private with @internal (#224835) 2025-06-23 19:59:17 +02:00
security_solution_playwright [chore] update playwright to 1.50.1 (#210769) 2025-06-13 10:04:04 +02:00
session_view [Security][9.1] Security roles siemV3 migration for Global Artifact Management (#219566) 2025-06-23 16:14:13 +02:00
spaces_api_integration [Security][9.1] Security roles siemV3 migration for Global Artifact Management (#219566) 2025-06-23 16:14:13 +02:00
stack_functional_integration [ML] Moves job and trained model management features into Stack Management (#204290) 2025-04-08 19:52:16 +02:00
task_manager_claimer_update_by_query [Authz] Mandatory Security Config (#215180) 2025-03-27 12:04:53 -07:00
ui_capabilities Disable allowAbsoluteUrls for axios (#215138) 2025-03-25 09:52:36 +01:00
upgrade Optimize existing image assets with lossless compression (#223998) 2025-06-19 16:44:13 +02:00
upgrade_assistant_integration [UA] Forwardport 8.x UA commits into main (#218957) 2025-05-05 12:55:47 +02:00
usage_collection Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-core (#201653) 2025-01-04 11:47:24 -07:00
.gitignore SKA: Update and breakdown x-pack/.gitignore (#212341) 2025-02-25 11:34:42 +01:00
kibana.jsonc Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
tsconfig.json [Intercept] Setup intervals for intercept in Kibana offerings (#221743) 2025-06-23 20:45:31 +02:00