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.
[Security Solution] Move risk score API schemas to /common/api (elast…
…ic#163032) Closes elastic/security-team#7101
- Loading branch information
1 parent
04e22b5
commit 7df8c13
Showing
25 changed files
with
147 additions
and
88 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
18 changes: 18 additions & 0 deletions
18
x-pack/plugins/security_solution/common/api/risk_score/create_index/create_index_route.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,18 @@ | ||
/* | ||
* 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 type { TypeOf } from '@kbn/config-schema'; | ||
import { schema } from '@kbn/config-schema'; | ||
|
||
export const createEsIndexRequestBody = schema.object({ | ||
index: schema.string({ minLength: 1 }), | ||
mappings: schema.maybe( | ||
schema.oneOf([schema.string(), schema.recordOf(schema.string({ minLength: 1 }), schema.any())]) | ||
), | ||
}); | ||
|
||
export type CreateEsIndexRequestBody = TypeOf<typeof createEsIndexRequestBody>; |
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
17 changes: 17 additions & 0 deletions
17
...ommon/api/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.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,17 @@ | ||
/* | ||
* 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 { schema } from '@kbn/config-schema'; | ||
|
||
export const createPrebuiltSavedObjectsRequestBody = { | ||
params: schema.object({ | ||
template_name: schema.oneOf([ | ||
schema.literal('hostRiskScoreDashboards'), | ||
schema.literal('userRiskScoreDashboards'), | ||
]), | ||
}), | ||
}; |
25 changes: 25 additions & 0 deletions
25
...ecurity_solution/common/api/risk_score/create_stored_script/create_stored_script_route.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,25 @@ | ||
/* | ||
* 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 type { TypeOf } from '@kbn/config-schema'; | ||
import { schema } from '@kbn/config-schema'; | ||
|
||
export const createStoredScriptRequestBody = schema.object({ | ||
id: schema.string({ minLength: 1 }), | ||
script: schema.object({ | ||
lang: schema.oneOf([ | ||
schema.string(), | ||
schema.literal('painless'), | ||
schema.literal('expression'), | ||
schema.literal('mustache'), | ||
schema.literal('java'), | ||
]), | ||
options: schema.maybe(schema.recordOf(schema.string(), schema.string())), | ||
source: schema.string(), | ||
}), | ||
}); | ||
|
||
export type CreateStoredScriptRequestBody = TypeOf<typeof createStoredScriptRequestBody>; |
12 changes: 12 additions & 0 deletions
12
...ck/plugins/security_solution/common/api/risk_score/delete_indices/delete_indices_route.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,12 @@ | ||
/* | ||
* 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 { schema } from '@kbn/config-schema'; | ||
|
||
export const deleteIndicesRequestBody = schema.object({ | ||
indices: schema.arrayOf(schema.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
15 changes: 15 additions & 0 deletions
15
...ecurity_solution/common/api/risk_score/delete_stored_script/delete_stored_script_route.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,15 @@ | ||
/* | ||
* 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 type { TypeOf } from '@kbn/config-schema'; | ||
import { schema } from '@kbn/config-schema'; | ||
|
||
export const deleteStoredScriptRequestBody = schema.object({ | ||
id: schema.string({ minLength: 1 }), | ||
}); | ||
|
||
export type DeleteStoredScriptRequestBody = TypeOf<typeof deleteStoredScriptRequestBody>; |
16 changes: 16 additions & 0 deletions
16
x-pack/plugins/security_solution/common/api/risk_score/index.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,16 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './create_index/create_index_route'; | ||
export * from './create_prebuilt_saved_objects/create_prebuilt_saved_objects_route'; | ||
export * from './create_stored_script/create_stored_script_route'; | ||
export * from './delete_indices/delete_indices_route'; | ||
export * from './delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route'; | ||
export * from './delete_stored_script/delete_stored_script_route'; | ||
export * from './index_status/index_status_route'; | ||
export * from './install_modules/install_modules_route'; | ||
export * from './read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route'; |
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
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
Oops, something went wrong.