Skip to content

Commit f645f6a

Browse files
committed
Merge branch 'disable-rbac-alert-security-solution' of github.com:XavierM/kibana into disable-rbac-alert-security-solution
2 parents 87c18c4 + 5875240 commit f645f6a

File tree

3 files changed

+30
-37
lines changed

3 files changed

+30
-37
lines changed

x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ const DetectionEnginePageComponent: React.FC<DetectionEngineComponentProps> = ({
294294
{hasEncryptionKey != null && !hasEncryptionKey && <NoApiIntegrationKeyCallOut />}
295295
<NeedAdminForUpdateRulesCallOut />
296296
<MissingPrivilegesCallOut />
297-
{indicesExist && (!hasIndexRead || !canUserREAD) ? (
297+
{indicesExist && (hasIndexRead === false || canUserREAD === false) ? (
298298
<EmptyPage
299299
actions={emptyPageActions}
300300
message={i18n.ALERTS_FEATURE_NO_PERMISSIONS_MSG}

x-pack/test/api_integration/apis/security/privileges.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,7 @@ export default function ({ getService }: FtrProviderContext) {
3232
actions: ['all', 'read'],
3333
stackAlerts: ['all', 'read'],
3434
ml: ['all', 'read'],
35-
siem: [
36-
'all',
37-
'read',
38-
'minimal_all',
39-
'minimal_read',
40-
'cases_all',
41-
'cases_read',
42-
'alerts_all',
43-
'alerts_read',
44-
],
35+
siem: ['all', 'read', 'minimal_all', 'minimal_read', 'cases_all', 'cases_read'],
4536
observabilityCases: ['all', 'read'],
4637
uptime: ['all', 'read'],
4738
infrastructure: ['all', 'read'],

x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_index.ts

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ export default ({ getService }: FtrProviderContext) => {
8282
expect(body).to.eql({ message: 'index for this space does not exist', status_code: 404 });
8383
});
8484

85-
it('should be able to create a signal index when it has not been created yet', async () => {
85+
it('should NOT be able to create a signal index when it has not been created yet. Should return a 403 and error that the user is unauthorized', async () => {
8686
const { body } = await supertestWithoutAuth
8787
.post(DETECTION_ENGINE_INDEX_URL)
8888
.set('kbn-xsrf', 'true')
8989
.auth(role, 'changeme')
9090
.send()
91-
.expect(200);
92-
93-
expect(body).to.eql({ acknowledged: true });
91+
.expect(403);
92+
expect(body.message).to.match(/^security_exception/);
93+
expect(body.status_code).to.eql(403);
9494
});
9595

9696
it('should be able to read the index name and status as not being outdated', async () => {
@@ -103,7 +103,7 @@ export default ({ getService }: FtrProviderContext) => {
103103
.send()
104104
.expect(200);
105105
expect(body).to.eql({
106-
index_mapping_outdated: false,
106+
index_mapping_outdated: null,
107107
name: `${DEFAULT_SIGNALS_INDEX}-default`,
108108
});
109109
});
@@ -129,15 +129,15 @@ export default ({ getService }: FtrProviderContext) => {
129129
expect(body).to.eql({ message: 'index for this space does not exist', status_code: 404 });
130130
});
131131

132-
it('should be able to create a signal index when it has not been created yet.', async () => {
132+
it('should NOT be able to create a signal index when it has not been created yet. Should return a 403 and error that the user is unauthorized', async () => {
133133
const { body } = await supertestWithoutAuth
134134
.post(DETECTION_ENGINE_INDEX_URL)
135135
.set('kbn-xsrf', 'true')
136136
.auth(role, 'changeme')
137137
.send()
138-
.expect(200);
139-
140-
expect(body).to.eql({ acknowledged: true });
138+
.expect(403);
139+
expect(body.message).to.match(/^security_exception/);
140+
expect(body.status_code).to.eql(403);
141141
});
142142

143143
it('should be able to read the index name and status as not being outdated', async () => {
@@ -150,7 +150,7 @@ export default ({ getService }: FtrProviderContext) => {
150150
.send()
151151
.expect(200);
152152
expect(body).to.eql({
153-
index_mapping_outdated: false,
153+
index_mapping_outdated: null,
154154
name: `${DEFAULT_SIGNALS_INDEX}-default`,
155155
});
156156
});
@@ -226,15 +226,15 @@ export default ({ getService }: FtrProviderContext) => {
226226
expect(body).to.eql({ message: 'index for this space does not exist', status_code: 404 });
227227
});
228228

229-
it('should be able to create a signal index when it has not been created yet', async () => {
229+
it('should NOT be able to create a signal index when it has not been created yet. Should return a 403 and error that the user is unauthorized', async () => {
230230
const { body } = await supertestWithoutAuth
231231
.post(DETECTION_ENGINE_INDEX_URL)
232232
.set('kbn-xsrf', 'true')
233233
.auth(role, 'changeme')
234234
.send()
235-
.expect(200);
236-
237-
expect(body).to.eql({ acknowledged: true });
235+
.expect(403);
236+
expect(body.message).to.match(/^security_exception/);
237+
expect(body.status_code).to.eql(403);
238238
});
239239

240240
it('should be able to read the index name and status as not being outdated', async () => {
@@ -272,16 +272,16 @@ export default ({ getService }: FtrProviderContext) => {
272272
.expect(404);
273273
expect(body).to.eql({ message: 'index for this space does not exist', status_code: 404 });
274274
});
275-
// here
276-
it('should be able to create a signal index when it has not been created yet', async () => {
275+
276+
it('should NOT be able to create a signal index when it has not been created yet. Should return a 403 and error that the user is unauthorized', async () => {
277277
const { body } = await supertestWithoutAuth
278278
.post(DETECTION_ENGINE_INDEX_URL)
279279
.set('kbn-xsrf', 'true')
280280
.auth(role, 'changeme')
281281
.send()
282-
.expect(200);
283-
284-
expect(body).to.eql({ acknowledged: true });
282+
.expect(403);
283+
expect(body.message).to.match(/^security_exception/);
284+
expect(body.status_code).to.eql(403);
285285
});
286286

287287
it('should be able to read the index name and status as not being outdated', async () => {
@@ -294,7 +294,7 @@ export default ({ getService }: FtrProviderContext) => {
294294
.send()
295295
.expect(200);
296296
expect(body).to.eql({
297-
index_mapping_outdated: false,
297+
index_mapping_outdated: null,
298298
name: `${DEFAULT_SIGNALS_INDEX}-default`,
299299
});
300300
});
@@ -370,14 +370,15 @@ export default ({ getService }: FtrProviderContext) => {
370370
expect(body).to.eql({ message: 'index for this space does not exist', status_code: 404 });
371371
});
372372

373-
it('should be able to create a signal index when it has not been created yet', async () => {
373+
it('should NOT be able to create a signal index when it has not been created yet. Should return a 401 unauthorized', async () => {
374374
const { body } = await supertestWithoutAuth
375375
.post(DETECTION_ENGINE_INDEX_URL)
376376
.set('kbn-xsrf', 'true')
377377
.auth(role, 'changeme')
378378
.send()
379-
.expect(200);
380-
expect(body).to.eql({ acknowledged: true });
379+
.expect(403);
380+
expect(body.message).to.match(/^security_exception/);
381+
expect(body.status_code).to.eql(403);
381382
});
382383

383384
it('should be able to read the index name and status as being outdated.', async () => {
@@ -416,14 +417,15 @@ export default ({ getService }: FtrProviderContext) => {
416417
expect(body).to.eql({ message: 'index for this space does not exist', status_code: 404 });
417418
});
418419

419-
it('should be able to create a signal index when it has not been created yet', async () => {
420+
it('should NOT be able to create a signal index when it has not been created yet. Should return a 401 unauthorized', async () => {
420421
const { body } = await supertestWithoutAuth
421422
.post(DETECTION_ENGINE_INDEX_URL)
422423
.set('kbn-xsrf', 'true')
423424
.auth(role, 'changeme')
424425
.send()
425-
.expect(200);
426-
expect(body).to.eql({ acknowledged: true });
426+
.expect(403);
427+
expect(body.message).to.match(/^security_exception/);
428+
expect(body.status_code).to.eql(403);
427429
});
428430

429431
it('should be able to read the index name and status as being outdated.', async () => {

0 commit comments

Comments
 (0)