Skip to content

Commit

Permalink
[7.x] [Security Solution] [Detections] Bug fix for read privilege che…
Browse files Browse the repository at this point in the history
…ck during rule exec (#86852) (#86858)
  • Loading branch information
dhurley14 authored Dec 23, 2020
1 parent 1920f6a commit 9f202aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,16 @@ describe('rules_notification_alert_type', () => {
'myfa*': {
read: true,
},
'anotherindex*': {
read: true,
},
'some*': {
read: false,
},
},
application: {},
});
payload.params.index = ['some*', 'myfa*'];
payload.params.index = ['some*', 'myfa*', 'anotherindex*'];
await alert.executor(payload);
expect(ruleStatusService.partialFailure).toHaveBeenCalled();
expect(ruleStatusService.partialFailure.mock.calls[0][0]).toContain(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,7 @@ export const signalRulesAlertType = ({
(indexName) => privileges.index[indexName].read
);

if (
indexesWithReadPrivileges.length > 0 &&
indexesWithNoReadPrivileges.length >= indexesWithReadPrivileges.length
) {
if (indexesWithReadPrivileges.length > 0 && indexesWithNoReadPrivileges.length > 0) {
// some indices have read privileges others do not.
// set a partial failure status
const errorString = `Missing required read permissions on indexes: ${JSON.stringify(
Expand Down

0 comments on commit 9f202aa

Please sign in to comment.