-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Detections & Response] RBAC - Add Detection Alerts kibana feature #244637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 133 commits
7a7d60f
29b2c23
a59710c
19ca27a
c6a9bd3
48d484c
791d6e0
c6ce29e
9b5e196
10022c6
1c92349
5b57b64
90f2482
e00cc21
7719682
b389f5c
faf0bf2
b9d3cb0
42c8155
4a4942d
bcc6fc4
f4e537e
6c293e0
cf283a5
e53d7f7
2e3878b
2c533e2
a74b90f
5567ccb
b24a1da
ab90b8e
81e5675
fd20b57
b91144a
3a8835d
c519356
9a3a431
9f8c242
134e9e3
af65a0c
fa67e81
5b2614e
901eba7
5c628e7
3c6064e
f78cd3b
e42d1ae
604d509
4e73573
33c52be
30faef7
cb85069
6e9f9cc
5845cac
8de6415
de5553e
9b6b23e
dfb671b
d56a77f
a7f4526
164b934
e6ce514
fbec322
8863f31
d62eb64
8a69b95
9ae3dfb
06a4a75
3f17550
cbc49db
b0f002f
68da4f7
dc8e414
9f4755c
a66815f
84c6d94
dec7757
3be2559
94bc7b7
633d52f
4a65b47
08c475d
d9eabc4
e4e7779
ac1b06f
2e17ac6
ec761fb
13ab31a
621643f
2fbb7e7
2158f8d
25a5975
7c6a393
ff76f06
1824f6b
a57cc74
24e4de1
4010149
9fda17e
f0687ce
9f40ccd
7a6f6fd
b0e71fb
94e53bd
1726097
37ec32b
50e04ee
3059d0b
d4a8768
727b92f
9f7ba0d
30bcc83
33e2c75
3f80da1
2ced3ca
72e1531
2161a70
c999601
db86c73
6ba1108
ca1544a
ed96ccd
857acbe
d4da241
f6c7421
13dfdef
3dd699f
b914878
2192687
2129efe
f52d9c6
bedeb2b
3d38c19
2ce14bd
3eed09b
5517d72
ca54f79
b7ef23a
094253d
30057ab
db369f3
44305f8
3093b7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| 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 { ProductFeatureAlertsKey } from '../product_features_keys'; | ||
| import { getAlertsBaseKibanaFeature } from './kibana_features'; | ||
| import type { ProductFeatureParams } from '../types'; | ||
| import { alertsDefaultProductFeaturesConfig } from './product_feature_config'; | ||
|
|
||
| export const getAlertsFeature = (): ProductFeatureParams<ProductFeatureAlertsKey, string> => ({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder whether we should comment on what a security feature does. We have increasing number of security features where the boundary might be not 100% clear. There is a Google Sheet(s) describing the behavior but it lives separately. A comment could make the description clearer to the code. WDYT?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| baseKibanaFeature: getAlertsBaseKibanaFeature(), | ||
| baseKibanaSubFeatureIds: [], | ||
| subFeaturesMap: new Map(), | ||
| productFeatureConfig: alertsDefaultProductFeaturesConfig, | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /* | ||
| * 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 { DEFAULT_APP_CATEGORIES } from '@kbn/core-application-common'; | ||
| import { i18n } from '@kbn/i18n'; | ||
| import { SECURITY_SOLUTION_RULE_TYPE_IDS } from '@kbn/securitysolution-rules'; | ||
| import { DATA_VIEW_SAVED_OBJECT_TYPE } from '@kbn/data-views-plugin/common'; | ||
| import { | ||
| ALERTS_API_ALL, | ||
| ALERTS_API_READ, | ||
| APP_ID, | ||
| LEGACY_NOTIFICATIONS_ID, | ||
| ALERTS_FEATURE_ID, | ||
| SERVER_APP_ID, | ||
| ALERTS_UI_READ, | ||
| ALERTS_UI_EDIT, | ||
| INITIALIZE_SECURITY_SOLUTION, | ||
| USERS_API_READ, | ||
| } from '../constants'; | ||
| import { type BaseKibanaFeatureConfig } from '../types'; | ||
|
|
||
| const alertingFeatures = [LEGACY_NOTIFICATIONS_ID, ...SECURITY_SOLUTION_RULE_TYPE_IDS].map( | ||
| (ruleTypeId) => ({ | ||
| ruleTypeId, | ||
| consumers: [SERVER_APP_ID], | ||
| }) | ||
| ); | ||
|
|
||
| export const getAlertsBaseKibanaFeature = (): BaseKibanaFeatureConfig => ({ | ||
| id: ALERTS_FEATURE_ID, | ||
| name: i18n.translate( | ||
| 'securitySolutionPackages.features.featureRegistry.linkSecuritySolutionRolesAlertsTitle', | ||
| { | ||
| defaultMessage: 'Alerts', | ||
| } | ||
| ), | ||
| order: 1100, | ||
| category: DEFAULT_APP_CATEGORIES.security, | ||
| app: [ALERTS_FEATURE_ID, 'kibana', 'securitySolution'], | ||
| catalogue: [APP_ID], | ||
| alerting: alertingFeatures, | ||
| privileges: { | ||
| all: { | ||
| app: ['securitySolution', ALERTS_FEATURE_ID, 'kibana'], | ||
| catalogue: [APP_ID], | ||
| savedObject: { | ||
| all: [], | ||
| read: [DATA_VIEW_SAVED_OBJECT_TYPE], | ||
| }, | ||
| alerting: { | ||
| alert: { all: alertingFeatures }, | ||
| }, | ||
| ui: [ALERTS_UI_READ, ALERTS_UI_EDIT], | ||
| api: ['rac', INITIALIZE_SECURITY_SOLUTION, ALERTS_API_ALL, ALERTS_API_READ, USERS_API_READ], | ||
| }, | ||
| read: { | ||
| app: [ALERTS_FEATURE_ID, 'kibana', 'securitySolution'], | ||
| catalogue: [APP_ID], | ||
| savedObject: { | ||
| all: [], | ||
| read: [DATA_VIEW_SAVED_OBJECT_TYPE], | ||
| }, | ||
| alerting: { | ||
| alert: { read: alertingFeatures }, | ||
| }, | ||
| ui: [ALERTS_UI_READ], | ||
| api: ['rac', INITIALIZE_SECURITY_SOLUTION, ALERTS_API_READ, USERS_API_READ], | ||
| }, | ||
| }, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * 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 { ProductFeatureAlertsKey } from '../product_features_keys'; | ||
| import type { AlertsProductFeaturesConfig } from './types'; | ||
|
|
||
| export const alertsDefaultProductFeaturesConfig: AlertsProductFeaturesConfig = { | ||
| [ProductFeatureAlertsKey.externalDetections]: { | ||
| privileges: { | ||
| all: { | ||
| ui: ['external_detections'], | ||
| api: [], | ||
| }, | ||
| read: { | ||
| ui: ['external_detections'], | ||
| api: [], | ||
| }, | ||
| }, | ||
| }, | ||
| [ProductFeatureAlertsKey.detections]: { | ||
| privileges: { | ||
| all: { | ||
| ui: ['detections'], | ||
| api: ['bulkGetUserProfiles'], | ||
| }, | ||
| read: { | ||
| ui: ['detections'], | ||
| api: [], | ||
| }, | ||
| }, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* | ||
| * 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 { ProductFeatureAlertsKey } from '../product_features_keys'; | ||
| import type { ProductFeaturesConfig } from '../types'; | ||
|
|
||
| export type AlertsProductFeaturesConfig = ProductFeaturesConfig<ProductFeatureAlertsKey>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it a bug not taking
panel.itemsinto account?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's why I fixed it 😉 . However, it wasn't a bug prior to this branch, since there wasn't previously a user who could see the alerts table but lacked alert actions. I detailed this in 84c6d94.