mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Security Solution][Exceptions] - Add exception list duplication options with and without expired items (#154991)
## Summary Adds the following: - Add the option to duplicate from the shared exception list management actions dropdowns - User can select to include exception items with expired TTL - User can select to not include exception items with expired TTL - Cypress tests added for both options
This commit is contained in:
parent
fdc23f570e
commit
11155329cc
67 changed files with 2303 additions and 332 deletions
|
@ -32,6 +32,7 @@ import {
|
|||
GetExceptionFilterFromExceptionListIdsProps,
|
||||
GetExceptionFilterFromExceptionsProps,
|
||||
ExceptionFilterResponse,
|
||||
DuplicateExceptionListProps,
|
||||
} from '@kbn/securitysolution-io-ts-list-types';
|
||||
|
||||
import {
|
||||
|
@ -617,3 +618,31 @@ export const getExceptionFilterFromExceptions = async ({
|
|||
}),
|
||||
signal,
|
||||
});
|
||||
|
||||
/**
|
||||
* Duplicate an ExceptionList and its items by providing a ExceptionList list_id
|
||||
*
|
||||
* @param http Kibana http service
|
||||
* @param includeExpiredExceptions boolean for including exception items with expired TTL
|
||||
* @param listId ExceptionList LIST_ID (not id)
|
||||
* @param namespaceType ExceptionList namespace_type
|
||||
* @param signal to cancel request
|
||||
*
|
||||
* @throws An error if response is not OK
|
||||
*/
|
||||
export const duplicateExceptionList = async ({
|
||||
http,
|
||||
includeExpiredExceptions,
|
||||
listId,
|
||||
namespaceType,
|
||||
signal,
|
||||
}: DuplicateExceptionListProps): Promise<ExceptionListSchema> =>
|
||||
http.fetch<ExceptionListSchema>(`${EXCEPTION_LIST_URL}/_duplicate`, {
|
||||
method: 'POST',
|
||||
query: {
|
||||
list_id: listId,
|
||||
namespace_type: namespaceType,
|
||||
include_expired_exceptions: includeExpiredExceptions,
|
||||
},
|
||||
signal,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue