Skip to content

Commit

Permalink
[Security Solution][Detections] Reverts rules table tag filter to use…
Browse files Browse the repository at this point in the history
… AND operator (#79920)
  • Loading branch information
dplumlee committed Oct 8, 2020
1 parent ef37063 commit a7d7442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ describe('Detections Rules API', () => {
expect(fetchMock).toHaveBeenCalledWith('/api/detection_engine/rules/_find', {
method: 'GET',
query: {
filter: 'alert.attributes.tags: "hello" OR alert.attributes.tags: "world"',
filter: 'alert.attributes.tags: "hello" AND alert.attributes.tags: "world"',
page: 1,
per_page: 20,
sort_field: 'enabled',
Expand Down Expand Up @@ -297,7 +297,7 @@ describe('Detections Rules API', () => {
method: 'GET',
query: {
filter:
'alert.attributes.name: ruleName AND alert.attributes.tags: "__internal_immutable:false" AND alert.attributes.tags: "__internal_immutable:true" AND (alert.attributes.tags: "hello" OR alert.attributes.tags: "world")',
'alert.attributes.name: ruleName AND alert.attributes.tags: "__internal_immutable:false" AND alert.attributes.tags: "__internal_immutable:true" AND (alert.attributes.tags: "hello" AND alert.attributes.tags: "world")',
page: 1,
per_page: 20,
sort_field: 'enabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const fetchRules = async ({

const tags = [
...(filterOptions.tags?.map((t) => `alert.attributes.tags: "${t.replace(/"/g, '\\"')}"`) ?? []),
].join(' OR ');
].join(' AND ');

const filterString =
filtersWithoutTags !== '' && tags !== ''
Expand Down

0 comments on commit a7d7442

Please sign in to comment.