-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Entity Store] Enablement UI (#196076)
### Entity store enablement UI This PR adds a UI to enable the Entity Store. ### How to test 1. Enable `entityStoreEnabled` experimental feature flag 2. Navigate to `Security > Dashboards > Entity Analytics` 3. Work through the distinct flows to enable the store * For example, choose to enable risk score together with the store 4. Navigate to `Security > Manage > Entity Store` to start/stop the store 5. Validate that the appropriate transforms and pipelines have been initialized and have the correct status (for example, via the Stack Management UI) EDIT: Enablement flow screenshots: #### Enable both risk score and entity store ![Screenshot 2024-10-15 at 12 14 40](https://github.com/user-attachments/assets/90ab2eaa-dd73-47b4-b940-c9549422e37c) #### Enable Risk score only (Entity store already enabled) ![Screenshot 2024-10-15 at 12 15 04](https://github.com/user-attachments/assets/3ef31857-7515-4636-adde-f6c6e7f7c13b) #### Modal to choose what to enable ![Screenshot 2024-10-15 at 12 14 48](https://github.com/user-attachments/assets/1746767a-cfb0-41c0-823c-cafac45bd901) #### New Entity Store management page ![Screenshot 2024-10-15 at 12 14 08](https://github.com/user-attachments/assets/aa2b8c63-1fcf-4a18-87d2-cecceaabd6cd) --------- Co-authored-by: jaredburgettelastic <[email protected]> Co-authored-by: machadoum <[email protected]> Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Mark Hopkin <[email protected]> Co-authored-by: natasha-moore-elastic <[email protected]>
- Loading branch information
1 parent
f0f1775
commit 58b2c6e
Showing
45 changed files
with
1,552 additions
and
433 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -38,6 +38,7 @@ components: | |
- started | ||
- stopped | ||
- updating | ||
- error | ||
|
||
IndexPattern: | ||
type: string | ||
|
This file contains 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 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 |
---|---|---|
|
@@ -806,6 +806,7 @@ components: | |
- started | ||
- stopped | ||
- updating | ||
- error | ||
type: string | ||
Entity: | ||
oneOf: | ||
|
This file contains 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 |
---|---|---|
|
@@ -806,6 +806,7 @@ components: | |
- started | ||
- stopped | ||
- updating | ||
- error | ||
type: string | ||
Entity: | ||
oneOf: | ||
|
This file contains 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 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 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 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
68 changes: 68 additions & 0 deletions
68
x-pack/plugins/security_solution/public/entity_analytics/api/entity_store.ts
This file contains 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,68 @@ | ||
/* | ||
* 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 { useMemo } from 'react'; | ||
import type { | ||
DeleteEntityEngineResponse, | ||
EntityType, | ||
GetEntityEngineResponse, | ||
InitEntityEngineResponse, | ||
ListEntityEnginesResponse, | ||
StopEntityEngineResponse, | ||
} from '../../../common/api/entity_analytics'; | ||
import { API_VERSIONS } from '../../../common/entity_analytics/constants'; | ||
import { useKibana } from '../../common/lib/kibana/kibana_react'; | ||
|
||
export const useEntityStoreRoutes = () => { | ||
const http = useKibana().services.http; | ||
|
||
return useMemo(() => { | ||
const initEntityStore = async (entityType: EntityType) => { | ||
return http.fetch<InitEntityEngineResponse>(`/api/entity_store/engines/${entityType}/init`, { | ||
method: 'POST', | ||
version: API_VERSIONS.public.v1, | ||
body: JSON.stringify({}), | ||
}); | ||
}; | ||
|
||
const stopEntityStore = async (entityType: EntityType) => { | ||
return http.fetch<StopEntityEngineResponse>(`/api/entity_store/engines/${entityType}/stop`, { | ||
method: 'POST', | ||
version: API_VERSIONS.public.v1, | ||
body: JSON.stringify({}), | ||
}); | ||
}; | ||
|
||
const getEntityEngine = async (entityType: EntityType) => { | ||
return http.fetch<GetEntityEngineResponse>(`/api/entity_store/engines/${entityType}`, { | ||
method: 'GET', | ||
version: API_VERSIONS.public.v1, | ||
}); | ||
}; | ||
|
||
const deleteEntityEngine = async (entityType: EntityType) => { | ||
return http.fetch<DeleteEntityEngineResponse>(`/api/entity_store/engines/${entityType}`, { | ||
method: 'DELETE', | ||
version: API_VERSIONS.public.v1, | ||
}); | ||
}; | ||
|
||
const listEntityEngines = async () => { | ||
return http.fetch<ListEntityEnginesResponse>(`/api/entity_store/engines`, { | ||
method: 'GET', | ||
version: API_VERSIONS.public.v1, | ||
}); | ||
}; | ||
|
||
return { | ||
initEntityStore, | ||
stopEntityStore, | ||
getEntityEngine, | ||
deleteEntityEngine, | ||
listEntityEngines, | ||
}; | ||
}, [http]); | ||
}; |
Oops, something went wrong.