forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Entity Analytics][UI] UI changes for Risk Engine to include closed a…
…lerts for risk score calculation (elastic#201909) ## Summary We are introducing a new feature that allows users to include "closed" alerts in risk score calculations. Users can toggle a button to include closed alerts in the risk score calculation and specify a date/time range for the calculation. Additionally, they can preview the data before finalising and saving these changes for the next engine run. ![Image](https://github.com/user-attachments/assets/5f91c990-22d6-46e5-8a7b-9875003867e4) ### **Note : This PR is an extension to the following PRs.** - [API] : elastic#201344 - [API] : elastic#201397 ### 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/packages/kbn-i18n/README.md) - [x] [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 - [ ] 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) --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
a9f076c
commit a95ec61
Showing
39 changed files
with
1,615 additions
and
164 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
54 changes: 54 additions & 0 deletions
54
...lution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.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,54 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* NOTICE: Do not edit this file manually. | ||
* This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
* | ||
* info: | ||
* title: Risk Scoring API | ||
* version: 2023-10-31 | ||
*/ | ||
|
||
import { z } from '@kbn/zod'; | ||
|
||
export type ConfigureRiskEngineSavedObjectErrorResponse = z.infer< | ||
typeof ConfigureRiskEngineSavedObjectErrorResponse | ||
>; | ||
export const ConfigureRiskEngineSavedObjectErrorResponse = z.object({ | ||
risk_engine_saved_object_configured: z.boolean(), | ||
errors: z.array( | ||
z.object({ | ||
seq: z.number().int(), | ||
error: z.string(), | ||
}) | ||
), | ||
}); | ||
|
||
export type ConfigureRiskEngineSavedObjectRequestBody = z.infer< | ||
typeof ConfigureRiskEngineSavedObjectRequestBody | ||
>; | ||
export const ConfigureRiskEngineSavedObjectRequestBody = z.object({ | ||
exclude_alert_statuses: z.array(z.string()).optional(), | ||
range: z | ||
.object({ | ||
start: z.string().optional(), | ||
end: z.string().optional(), | ||
}) | ||
.optional(), | ||
exclude_alert_tags: z.array(z.string()).optional(), | ||
}); | ||
export type ConfigureRiskEngineSavedObjectRequestBodyInput = z.input< | ||
typeof ConfigureRiskEngineSavedObjectRequestBody | ||
>; | ||
|
||
export type ConfigureRiskEngineSavedObjectResponse = z.infer< | ||
typeof ConfigureRiskEngineSavedObjectResponse | ||
>; | ||
export const ConfigureRiskEngineSavedObjectResponse = z.object({ | ||
risk_engine_saved_object_configured: z.boolean().optional(), | ||
}); |
81 changes: 81 additions & 0 deletions
81
...n/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml
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,81 @@ | ||
openapi: 3.0.0 | ||
info: | ||
version: '2023-10-31' | ||
title: Risk Scoring API | ||
description: These APIs allow the consumer to configure the Risk Engine Saved Object. | ||
paths: | ||
/api/risk_score/engine/saved_object/configure: | ||
patch: | ||
x-labels: [ess, serverless] | ||
x-codegen-enabled: true | ||
operationId: ConfigureRiskEngineSavedObject | ||
summary: Configure the Risk Engine Saved Object | ||
description: Configuring the Risk Engine Saved Object | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
exclude_alert_statuses: | ||
type: array | ||
items: | ||
type: string | ||
range: | ||
type: object | ||
properties: | ||
start: | ||
type: string | ||
end: | ||
type: string | ||
exclude_alert_tags: | ||
type: array | ||
items: | ||
type: string | ||
responses: | ||
'200': | ||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
risk_engine_saved_object_configured: | ||
type: boolean | ||
'400': | ||
description: Task manager is unavailable | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../common/common.schema.yaml#/components/schemas/TaskManagerUnavailableResponse' | ||
default: | ||
description: Unexpected error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ConfigureRiskEngineSavedObjectErrorResponse' | ||
|
||
components: | ||
schemas: | ||
ConfigureRiskEngineSavedObjectErrorResponse: | ||
type: object | ||
required: | ||
- risk_engine_saved_object_configured | ||
- errors | ||
properties: | ||
risk_engine_saved_object_configured: | ||
type: boolean | ||
example: false | ||
errors: | ||
type: array | ||
items: | ||
type: object | ||
required: | ||
- seq | ||
- error | ||
properties: | ||
seq: | ||
type: integer | ||
error: | ||
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
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
Oops, something went wrong.