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.
[SIEM] [Detection engine] Add user permission to detection engine (el…
…astic#53778) * add logic to see if we can show signals or create signal index for user * fix unit test * fix spelling set up * Update msg from review * review II * fix type * review III * fix bug found by Garrett * fix snapshot
- Loading branch information
Showing
23 changed files
with
696 additions
and
113 deletions.
There are no files selected for viewing
8 changes: 6 additions & 2 deletions
8
x-pack/legacy/plugins/siem/public/components/empty_page/__snapshots__/index.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
...y/plugins/siem/public/containers/detection_engine/signals/errors_types/get_index_error.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,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { MessageBody } from '../../../../components/ml/api/throw_if_not_ok'; | ||
|
||
export class SignalIndexError extends Error { | ||
message: string = ''; | ||
statusCode: number = -1; | ||
error: string = ''; | ||
|
||
constructor(errObj: MessageBody) { | ||
super(errObj.message); | ||
this.message = errObj.message ?? ''; | ||
this.statusCode = errObj.statusCode ?? -1; | ||
this.error = errObj.error ?? ''; | ||
this.name = 'SignalIndexError'; | ||
|
||
// Set the prototype explicitly. | ||
Object.setPrototypeOf(this, SignalIndexError.prototype); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/errors_types/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,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './get_index_error'; | ||
export * from './post_index_error'; | ||
export * from './privilege_user_error'; |
24 changes: 24 additions & 0 deletions
24
.../plugins/siem/public/containers/detection_engine/signals/errors_types/post_index_error.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,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { MessageBody } from '../../../../components/ml/api/throw_if_not_ok'; | ||
|
||
export class PostSignalError extends Error { | ||
message: string = ''; | ||
statusCode: number = -1; | ||
error: string = ''; | ||
|
||
constructor(errObj: MessageBody) { | ||
super(errObj.message); | ||
this.message = errObj.message ?? ''; | ||
this.statusCode = errObj.statusCode ?? -1; | ||
this.error = errObj.error ?? ''; | ||
this.name = 'PostSignalError'; | ||
|
||
// Set the prototype explicitly. | ||
Object.setPrototypeOf(this, PostSignalError.prototype); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...gins/siem/public/containers/detection_engine/signals/errors_types/privilege_user_error.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,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { MessageBody } from '../../../../components/ml/api/throw_if_not_ok'; | ||
|
||
export class PrivilegeUserError extends Error { | ||
message: string = ''; | ||
statusCode: number = -1; | ||
error: string = ''; | ||
|
||
constructor(errObj: MessageBody) { | ||
super(errObj.message); | ||
this.message = errObj.message ?? ''; | ||
this.statusCode = errObj.statusCode ?? -1; | ||
this.error = errObj.error ?? ''; | ||
this.name = 'PrivilegeUserError'; | ||
|
||
// Set the prototype explicitly. | ||
Object.setPrototypeOf(this, PrivilegeUserError.prototype); | ||
} | ||
} |
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.