Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
82156ad
initial commit
logeekal Apr 29, 2025
53d61b4
fix: integration tests + rules only
logeekal Apr 29, 2025
6d12919
tests: all integration tests passing
logeekal Apr 29, 2025
ebb967f
enhance delete tests
logeekal Apr 29, 2025
dea1fcb
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine Apr 29, 2025
5e20db9
fix: types
logeekal Apr 29, 2025
664da82
fix: failing tests
logeekal Apr 30, 2025
40191a1
housekeeping
logeekal May 2, 2025
85b9865
more housekeeping
logeekal May 2, 2025
44222eb
Merge branch 'main' into siem_migrations_new_endpoint
logeekal May 2, 2025
4b3d458
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine May 2, 2025
75617a7
fix: types
logeekal May 2, 2025
c746e4a
Merge branch 'main' into siem_migrations_new_endpoint
logeekal May 5, 2025
fe36eba
fix: rules page
logeekal May 6, 2025
a26fb0e
fix: rules update
logeekal May 6, 2025
8fab789
tests: cypress
logeekal May 7, 2025
0cf1b1f
chore: Change start/stop method PUT-->POST
logeekal May 7, 2025
7bd6341
fix: remove last execution references
logeekal May 7, 2025
886ae7c
fix: housekeeping add/create rules
logeekal May 7, 2025
9a37d3f
add migration
logeekal May 8, 2025
062c9d0
more tests
logeekal May 9, 2025
fb8e9bb
fix: delete logic
logeekal May 9, 2025
bb42897
types + tests
logeekal May 9, 2025
e9e4e8c
mocks
logeekal May 9, 2025
43cdb02
add isNotFoundError
logeekal May 11, 2025
ae981e4
rename ruleMigration --> migrationRule
logeekal May 19, 2025
8e5a3f9
fix: isNotFoundError tests + types
logeekal May 19, 2025
3a958df
rename ruleMigration --> migrationRule
logeekal May 19, 2025
67d481a
fix: cypress
logeekal May 19, 2025
d012c79
housekeeping
logeekal May 19, 2025
596002c
tests + consistent error codes
logeekal May 19, 2025
a3610ba
fix: cypress tests
logeekal May 19, 2025
9ef0c81
fix: tests for data service
logeekal May 19, 2025
45852f9
fix: tests
logeekal May 19, 2025
c6a45ae
Merge branch 'main' into siem_migrations_new_endpoint
logeekal May 19, 2025
6115d50
remove unnecessary line
logeekal May 19, 2025
a3415aa
PR Feedback: refactoring
logeekal May 21, 2025
02c4c6e
PR Feedback: Removed migration object from middleware
logeekal May 21, 2025
8b5b7c7
chores: housekeeping
logeekal May 21, 2025
cae736d
PR Feedback: better index pattern fetching
logeekal May 21, 2025
b629c21
fix: size issue when deleting resources
logeekal May 21, 2025
283b674
fix: bulk rules in test
logeekal May 21, 2025
a2f1f5e
fix: renames
logeekal May 22, 2025
7a8b5e0
Merge branch 'main' into siem_migrations_new_endpoint
logeekal May 22, 2025
4f740bb
Merge branch 'main' into siem_migrations_new_endpoint
logeekal May 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@ import type {
ResolveTimelineResponse,
} from './timeline/resolve_timeline/resolve_timeline_route.gen';
import type {
CreateRuleMigrationRequestParamsInput,
CreateRuleMigrationRequestBodyInput,
CreateRuleMigrationResponse,
CreateRuleMigrationRulesRequestParamsInput,
CreateRuleMigrationRulesRequestBodyInput,
DeleteRuleMigrationRequestParamsInput,
GetAllStatsRuleMigrationResponse,
GetRuleMigrationRequestQueryInput,
GetRuleMigrationRequestParamsInput,
GetRuleMigrationResponse,
GetRuleMigrationIntegrationsResponse,
Expand All @@ -388,6 +388,9 @@ import type {
GetRuleMigrationResourcesResponse,
GetRuleMigrationResourcesMissingRequestParamsInput,
GetRuleMigrationResourcesMissingResponse,
GetRuleMigrationRulesRequestQueryInput,
GetRuleMigrationRulesRequestParamsInput,
GetRuleMigrationRulesResponse,
GetRuleMigrationStatsRequestParamsInput,
GetRuleMigrationStatsResponse,
GetRuleMigrationTranslationStatsRequestParamsInput,
Expand All @@ -401,8 +404,10 @@ import type {
StopRuleMigrationRequestParamsInput,
StopRuleMigrationResponse,
UpdateRuleMigrationRequestParamsInput,
UpdateRuleMigrationRequestBodyInput,
UpdateRuleMigrationResponse,
UpdateRuleMigrationRulesRequestParamsInput,
UpdateRuleMigrationRulesRequestBodyInput,
UpdateRuleMigrationRulesResponse,
UpsertRuleMigrationResourcesRequestParamsInput,
UpsertRuleMigrationResourcesRequestBodyInput,
UpsertRuleMigrationResourcesResponse,
Expand Down Expand Up @@ -726,13 +731,28 @@ For detailed information on Kibana actions and alerting, and additional API call
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Creates a new SIEM rules migration using the original vendor rules provided
* Creates a new rule migration and returns the corresponding migration_id
*/
async createRuleMigration(props: CreateRuleMigrationProps) {
async createRuleMigration() {
this.log.info(`${new Date().toISOString()} Calling API CreateRuleMigration`);
return this.kbnClient
.request<CreateRuleMigrationResponse>({
path: replaceParams('/internal/siem_migrations/rules/{migration_id}', props.params),
path: '/internal/siem_migrations/rules',
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'PUT',
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Adds original vendor rules to an already existing migration. Can be called multiple times to add more rules
*/
async createRuleMigrationRules(props: CreateRuleMigrationRulesProps) {
this.log.info(`${new Date().toISOString()} Calling API CreateRuleMigrationRules`);
return this.kbnClient
.request({
path: replaceParams('/internal/siem_migrations/rules/{migration_id}/rules', props.params),
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
Expand Down Expand Up @@ -869,6 +889,21 @@ The difference between the `id` and `rule_id` is that the `id` is a unique rule
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Deletes a rule migration document stored in the system given the rule migration id
*/
async deleteRuleMigration(props: DeleteRuleMigrationProps) {
this.log.info(`${new Date().toISOString()} Calling API DeleteRuleMigration`);
return this.kbnClient
.request({
path: replaceParams('/internal/siem_migrations/rules/{migration_id}', props.params),
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'DELETE',
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Delete one or more Timelines or Timeline templates.
*/
Expand Down Expand Up @@ -1496,7 +1531,7 @@ finalize it.
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Retrieves the rule documents stored in the system given the rule migration id
* Retrieves the rule migration document stored in the system given the rule migration id
*/
async getRuleMigration(props: GetRuleMigrationProps) {
this.log.info(`${new Date().toISOString()} Calling API GetRuleMigration`);
Expand All @@ -1507,8 +1542,6 @@ finalize it.
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'GET',

query: props.query,
})
.catch(catchAxiosErrorFormatAndThrow);
}
Expand Down Expand Up @@ -1598,6 +1631,23 @@ finalize it.
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Retrieves the the list of rules included in a migration given the migration id
*/
async getRuleMigrationRules(props: GetRuleMigrationRulesProps) {
this.log.info(`${new Date().toISOString()} Calling API GetRuleMigrationRules`);
return this.kbnClient
.request<GetRuleMigrationRulesResponse>({
path: replaceParams('/internal/siem_migrations/rules/{migration_id}/rules', props.params),
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'GET',

query: props.query,
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Retrieves the stats of a SIEM rules migration using the migration id provided
*/
Expand Down Expand Up @@ -2331,7 +2381,7 @@ The difference between the `id` and `rule_id` is that the `id` is a unique rule
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'PUT',
method: 'POST',
body: props.body,
})
.catch(catchAxiosErrorFormatAndThrow);
Expand Down Expand Up @@ -2359,7 +2409,7 @@ The difference between the `id` and `rule_id` is that the `id` is a unique rule
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'PUT',
method: 'POST',
})
.catch(catchAxiosErrorFormatAndThrow);
}
Expand Down Expand Up @@ -2433,7 +2483,7 @@ The difference between the `id` and `rule_id` is that the `id` is a unique rule
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Updates rules migrations attributes
* Updates rules migrations data
*/
async updateRuleMigration(props: UpdateRuleMigrationProps) {
this.log.info(`${new Date().toISOString()} Calling API UpdateRuleMigration`);
Expand All @@ -2443,7 +2493,22 @@ The difference between the `id` and `rule_id` is that the `id` is a unique rule
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'PUT',
method: 'PATCH',
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Updates rules migrations attributes
*/
async updateRuleMigrationRules(props: UpdateRuleMigrationRulesProps) {
this.log.info(`${new Date().toISOString()} Calling API UpdateRuleMigrationRules`);
return this.kbnClient
.request<UpdateRuleMigrationRulesResponse>({
path: replaceParams('/internal/siem_migrations/rules/{migration_id}/rules', props.params),
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '1',
},
method: 'PATCH',
body: props.body,
})
.catch(catchAxiosErrorFormatAndThrow);
Expand Down Expand Up @@ -2522,9 +2587,9 @@ export interface CreatePrivMonUserProps {
export interface CreateRuleProps {
body: CreateRuleRequestBodyInput;
}
export interface CreateRuleMigrationProps {
params: CreateRuleMigrationRequestParamsInput;
body: CreateRuleMigrationRequestBodyInput;
export interface CreateRuleMigrationRulesProps {
params: CreateRuleMigrationRulesRequestParamsInput;
body: CreateRuleMigrationRulesRequestBodyInput;
}
export interface CreateTimelinesProps {
body: CreateTimelinesRequestBodyInput;
Expand All @@ -2549,6 +2614,9 @@ export interface DeletePrivMonUserProps {
export interface DeleteRuleProps {
query: DeleteRuleRequestQueryInput;
}
export interface DeleteRuleMigrationProps {
params: DeleteRuleMigrationRequestParamsInput;
}
export interface DeleteTimelinesProps {
body: DeleteTimelinesRequestBodyInput;
}
Expand Down Expand Up @@ -2654,7 +2722,6 @@ export interface GetRuleExecutionResultsProps {
params: GetRuleExecutionResultsRequestParamsInput;
}
export interface GetRuleMigrationProps {
query: GetRuleMigrationRequestQueryInput;
params: GetRuleMigrationRequestParamsInput;
}
export interface GetRuleMigrationPrebuiltRulesProps {
Expand All @@ -2667,6 +2734,10 @@ export interface GetRuleMigrationResourcesProps {
export interface GetRuleMigrationResourcesMissingProps {
params: GetRuleMigrationResourcesMissingRequestParamsInput;
}
export interface GetRuleMigrationRulesProps {
query: GetRuleMigrationRulesRequestQueryInput;
params: GetRuleMigrationRulesRequestParamsInput;
}
export interface GetRuleMigrationStatsProps {
params: GetRuleMigrationStatsRequestParamsInput;
}
Expand Down Expand Up @@ -2793,7 +2864,10 @@ export interface UpdateRuleProps {
}
export interface UpdateRuleMigrationProps {
params: UpdateRuleMigrationRequestParamsInput;
body: UpdateRuleMigrationRequestBodyInput;
}
export interface UpdateRuleMigrationRulesProps {
params: UpdateRuleMigrationRulesRequestParamsInput;
body: UpdateRuleMigrationRulesRequestBodyInput;
}
export interface UpdateWorkflowInsightProps {
params: UpdateWorkflowInsightRequestParamsInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ export const SIEM_RULE_MIGRATIONS_PATH = `${SIEM_MIGRATIONS_PATH}/rules` as cons
export const SIEM_RULE_MIGRATIONS_ALL_STATS_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/stats` as const;
export const SIEM_RULE_MIGRATIONS_INTEGRATIONS_PATH =
`${SIEM_RULE_MIGRATIONS_PATH}/integrations` as const;
export const SIEM_RULE_MIGRATION_CREATE_PATH =
`${SIEM_RULE_MIGRATIONS_PATH}/{migration_id?}` as const;
export const SIEM_RULE_MIGRATION_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/{migration_id}` as const;
export const SIEM_RULE_MIGRATION_RULES_PATH = `${SIEM_RULE_MIGRATION_PATH}/rules` as const;
export const SIEM_RULE_MIGRATION_START_PATH = `${SIEM_RULE_MIGRATION_PATH}/start` as const;
export const SIEM_RULE_MIGRATION_STATS_PATH = `${SIEM_RULE_MIGRATION_PATH}/stats` as const;
export const SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH =
Expand Down
Loading