-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Permission II (#54292)
* allow read only user with no CRUD * use ../../lib/kibana * fix timeline-template * add re-routing on page * bug * cleanup * review I * review II * a pretty shameful bug I will live thanks Frank * bug select rule * only activate deactivate if user has the manage permission * add permissions rule with manage api key * bug on batch action for rules * add permissions to write status on signal
- Loading branch information
Showing
34 changed files
with
953 additions
and
339 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
6 changes: 3 additions & 3 deletions
6
x-pack/legacy/plugins/siem/public/components/stat_items/__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
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
26 changes: 26 additions & 0 deletions
26
.../plugins/siem/public/pages/detection_engine/components/no_write_signals_callout/index.tsx
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,26 @@ | ||
/* | ||
* 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 { EuiCallOut, EuiButton } from '@elastic/eui'; | ||
import React, { memo, useCallback, useState } from 'react'; | ||
|
||
import * as i18n from './translations'; | ||
|
||
const NoWriteSignalsCallOutComponent = () => { | ||
const [showCallOut, setShowCallOut] = useState(true); | ||
const handleCallOut = useCallback(() => setShowCallOut(false), [setShowCallOut]); | ||
|
||
return showCallOut ? ( | ||
<EuiCallOut title={i18n.NO_WRITE_SIGNALS_CALLOUT_TITLE} color="warning" iconType="alert"> | ||
<p>{i18n.NO_WRITE_SIGNALS_CALLOUT_MSG}</p> | ||
<EuiButton color="warning" onClick={handleCallOut}> | ||
{i18n.DISMISS_CALLOUT} | ||
</EuiButton> | ||
</EuiCallOut> | ||
) : null; | ||
}; | ||
|
||
export const NoWriteSignalsCallOut = memo(NoWriteSignalsCallOutComponent); |
29 changes: 29 additions & 0 deletions
29
...ns/siem/public/pages/detection_engine/components/no_write_signals_callout/translations.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,29 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
|
||
export const NO_WRITE_SIGNALS_CALLOUT_TITLE = i18n.translate( | ||
'xpack.siem.detectionEngine.noWriteSignalsCallOutTitle', | ||
{ | ||
defaultMessage: 'Signals index permissions required', | ||
} | ||
); | ||
|
||
export const NO_WRITE_SIGNALS_CALLOUT_MSG = i18n.translate( | ||
'xpack.siem.detectionEngine.noWriteSignalsCallOutMsg', | ||
{ | ||
defaultMessage: | ||
'You are currently missing the required permissions to update signals. Please contact your administrator for further assistance.', | ||
} | ||
); | ||
|
||
export const DISMISS_CALLOUT = i18n.translate( | ||
'xpack.siem.detectionEngine.dismissNoWriteSignalButton', | ||
{ | ||
defaultMessage: 'Dismiss', | ||
} | ||
); |
Oops, something went wrong.