+ {showDetails && (
+
+ )}
+ >
+ );
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_field_bucket.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_field_bucket.tsx
new file mode 100644
index 0000000000000..5a2b855828f53
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_field_bucket.tsx
@@ -0,0 +1,99 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import { StringFieldProgressBar } from './string_progress_bar';
+import { Bucket } from './types';
+import { IndexPatternField } from '../../../../../../../../plugins/data/public';
+
+interface Props {
+ bucket: Bucket;
+ field: IndexPatternField;
+ onAddFilter: (field: IndexPatternField | string, value: string, type: '+' | '-') => void;
+}
+
+export function DiscoverFieldBucket({ field, bucket, onAddFilter }: Props) {
+ const emptyTxt = i18n.translate('kbn.discover.fieldChooser.detailViews.emptyStringText', {
+ defaultMessage: 'Empty string',
+ });
+ const addLabel = i18n.translate(
+ 'kbn.discover.fieldChooser.detailViews.filterValueButtonAriaLabel',
+ {
+ defaultMessage: 'Filter for {field}: "{value}"',
+ values: { value: bucket.value, field: field.name },
+ }
+ );
+ const removeLabel = i18n.translate(
+ 'kbn.discover.fieldChooser.detailViews.filterOutValueButtonAriaLabel',
+ {
+ defaultMessage: 'Filter out {field}: "{value}"',
+ values: { value: bucket.value, field: field.name },
+ }
+ );
+
+ return (
+ <>
+
+
+
+ {bucket.display === '' ? emptyTxt : bucket.display}
+
+
+ {field.filterable && (
+
+
+
+ )}
+
+
+ >
+ );
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_field_details.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_field_details.tsx
new file mode 100644
index 0000000000000..6266c29745718
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_field_details.tsx
@@ -0,0 +1,98 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { EuiLink, EuiSpacer, EuiIconTip, EuiText } from '@elastic/eui';
+import { FormattedMessage } from '@kbn/i18n/react';
+import { DiscoverFieldBucket } from './discover_field_bucket';
+import { getWarnings } from './lib/get_warnings';
+import { Bucket, FieldDetails } from './types';
+import { IndexPatternField, IndexPattern } from '../../../../../../../../plugins/data/public';
+
+interface DiscoverFieldDetailsProps {
+ field: IndexPatternField;
+ indexPattern: IndexPattern;
+ details: FieldDetails;
+ onAddFilter: (field: IndexPatternField | string, value: string, type: '+' | '-') => void;
+}
+
+export function DiscoverFieldDetails({
+ field,
+ indexPattern,
+ details,
+ onAddFilter,
+}: DiscoverFieldDetailsProps) {
+ const warnings = getWarnings(field);
+
+ return (
+
+
+ );
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern_directive.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_sidebar_directive.ts
similarity index 61%
rename from src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern_directive.tsx
rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_sidebar_directive.ts
index d6527b0d7beed..9dcb459f83613 100644
--- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_index_pattern_directive.tsx
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/discover_sidebar_directive.ts
@@ -16,25 +16,20 @@
* specific language governing permissions and limitations
* under the License.
*/
-import React from 'react';
import { wrapInI18nContext } from '../../../kibana_services';
-import { DiscoverIndexPattern, DiscoverIndexPatternProps } from './discover_index_pattern';
+import { DiscoverSidebar } from './discover_sidebar';
-/**
- * At initial rendering the angular directive the selectedIndexPattern prop is undefined
- * This wrapper catches this, had to be introduced to satisfy eslint
- */
-export function DiscoverIndexPatternWrapper(props: DiscoverIndexPatternProps) {
- if (!props.selectedIndexPattern || !Array.isArray(props.indexPatternList)) {
- return null;
- }
- return ;
-}
-
-export function createIndexPatternSelectDirective(reactDirective: any) {
- return reactDirective(wrapInI18nContext(DiscoverIndexPatternWrapper), [
+export function createDiscoverSidebarDirective(reactDirective: any) {
+ return reactDirective(wrapInI18nContext(DiscoverSidebar), [
+ ['columns', { watchDepth: 'reference' }],
+ ['fieldCounts', { watchDepth: 'reference' }],
+ ['hits', { watchDepth: 'reference' }],
['indexPatternList', { watchDepth: 'reference' }],
+ ['onAddField', { watchDepth: 'reference' }],
+ ['onAddFilter', { watchDepth: 'reference' }],
+ ['onRemoveField', { watchDepth: 'reference' }],
['selectedIndexPattern', { watchDepth: 'reference' }],
['setIndexPattern', { watchDepth: 'reference' }],
+ ['state', { watchDepth: 'reference' }],
]);
}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search_directive.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/index.ts
similarity index 67%
rename from src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search_directive.ts
rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/index.ts
index 6d570349ee0c6..1b837840b52f6 100644
--- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field_search_directive.ts
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/index.ts
@@ -16,13 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { wrapInI18nContext } from '../../../kibana_services';
-import { DiscoverFieldSearch } from './discover_field_search';
-export function createFieldSearchDirective(reactDirective: any) {
- return reactDirective(wrapInI18nContext(DiscoverFieldSearch), [
- ['onChange', { watchDepth: 'reference' }],
- ['value', { watchDepth: 'value' }],
- ['types', { watchDepth: 'value' }],
- ]);
-}
+export { DiscoverSidebar } from './discover_sidebar';
+export { createDiscoverSidebarDirective } from './discover_sidebar_directive';
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/field_calculator.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_calculator.js
similarity index 100%
rename from src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/field_calculator.js
rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_calculator.js
diff --git a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_calculator.test.ts
similarity index 64%
rename from src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js
rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_calculator.test.ts
index f302d684135f6..98763937e888f 100644
--- a/src/legacy/core_plugins/kibana/public/discover/__tests__/directives/field_calculator.js
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_calculator.test.ts
@@ -18,25 +18,29 @@
*/
import _ from 'lodash';
-import { pluginInstance } from 'plugins/kibana/discover/legacy';
-import ngMock from 'ng_mock';
-import { fieldCalculator } from '../../np_ready/components/field_chooser/lib/field_calculator';
-import expect from '@kbn/expect';
-import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';
-
-// Load the kibana app dependencies.
-
-let indexPattern;
+// @ts-ignore
+import realHits from 'fixtures/real_hits.js';
+// @ts-ignore
+import StubIndexPattern from 'test_utils/stub_index_pattern';
+// @ts-ignore
+import stubbedLogstashFields from 'fixtures/logstash_fields';
+import { coreMock } from '../../../../../../../../../core/public/mocks';
+import { IndexPattern } from '../../../../../../../../../plugins/data/public';
+// @ts-ignore
+import { fieldCalculator } from './field_calculator';
+
+let indexPattern: IndexPattern;
describe('fieldCalculator', function() {
- beforeEach(() => pluginInstance.initializeInnerAngular());
- beforeEach(ngMock.module('app/discover'));
- beforeEach(
- ngMock.inject(function(Private) {
- indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
- })
- );
-
+ beforeEach(function() {
+ indexPattern = new StubIndexPattern(
+ 'logstash-*',
+ (cfg: any) => cfg,
+ 'time',
+ stubbedLogstashFields(),
+ coreMock.createStart()
+ );
+ });
it('should have a _countMissing that counts nulls & undefineds in an array', function() {
const values = [
['foo', 'bar'],
@@ -52,13 +56,13 @@ describe('fieldCalculator', function() {
'foo',
undefined,
];
- expect(fieldCalculator._countMissing(values)).to.be(5);
+ expect(fieldCalculator._countMissing(values)).toBe(5);
});
describe('_groupValues', function() {
- let groups;
- let params;
- let values;
+ let groups: Record;
+ let params: any;
+ let values: any;
beforeEach(function() {
values = [
['foo', 'bar'],
@@ -79,36 +83,36 @@ describe('fieldCalculator', function() {
});
it('should have a _groupValues that counts values', function() {
- expect(groups).to.be.an(Object);
+ expect(groups).toBeInstanceOf(Object);
});
it('should throw an error if any value is a plain object', function() {
expect(function() {
fieldCalculator._groupValues([{}, true, false], params);
- }).to.throwError();
+ }).toThrowError();
});
it('should handle values with dots in them', function() {
values = ['0', '0.........', '0.......,.....'];
params = {};
groups = fieldCalculator._groupValues(values, params);
- expect(groups[values[0]].count).to.be(1);
- expect(groups[values[1]].count).to.be(1);
- expect(groups[values[2]].count).to.be(1);
+ expect(groups[values[0]].count).toBe(1);
+ expect(groups[values[1]].count).toBe(1);
+ expect(groups[values[2]].count).toBe(1);
});
it('should have a a key for value in the array when not grouping array terms', function() {
- expect(_.keys(groups).length).to.be(3);
- expect(groups.foo).to.be.a(Object);
- expect(groups.bar).to.be.a(Object);
- expect(groups.baz).to.be.a(Object);
+ expect(_.keys(groups).length).toBe(3);
+ expect(groups.foo).toBeInstanceOf(Object);
+ expect(groups.bar).toBeInstanceOf(Object);
+ expect(groups.baz).toBeInstanceOf(Object);
});
it('should count array terms independently', function() {
- expect(groups['foo,bar']).to.be(undefined);
- expect(groups.foo.count).to.be(5);
- expect(groups.bar.count).to.be(3);
- expect(groups.baz.count).to.be(1);
+ expect(groups['foo,bar']).toBe(undefined);
+ expect(groups.foo.count).toBe(5);
+ expect(groups.bar.count).toBe(3);
+ expect(groups.baz.count).toBe(1);
});
describe('grouped array terms', function() {
@@ -118,27 +122,27 @@ describe('fieldCalculator', function() {
});
it('should group array terms when passed params.grouped', function() {
- expect(_.keys(groups).length).to.be(4);
- expect(groups['foo,bar']).to.be.a(Object);
+ expect(_.keys(groups).length).toBe(4);
+ expect(groups['foo,bar']).toBeInstanceOf(Object);
});
it('should contain the original array as the value', function() {
- expect(groups['foo,bar'].value).to.eql(['foo', 'bar']);
+ expect(groups['foo,bar'].value).toEqual(['foo', 'bar']);
});
it('should count the pairs separately from the values they contain', function() {
- expect(groups['foo,bar'].count).to.be(2);
- expect(groups.foo.count).to.be(3);
- expect(groups.bar.count).to.be(1);
+ expect(groups['foo,bar'].count).toBe(2);
+ expect(groups.foo.count).toBe(3);
+ expect(groups.bar.count).toBe(1);
});
});
});
describe('getFieldValues', function() {
- let hits;
+ let hits: any;
beforeEach(function() {
- hits = _.each(require('fixtures/real_hits.js'), indexPattern.flattenHit);
+ hits = _.each(_.cloneDeep(realHits), indexPattern.flattenHit);
});
it('Should return an array of values for _source fields', function() {
@@ -146,32 +150,32 @@ describe('fieldCalculator', function() {
hits,
indexPattern.fields.getByName('extension')
);
- expect(extensions).to.be.an(Array);
+ expect(extensions).toBeInstanceOf(Array);
expect(
_.filter(extensions, function(v) {
return v === 'html';
}).length
- ).to.be(8);
- expect(_.uniq(_.clone(extensions)).sort()).to.eql(['gif', 'html', 'php', 'png']);
+ ).toBe(8);
+ expect(_.uniq(_.clone(extensions)).sort()).toEqual(['gif', 'html', 'php', 'png']);
});
it('Should return an array of values for core meta fields', function() {
const types = fieldCalculator.getFieldValues(hits, indexPattern.fields.getByName('_type'));
- expect(types).to.be.an(Array);
+ expect(types).toBeInstanceOf(Array);
expect(
_.filter(types, function(v) {
return v === 'apache';
}).length
- ).to.be(18);
- expect(_.uniq(_.clone(types)).sort()).to.eql(['apache', 'nginx']);
+ ).toBe(18);
+ expect(_.uniq(_.clone(types)).sort()).toEqual(['apache', 'nginx']);
});
});
describe('getFieldValueCounts', function() {
- let params;
+ let params: { hits: any; field: any; count: number };
beforeEach(function() {
params = {
- hits: require('fixtures/real_hits.js'),
+ hits: _.cloneDeep(realHits),
field: indexPattern.fields.getByName('extension'),
count: 3,
};
@@ -179,36 +183,36 @@ describe('fieldCalculator', function() {
it('counts the top 3 values', function() {
const extensions = fieldCalculator.getFieldValueCounts(params);
- expect(extensions).to.be.an(Object);
- expect(extensions.buckets).to.be.an(Array);
- expect(extensions.buckets.length).to.be(3);
- expect(_.pluck(extensions.buckets, 'value')).to.eql(['html', 'php', 'gif']);
- expect(extensions.error).to.be(undefined);
+ expect(extensions).toBeInstanceOf(Object);
+ expect(extensions.buckets).toBeInstanceOf(Array);
+ expect(extensions.buckets.length).toBe(3);
+ expect(_.pluck(extensions.buckets, 'value')).toEqual(['html', 'php', 'gif']);
+ expect(extensions.error).toBe(undefined);
});
it('fails to analyze geo and attachment types', function() {
params.field = indexPattern.fields.getByName('point');
- expect(fieldCalculator.getFieldValueCounts(params).error).to.not.be(undefined);
+ expect(fieldCalculator.getFieldValueCounts(params).error).not.toBe(undefined);
params.field = indexPattern.fields.getByName('area');
- expect(fieldCalculator.getFieldValueCounts(params).error).to.not.be(undefined);
+ expect(fieldCalculator.getFieldValueCounts(params).error).not.toBe(undefined);
params.field = indexPattern.fields.getByName('request_body');
- expect(fieldCalculator.getFieldValueCounts(params).error).to.not.be(undefined);
+ expect(fieldCalculator.getFieldValueCounts(params).error).not.toBe(undefined);
});
it('fails to analyze fields that are in the mapping, but not the hits', function() {
params.field = indexPattern.fields.getByName('ip');
- expect(fieldCalculator.getFieldValueCounts(params).error).to.not.be(undefined);
+ expect(fieldCalculator.getFieldValueCounts(params).error).not.toBe(undefined);
});
it('counts the total hits', function() {
- expect(fieldCalculator.getFieldValueCounts(params).total).to.be(params.hits.length);
+ expect(fieldCalculator.getFieldValueCounts(params).total).toBe(params.hits.length);
});
it('counts the hits the field exists in', function() {
params.field = indexPattern.fields.getByName('phpmemory');
- expect(fieldCalculator.getFieldValueCounts(params).exists).to.be(5);
+ expect(fieldCalculator.getFieldValueCounts(params).exists).toBe(5);
});
});
});
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_filter.test.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_filter.test.ts
new file mode 100644
index 0000000000000..ca0fcfc846362
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_filter.test.ts
@@ -0,0 +1,96 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { getDefaultFieldFilter, setFieldFilterProp, isFieldFiltered } from './field_filter';
+import { IndexPatternField } from '../../../../../../../../../plugins/data/public';
+
+describe('field_filter', function() {
+ it('getDefaultFieldFilter should return default filter state', function() {
+ expect(getDefaultFieldFilter()).toMatchInlineSnapshot(`
+ Object {
+ "aggregatable": null,
+ "missing": true,
+ "name": "",
+ "searchable": null,
+ "type": "any",
+ }
+ `);
+ });
+ it('setFieldFilterProp should return allow filter changes', function() {
+ const state = getDefaultFieldFilter();
+ const targetState = {
+ aggregatable: true,
+ missing: true,
+ name: 'test',
+ searchable: true,
+ type: 'string',
+ };
+ const actualState = Object.entries(targetState).reduce((acc, kv) => {
+ return setFieldFilterProp(acc, kv[0], kv[1]);
+ }, state);
+ expect(actualState).toMatchInlineSnapshot(`
+ Object {
+ "aggregatable": true,
+ "missing": true,
+ "name": "test",
+ "searchable": true,
+ "type": "string",
+ }
+ `);
+ });
+ it('filters a given list', () => {
+ const defaultState = getDefaultFieldFilter();
+ const fieldList = [
+ {
+ name: 'bytes',
+ type: 'number',
+ esTypes: ['long'],
+ count: 10,
+ scripted: false,
+ searchable: false,
+ aggregatable: false,
+ },
+ {
+ name: 'extension',
+ type: 'string',
+ esTypes: ['text'],
+ count: 10,
+ scripted: true,
+ searchable: true,
+ aggregatable: true,
+ },
+ ] as IndexPatternField[];
+
+ [
+ { filter: {}, result: ['bytes', 'extension'] },
+ { filter: { name: 'by' }, result: ['bytes'] },
+ { filter: { aggregatable: true }, result: ['extension'] },
+ { filter: { aggregatable: true, searchable: false }, result: [] },
+ { filter: { type: 'string' }, result: ['extension'] },
+ ].forEach(test => {
+ const filtered = fieldList
+ .filter(field =>
+ isFieldFiltered(field, { ...defaultState, ...test.filter }, { bytes: 1, extension: 1 })
+ )
+ .map(field => field.name);
+
+ expect(filtered).toEqual(test.result);
+ });
+ });
+});
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_filter.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_filter.ts
new file mode 100644
index 0000000000000..ed7ad1a43fa8c
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/field_filter.ts
@@ -0,0 +1,78 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { IndexPatternField } from '../../../../../../../../../plugins/data/public';
+
+export interface FieldFilterState {
+ missing: boolean;
+ type: string;
+ name: string;
+ aggregatable: null | boolean;
+ searchable: null | boolean;
+}
+
+export function getDefaultFieldFilter(): FieldFilterState {
+ return {
+ missing: true,
+ type: 'any',
+ name: '',
+ aggregatable: null,
+ searchable: null,
+ };
+}
+
+export function setFieldFilterProp(
+ state: FieldFilterState,
+ name: string,
+ value: string | boolean | null | undefined
+): FieldFilterState {
+ const newState = { ...state };
+ if (name === 'missing') {
+ newState.missing = Boolean(value);
+ } else if (name === 'aggregatable') {
+ newState.aggregatable = typeof value !== 'boolean' ? null : value;
+ } else if (name === 'searchable') {
+ newState.searchable = typeof value !== 'boolean' ? null : value;
+ } else if (name === 'name') {
+ newState.name = String(value);
+ } else if (name === 'type') {
+ newState.type = String(value);
+ }
+ return newState;
+}
+
+export function isFieldFiltered(
+ field: IndexPatternField,
+ filterState: FieldFilterState,
+ fieldCounts: Record
+): boolean {
+ const matchFilter = filterState.type === 'any' || field.type === filterState.type;
+ const isAggregatable =
+ filterState.aggregatable === null || field.aggregatable === filterState.aggregatable;
+ const isSearchable =
+ filterState.searchable === null || field.searchable === filterState.searchable;
+ const scriptedOrMissing =
+ !filterState.missing ||
+ field.type === '_source' ||
+ field.scripted ||
+ fieldCounts[field.name] > 0;
+ const matchName = !filterState.name || field.name.indexOf(filterState.name) !== -1;
+
+ return matchFilter && isAggregatable && isSearchable && scriptedOrMissing && matchName;
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_details.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_details.ts
new file mode 100644
index 0000000000000..9999b108c5cc1
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_details.ts
@@ -0,0 +1,52 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { getVisualizeUrl, isFieldVisualizable } from './visualize_url_utils';
+import { AppState } from '../../../angular/discover_state';
+// @ts-ignore
+import { fieldCalculator } from './field_calculator';
+import { IndexPatternField, IndexPattern } from '../../../../../../../../../plugins/data/public';
+import { DiscoverServices } from '../../../../build_services';
+
+export function getDetails(
+ field: IndexPatternField,
+ indexPattern: IndexPattern,
+ state: AppState,
+ columns: string[],
+ hits: Array>,
+ services: DiscoverServices
+) {
+ const details = {
+ visualizeUrl:
+ services.capabilities.visualize.show && isFieldVisualizable(field, services.visualizations)
+ ? getVisualizeUrl(field, indexPattern, state, columns, services)
+ : null,
+ ...fieldCalculator.getFieldValueCounts({
+ hits,
+ field,
+ count: 5,
+ grouped: false,
+ }),
+ };
+ if (details.buckets) {
+ for (const bucket of details.buckets) {
+ bucket.display = field.format.convert(bucket.value);
+ }
+ }
+ return details;
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_field_type_name.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_field_type_name.ts
new file mode 100644
index 0000000000000..0cf428ee48b9d
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_field_type_name.ts
@@ -0,0 +1,73 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { i18n } from '@kbn/i18n';
+
+export function getFieldTypeName(type: string) {
+ switch (type) {
+ case 'boolean':
+ return i18n.translate('kbn.discover.fieldNameIcons.booleanAriaLabel', {
+ defaultMessage: 'Boolean field',
+ });
+ case 'conflict':
+ return i18n.translate('kbn.discover.fieldNameIcons.conflictFieldAriaLabel', {
+ defaultMessage: 'Conflicting field',
+ });
+ case 'date':
+ return i18n.translate('kbn.discover.fieldNameIcons.dateFieldAriaLabel', {
+ defaultMessage: 'Date field',
+ });
+ case 'geo_point':
+ return i18n.translate('kbn.discover.fieldNameIcons.geoPointFieldAriaLabel', {
+ defaultMessage: 'Geo point field',
+ });
+ case 'geo_shape':
+ return i18n.translate('kbn.discover.fieldNameIcons.geoShapeFieldAriaLabel', {
+ defaultMessage: 'Geo shape field',
+ });
+ case 'ip':
+ return i18n.translate('kbn.discover.fieldNameIcons.ipAddressFieldAriaLabel', {
+ defaultMessage: 'IP address field',
+ });
+ case 'murmur3':
+ return i18n.translate('kbn.discover.fieldNameIcons.murmur3FieldAriaLabel', {
+ defaultMessage: 'Murmur3 field',
+ });
+ case 'number':
+ return i18n.translate('kbn.discover.fieldNameIcons.numberFieldAriaLabel', {
+ defaultMessage: 'Number field',
+ });
+ case 'source':
+ // Note that this type is currently not provided, type for _source is undefined
+ return i18n.translate('kbn.discover.fieldNameIcons.sourceFieldAriaLabel', {
+ defaultMessage: 'Source field',
+ });
+ case 'string':
+ return i18n.translate('kbn.discover.fieldNameIcons.stringFieldAriaLabel', {
+ defaultMessage: 'String field',
+ });
+ case 'nested':
+ return i18n.translate('kbn.discover.fieldNameIcons.nestedFieldAriaLabel', {
+ defaultMessage: 'Nested field',
+ });
+ default:
+ return i18n.translate('kbn.discover.fieldNameIcons.unknownFieldAriaLabel', {
+ defaultMessage: 'Unknown field',
+ });
+ }
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_index_pattern_field_list.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_index_pattern_field_list.ts
new file mode 100644
index 0000000000000..1b906501c6fe7
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_index_pattern_field_list.ts
@@ -0,0 +1,44 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { difference, map } from 'lodash';
+import {
+ IndexPatternFieldList,
+ IndexPattern,
+ IndexPatternField,
+} from '../../../../../../../../../plugins/data/public';
+
+export function getIndexPatternFieldList(
+ indexPattern: IndexPattern,
+ fieldCounts: Record
+): IndexPatternFieldList {
+ if (!indexPattern || !fieldCounts) return new IndexPatternFieldList(indexPattern, []);
+
+ const fieldSpecs = indexPattern.fields.slice(0);
+ const fieldNamesInDocs = Object.keys(fieldCounts);
+ const fieldNamesInIndexPattern = map(indexPattern.fields, 'name');
+
+ difference(fieldNamesInDocs, fieldNamesInIndexPattern).forEach(unknownFieldName => {
+ fieldSpecs.push({
+ name: String(unknownFieldName),
+ type: 'unknown',
+ } as IndexPatternField);
+ });
+
+ return new IndexPatternFieldList(indexPattern, fieldSpecs);
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/field_name.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_warnings.ts
similarity index 55%
rename from src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/field_name.js
rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_warnings.ts
index 47e50f3cc3d4b..51d18c03888a7 100644
--- a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/field_name.js
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/get_warnings.ts
@@ -16,20 +16,28 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { FieldName } from '../../../../../../../../plugins/discover/public';
-import { getServices, wrapInI18nContext } from '../../../kibana_services';
+import { i18n } from '@kbn/i18n';
+import { IndexPatternField } from '../../../../../../../../../plugins/data/public';
-export function FieldNameDirectiveProvider(reactDirective) {
- return reactDirective(
- wrapInI18nContext(FieldName),
- [
- ['field', { watchDepth: 'collection' }],
- ['fieldName', { watchDepth: 'reference' }],
- ['fieldType', { watchDepth: 'reference' }],
- ],
- { restrict: 'AE' },
- {
- useShortDots: getServices().uiSettings.get('shortDots:enable'),
- }
- );
+export function getWarnings(field: IndexPatternField) {
+ let warnings = [];
+
+ if (field.scripted) {
+ warnings.push(
+ i18n.translate(
+ 'kbn.discover.fieldChooser.discoverField.scriptedFieldsTakeLongExecuteDescription',
+ {
+ defaultMessage: 'Scripted fields can take a long time to execute.',
+ }
+ )
+ );
+ }
+
+ if (warnings.length > 1) {
+ warnings = warnings.map(function(warning, i) {
+ return (i > 0 ? '\n' : '') + (i + 1) + ' - ' + warning;
+ });
+ }
+
+ return warnings;
}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/group_fields.test.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/group_fields.test.ts
new file mode 100644
index 0000000000000..e83287a139dd0
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/group_fields.test.ts
@@ -0,0 +1,114 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { groupFields } from './group_fields';
+import { getDefaultFieldFilter } from './field_filter';
+
+describe('group_fields', function() {
+ it('should group fields in selected, popular, unpopular group', function() {
+ const fields = [
+ {
+ name: 'category',
+ type: 'string',
+ esTypes: ['text'],
+ count: 1,
+ scripted: false,
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ },
+ {
+ name: 'currency',
+ type: 'string',
+ esTypes: ['keyword'],
+ count: 0,
+ scripted: false,
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ },
+ {
+ name: 'customer_birth_date',
+ type: 'date',
+ esTypes: ['date'],
+ count: 0,
+ scripted: false,
+ searchable: true,
+ aggregatable: true,
+ readFromDocValues: true,
+ },
+ ];
+
+ const fieldCounts = {
+ category: 1,
+ currency: 1,
+ customer_birth_date: 1,
+ };
+
+ const fieldFilterState = getDefaultFieldFilter();
+
+ const actual = groupFields(fields as any, ['currency'], 5, fieldCounts, fieldFilterState);
+ expect(actual).toMatchInlineSnapshot(`
+ Object {
+ "popular": Array [
+ Object {
+ "aggregatable": true,
+ "count": 1,
+ "esTypes": Array [
+ "text",
+ ],
+ "name": "category",
+ "readFromDocValues": true,
+ "scripted": false,
+ "searchable": true,
+ "type": "string",
+ },
+ ],
+ "selected": Array [
+ Object {
+ "aggregatable": true,
+ "count": 0,
+ "esTypes": Array [
+ "keyword",
+ ],
+ "name": "currency",
+ "readFromDocValues": true,
+ "scripted": false,
+ "searchable": true,
+ "type": "string",
+ },
+ ],
+ "unpopular": Array [
+ Object {
+ "aggregatable": true,
+ "count": 0,
+ "esTypes": Array [
+ "date",
+ ],
+ "name": "customer_birth_date",
+ "readFromDocValues": true,
+ "scripted": false,
+ "searchable": true,
+ "type": "date",
+ },
+ ],
+ }
+ `);
+ });
+});
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/group_fields.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/group_fields.tsx
new file mode 100644
index 0000000000000..85ca8d6a4e15e
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/group_fields.tsx
@@ -0,0 +1,78 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import {
+ IndexPatternFieldList,
+ IndexPatternField,
+} from '../../../../../../../../../plugins/data/public';
+import { FieldFilterState, isFieldFiltered } from './field_filter';
+
+interface GroupedFields {
+ selected: IndexPatternField[];
+ popular: IndexPatternField[];
+ unpopular: IndexPatternField[];
+}
+
+/**
+ * group the fields into selected, popular and unpopular, filter by fieldFilterState
+ */
+export function groupFields(
+ fields: IndexPatternFieldList | null,
+ columns: string[],
+ popularLimit: number,
+ fieldCounts: Record,
+ fieldFilterState: FieldFilterState
+): GroupedFields {
+ const result: GroupedFields = {
+ selected: [],
+ popular: [],
+ unpopular: [],
+ };
+ if (!Array.isArray(fields) || !Array.isArray(columns) || typeof fieldCounts !== 'object') {
+ return result;
+ }
+
+ const popular = fields
+ .filter(field => !columns.includes(field.name) && field.count)
+ .sort((a: IndexPatternField, b: IndexPatternField) => (b.count || 0) - (a.count || 0))
+ .map(field => field.name)
+ .slice(0, popularLimit);
+
+ const compareFn = (a: IndexPatternField, b: IndexPatternField) => {
+ if (!a.displayName) {
+ return 0;
+ }
+ return a.displayName.localeCompare(b.displayName || '');
+ };
+ const fieldsSorted = fields.sort(compareFn);
+
+ for (const field of fieldsSorted) {
+ if (!isFieldFiltered(field, fieldFilterState, fieldCounts)) {
+ continue;
+ }
+ if (columns.includes(field.name)) {
+ result.selected.push(field);
+ } else if (popular.includes(field.name) && field.type !== '_source') {
+ result.popular.push(field);
+ } else if (field.type !== '_source') {
+ result.unpopular.push(field);
+ }
+ }
+
+ return result;
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/visualize_url_utils.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/visualize_url_utils.ts
new file mode 100644
index 0000000000000..d146d212055b7
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/lib/visualize_url_utils.ts
@@ -0,0 +1,188 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import uuid from 'uuid/v4';
+import rison from 'rison-node';
+import { parse, stringify } from 'query-string';
+import {
+ IFieldType,
+ IIndexPattern,
+ IndexPatternField,
+ KBN_FIELD_TYPES,
+} from '../../../../../../../../../plugins/data/public';
+import { AppState } from '../../../angular/discover_state';
+import { DiscoverServices } from '../../../../build_services';
+import {
+ VisualizationsStart,
+ VisTypeAlias,
+} from '../../../../../../../../../plugins/visualizations/public';
+
+function getMapsAppBaseUrl(visualizations: VisualizationsStart) {
+ const mapsAppVisAlias = visualizations.getAliases().find(({ name }) => {
+ return name === 'maps';
+ });
+ return mapsAppVisAlias ? mapsAppVisAlias.aliasUrl : null;
+}
+
+export function isMapsAppRegistered(visualizations: VisualizationsStart) {
+ return visualizations.getAliases().some(({ name }: VisTypeAlias) => {
+ return name === 'maps';
+ });
+}
+
+export function isFieldVisualizable(field: IFieldType, visualizations: VisualizationsStart) {
+ if (field.name === '_id') {
+ // Else you'd get a 'Fielddata access on the _id field is disallowed' error on ES side.
+ return false;
+ }
+ if (
+ (field.type === KBN_FIELD_TYPES.GEO_POINT || field.type === KBN_FIELD_TYPES.GEO_SHAPE) &&
+ isMapsAppRegistered(visualizations)
+ ) {
+ return true;
+ }
+ return field.visualizable;
+}
+
+export function getMapsAppUrl(
+ field: IFieldType,
+ indexPattern: IIndexPattern,
+ appState: AppState,
+ columns: string[],
+ services: DiscoverServices
+) {
+ const mapAppParams = new URLSearchParams();
+
+ // Copy global state
+ const locationSplit = window.location.href.split('discover?');
+ if (locationSplit.length > 1) {
+ const discoverParams = new URLSearchParams(locationSplit[1]);
+ const globalStateUrlValue = discoverParams.get('_g');
+ if (globalStateUrlValue) {
+ mapAppParams.set('_g', globalStateUrlValue);
+ }
+ }
+
+ // Copy filters and query in app state
+ const mapsAppState: any = {
+ filters: appState.filters || [],
+ };
+ if (appState.query) {
+ mapsAppState.query = appState.query;
+ }
+ // @ts-ignore
+ mapAppParams.set('_a', rison.encode(mapsAppState));
+
+ // create initial layer descriptor
+ const hasColumns = columns && columns.length && columns[0] !== '_source';
+ const supportsClustering = field.aggregatable;
+ mapAppParams.set(
+ 'initialLayers',
+ // @ts-ignore
+ rison.encode_array([
+ {
+ id: uuid(),
+ label: indexPattern.title,
+ sourceDescriptor: {
+ id: uuid(),
+ type: 'ES_SEARCH',
+ geoField: field.name,
+ tooltipProperties: hasColumns ? columns : [],
+ indexPatternId: indexPattern.id,
+ scalingType: supportsClustering ? 'CLUSTERS' : 'LIMIT',
+ },
+ visible: true,
+ type: supportsClustering ? 'BLENDED_VECTOR' : 'VECTOR',
+ },
+ ])
+ );
+
+ return services.addBasePath(
+ `${getMapsAppBaseUrl(services.visualizations)}?${mapAppParams.toString()}`
+ );
+}
+
+export function getVisualizeUrl(
+ field: IndexPatternField,
+ indexPattern: IIndexPattern,
+ state: AppState,
+ columns: string[],
+ services: DiscoverServices
+) {
+ const aggsTermSize = services.uiSettings.get('discover:aggs:terms:size');
+ const urlParams = parse(services.history.location.search) as Record;
+
+ if (
+ (field.type === KBN_FIELD_TYPES.GEO_POINT || field.type === KBN_FIELD_TYPES.GEO_SHAPE) &&
+ isMapsAppRegistered(services.visualizations)
+ ) {
+ return getMapsAppUrl(field, indexPattern, state, columns, services);
+ }
+
+ let agg;
+ const isGeoPoint = field.type === KBN_FIELD_TYPES.GEO_POINT;
+ const type = isGeoPoint ? 'tile_map' : 'histogram';
+ // If we're visualizing a date field, and our index is time based (and thus has a time filter),
+ // then run a date histogram
+ if (field.type === 'date' && indexPattern.timeFieldName === field.name) {
+ agg = {
+ type: 'date_histogram',
+ schema: 'segment',
+ params: {
+ field: field.name,
+ interval: 'auto',
+ },
+ };
+ } else if (isGeoPoint) {
+ agg = {
+ type: 'geohash_grid',
+ schema: 'segment',
+ params: {
+ field: field.name,
+ precision: 3,
+ },
+ };
+ } else {
+ agg = {
+ type: 'terms',
+ schema: 'segment',
+ params: {
+ field: field.name,
+ size: parseInt(aggsTermSize, 10),
+ orderBy: '2',
+ },
+ };
+ }
+ const linkUrlParams = {
+ ...urlParams,
+ ...{
+ indexPattern: state.index!,
+ type,
+ _a: rison.encode({
+ filters: state.filters || [],
+ query: state.query,
+ vis: {
+ type,
+ aggs: [{ schema: 'metric', type: 'count', id: '2' }, agg],
+ },
+ } as any),
+ },
+ };
+
+ return `#/visualize/create?${stringify(linkUrlParams)}`;
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/string_progress_bar.tsx b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/string_progress_bar.tsx
similarity index 80%
rename from src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/string_progress_bar.tsx
rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/string_progress_bar.tsx
index 0c5e7fa69357d..7ea41aa4bf270 100644
--- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/string_progress_bar.tsx
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/string_progress_bar.tsx
@@ -18,14 +18,13 @@
*/
import React from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiText, EuiToolTip } from '@elastic/eui';
-import { wrapInI18nContext } from '../../../kibana_services';
interface Props {
percent: number;
count: number;
}
-function StringFieldProgressBar(props: Props) {
+export function StringFieldProgressBar(props: Props) {
return (
-
+
@@ -50,7 +49,3 @@ function StringFieldProgressBar(props: Props) {
);
}
-
-export function createStringFieldProgressBarDirective(reactDirective: any) {
- return reactDirective(wrapInI18nContext(StringFieldProgressBar));
-}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/types.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/types.ts
similarity index 78%
rename from src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/types.ts
rename to src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/types.ts
index 302bf5165777c..a1d71b4d3447d 100644
--- a/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/types.ts
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/components/sidebar/types.ts
@@ -21,3 +21,18 @@ export interface IndexPatternRef {
id: string;
title: string;
}
+
+export interface FieldDetails {
+ error: string;
+ exists: number;
+ total: boolean;
+ buckets: Bucket[];
+ visualizeUrl: string;
+}
+
+export interface Bucket {
+ display: string;
+ value: string;
+ percent: number;
+ count: number;
+}
diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable.ts
index 3cb8bce80fa41..f8e769d837447 100644
--- a/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable.ts
+++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/search_embeddable.ts
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+import angular from 'angular';
import _ from 'lodash';
import * as Rx from 'rxjs';
import { Subscription } from 'rxjs';
@@ -23,7 +24,7 @@ import { i18n } from '@kbn/i18n';
import {
UiActionsStart,
APPLY_FILTER_TRIGGER,
-} from '../../../../../../..//plugins/ui_actions/public';
+} from '../../../../../../../plugins/ui_actions/public';
import { RequestAdapter, Adapters } from '../../../../../../../plugins/inspector/public';
import {
esFilters,
@@ -41,7 +42,6 @@ import { ISearchEmbeddable, SearchInput, SearchOutput } from './types';
import { SortOrder } from '../angular/doc_table/components/table_header/helpers';
import { getSortForSearchSource } from '../angular/doc_table/lib/get_sort_for_search_source';
import {
- angular,
getRequestInspectorStats,
getResponseInspectorStats,
getServices,
diff --git a/src/legacy/ui/public/styles/_legacy/components/_index.scss b/src/legacy/ui/public/styles/_legacy/components/_index.scss
index 4a50a0430d559..cfae0700bb71e 100644
--- a/src/legacy/ui/public/styles/_legacy/components/_index.scss
+++ b/src/legacy/ui/public/styles/_legacy/components/_index.scss
@@ -7,7 +7,6 @@
@import './navbar';
@import './config';
@import './pagination';
-@import './sidebar';
@import './spinner';
@import './table';
@import './truncate';
diff --git a/src/legacy/ui/public/styles/_legacy/components/_sidebar.scss b/src/legacy/ui/public/styles/_legacy/components/_sidebar.scss
deleted file mode 100644
index d44129b6ec849..0000000000000
--- a/src/legacy/ui/public/styles/_legacy/components/_sidebar.scss
+++ /dev/null
@@ -1,127 +0,0 @@
-// ONLY USED IN DISCOVER
-
-.sidebar-container {
- padding-left: 0 !important;
- padding-right: 0 !important;
- background-color: $euiColorLightestShade;
- border-right-color: transparent;
- border-bottom-color: transparent;
-
- .sidebar-well {
- background-color: lightOrDarkTheme(tint($euiColorPrimary, 90%), $euiColorLightShade);
- }
-
- .sidebar-list {
- .sidebar-controls {
- border-radius: $euiBorderRadius;
- margin-right: -13px;
- margin-top: $euiSizeXS / 2;
-
- .navbar-btn-link {
- padding-left: $euiSizeS;
- padding-right: $euiSizeS;
- }
-
- .sidebar-controls-error {
- cursor: default;
- }
- }
-
- ul {
- list-style: none;
- margin-bottom: 0;
- }
-
- .sidebar-item {
- border-top-color: transparent;
- font-size: $euiFontSizeXS;
- border-top: solid 1px transparent;
- border-bottom: solid 1px transparent;
- line-height: normal;
-
- label {
- @include __legacyLabelStyles__bad;
- margin-bottom: $euiSizeXS;
- display: block;
- }
-
- &.active {
- background-color: shade($euiColorLightestShade, 10%);
- color: $euiColorDarkestShade;
- border-color: $euiColorLightShade;
- }
- }
-
- .sidebar-item-title,
- .sidebar-item-text {
- margin: 0;
- padding: $euiSizeXS 0;
- text-align: center;
- width: 100%;
- border: none;
- border-radius: 0;
- }
-
- .sidebar-item-title {
- @include euiTextTruncate;
- text-align: left;
-
- &.full-title {
- white-space: normal;
- }
- }
-
- .sidebar-item-text {
- background: $euiColorEmptyShade;
- }
- }
-
- .sidebar-list-header {
- .sidebar-list-header-heading {
- color: $euiColorDarkestShade;
- border: 1px solid transparent;
- }
-
- .sidebar-list-header-label {
- padding-left: $euiSizeS;
- font-size: $euiFontSizeXS;
- line-height: $euiLineHeight;
- font-weight: $euiFontWeightBold;
- color: $euiColorDarkShade;
- border-bottom: 1px solid $euiColorLightShade;
- }
- }
-
- .index-pattern {
- font-weight: $euiFontWeightBold;
- padding: $euiSizeXS $euiSizeS;
- display: flex;
- justify-content: space-between;
- background-color: shadeOrTint($euiColorPrimary, 60%, 60%);
- color: $euiColorEmptyShade;
- line-height: $euiSizeL;
-
- .index-pattern-label {
- font-size: $euiFontSizeS;
- font-weight: $euiFontWeightBold;
- margin: 0;
- }
-
- > * {
- flex: 0 1 auto;
- align-self: center;
- }
- }
-}
-
-.indexPattern__container {
- display: flex;
- align-items: center;
- height: $euiSize * 3;
- margin-top: -$euiSizeS;
-}
-
-.indexPattern__triggerButton {
- @include euiTitle('xs');
- line-height: $euiSizeXXL;
-}
diff --git a/src/plugins/discover/public/components/field_name/__snapshots__/field_name.test.tsx.snap b/src/plugins/discover/public/components/field_name/__snapshots__/field_name.test.tsx.snap
index 2424416f6f92c..9f48e6e57e0ff 100644
--- a/src/plugins/discover/public/components/field_name/__snapshots__/field_name.test.tsx.snap
+++ b/src/plugins/discover/public/components/field_name/__snapshots__/field_name.test.tsx.snap
@@ -2,7 +2,7 @@
exports[`FieldName renders a geo field, useShortDots is set to true 1`] = `
{
- const field = {
- type: 'number',
- name: 'test.test.test',
- rowCount: 100,
- scripted: false,
- };
- const component = render();
+ const component = render();
expect(component).toMatchSnapshot();
});
test('FieldName renders a geo field, useShortDots is set to true', () => {
- const field = {
- type: 'geo_point',
- name: 'test.test.test',
- rowCount: 0,
- scripted: false,
- };
- const component = render();
+ const component = render(
+
+ );
expect(component).toMatchSnapshot();
});
diff --git a/src/plugins/discover/public/components/field_name/field_name.tsx b/src/plugins/discover/public/components/field_name/field_name.tsx
index 63518aae28de6..f7f1433328adf 100644
--- a/src/plugins/discover/public/components/field_name/field_name.tsx
+++ b/src/plugins/discover/public/components/field_name/field_name.tsx
@@ -17,51 +17,36 @@
* under the License.
*/
import React from 'react';
-import classNames from 'classnames';
import { EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui';
import { FieldIcon, FieldIconProps } from '../../../../kibana_react/public';
import { shortenDottedString } from '../../helpers';
import { getFieldTypeName } from './field_type_name';
-// property field is provided at discover's field chooser
// properties fieldType and fieldName are provided in kbn_doc_view
// this should be changed when both components are deangularized
interface Props {
- field?: {
- type: string;
- name: string;
- rowCount?: number;
- scripted?: boolean;
- };
- fieldName?: string;
- fieldType?: string;
+ fieldName: string;
+ fieldType: string;
useShortDots?: boolean;
fieldIconProps?: Omit;
+ scripted?: boolean;
}
-export function FieldName({ field, fieldName, fieldType, useShortDots, fieldIconProps }: Props) {
- const type = field ? String(field.type) : String(fieldType);
- const typeName = getFieldTypeName(type);
-
- const name = field ? String(field.name) : String(fieldName);
- const displayName = useShortDots ? shortenDottedString(name) : name;
-
- const noResults = field ? !field.rowCount && !field.scripted : false;
-
- const className = classNames('dscFieldName', {
- 'dscFieldName--noResults': noResults,
- });
+export function FieldName({
+ fieldName,
+ fieldType,
+ useShortDots,
+ fieldIconProps,
+ scripted = false,
+}: Props) {
+ const typeName = getFieldTypeName(fieldType);
+ const displayName = useShortDots ? shortenDottedString(fieldName) : fieldName;
return (
-
+
-
+
diff --git a/test/accessibility/apps/discover.ts b/test/accessibility/apps/discover.ts
index cf3d37d29b491..086b13ecee2b3 100644
--- a/test/accessibility/apps/discover.ts
+++ b/test/accessibility/apps/discover.ts
@@ -63,7 +63,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
await a11y.testAppSnapshot();
});
- it.skip('Click on new to clear the search', async () => {
+ it('Click on new to clear the search', async () => {
await PageObjects.discover.clickNewSearchButton();
await a11y.testAppSnapshot();
});
@@ -121,7 +121,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
await a11y.testAppSnapshot();
});
- it.skip('Add more fields from sidebar', async () => {
+ it('Add more fields from sidebar', async () => {
for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) {
await PageObjects.discover.clickFieldListItem(columnName);
await PageObjects.discover.clickFieldListPlusFilter(columnName, value);
diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js
index 65291c3c4772c..d85d5a952d3ec 100644
--- a/test/functional/apps/management/_scripted_fields.js
+++ b/test/functional/apps/management/_scripted_fields.js
@@ -388,7 +388,7 @@ export default function({ getService, getPageObjects }) {
await log.debug('filter by "Sep 17, 2015 @ 23:00" in the expanded scripted field list');
await PageObjects.discover.clickFieldListPlusFilter(
scriptedPainlessFieldName2,
- '2015-09-17 23:00'
+ '1442531297065'
);
await PageObjects.header.waitUntilLoadingHasFinished();
diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts
index 1d4e51360f319..10652ce3ec4b2 100644
--- a/test/functional/page_objects/discover_page.ts
+++ b/test/functional/page_objects/discover_page.ts
@@ -112,6 +112,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
public async clickNewSearchButton() {
await testSubjects.click('discoverNewButton');
+ await header.waitUntilLoadingHasFinished();
}
public async clickSaveSearchButton() {
@@ -207,7 +208,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
public async getAllFieldNames() {
const sidebar = await testSubjects.find('discover-sidebar');
const $ = await sidebar.parseDomContent();
- return $('.sidebar-item[attr-field]')
+ return $('.dscSidebar__item[attr-field]')
.toArray()
.map(field =>
$(field)
@@ -249,13 +250,17 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider
}
public async expectMissingFieldListItemVisualize(field: string) {
- await testSubjects.missingOrFail(`fieldVisualize-${field}`, { allowHidden: true });
+ await testSubjects.missingOrFail(`fieldVisualize-${field}`);
}
public async clickFieldListPlusFilter(field: string, value: string) {
- // this method requires the field details to be open from clickFieldListItem()
+ const plusFilterTestSubj = `plus-${field}-${value}`;
+ if (!(await testSubjects.exists(plusFilterTestSubj))) {
+ // field has to be open
+ await this.clickFieldListItem(field);
+ }
// testSubjects.find doesn't handle spaces in the data-test-subj value
- await testSubjects.click(`plus-${field}-${value}`);
+ await testSubjects.click(plusFilterTestSubj);
await header.waitUntilLoadingHasFinished();
}
diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.css b/x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.css
index 2c203e507260f..88e38d55e5784 100644
--- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.css
+++ b/x-pack/legacy/plugins/reporting/export_types/common/layouts/preserve_layout.css
@@ -34,7 +34,7 @@ filter-bar,
/* hide unusable controls */
discover-app .dscTimechart,
-discover-app .sidebar-container,
+discover-app .dscSidebar__container,
discover-app .kbnCollapsibleSidebar__collapseButton,
discover-app navbar[name=discover-search],
discover-app .discover-table-footer {
diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/print.css b/x-pack/legacy/plugins/reporting/export_types/common/layouts/print.css
index b5c9861208b7b..ddd280c7b3f23 100644
--- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/print.css
+++ b/x-pack/legacy/plugins/reporting/export_types/common/layouts/print.css
@@ -33,7 +33,7 @@ filter-bar,
/* hide unusable controls */
discover-app .dscTimechart,
-discover-app .sidebar-container,
+discover-app .dscSidebar__container,
discover-app .kbnCollapsibleSidebar__collapseButton,
discover-app navbar[name="discover-search"],
discover-app .discover-table-footer {
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index ccfb2707a51b9..447a3b706bf96 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -1060,16 +1060,9 @@
"kbn.discover.fetchError.managmentLinkText": "管理 > インデックスパターン",
"kbn.discover.fetchError.scriptedFieldsText": "「スクリプトフィールド」",
"kbn.discover.fieldChooser.detailViews.emptyStringText": "空の文字列",
- "kbn.discover.fieldChooser.detailViews.filterOutValueButtonAriaLabel": "この値を除外",
- "kbn.discover.fieldChooser.detailViews.filterValueButtonAriaLabel": "この値でフィルターを適用",
"kbn.discover.fieldChooser.detailViews.recordsText": "記録",
"kbn.discover.fieldChooser.detailViews.topValuesInRecordsDescription": "次の記録のトップ 5 の値",
"kbn.discover.fieldChooser.detailViews.visualizeLinkText": "可視化",
- "kbn.discover.fieldChooser.detailViews.warningsText": "{warningsLength, plural, one {# 警告} other {# 警告}}",
- "kbn.discover.fieldChooser.discoverField.addButtonLabel": "追加",
- "kbn.discover.fieldChooser.discoverField.bucketAriaLabel": "値: {value}",
- "kbn.discover.fieldChooser.discoverField.emptyStringText": "空の文字列",
- "kbn.discover.fieldChooser.discoverField.removeButtonLabel": "削除",
"kbn.discover.fieldChooser.discoverField.scriptedFieldsTakeLongExecuteDescription": "スクリプトフィールドは実行に時間がかかる場合があります。",
"kbn.discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForGeoFieldsErrorMessage": "ジオフィールドは分析できません。",
"kbn.discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForObjectFieldsErrorMessage": "オブジェクトフィールドは分析できません。",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 06eb805d5af0e..5ca4f609a6dcd 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -1060,16 +1060,9 @@
"kbn.discover.fetchError.managmentLinkText": "管理 > 索引模式",
"kbn.discover.fetchError.scriptedFieldsText": "“脚本字段”",
"kbn.discover.fieldChooser.detailViews.emptyStringText": "空字符串",
- "kbn.discover.fieldChooser.detailViews.filterOutValueButtonAriaLabel": "筛除此值",
- "kbn.discover.fieldChooser.detailViews.filterValueButtonAriaLabel": "筛留此值",
"kbn.discover.fieldChooser.detailViews.recordsText": "个记录",
"kbn.discover.fieldChooser.detailViews.topValuesInRecordsDescription": "排名前 5 位的值,范围:",
"kbn.discover.fieldChooser.detailViews.visualizeLinkText": "可视化",
- "kbn.discover.fieldChooser.detailViews.warningsText": "{warningsLength, plural, one {# 个警告} other {# 个警告}}",
- "kbn.discover.fieldChooser.discoverField.addButtonLabel": "添加",
- "kbn.discover.fieldChooser.discoverField.bucketAriaLabel": "值:{value}",
- "kbn.discover.fieldChooser.discoverField.emptyStringText": "空字符串",
- "kbn.discover.fieldChooser.discoverField.removeButtonLabel": "移除",
"kbn.discover.fieldChooser.discoverField.scriptedFieldsTakeLongExecuteDescription": "脚本字段执行时间会很长。",
"kbn.discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForGeoFieldsErrorMessage": "分析不适用于地理字段。",
"kbn.discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForObjectFieldsErrorMessage": "分析不适用于对象字段。",
From b96bae8427513390e1fc7a333a3505f651dc539f Mon Sep 17 00:00:00 2001
From: James Gowdy
Date: Tue, 31 Mar 2020 16:03:42 +0100
Subject: [PATCH 009/104] [ML] Catching unknown index pattern errors (#61935)
* [ML] Catching unknown index pattern errors
* fixing typo
* fixing typo
Co-authored-by: Elastic Machine
---
.../messagebar/messagebar_service.js | 2 +-
.../application/contexts/kibana/index.ts | 1 +
.../kibana/use_notifications_context.ts | 11 ++++++++
.../application/routing/use_resolver.ts | 26 +++++++++++++++----
4 files changed, 34 insertions(+), 6 deletions(-)
create mode 100644 x-pack/plugins/ml/public/application/contexts/kibana/use_notifications_context.ts
diff --git a/x-pack/plugins/ml/public/application/components/messagebar/messagebar_service.js b/x-pack/plugins/ml/public/application/components/messagebar/messagebar_service.js
index d79fe14cbac4e..1dc7140bd2687 100644
--- a/x-pack/plugins/ml/public/application/components/messagebar/messagebar_service.js
+++ b/x-pack/plugins/ml/public/application/components/messagebar/messagebar_service.js
@@ -21,7 +21,7 @@ function errorNotify(text, resp) {
const toastNotifications = getToastNotifications();
toastNotifications.addError(new MLRequestFailure(err, resp), {
title: i18n.translate('xpack.ml.messagebarService.errorTitle', {
- defaultMessage: 'An error has ocurred',
+ defaultMessage: 'An error has occurred',
}),
});
}
diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/index.ts b/x-pack/plugins/ml/public/application/contexts/kibana/index.ts
index 2add1b6ea161c..0f071a42a5688 100644
--- a/x-pack/plugins/ml/public/application/contexts/kibana/index.ts
+++ b/x-pack/plugins/ml/public/application/contexts/kibana/index.ts
@@ -7,3 +7,4 @@
export { useMlKibana, StartServices, MlKibanaReactContextValue } from './kibana_context';
export { useUiSettings } from './use_ui_settings_context';
export { useTimefilter } from './use_timefilter';
+export { useNotifications } from './use_notifications_context';
diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/use_notifications_context.ts b/x-pack/plugins/ml/public/application/contexts/kibana/use_notifications_context.ts
new file mode 100644
index 0000000000000..a03d9da49f365
--- /dev/null
+++ b/x-pack/plugins/ml/public/application/contexts/kibana/use_notifications_context.ts
@@ -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;
+ * you may not use this file except in compliance with the Elastic License.
+ */
+
+import { useMlKibana } from './kibana_context';
+
+export const useNotifications = () => {
+ return useMlKibana().services.notifications;
+};
diff --git a/x-pack/plugins/ml/public/application/routing/use_resolver.ts b/x-pack/plugins/ml/public/application/routing/use_resolver.ts
index 6df7eee3d64a6..8e94f8d77fbb2 100644
--- a/x-pack/plugins/ml/public/application/routing/use_resolver.ts
+++ b/x-pack/plugins/ml/public/application/routing/use_resolver.ts
@@ -6,6 +6,7 @@
import { useEffect, useState } from 'react';
import { IUiSettingsClient } from 'kibana/public';
+import { i18n } from '@kbn/i18n';
import {
getIndexPatternById,
getIndexPatternsContract,
@@ -14,6 +15,7 @@ import {
import { createSearchItems } from '../jobs/new_job/utils/new_job_utils';
import { ResolverResults, Resolvers } from './resolvers';
import { MlContextValue } from '../contexts/ml';
+import { useNotifications } from '../contexts/kibana';
export const useResolver = (
indexPatternId: string | undefined,
@@ -21,6 +23,8 @@ export const useResolver = (
config: IUiSettingsClient,
resolvers: Resolvers
): { context: MlContextValue; results: ResolverResults } => {
+ const notifications = useNotifications();
+
const funcNames = Object.keys(resolvers); // Object.entries gets this wrong?!
const funcs = Object.values(resolvers); // Object.entries gets this wrong?!
const tempResults = funcNames.reduce((p, c) => {
@@ -37,8 +41,14 @@ export const useResolver = (
const res = await Promise.all(funcs.map(r => r()));
res.forEach((r, i) => (tempResults[funcNames[i]] = r));
setResults(tempResults);
+ } catch (error) {
+ // quietly fail. Errors being thrown here are expected as a way to handle privilege or license check failures.
+ // The user will be redirected by the failed resolver.
+ return;
+ }
- if (indexPatternId !== undefined || savedSearchId !== undefined) {
+ if (indexPatternId !== undefined || savedSearchId !== undefined) {
+ try {
// note, currently we're using our own kibana context that requires a current index pattern to be set
// this means, if the page uses this context, useResolver must be passed a string for the index pattern id
// and loadIndexPatterns must be part of the resolvers.
@@ -56,11 +66,17 @@ export const useResolver = (
indexPatterns: getIndexPatternsContract()!,
kibanaConfig: config,
});
- } else {
- setContext({});
+ } catch (error) {
+ // an unexpected error has occurred. This could be caused by an incorrect index pattern or saved search ID
+ notifications.toasts.addError(new Error(error), {
+ title: i18n.translate('xpack.ml.useResolver.errorTitle', {
+ defaultMessage: 'An error has occurred',
+ }),
+ });
+ window.location.href = '#/';
}
- } catch (error) {
- // quietly fail. Let the resolvers handle the redirection if any fail to resolve
+ } else {
+ setContext({});
}
})();
}, []);
From 069439a7eca87092e6214edb743f743aafc6ba32 Mon Sep 17 00:00:00 2001
From: Melissa Alvarez
Date: Tue, 31 Mar 2020 11:04:48 -0400
Subject: [PATCH 010/104] [ML] DF Analytics results table: use index pattern
field format if one exists (#61709)
* classification: use index field format in results table
* regression: use index field format in results table
* outlier: use index field format in results table
* update types
* add destIndex specific fields when using sourceIndex for fields
---
.../data_frame_analytics/common/fields.ts | 29 ++++++-----
.../classification_exploration.tsx | 49 +++++++++++++------
.../results_table.tsx | 43 ++++++++++++----
.../use_explore_data.ts | 3 +-
.../exploration_data_grid.tsx | 16 ++++++
.../outlier_exploration.tsx | 1 +
.../regression_exploration.tsx | 47 +++++++++++++-----
.../regression_exploration/results_table.tsx | 43 +++++++++++++---
.../use_explore_data.ts | 3 +-
.../use_explore_data/use_explore_data.ts | 32 +++++++++---
10 files changed, 203 insertions(+), 63 deletions(-)
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts
index fb1d4edb37af8..59b42935a141d 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts
@@ -243,7 +243,8 @@ export function getFlattenedFields(obj: EsDocSource, resultsField: string): EsFi
export const getDefaultFieldsFromJobCaps = (
fields: Field[],
- jobConfig: DataFrameAnalyticsConfig
+ jobConfig: DataFrameAnalyticsConfig,
+ needsDestIndexFields: boolean
): { selectedFields: Field[]; docFields: Field[]; depVarType?: ES_FIELD_TYPES } => {
const fieldsObj = { selectedFields: [], docFields: [] };
if (fields.length === 0) {
@@ -260,16 +261,22 @@ export const getDefaultFieldsFromJobCaps = (
const predictedField = `${resultsField}.${
predictionFieldName ? predictionFieldName : defaultPredictionField
}`;
-
- const allFields: any = [
- {
- id: `${resultsField}.is_training`,
- name: `${resultsField}.is_training`,
- type: ES_FIELD_TYPES.BOOLEAN,
- },
- { id: predictedField, name: predictedField, type },
- ...fields,
- ].sort(({ name: a }, { name: b }) => sortRegressionResultsFields(a, b, jobConfig));
+ // Only need to add these first two fields if we didn't use dest index pattern to get the fields
+ const allFields: any =
+ needsDestIndexFields === true
+ ? [
+ {
+ id: `${resultsField}.is_training`,
+ name: `${resultsField}.is_training`,
+ type: ES_FIELD_TYPES.BOOLEAN,
+ },
+ { id: predictedField, name: predictedField, type },
+ ]
+ : [];
+
+ allFields.push(...fields);
+ // @ts-ignore
+ allFields.sort(({ name: a }, { name: b }) => sortRegressionResultsFields(a, b, jobConfig));
let selectedFields = allFields
.slice(0, DEFAULT_REGRESSION_COLUMNS * 2)
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx
index 41430b163c029..5c151166829ab 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/classification_exploration.tsx
@@ -15,7 +15,7 @@ import { DATA_FRAME_TASK_STATE } from '../../../analytics_management/components/
import { ResultsSearchQuery, defaultSearchQuery } from '../../../../common/analytics';
import { LoadingPanel } from '../loading_panel';
import { getIndexPatternIdFromName } from '../../../../../util/index_utils';
-import { IIndexPattern } from '../../../../../../../../../../src/plugins/data/common/index_patterns';
+import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public';
import { newJobCapsService } from '../../../../../services/new_job_capabilities_service';
import { useMlContext } from '../../../../../contexts/ml';
import { isGetDataFrameAnalyticsStatsResponseOk } from '../../../analytics_management/services/analytics_service/get_analytics';
@@ -53,6 +53,7 @@ interface Props {
export const ClassificationExploration: FC = ({ jobId }) => {
const [jobConfig, setJobConfig] = useState(undefined);
const [jobStatus, setJobStatus] = useState(undefined);
+ const [indexPattern, setIndexPattern] = useState(undefined);
const [isLoadingJobConfig, setIsLoadingJobConfig] = useState(false);
const [isInitialized, setIsInitialized] = useState(false);
const [jobConfigErrorMessage, setJobConfigErrorMessage] = useState(undefined);
@@ -108,11 +109,27 @@ export const ClassificationExploration: FC = ({ jobId }) => {
const initializeJobCapsService = async () => {
if (jobConfig !== undefined) {
try {
- const sourceIndex = jobConfig.source.index[0];
- const indexPatternId = getIndexPatternIdFromName(sourceIndex) || sourceIndex;
- const indexPattern: IIndexPattern = await mlContext.indexPatterns.get(indexPatternId);
- if (indexPattern !== undefined) {
- await newJobCapsService.initializeFromIndexPattern(indexPattern, false, false);
+ const destIndex = Array.isArray(jobConfig.dest.index)
+ ? jobConfig.dest.index[0]
+ : jobConfig.dest.index;
+ const destIndexPatternId = getIndexPatternIdFromName(destIndex) || destIndex;
+ let indexP: IndexPattern | undefined;
+
+ try {
+ indexP = await mlContext.indexPatterns.get(destIndexPatternId);
+ } catch (e) {
+ indexP = undefined;
+ }
+
+ if (indexP === undefined) {
+ const sourceIndex = jobConfig.source.index[0];
+ const sourceIndexPatternId = getIndexPatternIdFromName(sourceIndex) || sourceIndex;
+ indexP = await mlContext.indexPatterns.get(sourceIndexPatternId);
+ }
+
+ if (indexP !== undefined) {
+ setIndexPattern(indexP);
+ await newJobCapsService.initializeFromIndexPattern(indexP, false, false);
}
setIsInitialized(true);
} catch (e) {
@@ -127,7 +144,7 @@ export const ClassificationExploration: FC = ({ jobId }) => {
useEffect(() => {
initializeJobCapsService();
- }, [JSON.stringify(jobConfig)]);
+ }, [jobConfig && jobConfig.id]);
if (jobConfigErrorMessage !== undefined || jobCapsServiceErrorMessage !== undefined) {
return (
@@ -153,13 +170,17 @@ export const ClassificationExploration: FC = ({ jobId }) => {
)}
{isLoadingJobConfig === true && jobConfig === undefined && }
- {isLoadingJobConfig === false && jobConfig !== undefined && isInitialized === true && (
-
- )}
+ {isLoadingJobConfig === false &&
+ jobConfig !== undefined &&
+ indexPattern !== undefined &&
+ isInitialized === true && (
+
+ )}
);
};
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx
index dabb8db514226..fbdb47c87c7ef 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/results_table.tsx
@@ -28,6 +28,8 @@ import {
import { Query as QueryType } from '../../../analytics_management/components/analytics_list/common';
import { ES_FIELD_TYPES } from '../../../../../../../../../../src/plugins/data/public';
+import { mlFieldFormatService } from '../../../../../services/field_format_service';
+import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public';
import {
ColumnType,
@@ -61,7 +63,6 @@ import {
} from '../../../../common';
import { getTaskStateBadge } from '../../../analytics_management/components/analytics_list/columns';
import { DATA_FRAME_TASK_STATE } from '../../../analytics_management/components/analytics_list/common';
-
import { useExploreData, TableItem } from './use_explore_data';
import { ExplorationTitle } from './classification_exploration';
@@ -85,13 +86,14 @@ const showingFirstDocs = i18n.translate(
);
interface Props {
+ indexPattern: IndexPattern;
jobConfig: DataFrameAnalyticsConfig;
jobStatus?: DATA_FRAME_TASK_STATE;
setEvaluateSearchQuery: React.Dispatch>;
}
export const ResultsTable: FC = React.memo(
- ({ jobConfig, jobStatus, setEvaluateSearchQuery }) => {
+ ({ indexPattern, jobConfig, jobStatus, setEvaluateSearchQuery }) => {
const [pageIndex, setPageIndex] = useState(0);
const [pageSize, setPageSize] = useState(25);
const [selectedFields, setSelectedFields] = useState([] as Field[]);
@@ -126,6 +128,8 @@ export const ResultsTable: FC = React.memo(
}
}
+ const needsDestIndexFields = indexPattern && indexPattern.title === jobConfig.source.index[0];
+
const {
errorMessage,
loadExploreData,
@@ -133,12 +137,24 @@ export const ResultsTable: FC = React.memo(
sortDirection,
status,
tableItems,
- } = useExploreData(jobConfig, selectedFields, setSelectedFields, setDocFields, setDepVarType);
+ } = useExploreData(
+ jobConfig,
+ needsDestIndexFields,
+ selectedFields,
+ setSelectedFields,
+ setDocFields,
+ setDepVarType
+ );
const columns: Array> = selectedFields
.sort(({ name: a }, { name: b }) => sortRegressionResultsFields(a, b, jobConfig))
.map(field => {
const { type } = field;
+ let format: any;
+
+ if (indexPattern !== undefined) {
+ format = mlFieldFormatService.getFieldFormatFromIndexPattern(indexPattern, field.id, '');
+ }
const isNumber =
type !== undefined &&
(BASIC_NUMERICAL_TYPES.has(type) || EXTENDED_NUMERICAL_TYPES.has(type));
@@ -151,6 +167,11 @@ export const ResultsTable: FC = React.memo(
};
const render = (d: any, fullItem: EsDoc) => {
+ if (format !== undefined) {
+ d = format.convert(d, 'text');
+ return d;
+ }
+
if (Array.isArray(d) && d.every(item => typeof item === 'string')) {
// If the cells data is an array of strings, return as a comma separated list.
// The list will get limited to 5 items with `…` at the end if there's more in the original array.
@@ -193,12 +214,16 @@ export const ResultsTable: FC = React.memo(
break;
case ES_FIELD_TYPES.DATE:
column.align = 'right';
- column.render = (d: any) => {
- if (d !== undefined) {
- return formatHumanReadableDateTimeSeconds(moment(d).unix() * 1000);
- }
- return d;
- };
+ if (format !== undefined) {
+ column.render = render;
+ } else {
+ column.render = (d: any) => {
+ if (d !== undefined) {
+ return formatHumanReadableDateTimeSeconds(moment(d).unix() * 1000);
+ }
+ return d;
+ };
+ }
break;
default:
column.render = render;
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_explore_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_explore_data.ts
index ff6d8377508d8..6038def592e5c 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_explore_data.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/use_explore_data.ts
@@ -51,6 +51,7 @@ export interface UseExploreDataReturnType {
export const useExploreData = (
jobConfig: DataFrameAnalyticsConfig | undefined,
+ needsDestIndexFields: boolean,
selectedFields: Field[],
setSelectedFields: React.Dispatch>,
setDocFields: React.Dispatch>,
@@ -70,7 +71,7 @@ export const useExploreData = (
selectedFields: defaultSelected,
docFields,
depVarType,
- } = getDefaultFieldsFromJobCaps(fields, jobConfig);
+ } = getDefaultFieldsFromJobCaps(fields, jobConfig, needsDestIndexFields);
setDepVarType(depVarType);
setSelectedFields(defaultSelected);
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx
index 2df0f70a56722..e88bc1cd06f95 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_data_grid/exploration_data_grid.tsx
@@ -12,6 +12,10 @@ import { EuiDataGrid, EuiDataGridPaginationProps, EuiDataGridSorting } from '@el
import { euiDataGridStyle, euiDataGridToolbarSettings } from '../../../../common';
+import { mlFieldFormatService } from '../../../../../services/field_format_service';
+
+import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public';
+
const FEATURE_INFLUENCE = 'feature_influence';
const PAGE_SIZE_OPTIONS = [5, 10, 25, 50];
@@ -21,6 +25,7 @@ type TableItem = Record;
interface ExplorationDataGridProps {
colorRange: (d: number) => string;
columns: any[];
+ indexPattern: IndexPattern;
pagination: Pagination;
resultsField: string;
rowCount: number;
@@ -35,6 +40,7 @@ interface ExplorationDataGridProps {
export const ExplorationDataGrid: FC = ({
colorRange,
columns,
+ indexPattern,
pagination,
resultsField,
rowCount,
@@ -63,6 +69,12 @@ export const ExplorationDataGrid: FC = ({
return null;
}
+ let format: any;
+
+ if (indexPattern !== undefined) {
+ format = mlFieldFormatService.getFieldFormatFromIndexPattern(indexPattern, columnId, '');
+ }
+
const cellValue =
fullItem.hasOwnProperty(columnId) && fullItem[columnId] !== undefined
? fullItem[columnId]
@@ -87,6 +99,10 @@ export const ExplorationDataGrid: FC = ({
});
}
+ if (format !== undefined) {
+ return format.convert(cellValue, 'text');
+ }
+
if (typeof cellValue === 'string' || cellValue === null) {
return cellValue;
}
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx
index d686c605f1912..fdcb7d9d237e3 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/outlier_exploration.tsx
@@ -203,6 +203,7 @@ export const OutlierExploration: FC = React.memo(({ jobId }) =
= ({ jobId }) => {
const [jobConfig, setJobConfig] = useState(undefined);
const [jobStatus, setJobStatus] = useState(undefined);
+ const [indexPattern, setIndexPattern] = useState(undefined);
const [isLoadingJobConfig, setIsLoadingJobConfig] = useState(false);
const [isInitialized, setIsInitialized] = useState(false);
const [jobConfigErrorMessage, setJobConfigErrorMessage] = useState(undefined);
@@ -99,11 +100,27 @@ export const RegressionExploration: FC = ({ jobId }) => {
const initializeJobCapsService = async () => {
if (jobConfig !== undefined) {
try {
- const sourceIndex = jobConfig.source.index[0];
- const indexPatternId = getIndexPatternIdFromName(sourceIndex) || sourceIndex;
- const indexPattern: IIndexPattern = await mlContext.indexPatterns.get(indexPatternId);
- if (indexPattern !== undefined) {
- await newJobCapsService.initializeFromIndexPattern(indexPattern, false, false);
+ const destIndex = Array.isArray(jobConfig.dest.index)
+ ? jobConfig.dest.index[0]
+ : jobConfig.dest.index;
+ const destIndexPatternId = getIndexPatternIdFromName(destIndex) || destIndex;
+ let indexP: IIndexPattern | undefined;
+
+ try {
+ indexP = await mlContext.indexPatterns.get(destIndexPatternId);
+ } catch (e) {
+ indexP = undefined;
+ }
+
+ if (indexP === undefined) {
+ const sourceIndex = jobConfig.source.index[0];
+ const sourceIndexPatternId = getIndexPatternIdFromName(sourceIndex) || sourceIndex;
+ indexP = await mlContext.indexPatterns.get(sourceIndexPatternId);
+ }
+
+ if (indexP !== undefined) {
+ setIndexPattern(indexP);
+ await newJobCapsService.initializeFromIndexPattern(indexP, false, false);
}
setIsInitialized(true);
} catch (e) {
@@ -118,7 +135,7 @@ export const RegressionExploration: FC = ({ jobId }) => {
useEffect(() => {
initializeJobCapsService();
- }, [JSON.stringify(jobConfig)]);
+ }, [jobConfig && jobConfig.id]);
if (jobConfigErrorMessage !== undefined || jobCapsServiceErrorMessage !== undefined) {
return (
@@ -144,13 +161,17 @@ export const RegressionExploration: FC = ({ jobId }) => {
)}
{isLoadingJobConfig === true && jobConfig === undefined && }
- {isLoadingJobConfig === false && jobConfig !== undefined && isInitialized === true && (
-
- )}
+ {isLoadingJobConfig === false &&
+ jobConfig !== undefined &&
+ indexPattern !== undefined &&
+ isInitialized === true && (
+
+ )}
);
};
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx
index b896c34a582f7..8d53a9278a1af 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/results_table.tsx
@@ -28,6 +28,7 @@ import {
import { Query as QueryType } from '../../../analytics_management/components/analytics_list/common';
import { ES_FIELD_TYPES } from '../../../../../../../../../../src/plugins/data/public';
+import { mlFieldFormatService } from '../../../../../services/field_format_service';
import {
ColumnType,
@@ -61,6 +62,7 @@ import {
} from '../../../../common';
import { getTaskStateBadge } from '../../../analytics_management/components/analytics_list/columns';
import { DATA_FRAME_TASK_STATE } from '../../../analytics_management/components/analytics_list/common';
+import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public';
import { useExploreData, TableItem } from './use_explore_data';
import { ExplorationTitle } from './regression_exploration';
@@ -85,13 +87,14 @@ const showingFirstDocs = i18n.translate(
);
interface Props {
+ indexPattern: IndexPattern;
jobConfig: DataFrameAnalyticsConfig;
jobStatus?: DATA_FRAME_TASK_STATE;
setEvaluateSearchQuery: React.Dispatch>;
}
export const ResultsTable: FC = React.memo(
- ({ jobConfig, jobStatus, setEvaluateSearchQuery }) => {
+ ({ indexPattern, jobConfig, jobStatus, setEvaluateSearchQuery }) => {
const [pageIndex, setPageIndex] = useState(0);
const [pageSize, setPageSize] = useState(25);
const [selectedFields, setSelectedFields] = useState([] as Field[]);
@@ -126,6 +129,8 @@ export const ResultsTable: FC = React.memo(
}
}
+ const needsDestIndexFields = indexPattern && indexPattern.title === jobConfig.source.index[0];
+
const {
errorMessage,
loadExploreData,
@@ -133,12 +138,25 @@ export const ResultsTable: FC = React.memo(
sortDirection,
status,
tableItems,
- } = useExploreData(jobConfig, selectedFields, setSelectedFields, setDocFields, setDepVarType);
+ } = useExploreData(
+ jobConfig,
+ needsDestIndexFields,
+ selectedFields,
+ setSelectedFields,
+ setDocFields,
+ setDepVarType
+ );
const columns: Array> = selectedFields
.sort(({ name: a }, { name: b }) => sortRegressionResultsFields(a, b, jobConfig))
.map(field => {
const { type } = field;
+ let format: any;
+
+ if (indexPattern !== undefined) {
+ format = mlFieldFormatService.getFieldFormatFromIndexPattern(indexPattern, field.id, '');
+ }
+
const isNumber =
type !== undefined &&
(BASIC_NUMERICAL_TYPES.has(type) || EXTENDED_NUMERICAL_TYPES.has(type));
@@ -151,6 +169,11 @@ export const ResultsTable: FC = React.memo(
};
const render = (d: any, fullItem: EsDoc) => {
+ if (format !== undefined) {
+ d = format.convert(d, 'text');
+ return d;
+ }
+
if (Array.isArray(d) && d.every(item => typeof item === 'string')) {
// If the cells data is an array of strings, return as a comma separated list.
// The list will get limited to 5 items with `…` at the end if there's more in the original array.
@@ -193,12 +216,16 @@ export const ResultsTable: FC = React.memo(
break;
case ES_FIELD_TYPES.DATE:
column.align = 'right';
- column.render = (d: any) => {
- if (d !== undefined) {
- return formatHumanReadableDateTimeSeconds(moment(d).unix() * 1000);
- }
- return d;
- };
+ if (format !== undefined) {
+ column.render = render;
+ } else {
+ column.render = (d: any) => {
+ if (d !== undefined) {
+ return formatHumanReadableDateTimeSeconds(moment(d).unix() * 1000);
+ }
+ return d;
+ };
+ }
break;
default:
column.render = render;
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts
index 22fbbaac99a18..e158e952c1c18 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/use_explore_data.ts
@@ -46,6 +46,7 @@ export interface UseExploreDataReturnType {
export const useExploreData = (
jobConfig: DataFrameAnalyticsConfig | undefined,
+ needsDestIndexFields: boolean,
selectedFields: Field[],
setSelectedFields: React.Dispatch>,
setDocFields: React.Dispatch>,
@@ -65,7 +66,7 @@ export const useExploreData = (
selectedFields: defaultSelected,
docFields,
depVarType,
- } = getDefaultFieldsFromJobCaps(fields, jobConfig);
+ } = getDefaultFieldsFromJobCaps(fields, jobConfig, needsDestIndexFields);
setDepVarType(depVarType);
setSelectedFields(defaultSelected);
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/hooks/use_explore_data/use_explore_data.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/hooks/use_explore_data/use_explore_data.ts
index d637057a4430d..30f2139a263f7 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/hooks/use_explore_data/use_explore_data.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/hooks/use_explore_data/use_explore_data.ts
@@ -116,12 +116,32 @@ export const useExploreData = (jobId: string): UseExploreDataReturnType => {
useEffect(() => {
(async () => {
if (jobConfig !== undefined) {
- const sourceIndex = jobConfig.source.index[0];
- const indexPatternId = getIndexPatternIdFromName(sourceIndex) || sourceIndex;
- const jobCapsIndexPattern: IndexPattern = await mlContext.indexPatterns.get(indexPatternId);
- if (jobCapsIndexPattern !== undefined) {
- setIndexPattern(jobCapsIndexPattern);
- await newJobCapsService.initializeFromIndexPattern(jobCapsIndexPattern, false, false);
+ try {
+ const destIndex = Array.isArray(jobConfig.dest.index)
+ ? jobConfig.dest.index[0]
+ : jobConfig.dest.index;
+ const destIndexPatternId = getIndexPatternIdFromName(destIndex) || destIndex;
+ let indexP: IndexPattern | undefined;
+
+ try {
+ indexP = await mlContext.indexPatterns.get(destIndexPatternId);
+ } catch (e) {
+ indexP = undefined;
+ }
+
+ if (indexP === undefined) {
+ const sourceIndex = jobConfig.source.index[0];
+ const sourceIndexPatternId = getIndexPatternIdFromName(sourceIndex) || sourceIndex;
+ indexP = await mlContext.indexPatterns.get(sourceIndexPatternId);
+ }
+
+ if (indexP !== undefined) {
+ setIndexPattern(indexP);
+ await newJobCapsService.initializeFromIndexPattern(indexP, false, false);
+ }
+ } catch (e) {
+ // eslint-disable-next-line
+ console.log('Error loading index field data', e);
}
}
})();
From 12c8ff78d722ccb0e2a1aa5486e8fb303398db80 Mon Sep 17 00:00:00 2001
From: Jean-Louis Leysens
Date: Tue, 31 Mar 2020 17:26:46 +0200
Subject: [PATCH 011/104] [UA] Tight worker loop can cause high CPU usage
(#60950)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Addded worker padding to save some CPU
* Updated comments
* Update worker scheduler and add a new util
The worker scheduler should only sleep when it cannot process any
in progress operations. Additionally, logic has been added
for handling of queue operations that have been in the queue for
a long time and may be viewed as still in small window of time
by wokers that do not have the credentials to process those
reindex operations.
* res 👉🏻resolve
Co-authored-by: Elastic Machine
---
.../server/lib/reindexing/op_utils.ts | 3 ++
.../server/lib/reindexing/worker.ts | 41 +++++++++++++++----
2 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/op_utils.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/op_utils.ts
index ecba02e0d5466..7e921d8c571df 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/op_utils.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/op_utils.ts
@@ -50,6 +50,9 @@ const orderQueuedReindexOperations = ({
),
});
+export const isQueuedOp = (op: ReindexSavedObject) =>
+ Boolean(op.attributes.reindexOptions?.queueSettings);
+
export const queuedOpHasStarted = (op: ReindexSavedObject) =>
Boolean(op.attributes.reindexOptions?.queueSettings?.startedAt);
diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts
index d6051ce46312f..8aa678b2f66c2 100644
--- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts
+++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/worker.ts
@@ -10,12 +10,18 @@ import { Credential, CredentialStore } from './credential_store';
import { reindexActionsFactory } from './reindex_actions';
import { ReindexService, reindexServiceFactory } from './reindex_service';
import { LicensingPluginSetup } from '../../../../licensing/server';
-import { sortAndOrderReindexOperations, queuedOpHasStarted } from './op_utils';
+import { sortAndOrderReindexOperations, queuedOpHasStarted, isQueuedOp } from './op_utils';
const POLL_INTERVAL = 30000;
// If no nodes have been able to update this index in 2 minutes (due to missing credentials), set to paused.
const PAUSE_WINDOW = POLL_INTERVAL * 4;
+/**
+ * To avoid running the worker loop very tightly and causing a CPU bottleneck we use this
+ * padding to simulate an asynchronous sleep. See the description of the tight loop below.
+ */
+const WORKER_PADDING_MS = 1000;
+
/**
* A singleton worker that will coordinate two polling loops:
* (1) A longer loop that polls for reindex operations that are in progress. If any are found, loop (2) is started.
@@ -102,16 +108,25 @@ export class ReindexWorker {
/**
* Runs an async loop until all inProgress jobs are complete or failed.
*/
- private startUpdateOperationLoop = async () => {
+ private startUpdateOperationLoop = async (): Promise => {
this.updateOperationLoopRunning = true;
-
try {
while (this.inProgressOps.length > 0) {
this.log.debug(`Updating ${this.inProgressOps.length} reindex operations`);
// Push each operation through the state machine and refresh.
await Promise.all(this.inProgressOps.map(this.processNextStep));
+
await this.refresh();
+
+ if (
+ this.inProgressOps.length &&
+ this.inProgressOps.every(op => !this.credentialStore.get(op))
+ ) {
+ // TODO: This tight loop needs something to relax potentially high CPU demands so this padding is added.
+ // This scheduler should be revisited in future.
+ await new Promise(resolve => setTimeout(resolve, WORKER_PADDING_MS));
+ }
}
} finally {
this.updateOperationLoopRunning = false;
@@ -173,20 +188,32 @@ export class ReindexWorker {
}
};
- private processNextStep = async (reindexOp: ReindexSavedObject) => {
+ private lastCheckedQueuedOpId: string | undefined;
+ private processNextStep = async (reindexOp: ReindexSavedObject): Promise => {
const credential = this.credentialStore.get(reindexOp);
if (!credential) {
- // Set to paused state if the job hasn't been updated in PAUSE_WINDOW.
+ // If this is a queued reindex op, and we know there can only ever be one in progress at a
+ // given time, there is a small chance it may have just reached the front of the queue so
+ // we give it a chance to be updated by another worker with credentials by making this a
+ // noop once. If it has not been updated by the next loop we will mark it paused if it
+ // falls outside of PAUSE_WINDOW.
+ if (isQueuedOp(reindexOp)) {
+ if (this.lastCheckedQueuedOpId !== reindexOp.id) {
+ this.lastCheckedQueuedOpId = reindexOp.id;
+ return;
+ }
+ }
// This indicates that no Kibana nodes currently have credentials to update this job.
const now = moment();
const updatedAt = moment(reindexOp.updated_at);
if (updatedAt < now.subtract(PAUSE_WINDOW)) {
- return this.reindexService.pauseReindexOperation(reindexOp.attributes.indexName);
+ await this.reindexService.pauseReindexOperation(reindexOp.attributes.indexName);
+ return;
} else {
// If it has been updated recently, we assume another node has the necessary credentials,
// and this becomes a noop.
- return reindexOp;
+ return;
}
}
From 81e1dca2c8c6f57f74f5b95ecd73d3dcf53f086a Mon Sep 17 00:00:00 2001
From: Yuliia Naumenko
Date: Tue, 31 Mar 2020 08:49:08 -0700
Subject: [PATCH 012/104] Added styles to make combobox list items wider for
alerting flyout (#61894)
* Added styles to make combobox list items wider for alerting flyout
* Fixed width for OF expression popover
* Fixed due to comments
* Fixed due to comments
* Resized
---
.../triggers_actions_ui/public/common/expression_items/of.scss | 3 +++
.../triggers_actions_ui/public/common/expression_items/of.tsx | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
create mode 100644 x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.scss
diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.scss b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.scss
new file mode 100644
index 0000000000000..6b55a43201d16
--- /dev/null
+++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.scss
@@ -0,0 +1,3 @@
+.actOf__aggFieldContainer {
+ width: $euiSize * 29;
+}
diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx
index 70aa4be6b7f87..d399f6136690b 100644
--- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx
+++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx
@@ -18,6 +18,7 @@ import {
import { builtInAggregationTypes } from '../constants';
import { AggregationType } from '../types';
import { ClosablePopoverTitle } from './components';
+import './of.scss';
interface OfExpressionProps {
aggType: string;
@@ -108,7 +109,7 @@ export const OfExpression = ({
/>
-
+ 0 && aggField !== undefined}
From 341c787f9cccf246f37fd34384cd5f3fd3ba8624 Mon Sep 17 00:00:00 2001
From: The SpaceCake Project
Date: Tue, 31 Mar 2020 12:24:59 -0400
Subject: [PATCH 013/104] [SIEM] version 7.7 rule import (#61903)
* rule import
* Update x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json
Co-Authored-By: Garrett Spong
* Update add_prepackaged_rules_schema.ts
* Update rule.ts
* updates 'prebuilt_rules_loaded' data (#61940)
Co-authored-by: Garrett Spong
Co-authored-by: Elastic Machine
Co-authored-by: MadameSheema
---
.../plugins/siem/cypress/objects/rule.ts | 2 +-
.../schemas/add_prepackaged_rules_schema.ts | 8 +-
.../403_response_to_a_post.json | 7 +-
.../405_response_method_not_allowed.json | 7 +-
..._security_adversary_behavior_detected.json | 3 +-
...dpoint_security_cred_dumping_detected.json | 3 +-
...point_security_cred_dumping_prevented.json | 3 +-
...t_security_cred_manipulation_detected.json | 3 +-
..._security_cred_manipulation_prevented.json | 3 +-
...ic_endpoint_security_exploit_detected.json | 3 +-
...c_endpoint_security_exploit_prevented.json | 3 +-
...ic_endpoint_security_malware_detected.json | 3 +-
...c_endpoint_security_malware_prevented.json | 3 +-
...nt_security_permission_theft_detected.json | 3 +-
...t_security_permission_theft_prevented.json | 3 +-
...t_security_process_injection_detected.json | 3 +-
..._security_process_injection_prevented.json | 3 +-
...endpoint_security_ransomware_detected.json | 3 +-
...ndpoint_security_ransomware_prevented.json | 3 +-
...den_file_attribute_with_via_attribexe.json | 5 +-
.../eql_adobe_hijack_persistence.json | 3 +-
.../eql_clearing_windows_event_logs.json | 5 +-
...delete_volume_usn_journal_with_fsutil.json | 5 +-
...deleting_backup_catalogs_with_wbadmin.json | 5 +-
.../eql_direct_outbound_smb_connection.json | 5 +-
...ble_windows_firewall_rules_with_netsh.json | 5 +-
...coding_or_decoding_files_via_certutil.json | 5 +-
.../eql_local_scheduled_task_commands.json | 5 +-
.../eql_local_service_commands.json | 5 +-
...ql_msbuild_making_network_connections.json | 5 +-
.../eql_mshta_making_network_connections.json | 5 +-
.../eql_psexec_lateral_movement_command.json | 5 +-
...ql_suspicious_ms_office_child_process.json | 7 +-
...l_suspicious_ms_outlook_child_process.json | 7 +-
.../eql_system_shells_via_services.json | 5 +-
...usual_network_connection_via_rundll32.json | 5 +-
.../eql_unusual_parentchild_relationship.json | 7 +-
...ql_unusual_process_network_connection.json | 5 +-
.../eql_user_account_creation.json | 5 +-
...ume_shadow_copy_deletion_via_vssadmin.json | 7 +-
..._volume_shadow_copy_deletion_via_wmic.json | 5 +-
...l_windows_script_executing_powershell.json | 5 +-
.../rules/prepackaged_rules/index.ts | 180 +++-
.../linux_anomalous_network_activity.json | 24 +
...linux_anomalous_network_port_activity.json | 24 +
.../linux_anomalous_network_service.json | 24 +
.../linux_anomalous_network_url_activity.json | 24 +
.../linux_anomalous_process_all_hosts.json | 24 +
.../linux_anomalous_user_name.json | 24 +
.../linux_hping_activity.json | 5 +-
.../linux_iodine_activity.json | 5 +-
.../linux_kernel_module_activity.json | 5 +-
.../linux_mknod_activity.json | 7 +-
.../linux_netcat_network_connection.json | 5 +-
.../linux_nmap_activity.json | 7 +-
.../linux_nping_activity.json | 9 +-
...nux_process_started_in_temp_directory.json | 7 +-
.../linux_shell_activity_by_web_server.json | 5 +-
.../linux_socat_activity.json | 7 +-
.../linux_strace_activity.json | 5 +-
.../linux_tcpdump_activity.json | 5 +-
.../linux_whoami_commmand.json | 7 +-
.../network_dns_directly_to_the_internet.json | 9 +-
...fer_protocol_activity_to_the_internet.json | 9 +-
...hat_protocol_activity_to_the_internet.json | 9 +-
.../network_nat_traversal_port_activity.json | 7 +-
.../network_port_26_activity.json | 7 +-
...rk_port_8000_activity_to_the_internet.json | 9 +-
..._to_point_tunneling_protocol_activity.json | 7 +-
...k_proxy_port_activity_to_the_internet.json | 11 +-
...te_desktop_protocol_from_the_internet.json | 11 +-
...mote_desktop_protocol_to_the_internet.json | 11 +-
...mote_procedure_call_from_the_internet.json | 9 +-
...remote_procedure_call_to_the_internet.json | 9 +-
...file_sharing_activity_to_the_internet.json | 9 +-
.../network_smtp_to_the_internet.json | 11 +-
..._server_port_activity_to_the_internet.json | 11 +-
...rk_ssh_secure_shell_from_the_internet.json | 11 +-
...work_ssh_secure_shell_to_the_internet.json | 11 +-
.../network_telnet_port_activity.json | 9 +-
.../network_tor_activity_to_the_internet.json | 11 +-
...l_network_computing_from_the_internet.json | 11 +-
...ual_network_computing_to_the_internet.json | 11 +-
.../prepackaged_rules/null_user_agent.json | 9 +-
.../packetbeat_dns_tunneling.json | 24 +
.../packetbeat_rare_dns_question.json | 24 +
.../packetbeat_rare_server_domain.json | 24 +
.../packetbeat_rare_urls.json | 24 +
.../packetbeat_rare_user_agent.json | 24 +
.../rare_process_by_host_linux.json | 24 +
.../rare_process_by_host_windows.json | 24 +
.../prepackaged_rules/sqlmap_user_agent.json | 7 +-
.../suspicious_login_activity.json | 24 +
.../windows_anomalous_network_activity.json | 24 +
.../windows_anomalous_path_activity.json | 24 +
.../windows_anomalous_process_all_hosts.json | 24 +
.../windows_anomalous_process_creation.json | 24 +
.../windows_anomalous_script.json | 24 +
.../windows_anomalous_service.json | 24 +
.../windows_anomalous_user_name.json | 24 +
.../windows_certutil_network_connection.json | 36 +
...and_prompt_connecting_to_the_internet.json | 5 +-
...s_command_shell_started_by_powershell.json | 3 +-
...dows_command_shell_started_by_svchost.json | 3 +-
.../windows_credential_dumping_msbuild.json | 38 +
.../windows_cve_2020_0601.json | 36 +
...ws_defense_evasion_via_filter_manager.json | 3 +-
...ecution_msbuild_started_by_office_app.json | 56 ++
...s_execution_msbuild_started_by_script.json | 53 ++
...ion_msbuild_started_by_system_process.json | 53 ++
...ows_execution_msbuild_started_renamed.json | 38 +
...cution_msbuild_started_unusal_process.json | 41 +
...dows_execution_via_compiled_html_file.json | 3 +-
...dows_execution_via_net_com_assemblies.json | 51 +
...ution_via_trusted_developer_utilities.json | 5 +-
...le_program_connecting_to_the_internet.json | 5 +-
.../windows_injection_msbuild.json | 53 ++
...isc_lolbin_connecting_to_the_internet.json | 5 +-
.../windows_modification_of_boot_config.json | 36 +
.../windows_msxsl_network.json | 36 +
.../windows_net_command_system_account.json | 36 +
..._persistence_via_application_shimming.json | 3 +-
...escalation_via_accessibility_features.json | 5 +-
...rocess_discovery_via_tasklist_command.json | 3 +-
.../windows_rare_user_runas_event.json | 24 +
...windows_rare_user_type10_remote_login.json | 24 +
...er_program_connecting_to_the_internet.json | 7 +-
.../windows_suspicious_pdf_reader.json | 35 +
.../windows_uac_bypass_event_viewer.json | 36 +
.../windows_whoami_command_activity.json | 3 +-
.../prebuilt_rules_loaded/data.json.gz | Bin 27315 -> 40255 bytes
.../prebuilt_rules_loaded/mappings.json | 886 +++++++++++++++++-
132 files changed, 2423 insertions(+), 370 deletions(-)
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json
create mode 100644 x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json
diff --git a/x-pack/legacy/plugins/siem/cypress/objects/rule.ts b/x-pack/legacy/plugins/siem/cypress/objects/rule.ts
index 37c325c3b8030..ce920aeb957af 100644
--- a/x-pack/legacy/plugins/siem/cypress/objects/rule.ts
+++ b/x-pack/legacy/plugins/siem/cypress/objects/rule.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
-export const totalNumberOfPrebuiltRules = 92;
+export const totalNumberOfPrebuiltRules = 130;
interface Mitre {
tactic: string;
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts
index da9f9777a01a6..006fc81e3ee87 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts
@@ -52,7 +52,7 @@ import { hasListsFeature } from '../../feature_flags';
* - immutable is forbidden but defaults to true instead of to false and it can only ever be true
* - enabled defaults to false instead of true
* - version is a required field that must exist
- * - index is a required field that must exist
+ * - index is a required field that must exist if type !== machine_learning
*/
export const addPrepackagedRulesSchema = Joi.object({
actions: actions.default([]),
@@ -71,7 +71,11 @@ export const addPrepackagedRulesSchema = Joi.object({
.forbidden()
.default(true)
.valid(true),
- index: index.required(),
+ index: index.when('type', {
+ is: 'machine_learning',
+ then: Joi.forbidden(),
+ otherwise: Joi.required(),
+ }),
interval: interval.default('5m'),
query: query.when('type', {
is: 'machine_learning',
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json
index fd46a09d4ced0..3b043439759c1 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json
@@ -7,7 +7,6 @@
"apm-*-transaction*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Web Application Suspicious Activity: POST Request Declined",
"query": "http.response.status_code:403 and http.request.method:post",
"references": [
@@ -17,9 +16,9 @@
"rule_id": "a87a4e42-1d82-44bd-b0bf-d9b7f91fb89e",
"severity": "medium",
"tags": [
- "Elastic",
- "APM"
+ "APM",
+ "Elastic"
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json
index a6235c889902b..12c6a5feabebb 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json
@@ -7,7 +7,6 @@
"apm-*-transaction*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Web Application Suspicious Activity: Unauthorized Method",
"query": "http.response.status_code:405",
"references": [
@@ -17,9 +16,9 @@
"rule_id": "75ee75d8-c180-481c-ba88-ee50129a6aef",
"severity": "medium",
"tags": [
- "Elastic",
- "APM"
+ "APM",
+ "Elastic"
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json
index 397db1367f402..a3302896b7e98 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Adversary Behavior - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:rules_engine_event",
"risk_score": 47,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json
index fdd875e95b3d3..8c2c5f32feab7 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Credential Dumping - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:cred_theft_event and endgame.metadata.type:detection",
"risk_score": 73,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json
index 8ed63c55ef213..6a96da3218bf2 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Credential Dumping - Prevented - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:cred_theft_event and endgame.metadata.type:prevention",
"risk_score": 47,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json
index 98c4e5341d9e8..954e35ccd644a 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Credential Manipulation - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:token_manipulation_event and endgame.metadata.type:detection",
"risk_score": 73,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json
index 4234e3d955794..0de35891a3e81 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Credential Manipulation - Prevented - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:token_manipulation_event and endgame.metadata.type:prevention",
"risk_score": 47,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json
index 9971075d7e617..3652b7068ecd2 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Exploit - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:exploit_event and endgame.metadata.type:detection",
"risk_score": 73,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json
index 233552fc1de13..dbc910c3002a7 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Exploit - Prevented - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:exploit_event and endgame.metadata.type:prevention",
"risk_score": 47,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json
index 64d686fb984c9..efe2806532be0 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Malware - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:file_classification_event and endgame.metadata.type:detection",
"risk_score": 99,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json
index 72f2134f23ab2..51028b9dbeeb3 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Malware - Prevented - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:file_classification_event and endgame.metadata.type:prevention",
"risk_score": 73,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json
index 3755dd4cd5dac..c30ca0632f410 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Permission Theft - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:token_protection_event and endgame.metadata.type:detection",
"risk_score": 73,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json
index d869407586372..ed0c714254743 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Permission Theft - Prevented - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:token_protection_event and endgame.metadata.type:prevention",
"risk_score": 47,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json
index 1078cf69394e2..63b008849487a 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Process Injection - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:kernel_shellcode_event and endgame.metadata.type:detection",
"risk_score": 73,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json
index 8b68fc6925f9b..135b4a95e8005 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Process Injection - Prevented - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:kernel_shellcode_event and endgame.metadata.type:prevention",
"risk_score": 47,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json
index a332c7011e94b..d4042a5e6b9e1 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Ransomware - Detected - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:ransomware_event and endgame.metadata.type:detection",
"risk_score": 99,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json
index 087c91d2105ce..befdf611da223 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json
@@ -6,7 +6,6 @@
],
"interval": "10m",
"language": "kuery",
- "max_signals": 100,
"name": "Ransomware - Prevented - Elastic Endpoint",
"query": "event.kind:alert and event.module:endgame and event.action:ransomware_event and endgame.metadata.type:prevention",
"risk_score": 73,
@@ -18,4 +17,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json
index 43aead33925c1..6c9b54b8ddb02 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Adding Hidden File Attribute via Attrib",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.name:\"attrib.exe\" and process.args:\"+h\"",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:attrib.exe and process.args:+h",
"risk_score": 21,
"rule_id": "4630d948-40d4-4cef-ac69-4002e29bc3db",
"severity": "low",
@@ -48,4 +47,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json
index 8b8c510093260..3b4d2bc040217 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json
@@ -4,7 +4,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Adobe Hijack Persistence",
"query": "file.path:(\"C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe\" or \"C:\\Program Files\\Adobe\\Acrobat Reader DC\\Reader\\AcroCEF\\RdrCEF.exe\") and event.action:\"File created (rule: FileCreate)\" and not process.name:msiexec.exe",
"risk_score": 21,
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 2
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json
index 135e81148475f..244d329cc4bb7 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Clearing Windows Event Logs",
- "query": "event.action:\"Process Create (rule: ProcessCreate)\" and (process.name:\"wevtutil.exe\" and process.args:\"cl\") or (process.name:\"powershell.exe\" and process.args:\"Clear-EventLog\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:wevtutil.exe and process.args:cl or process.name:powershell.exe and process.args:Clear-EventLog",
"risk_score": 21,
"rule_id": "d331bbe2-6db4-4941-80a5-8270db72eb61",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json
index 815e2abd0fc96..4087542816588 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Delete Volume USN Journal with Fsutil",
- "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:\"fsutil.exe\" and process.args:(\"usn\" and \"deletejournal\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:fsutil.exe and process.args:(deletejournal and usn)",
"risk_score": 21,
"rule_id": "f675872f-6d85-40a3-b502-c0d2ef101e92",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json
index d990e071b2123..eca06723e68b8 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Deleting Backup Catalogs with Wbadmin",
- "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:\"wbadmin.exe\" and process.args:(\"delete\" and \"catalog\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:wbadmin.exe and process.args:(catalog and delete)",
"risk_score": 21,
"rule_id": "581add16-df76-42bb-af8e-c979bfb39a59",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json
index 9d1cebb32c865..e37c877c62889 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Direct Outbound SMB Connection",
- "query": " event.action:\"Network connection detected (rule: NetworkConnect)\" and destination.port:445 and not process.pid:4 and not destination.ip:(\"127.0.0.1\" or \"::1\")",
+ "query": "event.action:\"Network connection detected (rule: NetworkConnect)\" and destination.port:445 and not process.pid:4 and not destination.ip:(127.0.0.1 or \"::1\")",
"risk_score": 47,
"rule_id": "c82c7d8f-fb9e-4874-a4bd-fd9e3f9becf1",
"severity": "medium",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json
index 7ead979f27bb1..f6b4bc67ed9b1 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Disable Windows Firewall Rules via Netsh",
- "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:\"netsh.exe\" and process.args:(\"firewall\" and \"set\" and \"disable\") or process.args:(\"advfirewall\" and \"state\" and \"off\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:netsh.exe and process.args:(disable and firewall and set) or process.args:(advfirewall and off and state)",
"risk_score": 47,
"rule_id": "4b438734-3793-4fda-bd42-ceeada0be8f9",
"severity": "medium",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json
index 2cb92f0a26c90..38162889737ff 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Encoding or Decoding Files via CertUtil",
- "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:\"certutil.exe\" and process.args:(\"-encode\" or \"/encode\" or \"-decode\" or \"/decode\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:certutil.exe and process.args:(-decode or -encode or /decode or /encode)",
"risk_score": 47,
"rule_id": "fd70c98a-c410-42dc-a2e3-761c71848acf",
"severity": "medium",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json
index e7f46b46c2ce2..42007f153bd55 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json
@@ -7,9 +7,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Local Scheduled Task Commands",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.name:schtasks.exe and process.args:(\"/create\" or \"-create\" or \"/S\" or \"-s\" or \"/run\" or \"-run\" or \"/change\" or \"-change\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:schtasks.exe and process.args:(-change or -create or -run or -s or /S or /change or /create or /run)",
"risk_score": 21,
"rule_id": "afcce5ad-65de-4ed2-8516-5e093d3ac99a",
"severity": "low",
@@ -36,4 +35,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json
index b018435ea0214..9559baabe0e40 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Local Service Commands",
- "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:sc.exe and process.args:(\"create\" or \"config\" or \"failure\" or \"start\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:sc.exe and process.args:(config or create or failure or start)",
"risk_score": 21,
"rule_id": "e8571d5f-bea1-46c2-9f56-998de2d3ed95",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json
index 7d84e0bda06e5..3e34aacf605c7 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "MsBuild Making Network Connections",
- "query": " event.action:\"Network connection detected (rule: NetworkConnect)\" and process.name:MSBuild.exe and not destination.ip:(\"127.0.0.1\" or \"::1\")",
+ "query": "event.action:\"Network connection detected (rule: NetworkConnect)\" and process.name:MSBuild.exe and not destination.ip:(127.0.0.1 or \"::1\")",
"risk_score": 47,
"rule_id": "0e79980b-4250-4a50-a509-69294c14e84b",
"severity": "medium",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json
index 44141b08fb8f0..769614e8faf53 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Network Connection via Mshta",
- "query": "event.action:\"Network connection detected (rule: NetworkConnect)\" and process.name:\"mshta.exe\"",
+ "query": "event.action:\"Network connection detected (rule: NetworkConnect)\" and process.name:mshta.exe",
"references": [
"https://www.fireeye.com/blog/threat-research/2017/05/cyber-espionage-apt32.html"
],
@@ -36,4 +35,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json
index 580f73c25a4a2..ac170665042f6 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json
@@ -7,9 +7,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "PsExec Network Connection",
- "query": "process.name:PsExec.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" ",
+ "query": "process.name:PsExec.exe and event.action:\"Network connection detected (rule: NetworkConnect)\"",
"risk_score": 21,
"rule_id": "55d551c6-333b-4665-ab7e-5d14a59715ce",
"severity": "low",
@@ -51,4 +50,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json
index 95aabc49b5302..95c9c6b72f8f4 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Suspicious MS Office Child Process",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:(\"winword.exe\" or \"excel.exe\" or \"powerpnt.exe\" or \"eqnedt32.exe\" or \"fltldr.exe\" or \"mspub.exe\" or \"msaccess.exe\") and process.name:(\"arp.exe\" or \"dsquery.exe\" or \"dsget.exe\" or \"gpresult.exe\" or \"hostname.exe\" or \"ipconfig.exe\" or \"nbtstat.exe\" or \"net.exe\" or \"net1.exe\" or \"netsh.exe\" or \"netstat.exe\" or \"nltest.exe\" or \"ping.exe\" or \"qprocess.exe\" or \"quser.exe\" or \"qwinsta.exe\" or \"reg.exe\" or \"sc.exe\" or \"systeminfo.exe\" or \"tasklist.exe\" or \"tracert.exe\" or \"whoami.exe\" or \"bginfo.exe\" or \"cdb.exe\" or \"cmstp.exe\" or \"csi.exe\" or \"dnx.exe\" or \"fsi.exe\" or \"ieexec.exe\" or \"iexpress.exe\" or \"installutil.exe\" or \"Microsoft.Workflow.Compiler.exe\" or \"msbuild.exe\" or \"mshta.exe\" or \"msxsl.exe\" or \"odbcconf.exe\" or \"rcsi.exe\" or \"regsvr32.exe\" or \"xwizard.exe\" or \"atbroker.exe\" or \"forfiles.exe\" or \"schtasks.exe\" or \"regasm.exe\" or \"regsvcs.exe\" or \"cmd.exe\" or \"cscript.exe\" or \"powershell.exe\" or \"pwsh.exe\" or \"wmic.exe\" or \"wscript.exe\" or \"bitsadmin.exe\" or \"certutil.exe\" or \"ftp.exe\") ",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:(eqnedt32.exe or excel.exe or fltldr.exe or msaccess.exe or mspub.exe or powerpnt.exe or winword.exe) and process.name:(Microsoft.Workflow.Compiler.exe or arp.exe or atbroker.exe or bginfo.exe or bitsadmin.exe or cdb.exe or certutil.exe or cmd.exe or cmstp.exe or cscript.exe or csi.exe or dnx.exe or dsget.exe or dsquery.exe or forfiles.exe or fsi.exe or ftp.exe or gpresult.exe or hostname.exe or ieexec.exe or iexpress.exe or installutil.exe or ipconfig.exe or mshta.exe or msxsl.exe or nbtstat.exe or net.exe or net1.exe or netsh.exe or netstat.exe or nltest.exe or odbcconf.exe or ping.exe or powershell.exe or pwsh.exe or qprocess.exe or quser.exe or qwinsta.exe or rcsi.exe or reg.exe or regasm.exe or regsvcs.exe or regsvr32.exe or sc.exe or schtasks.exe or systeminfo.exe or tasklist.exe or tracert.exe or whoami.exe or wmic.exe or wscript.exe or xwizard.exe)",
"risk_score": 21,
"rule_id": "a624863f-a70d-417f-a7d2-7a404638d47f",
"severity": "low",
@@ -32,5 +31,5 @@
}
],
"type": "query",
- "version": 1
-}
+ "version": 2
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json
index f31228d0130f8..7f6c9257fabfd 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Suspicious MS Outlook Child Process",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:\"outlook.exe\" and process.name:(\"arp.exe\" or \"dsquery.exe\" or \"dsget.exe\" or \"gpresult.exe\" or \"hostname.exe\" or \"ipconfig.exe\" or \"nbtstat.exe\" or \"net.exe\" or \"net1.exe\" or \"netsh.exe\" or \"netstat.exe\" or \"nltest.exe\" or \"ping.exe\" or \"qprocess.exe\" or \"quser.exe\" or \"qwinsta.exe\" or \"reg.exe\" or \"sc.exe\" or \"systeminfo.exe\" or \"tasklist.exe\" or \"tracert.exe\" or \"whoami.exe\" or \"bginfo.exe\" or \"cdb.exe\" or \"cmstp.exe\" or \"csi.exe\" or \"dnx.exe\" or \"fsi.exe\" or \"ieexec.exe\" or \"iexpress.exe\" or \"installutil.exe\" or \"Microsoft.Workflow.Compiler.exe\" or \"msbuild.exe\" or \"mshta.exe\" or \"msxsl.exe\" or \"odbcconf.exe\" or \"rcsi.exe\" or \"regsvr32.exe\" or \"xwizard.exe\" or \"atbroker.exe\" or \"forfiles.exe\" or \"schtasks.exe\" or \"regasm.exe\" or \"regsvcs.exe\" or \"cmd.exe\" or \"cscript.exe\" or \"powershell.exe\" or \"pwsh.exe\" or \"wmic.exe\" or \"wscript.exe\" or \"bitsadmin.exe\" or \"certutil.exe\" or \"ftp.exe\") ",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:outlook.exe and process.name:(Microsoft.Workflow.Compiler.exe or arp.exe or atbroker.exe or bginfo.exe or bitsadmin.exe or cdb.exe or certutil.exe or cmd.exe or cmstp.exe or cscript.exe or csi.exe or dnx.exe or dsget.exe or dsquery.exe or forfiles.exe or fsi.exe or ftp.exe or gpresult.exe or hostname.exe or ieexec.exe or iexpress.exe or installutil.exe or ipconfig.exe or mshta.exe or msxsl.exe or nbtstat.exe or net.exe or net1.exe or netsh.exe or netstat.exe or nltest.exe or odbcconf.exe or ping.exe or powershell.exe or pwsh.exe or qprocess.exe or quser.exe or qwinsta.exe or rcsi.exe or reg.exe or regasm.exe or regsvcs.exe or regsvr32.exe or sc.exe or schtasks.exe or systeminfo.exe or tasklist.exe or tracert.exe or whoami.exe or wmic.exe or wscript.exe or xwizard.exe)",
"risk_score": 21,
"rule_id": "32f4675e-6c49-4ace-80f9-97c9259dca2e",
"severity": "low",
@@ -32,5 +31,5 @@
}
],
"type": "query",
- "version": 1
-}
+ "version": 2
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json
index a38232f37843e..1c001caa1539c 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "System Shells via Services",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:\"services.exe\" and process.name:(\"cmd.exe\" or \"powershell.exe\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:services.exe and process.name:(cmd.exe or powershell.exe)",
"risk_score": 47,
"rule_id": "0022d47d-39c7-4f69-a232-4fe9dc7a3acd",
"severity": "medium",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json
index 820c69cb3c809..0165f4d7512e4 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Unusual Network Connection via RunDLL32",
- "query": "process.name:rundll32.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:10.0.0.0/8 and not destination.ip:172.16.0.0/12 and not destination.ip:192.168.0.0/16",
+ "query": "process.name:rundll32.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 21,
"rule_id": "52aaab7b-b51c-441a-89ce-4387b3aea886",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json
index 21d3d2741378a..0b4bf9ff32945 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
- "name": "Unusual Parent-Child Relationship ",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.executable:* and ( (process.name:\"smss.exe\" and not process.parent.name:(\"System\" or \"smss.exe\")) or (process.name:\"csrss.exe\" and not process.parent.name:(\"smss.exe\" or \"svchost.exe\")) or (process.name:\"wininit.exe\" and not process.parent.name:\"smss.exe\") or (process.name:\"winlogon.exe\" and not process.parent.name:\"smss.exe\") or (process.name:\"lsass.exe\" and not process.parent.name:\"wininit.exe\") or (process.name:\"LogonUI.exe\" and not process.parent.name:(\"winlogon.exe\" or \"wininit.exe\")) or (process.name:\"services.exe\" and not process.parent.name:\"wininit.exe\") or (process.name:\"svchost.exe\" and not process.parent.name:(\"services.exe\" or \"MsMpEng.exe\")) or (process.name:\"spoolsv.exe\" and not process.parent.name:\"services.exe\") or (process.name:\"taskhost.exe\" and not process.parent.name:(\"services.exe\" or \"svchost.exe\")) or (process.name:\"taskhostw.exe\" and not process.parent.name:(\"services.exe\" or \"svchost.exe\")) or (process.name:\"userinit.exe\" and not process.parent.name:(\"dwm.exe\" or \"winlogon.exe\")) )",
+ "name": "Unusual Parent-Child Relationship",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.executable:* and (process.name:smss.exe and not process.parent.name:(System or smss.exe) or process.name:csrss.exe and not process.parent.name:(smss.exe or svchost.exe) or process.name:wininit.exe and not process.parent.name:smss.exe or process.name:winlogon.exe and not process.parent.name:smss.exe or process.name:lsass.exe and not process.parent.name:wininit.exe or process.name:LogonUI.exe and not process.parent.name:(wininit.exe or winlogon.exe) or process.name:services.exe and not process.parent.name:wininit.exe or process.name:svchost.exe and not process.parent.name:(MsMpEng.exe or services.exe) or process.name:spoolsv.exe and not process.parent.name:services.exe or process.name:taskhost.exe and not process.parent.name:(services.exe or svchost.exe) or process.name:taskhostw.exe and not process.parent.name:(services.exe or svchost.exe) or process.name:userinit.exe and not process.parent.name:(dwm.exe or winlogon.exe))",
"risk_score": 47,
"rule_id": "35df0dd8-092d-4a83-88c1-5151a804f31b",
"severity": "medium",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json
index ee861e19341af..2c88a2061844c 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Unusual Process Network Connection",
- "query": " event.action:\"Network connection detected (rule: NetworkConnect)\" and process.name:(bginfo.exe or cdb.exe or cmstp.exe or csi.exe or dnx.exe or fsi.exe or ieexec.exe or iexpress.exe or Microsoft.Workflow.Compiler.exe or odbcconf.exe or rcsi.exe or xwizard.exe)",
+ "query": "event.action:\"Network connection detected (rule: NetworkConnect)\" and process.name:(Microsoft.Workflow.Compiler.exe or bginfo.exe or cdb.exe or cmstp.exe or csi.exe or dnx.exe or fsi.exe or ieexec.exe or iexpress.exe or odbcconf.exe or rcsi.exe or xwizard.exe)",
"risk_score": 21,
"rule_id": "610949a1-312f-4e04-bb55-3a79b8c95267",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json
index 5a7aeab224548..240df34419132 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "User Account Creation",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.name:(\"net.exe\" or \"net1.exe\") and not process.parent.name:\"net.exe\" and process.args:(\"user\" and (\"/add\" or \"/ad\")) ",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:(net.exe or net1.exe) and not process.parent.name:net.exe and process.args:(user and (/ad or /add))",
"risk_score": 21,
"rule_id": "1aa9181a-492b-4c01-8b16-fa0735786b2b",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json
index 80c0dd962c099..e12c2e70138c9 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json
@@ -1,12 +1,11 @@
{
- "description": "Identifies use of vssadmin.exe for shadow copy deletion on endpoints. This commonly occurs in tandem with ransomware or other destructive attacks.",
+ "description": "Identifies use of vssadmin.exe for shadow copy deletion on endpoints. This commonly occurs in tandem with ransomware or other destructive attacks.",
"index": [
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Volume Shadow Copy Deletion via VssAdmin",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.name:\"vssadmin.exe\" and process.args:(\"delete\" and \"shadows\") ",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:vssadmin.exe and process.args:(delete and shadows)",
"risk_score": 73,
"rule_id": "b5ea4bfe-a1b2-421f-9d47-22a75a6f2921",
"severity": "high",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json
index d90aca1e2eaf4..94b8846741e3e 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Volume Shadow Copy Deletion via WMIC",
- "query": " event.action:\"Process Create (rule: ProcessCreate)\" and process.name:\"WMIC.exe\" and process.args:(\"shadowcopy\" and \"delete\")",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:WMIC.exe and process.args:(delete and shadowcopy)",
"risk_score": 73,
"rule_id": "dc9c1f74-dac3-48e3-b47f-eb79db358f57",
"severity": "high",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json
index 8f6e97cdd7bdb..b0a754a662c0e 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Windows Script Executing PowerShell",
- "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:(\"wscript.exe\" or \"cscript.exe\") and process.name:\"powershell.exe\"",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:(cscript.exe or wscript.exe) and process.name:powershell.exe",
"risk_score": 21,
"rule_id": "f545ff26-3c94-4fd0-bd33-3c7f95a3a0fc",
"severity": "low",
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts
index d9841948f35a5..c24f5bb64ef5e 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts
@@ -47,58 +47,96 @@ import rule37 from './eql_user_account_creation.json';
import rule38 from './eql_volume_shadow_copy_deletion_via_vssadmin.json';
import rule39 from './eql_volume_shadow_copy_deletion_via_wmic.json';
import rule40 from './eql_windows_script_executing_powershell.json';
-import rule41 from './linux_hping_activity.json';
-import rule42 from './linux_iodine_activity.json';
-import rule43 from './linux_kernel_module_activity.json';
-import rule44 from './linux_mknod_activity.json';
-import rule45 from './linux_netcat_network_connection.json';
-import rule46 from './linux_nmap_activity.json';
-import rule47 from './linux_nping_activity.json';
-import rule48 from './linux_process_started_in_temp_directory.json';
-import rule49 from './linux_shell_activity_by_web_server.json';
-import rule50 from './linux_socat_activity.json';
-import rule51 from './linux_strace_activity.json';
-import rule52 from './linux_tcpdump_activity.json';
-import rule53 from './linux_whoami_commmand.json';
-import rule54 from './network_dns_directly_to_the_internet.json';
-import rule55 from './network_ftp_file_transfer_protocol_activity_to_the_internet.json';
-import rule56 from './network_irc_internet_relay_chat_protocol_activity_to_the_internet.json';
-import rule57 from './network_nat_traversal_port_activity.json';
-import rule58 from './network_port_26_activity.json';
-import rule59 from './network_port_8000_activity_to_the_internet.json';
-import rule60 from './network_pptp_point_to_point_tunneling_protocol_activity.json';
-import rule61 from './network_proxy_port_activity_to_the_internet.json';
-import rule62 from './network_rdp_remote_desktop_protocol_from_the_internet.json';
-import rule63 from './network_rdp_remote_desktop_protocol_to_the_internet.json';
-import rule64 from './network_rpc_remote_procedure_call_from_the_internet.json';
-import rule65 from './network_rpc_remote_procedure_call_to_the_internet.json';
-import rule66 from './network_smb_windows_file_sharing_activity_to_the_internet.json';
-import rule67 from './network_smtp_to_the_internet.json';
-import rule68 from './network_sql_server_port_activity_to_the_internet.json';
-import rule69 from './network_ssh_secure_shell_from_the_internet.json';
-import rule70 from './network_ssh_secure_shell_to_the_internet.json';
-import rule71 from './network_telnet_port_activity.json';
-import rule72 from './network_tor_activity_to_the_internet.json';
-import rule73 from './network_vnc_virtual_network_computing_from_the_internet.json';
-import rule74 from './network_vnc_virtual_network_computing_to_the_internet.json';
-import rule75 from './null_user_agent.json';
-import rule76 from './sqlmap_user_agent.json';
-import rule77 from './windows_command_prompt_connecting_to_the_internet.json';
-import rule78 from './windows_command_shell_started_by_powershell.json';
-import rule79 from './windows_command_shell_started_by_svchost.json';
-import rule80 from './windows_defense_evasion_via_filter_manager.json';
-import rule81 from './windows_execution_via_compiled_html_file.json';
-import rule82 from './windows_execution_via_regsvr32.json';
-import rule83 from './windows_execution_via_trusted_developer_utilities.json';
-import rule84 from './windows_html_help_executable_program_connecting_to_the_internet.json';
-import rule85 from './windows_misc_lolbin_connecting_to_the_internet.json';
-import rule86 from './windows_persistence_via_application_shimming.json';
-import rule87 from './windows_priv_escalation_via_accessibility_features.json';
-import rule88 from './windows_process_discovery_via_tasklist_command.json';
-import rule89 from './windows_register_server_program_connecting_to_the_internet.json';
-import rule90 from './windows_signed_binary_proxy_execution.json';
-import rule91 from './windows_suspicious_process_started_by_a_script.json';
-import rule92 from './windows_whoami_command_activity.json';
+import rule41 from './linux_anomalous_network_activity.json';
+import rule42 from './linux_anomalous_network_port_activity.json';
+import rule43 from './linux_anomalous_network_service.json';
+import rule44 from './linux_anomalous_network_url_activity.json';
+import rule45 from './linux_anomalous_process_all_hosts.json';
+import rule46 from './linux_anomalous_user_name.json';
+import rule47 from './linux_hping_activity.json';
+import rule48 from './linux_iodine_activity.json';
+import rule49 from './linux_kernel_module_activity.json';
+import rule50 from './linux_mknod_activity.json';
+import rule51 from './linux_netcat_network_connection.json';
+import rule52 from './linux_nmap_activity.json';
+import rule53 from './linux_nping_activity.json';
+import rule54 from './linux_process_started_in_temp_directory.json';
+import rule55 from './linux_shell_activity_by_web_server.json';
+import rule56 from './linux_socat_activity.json';
+import rule57 from './linux_strace_activity.json';
+import rule58 from './linux_tcpdump_activity.json';
+import rule59 from './linux_whoami_commmand.json';
+import rule60 from './network_dns_directly_to_the_internet.json';
+import rule61 from './network_ftp_file_transfer_protocol_activity_to_the_internet.json';
+import rule62 from './network_irc_internet_relay_chat_protocol_activity_to_the_internet.json';
+import rule63 from './network_nat_traversal_port_activity.json';
+import rule64 from './network_port_26_activity.json';
+import rule65 from './network_port_8000_activity_to_the_internet.json';
+import rule66 from './network_pptp_point_to_point_tunneling_protocol_activity.json';
+import rule67 from './network_proxy_port_activity_to_the_internet.json';
+import rule68 from './network_rdp_remote_desktop_protocol_from_the_internet.json';
+import rule69 from './network_rdp_remote_desktop_protocol_to_the_internet.json';
+import rule70 from './network_rpc_remote_procedure_call_from_the_internet.json';
+import rule71 from './network_rpc_remote_procedure_call_to_the_internet.json';
+import rule72 from './network_smb_windows_file_sharing_activity_to_the_internet.json';
+import rule73 from './network_smtp_to_the_internet.json';
+import rule74 from './network_sql_server_port_activity_to_the_internet.json';
+import rule75 from './network_ssh_secure_shell_from_the_internet.json';
+import rule76 from './network_ssh_secure_shell_to_the_internet.json';
+import rule77 from './network_telnet_port_activity.json';
+import rule78 from './network_tor_activity_to_the_internet.json';
+import rule79 from './network_vnc_virtual_network_computing_from_the_internet.json';
+import rule80 from './network_vnc_virtual_network_computing_to_the_internet.json';
+import rule81 from './null_user_agent.json';
+import rule82 from './packetbeat_dns_tunneling.json';
+import rule83 from './packetbeat_rare_dns_question.json';
+import rule84 from './packetbeat_rare_server_domain.json';
+import rule85 from './packetbeat_rare_urls.json';
+import rule86 from './packetbeat_rare_user_agent.json';
+import rule87 from './rare_process_by_host_linux.json';
+import rule88 from './rare_process_by_host_windows.json';
+import rule89 from './sqlmap_user_agent.json';
+import rule90 from './suspicious_login_activity.json';
+import rule91 from './windows_anomalous_network_activity.json';
+import rule92 from './windows_anomalous_path_activity.json';
+import rule93 from './windows_anomalous_process_all_hosts.json';
+import rule94 from './windows_anomalous_process_creation.json';
+import rule95 from './windows_anomalous_script.json';
+import rule96 from './windows_anomalous_service.json';
+import rule97 from './windows_anomalous_user_name.json';
+import rule98 from './windows_certutil_network_connection.json';
+import rule99 from './windows_command_prompt_connecting_to_the_internet.json';
+import rule100 from './windows_command_shell_started_by_powershell.json';
+import rule101 from './windows_command_shell_started_by_svchost.json';
+import rule102 from './windows_credential_dumping_msbuild.json';
+import rule103 from './windows_cve_2020_0601.json';
+import rule104 from './windows_defense_evasion_via_filter_manager.json';
+import rule105 from './windows_execution_msbuild_started_by_office_app.json';
+import rule106 from './windows_execution_msbuild_started_by_script.json';
+import rule107 from './windows_execution_msbuild_started_by_system_process.json';
+import rule108 from './windows_execution_msbuild_started_renamed.json';
+import rule109 from './windows_execution_msbuild_started_unusal_process.json';
+import rule110 from './windows_execution_via_compiled_html_file.json';
+import rule111 from './windows_execution_via_net_com_assemblies.json';
+import rule112 from './windows_execution_via_regsvr32.json';
+import rule113 from './windows_execution_via_trusted_developer_utilities.json';
+import rule114 from './windows_html_help_executable_program_connecting_to_the_internet.json';
+import rule115 from './windows_injection_msbuild.json';
+import rule116 from './windows_misc_lolbin_connecting_to_the_internet.json';
+import rule117 from './windows_modification_of_boot_config.json';
+import rule118 from './windows_msxsl_network.json';
+import rule119 from './windows_net_command_system_account.json';
+import rule120 from './windows_persistence_via_application_shimming.json';
+import rule121 from './windows_priv_escalation_via_accessibility_features.json';
+import rule122 from './windows_process_discovery_via_tasklist_command.json';
+import rule123 from './windows_rare_user_runas_event.json';
+import rule124 from './windows_rare_user_type10_remote_login.json';
+import rule125 from './windows_register_server_program_connecting_to_the_internet.json';
+import rule126 from './windows_signed_binary_proxy_execution.json';
+import rule127 from './windows_suspicious_pdf_reader.json';
+import rule128 from './windows_suspicious_process_started_by_a_script.json';
+import rule129 from './windows_uac_bypass_event_viewer.json';
+import rule130 from './windows_whoami_command_activity.json';
export const rawRules = [
rule1,
rule2,
@@ -192,4 +230,42 @@ export const rawRules = [
rule90,
rule91,
rule92,
+ rule93,
+ rule94,
+ rule95,
+ rule96,
+ rule97,
+ rule98,
+ rule99,
+ rule100,
+ rule101,
+ rule102,
+ rule103,
+ rule104,
+ rule105,
+ rule106,
+ rule107,
+ rule108,
+ rule109,
+ rule110,
+ rule111,
+ rule112,
+ rule113,
+ rule114,
+ rule115,
+ rule116,
+ rule117,
+ rule118,
+ rule119,
+ rule120,
+ rule121,
+ rule122,
+ rule123,
+ rule124,
+ rule125,
+ rule126,
+ rule127,
+ rule128,
+ rule129,
+ rule130,
];
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json
new file mode 100644
index 0000000000000..1123c1161c4ce
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies Linux processes that do not usually use the network but have unexpected network activity, which can indicate command-and-control, lateral movement, persistence, or data exfiltration activity. A process with unusual network activity can denote process exploitation or injection, where the process is used to run persistence mechanisms that allow a malicious actor remote access or control of the host, data exfiltration, and execution of unauthorized network applications.",
+ "false_positives": [
+ "A newly installed program or one that rarely uses the network could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "linux_anomalous_network_activity_ecs",
+ "name": "Unusual Linux Network Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "52afbdc5-db15-485e-bc24-f5707f820c4b",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json
new file mode 100644
index 0000000000000..19dd643945b17
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies unusual destination port activity that can indicate command-and-control, persistence mechanism, or data exfiltration activity. Rarely used destination port activity is generally unusual in Linux fleets, and can indicate unauthorized access or threat actor activity.",
+ "false_positives": [
+ "A newly installed program or one that rarely uses the network could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "linux_anomalous_network_port_activity_ecs",
+ "name": "Unusual Linux Network Port Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "3c7e32e6-6104-46d9-a06e-da0f8b5795a0",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json
new file mode 100644
index 0000000000000..e2e5803618d06
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies unusual listening ports on Linux instances that can indicate execution of unauthorized services, backdoors, or persistence mechanisms.",
+ "false_positives": [
+ "A newly installed program or one that rarely uses the network could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "linux_anomalous_network_service",
+ "name": "Unusual Linux Network Service",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "52afbdc5-db15-596e-bc35-f5707f820c4b",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json
new file mode 100644
index 0000000000000..40dd2e76c7214
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected an unusual web URL request from a Linux host, which can indicate malware delivery and execution. Wget and cURL are commonly used by Linux programs to download code and data. Most of the time, their usage is entirely normal. Generally, because they use a list of URLs, they repeatedly download from the same locations. However, Wget and cURL are sometimes used to deliver Linux exploit payloads, and threat actors use these tools to download additional software and code. For these reasons, unusual URLs can indicate unauthorized downloads or threat activity.",
+ "false_positives": [
+ "A new and unusual program or artifact download in the course of software upgrades, debugging, or troubleshooting could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "linux_anomalous_network_url_activity_ecs",
+ "name": "Unusual Linux Web Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "52afbdc5-db15-485e-bc35-f5707f820c4c",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json
new file mode 100644
index 0000000000000..6bac2f25fd7de
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Searches for rare processes running on multiple Linux hosts in an entire fleet or network. This reduces the detection of false positives since automated maintenance processes usually only run occasionally on a single machine but are common to all or many hosts in a fleet.",
+ "false_positives": [
+ "A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "linux_anomalous_process_all_hosts_ecs",
+ "name": "Anomalous Process For a Linux Population",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "647fc812-7996-4795-8869-9c4ea595fe88",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json
new file mode 100644
index 0000000000000..8b7e6c89482f7
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected activity for a username that is not normally active, which can indicate unauthorized changes, activity by unauthorized users, lateral movement, or compromised credentials. In many organizations, new usernames are not often created apart from specific types of system activities, such as creating new accounts for new employees. These user accounts quickly become active and routine. Events from rarely used usernames can point to suspicious activity. Additionally, automated Linux fleets tend to see activity from rarely used usernames only when personnel log in to make authorized or unauthorized changes, or threat actors have acquired credentials and log in for malicious purposes. Unusual usernames can also indicate pivoting, where compromised credentials are used to try and move laterally from one host to another.",
+ "false_positives": [
+ "Uncommon user activity can be due to an engineer logging onto a server instance in order to perform manual troubleshooting or reconfiguration."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "linux_anomalous_user_name_ecs",
+ "name": "Unusual Linux Username",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "b347b919-665f-4aac-b9e8-68369bf2340c",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json
index c4b14389c0f75..bb8e8983661e6 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Hping Process Activity",
- "query": "process.name: (hping3 or hping2 or hping) and event.action:executed",
+ "query": "process.name:(hping or hping2 or hping3) and event.action:executed",
"references": [
"https://en.wikipedia.org/wiki/Hping"
],
@@ -22,4 +21,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json
index b8455a4d2b21d..4e49702855a76 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Potential DNS Tunneling via Iodine",
- "query": "process.name: (iodine or iodined) and event.action:executed",
+ "query": "process.name:(iodine or iodined) and event.action:executed",
"references": [
"https://code.kryo.se/iodine/"
],
@@ -22,4 +21,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json
index f1d12de674488..cf8cd72b7aa6f 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Persistence via Kernel Module Modification",
- "query": "process.name: (insmod or kmod or modprobe or rmod) and event.action:executed",
+ "query": "process.name:(insmod or kmod or modprobe or rmod) and event.action:executed",
"references": [
"https://www.hackers-arise.com/single-post/2017/11/03/Linux-for-Hackers-Part-10-Loadable-Kernel-Modules-LKM"
],
@@ -39,4 +38,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json
index b0d4c29dc00d3..3bd3848c07581 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json
@@ -1,5 +1,5 @@
{
- "description": "The Linux mknod program is sometimes used in the command payload of a remote command injection (RCI) and other exploits. It is used to export a command shell when the traditional version of netcat is not available to the payload.",
+ "description": "The Linux mknod program is sometimes used in the command payload of a remote command injection (RCI) and other exploits. It is used to export a command shell when the traditional version of netcat is not available to the payload.",
"false_positives": [
"Mknod is a Linux system program. Some normal use of this program, at varying levels of frequency, may originate from scripts, automation tools, and frameworks. Usage by web servers is more likely to be suspicious."
],
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Mknod Process Activity",
- "query": "process.name: mknod and event.action:executed",
+ "query": "process.name:mknod and event.action:executed",
"references": [
"https://pen-testing.sans.org/blog/2013/05/06/netcat-without-e-no-problem"
],
@@ -22,4 +21,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json
index 6ab1c1285c0d7..cd523b6594ccd 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Netcat Network Activity",
- "query": "process.name: (nc or ncat or netcat or netcat.openbsd or netcat.traditional) and event.action: (connected-to or bound-socket or socket_opened)",
+ "query": "process.name:(nc or ncat or netcat or netcat.openbsd or netcat.traditional) and event.action:(bound-socket or connected-to or socket_opened)",
"references": [
"http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet",
"https://www.sans.org/security-resources/sec560/netcat_cheat_sheet_v1.pdf",
@@ -24,4 +23,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json
index 5d7169219a6f1..604cfa172fd84 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json
@@ -1,5 +1,5 @@
{
- "description": "Nmap was executed on a Linux host. Nmap is a FOSS tool for network scanning and security testing. It can map and discover networks, and identify listening services and operating systems. It is sometimes used to gather information in support of exploitation, execution or lateral movement.",
+ "description": "Nmap was executed on a Linux host. Nmap is a FOSS tool for network scanning and security testing. It can map and discover networks, and identify listening services and operating systems. It is sometimes used to gather information in support of exploitation, execution or lateral movement.",
"false_positives": [
"Security testing tools and frameworks may run `Nmap` in the course of security auditing. Some normal use of this command may originate from security engineers and network or server administrators. Use of nmap by ordinary users is uncommon."
],
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Nmap Process Activity",
- "query": "process.name: nmap",
+ "query": "process.name:nmap",
"references": [
"https://en.wikipedia.org/wiki/Nmap"
],
@@ -22,4 +21,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json
index 6a713d22e3219..8e71b5b906711 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json
@@ -1,15 +1,14 @@
{
- "description": "Nping ran on a Linux host. Nping is part of the Nmap tool suite and has the ability to construct raw packets for a wide variety of security testing applications, including denial of service testing.",
+ "description": "Nping ran on a Linux host. Nping is part of the Nmap tool suite and has the ability to construct raw packets for a wide variety of security testing applications, including denial of service testing.",
"false_positives": [
- "Some normal use of this command may originate from security engineers and network or server administrators, but this is usually not routine or unannounced. Use of `Nping` by non-engineers or ordinary users is uncommon."
+ "Some normal use of this command may originate from security engineers and network or server administrators, but this is usually not routine or unannounced. Use of `Nping` by non-engineers or ordinary users is uncommon."
],
"index": [
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Nping Process Activity",
- "query": "process.name: nping and event.action:executed",
+ "query": "process.name:nping and event.action:executed",
"references": [
"https://en.wikipedia.org/wiki/Nmap"
],
@@ -22,4 +21,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json
index c80bb4eb41615..c50026d7736ae 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json
@@ -1,15 +1,14 @@
{
"description": "Identifies processes running in a temporary folder. This is sometimes done by adversaries to hide malware.",
"false_positives": [
- "Build systems, like Jenkins, may start processes in the `/tmp` directory. These can be exempted by name or by username."
+ "Build systems, like Jenkins, may start processes in the `/tmp` directory. These can be exempted by name or by username."
],
"index": [
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Unusual Process Execution - Temp",
- "query": "process.working_directory: /tmp and event.action:executed",
+ "query": "process.working_directory:/tmp and event.action:executed",
"risk_score": 47,
"rule_id": "df959768-b0c9-4d45-988c-5606a2be8e5a",
"severity": "medium",
@@ -19,4 +18,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json
index d9455ab7d5b3e..01f117e0a225b 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Potential Shell via Web Server",
- "query": "process.name: bash and user.name: (apache or www or \"www-data\") and event.action:executed",
+ "query": "process.name:bash and user.name:(apache or www or www-data) and event.action:executed",
"references": [
"https://pentestlab.blog/tag/web-shell/"
],
@@ -39,4 +38,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json
index 56fb41dc5f78f..a16b164e9ee4a 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json
@@ -1,15 +1,14 @@
{
"description": "A Socat process is running on a Linux host. Socat is often used as a persistence mechanism by exporting a reverse shell, or by serving a shell on a listening port. Socat is also sometimes used for lateral movement.",
"false_positives": [
- "Socat is a dual-use tool that can be used for benign or malicious activity. Some normal use of this program, at varying levels of frequency, may originate from scripts, automation tools, and frameworks. Usage by web servers is more likely to be suspicious."
+ "Socat is a dual-use tool that can be used for benign or malicious activity. Some normal use of this program, at varying levels of frequency, may originate from scripts, automation tools, and frameworks. Usage by web servers is more likely to be suspicious."
],
"index": [
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Socat Process Activity",
- "query": "process.name:socat and not process.args:\"-V\" and event.action:executed",
+ "query": "process.name:socat and not process.args:-V and event.action:executed",
"references": [
"https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/#method-2-using-socat"
],
@@ -22,4 +21,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json
index fdf52e7c728c6..9b18039b63fd0 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Strace Process Activity",
- "query": "process.name: strace and event.action:executed",
+ "query": "process.name:strace and event.action:executed",
"references": [
"https://en.wikipedia.org/wiki/Strace"
],
@@ -22,4 +21,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json
index 908e892026ee3..5ae48c8db9984 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Network Sniffing via Tcpdump",
- "query": "process.name: tcpdump and event.action:executed",
+ "query": "process.name:tcpdump and event.action:executed",
"risk_score": 21,
"rule_id": "7a137d76-ce3d-48e2-947d-2747796a78c0",
"severity": "low",
@@ -51,4 +50,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json
index 052ff34d15dcd..7fef4e813da98 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json
@@ -1,5 +1,5 @@
{
- "description": "The whoami application was executed on a Linux host. This is often used by tools and persistence mechanisms to test for privileged access.",
+ "description": "The whoami application was executed on a Linux host. This is often used by tools and persistence mechanisms to test for privileged access.",
"false_positives": [
"Security testing tools and frameworks may run this command. Some normal use of this command may originate from automation tools and frameworks."
],
@@ -7,9 +7,8 @@
"auditbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "User Discovery via Whoami",
- "query": "process.name: whoami and event.action:executed",
+ "query": "process.name:whoami and event.action:executed",
"risk_score": 21,
"rule_id": "120559c6-5e24-49f4-9e30-8ffe697df6b9",
"severity": "low",
@@ -36,4 +35,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json
index 56c11c236eecb..e08d681d14463 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json
@@ -1,5 +1,5 @@
{
- "description": "This rule detects when an internal network client sends DNS traffic directly to the Internet.\nThis is atypical behavior for a managed network, and can be indicative of malware,\nexfiltration, command and control, or, simply, misconfiguration. This DNS activity also impacts your\norganization's ability to provide enterprise monitoring and logging of DNS, and opens\nyour network to a variety of abuses and malicious communications.\n",
+ "description": "This rule detects when an internal network client sends DNS traffic directly to the Internet. This is atypical behavior for a managed network, and can be indicative of malware, exfiltration, command and control, or, simply, misconfiguration. This DNS activity also impacts your organization's ability to provide enterprise monitoring and logging of DNS, and opens your network to a variety of abuses and malicious communications.",
"false_positives": [
"Exclude DNS servers from this rule as this is expected behavior. Endpoints usually query local DNS servers defined in their DHCP scopes, but this may be overridden if a user configures their endpoint to use a remote DNS server. This is uncommon in managed enterprise networks because it could break intranet name resolution when split horizon DNS is utilized. Some consumer VPN services and browser plug-ins may send DNS traffic to remote Internet destinations. In that case, such devices or networks can be excluded from this rule when this is expected behavior."
],
@@ -7,9 +7,8 @@
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "DNS Activity to the Internet",
- "query": "destination.port:53 and (\n network.direction: outbound or (\n source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip:( 169.254.169.254/32 or 127.0.0.53/32 or 10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or 224.0.0.251 or ff02\\:\\:fb or 255.255.255.255 )\n )\n)\n",
+ "query": "destination.port:53 and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 169.254.169.254/32 or 172.16.0.0/12 or 192.168.0.0/16 or 224.0.0.251 or 224.0.0.252 or 255.255.255.255 or \"::1\" or \"ff02::fb\")",
"references": [
"https://www.us-cert.gov/ncas/alerts/TA15-240A",
"https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-81-2.pdf"
@@ -39,5 +38,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json
index a3a692596090c..24c3bad817227 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json
@@ -1,5 +1,5 @@
{
- "description": "This rule detects events that may indicate the use of FTP network connections to the Internet.\nThe File Transfer Protocol (FTP) has been around in its current form since the\n1980s. It can be a common and efficient procedure on your network to send and\nreceive files. Because of this, adversaries will also often use this protocol\nto exfiltrate data from your network or download new tools. Additionally, FTP\nis a plain-text protocol which, if intercepted, may expose usernames and\npasswords. FTP activity involving servers subject to regulations or compliance\nstandards may be unauthorized.\n",
+ "description": "This rule detects events that may indicate the use of FTP network connections to the Internet. The File Transfer Protocol (FTP) has been around in its current form since the 1980s. It can be a common and efficient procedure on your network to send and receive files. Because of this, adversaries will also often use this protocol to exfiltrate data from your network or download new tools. Additionally, FTP is a plain-text protocol which, if intercepted, may expose usernames and passwords. FTP activity involving servers subject to regulations or compliance standards may be unauthorized.",
"false_positives": [
"FTP servers should be excluded from this rule as this is expected behavior. Some business workflows may use FTP for data exchange. These workflows often have expected characteristics such as users, sources, and destinations. FTP activity involving an unusual source or destination may be more suspicious. FTP activity involving a production server that has no known associated FTP workflow or business requirement is often suspicious."
],
@@ -7,9 +7,8 @@
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "FTP (File Transfer Protocol) Activity to the Internet",
- "query": "network.transport: tcp and destination.port: (20 or 21) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:(20 or 21) and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 21,
"rule_id": "87ec6396-9ac4-4706-bcf0-2ebb22002f43",
"severity": "low",
@@ -50,5 +49,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json
index 0b5259d3417f5..bf286d4cab506 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json
@@ -1,5 +1,5 @@
{
- "description": "This rule detects events that use common ports for Internet Relay Chat (IRC) to the Internet.\nIRC is a common protocol that can be used for chat and file transfers. This\nprotocol is also a good candidate for remote control of malware and data\ntransfers to and from a network.\n",
+ "description": "This rule detects events that use common ports for Internet Relay Chat (IRC) to the Internet. IRC is a common protocol that can be used for chat and file transfers. This protocol is also a good candidate for remote control of malware and data transfers to and from a network.",
"false_positives": [
"IRC activity may be normal behavior for developers and engineers but is unusual for non-engineering end users. IRC activity involving an unusual source or destination may be more suspicious. IRC activity involving a production server is often suspicious. Because these ports are in the ephemeral range, this rule may false under certain conditions, such as when a NAT-ed web server replies to a client which has used a port in the range by coincidence. In this case, these servers can be excluded. Some legacy applications may use these ports, but this is very uncommon and usually only appears in local traffic using private IPs, which does not match this rule's conditions."
],
@@ -7,9 +7,8 @@
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "IRC (Internet Relay Chat) Protocol Activity to the Internet",
- "query": "network.transport: tcp and destination.port:(6667 or 6697) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:(6667 or 6697) and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 47,
"rule_id": "c6474c34-4953-447a-903e-9fcb7b6661aa",
"severity": "medium",
@@ -50,5 +49,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json
index 675fd588a1834..61c1e3d47cf7a 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json
@@ -1,5 +1,5 @@
{
- "description": "This rule detects events that could be describing IPSEC NAT Traversal traffic.\nIPSEC is a VPN technology that allows one system to talk to another using\nencrypted tunnels. NAT Traversal enables these tunnels to communicate over the\nInternet where one of the sides is behind a NAT router gateway. This may be\ncommon on your network, but this technique is also used by threat actors to\navoid detection.\n",
+ "description": "This rule detects events that could be describing IPSEC NAT Traversal traffic. IPSEC is a VPN technology that allows one system to talk to another using encrypted tunnels. NAT Traversal enables these tunnels to communicate over the Internet where one of the sides is behind a NAT router gateway. This may be common on your network, but this technique is also used by threat actors to avoid detection.",
"false_positives": [
"Some networks may utilize these protocols but usage that is unfamiliar to local network administrators can be unexpected and suspicious. Because this port is in the ephemeral range, this rule may false under certain conditions, such as when an application server with a public IP address replies to a client which has used a UDP port in the range by coincidence. This is uncommon but such servers can be excluded."
],
@@ -7,9 +7,8 @@
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "IPSEC NAT Traversal Port Activity",
- "query": "network.transport: udp and destination.port: 4500",
+ "query": "network.transport:udp and destination.port:4500",
"risk_score": 21,
"rule_id": "a9cb3641-ff4b-4cdc-a063-b4b8d02a67c7",
"severity": "low",
@@ -36,4 +35,4 @@
],
"type": "query",
"version": 2
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json
index bc00383f94528..a9a39b61884c5 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json
@@ -1,5 +1,5 @@
{
- "description": "This rule detects events that may indicate use of SMTP on TCP port 26. This\nport is commonly used by several popular mail transfer agents to deconflict\nwith the default SMTP port 25. This port has also been used by a malware family\ncalled BadPatch for command and control of Windows systems.\n",
+ "description": "This rule detects events that may indicate use of SMTP on TCP port 26. This port is commonly used by several popular mail transfer agents to deconflict with the default SMTP port 25. This port has also been used by a malware family called BadPatch for command and control of Windows systems.",
"false_positives": [
"Servers that process email traffic may cause false positives and should be excluded from this rule as this is expected behavior."
],
@@ -7,9 +7,8 @@
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "SMTP on Port 26/TCP",
- "query": "network.transport: tcp and destination.port: 26\n",
+ "query": "network.transport:tcp and destination.port:26",
"references": [
"https://unit42.paloaltonetworks.com/unit42-badpatch/",
"https://isc.sans.edu/forums/diary/Next+up+whats+up+with+TCP+port+26/25564/"
@@ -55,4 +54,4 @@
],
"type": "query",
"version": 2
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json
index f418648bebdb9..2f1390411f97b 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json
@@ -1,5 +1,5 @@
{
- "description": "TCP Port 8000 is commonly used for development environments of web server\nsoftware. It generally should not be exposed directly to the Internet. If you are\nrunning software like this on the Internet, you should consider placing it behind\na reverse proxy.\n",
+ "description": "TCP Port 8000 is commonly used for development environments of web server software. It generally should not be exposed directly to the Internet. If you are running software like this on the Internet, you should consider placing it behind a reverse proxy.",
"false_positives": [
"Because this port is in the ephemeral range, this rule may false under certain conditions, such as when a NATed web server replies to a client which has used a port in the range by coincidence. In this case, such servers can be excluded. Some applications may use this port but this is very uncommon and usually appears in local traffic using private IPs, which this rule does not match. Some cloud environments, particularly development environments, may use this port when VPNs or direct connects are not in use and cloud instances are accessed across the Internet."
],
@@ -7,9 +7,8 @@
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "TCP Port 8000 Activity to the Internet",
- "query": "network.transport: tcp and destination.port: 8000 and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:8000 and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 21,
"rule_id": "08d5d7e2-740f-44d8-aeda-e41f4263efaf",
"severity": "low",
@@ -35,5 +34,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json
index 2321b813a1552..f7170d8d33a51 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json
@@ -1,5 +1,5 @@
{
- "description": "This rule detects events that may indicate use of a PPTP VPN connection. Some\nthreat actors use these types of connections to tunnel their traffic while\navoiding detection.\n",
+ "description": "This rule detects events that may indicate use of a PPTP VPN connection. Some threat actors use these types of connections to tunnel their traffic while avoiding detection.",
"false_positives": [
"Some networks may utilize PPTP protocols but this is uncommon as more modern VPN technologies are available. Usage that is unfamiliar to local network administrators can be unexpected and suspicious. Torrenting applications may use this port. Because this port is in the ephemeral range, this rule may false under certain conditions, such as when an application server replies to a client that used this port by coincidence. This is uncommon but such servers can be excluded."
],
@@ -7,9 +7,8 @@
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "PPTP (Point to Point Tunneling Protocol) Activity",
- "query": "network.transport: tcp and destination.port: 1723\n",
+ "query": "network.transport:tcp and destination.port:1723",
"risk_score": 21,
"rule_id": "d2053495-8fe7-4168-b3df-dad844046be3",
"severity": "low",
@@ -36,4 +35,4 @@
],
"type": "query",
"version": 2
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json
index 58bba5b3fa712..da4319cf15307 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects events that may describe network events of proxy use to the\nInternet. It includes popular HTTP proxy ports and SOCKS proxy ports. Typically,\nenvironments will use an internal IP address for a proxy server. It can also\nbe used to circumvent network controls and detection mechanisms.\n",
+ "description": "This rule detects events that may describe network events of proxy use to the Internet. It includes popular HTTP proxy ports and SOCKS proxy ports. Typically, environments will use an internal IP address for a proxy server. It can also be used to circumvent network controls and detection mechanisms.",
"false_positives": [
- "Some proxied applications may use these ports but this usually occurs in local traffic using private IPs\n which this rule does not match. Proxies are widely used as a security technology but in enterprise environments\n this is usually local traffic which this rule does not match. Internet proxy services using these ports can be\n white-listed if desired. Some screen recording applications may use these ports. Proxy port activity involving\n an unusual source or destination may be more suspicious. Some cloud environments may use this port when VPNs or\n direct connects are not in use and cloud instances are accessed across the Internet. Because these ports are in\n the ephemeral range, this rule may false under certain conditions such as when a NATed web server replies to a\n client which has used a port in the range by coincidence. In this case, such servers can be excluded if desired."
+ "Some proxied applications may use these ports but this usually occurs in local traffic using private IPs which this rule does not match. Proxies are widely used as a security technology but in enterprise environments this is usually local traffic which this rule does not match. Internet proxy services using these ports can be white-listed if desired. Some screen recording applications may use these ports. Proxy port activity involving an unusual source or destination may be more suspicious. Some cloud environments may use this port when VPNs or direct connects are not in use and cloud instances are accessed across the Internet. Because these ports are in the ephemeral range, this rule may false under certain conditions such as when a NATed web server replies to a client which has used a port in the range by coincidence. In this case, such servers can be excluded if desired."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Proxy Port Activity to the Internet",
- "query": "network.transport: tcp and destination.port: (3128 or 8080 or 1080) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:(1080 or 3128 or 8080) and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 47,
"rule_id": "ad0e5e75-dd89-4875-8d0a-dfdc1828b5f3",
"severity": "medium",
@@ -35,5 +34,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json
index 03e507753cd22..d3b65a36f084b 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of RDP traffic\nfrom the Internet. RDP is commonly used by system administrators to remotely\ncontrol a system for maintenance or to use shared resources. It should almost\nnever be directly exposed to the Internet, as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.\n",
+ "description": "This rule detects network events that may indicate the use of RDP traffic from the Internet. RDP is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"false_positives": [
- " Some network security policies allow RDP directly from the Internet but usage that is unfamiliar to\n server or network owners can be unexpected and suspicious. RDP services may be exposed directly to the\n Internet in some networks such as cloud environments. In such cases, only RDP gateways, bastions or jump\n servers may be expected expose RDP directly to the Internet and can be exempted from this rule. RDP may\n be required by some work-flows such as remote access and support for specialized software products and\n servers. Such work-flows are usually known and not unexpected."
+ "Some network security policies allow RDP directly from the Internet but usage that is unfamiliar to server or network owners can be unexpected and suspicious. RDP services may be exposed directly to the Internet in some networks such as cloud environments. In such cases, only RDP gateways, bastions or jump servers may be expected expose RDP directly to the Internet and can be exempted from this rule. RDP may be required by some work-flows such as remote access and support for specialized software products and servers. Such work-flows are usually known and not unexpected."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "RDP (Remote Desktop Protocol) from the Internet",
- "query": "network.transport: tcp and destination.port: 3389 and (\n network.direction: inbound or (\n not source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n and destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:3389 and not source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 47,
"rule_id": "8c1bdde8-4204-45c0-9e0c-c85ca3902488",
"severity": "medium",
@@ -65,5 +64,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json
index af2279b2d9008..79618a867c73f 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of RDP traffic\nto the Internet. RDP is commonly used by system administrators to remotely\ncontrol a system for maintenance or to use shared resources. It should almost\nnever be directly exposed to the Internet, as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.\n",
+ "description": "This rule detects network events that may indicate the use of RDP traffic to the Internet. RDP is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"false_positives": [
- "RDP connections may be made directly to Internet destinations in order to access\n Windows cloud server instances but such connections are usually made only by engineers.\n In such cases, only RDP gateways, bastions or jump servers may be expected Internet\n destinations and can be exempted from this rule. RDP may be required by some work-flows\n such as remote access and support for specialized software products and servers. Such\n work-flows are usually known and not unexpected. Usage that is unfamiliar to server or\n network owners can be unexpected and suspicious."
+ "RDP connections may be made directly to Internet destinations in order to access Windows cloud server instances but such connections are usually made only by engineers. In such cases, only RDP gateways, bastions or jump servers may be expected Internet destinations and can be exempted from this rule. RDP may be required by some work-flows such as remote access and support for specialized software products and servers. Such work-flows are usually known and not unexpected. Usage that is unfamiliar to server or network owners can be unexpected and suspicious."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "RDP (Remote Desktop Protocol) to the Internet",
- "query": "network.transport: tcp and destination.port: 3389 and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:3389 and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 21,
"rule_id": "e56993d2-759c-4120-984c-9ec9bb940fd5",
"severity": "low",
@@ -50,5 +49,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json
index 4539d639a593a..da1e46750f3bd 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json
@@ -1,12 +1,11 @@
{
- "description": "This rule detects network events that may indicate the use of RPC traffic\nfrom the Internet. RPC is commonly used by system administrators to remotely\ncontrol a system for maintenance or to use shared resources. It should almost\nnever be directly exposed to the Internet, as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.\n",
+ "description": "This rule detects network events that may indicate the use of RPC traffic from the Internet. RPC is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "RPC (Remote Procedure Call) from the Internet",
- "query": "network.transport: tcp and destination.port: 135 and (\n network.direction: inbound or (\n not source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:135 and not source.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\") and destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 73,
"rule_id": "143cb236-0956-4f42-a706-814bcaa0cf5a",
"severity": "high",
@@ -32,5 +31,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json
index dd1b57572bcb3..d07d19b8fffee 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json
@@ -1,12 +1,11 @@
{
- "description": "This rule detects network events that may indicate the use of RPC traffic\nto the Internet. RPC is commonly used by system administrators to remotely\ncontrol a system for maintenance or to use shared resources. It should almost\nnever be directly exposed to the Internet, as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.\n",
+ "description": "This rule detects network events that may indicate the use of RPC traffic to the Internet. RPC is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "RPC (Remote Procedure Call) to the Internet",
- "query": "network.transport: tcp and destination.port: 135 and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:135 and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 73,
"rule_id": "32923416-763a-4531-bb35-f33b9232ecdb",
"severity": "high",
@@ -32,5 +31,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json
index 8b97df2182992..93a4b0ebbbd8e 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json
@@ -1,12 +1,11 @@
{
- "description": "This rule detects network events that may indicate the use of Windows\nfile sharing (also called SMB or CIFS) traffic to the Internet. SMB is commonly\nused within networks to share files, printers, and other system resources amongst\ntrusted systems. It should almost never be directly exposed to the Internet, as\nit is frequently targeted and exploited by threat actors as an initial access\nor back-door vector or for data exfiltration.\n",
+ "description": "This rule detects network events that may indicate the use of Windows file sharing (also called SMB or CIFS) traffic to the Internet. SMB is commonly used within networks to share files, printers, and other system resources amongst trusted systems. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector or for data exfiltration.",
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "SMB (Windows File Sharing) Activity to the Internet",
- "query": "network.transport: tcp and destination.port: (139 or 445) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:(139 or 445) and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 73,
"rule_id": "c82b2bd8-d701-420c-ba43-f11a155b681a",
"severity": "high",
@@ -47,5 +46,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json
index c6aa5eef372f4..ca287605490ef 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects events that may describe SMTP traffic from internal\nhosts to a host across the Internet. In an enterprise network, there is typically\na dedicated internal host that performs this function. It is also\nfrequently abused by threat actors for command and control, or data exfiltration.\n",
+ "description": "This rule detects events that may describe SMTP traffic from internal hosts to a host across the Internet. In an enterprise network, there is typically a dedicated internal host that performs this function. It is also frequently abused by threat actors for command and control, or data exfiltration.",
"false_positives": [
- "NATed servers that process email traffic may false and should be excluded from this rule as this is expected behavior for them. Consumer and personal devices may send email traffic to remote Internet destinations. In this case, such devices or networks can be excluded from this rule if this is expected behavior."
+ "NATed servers that process email traffic may false and should be excluded from this rule as this is expected behavior for them. Consumer and personal devices may send email traffic to remote Internet destinations. In this case, such devices or networks can be excluded from this rule if this is expected behavior."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "SMTP to the Internet",
- "query": "network.transport: tcp and destination.port: (25 or 465 or 587) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:(25 or 465 or 587) and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 21,
"rule_id": "67a9beba-830d-4035-bfe8-40b7e28f8ac4",
"severity": "low",
@@ -50,5 +49,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json
index f11d9705bbda4..3a5bd5bff98f5 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects events that may describe database traffic\n(MS SQL, Oracle, MySQL, and Postgresql) across the Internet. Databases\nshould almost never be directly exposed to the Internet, as they are\nfrequently targeted by threat actors to gain initial access to network resources.\n",
+ "description": "This rule detects events that may describe database traffic (MS SQL, Oracle, MySQL, and Postgresql) across the Internet. Databases should almost never be directly exposed to the Internet, as they are frequently targeted by threat actors to gain initial access to network resources.",
"false_positives": [
- "Because these ports are in the ephemeral range, this rule may false under certain conditions\n such as when a NATed web server replies to a client which has used a port in the range by\n coincidence. In this case, such servers can be excluded if desired. Some cloud environments may\n use this port when VPNs or direct connects are not in use and database instances are accessed\n directly across the Internet."
+ "Because these ports are in the ephemeral range, this rule may false under certain conditions such as when a NATed web server replies to a client which has used a port in the range by coincidence. In this case, such servers can be excluded if desired. Some cloud environments may use this port when VPNs or direct connects are not in use and database instances are accessed directly across the Internet."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "SQL Traffic to the Internet",
- "query": "network.transport: tcp and destination.port: (1433 or 1521 or 3336 or 5432) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:(1433 or 1521 or 3336 or 5432) and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 47,
"rule_id": "139c7458-566a-410c-a5cd-f80238d6a5cd",
"severity": "medium",
@@ -35,5 +34,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json
index a95447fc088df..429a91183e88a 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of SSH traffic\nfrom the Internet. SSH is commonly used by system administrators to remotely\ncontrol a system using the command line shell. If it is exposed to the Internet,\nit should be done with strong security controls as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.\n",
+ "description": "This rule detects network events that may indicate the use of SSH traffic from the Internet. SSH is commonly used by system administrators to remotely control a system using the command line shell. If it is exposed to the Internet, it should be done with strong security controls as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"false_positives": [
- "Some network security policies allow SSH directly from the Internet but usage that is\n unfamiliar to server or network owners can be unexpected and suspicious. SSH services may\n be exposed directly to the Internet in some networks such as cloud environments. In such\n cases, only SSH gateways, bastions or jump servers may be expected expose SSH directly to\n the Internet and can be exempted from this rule. SSH may be required by some work-flows\n such as remote access and support for specialized software products and servers. Such\n work-flows are usually known and not unexpected."
+ "Some network security policies allow SSH directly from the Internet but usage that is unfamiliar to server or network owners can be unexpected and suspicious. SSH services may be exposed directly to the Internet in some networks such as cloud environments. In such cases, only SSH gateways, bastions or jump servers may be expected expose SSH directly to the Internet and can be exempted from this rule. SSH may be required by some work-flows such as remote access and support for specialized software products and servers. Such work-flows are usually known and not unexpected."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "SSH (Secure Shell) from the Internet",
- "query": "network.transport: tcp and destination.port:22 and (\n network.direction: inbound or (\n not source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:22 and not source.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\") and destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 47,
"rule_id": "ea0784f0-a4d7-4fea-ae86-4baaf27a6f17",
"severity": "medium",
@@ -65,5 +64,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json
index b17d35f96324d..a260245b4dade 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of SSH traffic\nfrom the Internet. SSH is commonly used by system administrators to remotely\ncontrol a system using the command line shell. If it is exposed to the Internet,\nit should be done with strong security controls as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.\n",
+ "description": "This rule detects network events that may indicate the use of SSH traffic from the Internet. SSH is commonly used by system administrators to remotely control a system using the command line shell. If it is exposed to the Internet, it should be done with strong security controls as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"false_positives": [
- "SSH connections may be made directly to Internet destinations in order to access Linux\n cloud server instances but such connections are usually made only by engineers. In such cases,\n only SSH gateways, bastions or jump servers may be expected Internet destinations and can be\n exempted from this rule. SSH may be required by some work-flows such as remote access and support\n for specialized software products and servers. Such work-flows are usually known and not unexpected.\n Usage that is unfamiliar to server or network owners can be unexpected and suspicious."
+ "SSH connections may be made directly to Internet destinations in order to access Linux cloud server instances but such connections are usually made only by engineers. In such cases, only SSH gateways, bastions or jump servers may be expected Internet destinations and can be exempted from this rule. SSH may be required by some work-flows such as remote access and support for specialized software products and servers. Such work-flows are usually known and not unexpected. Usage that is unfamiliar to server or network owners can be unexpected and suspicious."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "SSH (Secure Shell) to the Internet",
- "query": "network.transport: tcp and destination.port:22 and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:22 and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 21,
"rule_id": "6f1500bc-62d7-4eb9-8601-7485e87da2f4",
"severity": "low",
@@ -35,5 +34,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json
index 99813595013cf..4cfe15683c825 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of Telnet traffic.\nTelnet is commonly used by system administrators to remotely control older or embed ed\nsystems using the command line shell. It should almost never be directly exposed to\nthe Internet, as it is frequently targeted and exploited by threat actors as an\ninitial access or back-door vector. As a plain-text protocol, it may also expose\nusernames and passwords to anyone capable of observing the traffic.\n",
+ "description": "This rule detects network events that may indicate the use of Telnet traffic. Telnet is commonly used by system administrators to remotely control older or embed ed systems using the command line shell. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector. As a plain-text protocol, it may also expose usernames and passwords to anyone capable of observing the traffic.",
"false_positives": [
- "IoT (Internet of Things) devices and networks may use telnet and can be excluded if\n desired. Some business work-flows may use Telnet for administration of older devices. These\n often have a predictable behavior. Telnet activity involving an unusual source or destination\n may be more suspicious. Telnet activity involving a production server that has no known\n associated Telnet work-flow or business requirement is often suspicious."
+ "IoT (Internet of Things) devices and networks may use telnet and can be excluded if desired. Some business work-flows may use Telnet for administration of older devices. These often have a predictable behavior. Telnet activity involving an unusual source or destination may be more suspicious. Telnet activity involving a production server that has no known associated Telnet work-flow or business requirement is often suspicious."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Telnet Port Activity",
- "query": "network.transport: tcp and destination.port: 23",
+ "query": "network.transport:tcp and destination.port:23",
"risk_score": 47,
"rule_id": "34fde489-94b0-4500-a76f-b8a157cf9269",
"severity": "medium",
@@ -66,4 +65,4 @@
],
"type": "query",
"version": 2
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json
index 47960f879dfb6..8c8bb809c9fec 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of Tor traffic\nto the Internet. Tor is a network protocol that sends traffic through a\nseries of encrypted tunnels used to conceal a user's location and usage.\nTor may be used by threat actors as an alternate communication pathway to\nconceal the actor's identity and avoid detection.\n",
+ "description": "This rule detects network events that may indicate the use of Tor traffic to the Internet. Tor is a network protocol that sends traffic through a series of encrypted tunnels used to conceal a user's location and usage. Tor may be used by threat actors as an alternate communication pathway to conceal the actor's identity and avoid detection.",
"false_positives": [
- "Tor client activity is uncommon in managed enterprise networks but may be common\n in unmanaged or public networks where few security policies apply. Because these ports\n are in the ephemeral range, this rule may false under certain conditions such as when a\n NATed web server replies to a client which has used one of these ports by coincidence.\n In this case, such servers can be excluded if desired."
+ "Tor client activity is uncommon in managed enterprise networks but may be common in unmanaged or public networks where few security policies apply. Because these ports are in the ephemeral range, this rule may false under certain conditions such as when a NATed web server replies to a client which has used one of these ports by coincidence. In this case, such servers can be excluded if desired."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Tor Activity to the Internet",
- "query": "network.transport: tcp and destination.port: (9001 or 9030) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port:(9001 or 9030) and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 47,
"rule_id": "7d2c38d7-ede7-4bdf-b140-445906e6c540",
"severity": "medium",
@@ -50,5 +49,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json
index d9195a2d2e98c..4204a4fe62e88 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of VNC traffic\nfrom the Internet. VNC is commonly used by system administrators to remotely\ncontrol a system for maintenance or to use shared resources. It should almost\nnever be directly exposed to the Internet, as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.\n",
+ "description": "This rule detects network events that may indicate the use of VNC traffic from the Internet. VNC is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"false_positives": [
- "VNC connections may be received directly to Linux cloud server instances but\n such connections are usually made only by engineers. VNC is less common than SSH\n or RDP but may be required by some work-flows such as remote access and support\n for specialized software products or servers. Such work-flows are usually known\n and not unexpected. Usage that is unfamiliar to server or network owners can be\n unexpected and suspicious."
+ "VNC connections may be received directly to Linux cloud server instances but such connections are usually made only by engineers. VNC is less common than SSH or RDP but may be required by some work-flows such as remote access and support for specialized software products or servers. Such work-flows are usually known and not unexpected. Usage that is unfamiliar to server or network owners can be unexpected and suspicious."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "VNC (Virtual Network Computing) from the Internet",
- "query": "network.transport: tcp and (destination.port >= 5800 and destination.port <= 5810) and (\n network.direction: inbound or (\n not source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port >= 5800 and destination.port <= 5810 and not source.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\") and destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 73,
"rule_id": "5700cb81-df44-46aa-a5d7-337798f53eb8",
"severity": "high",
@@ -50,5 +49,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json
index 57131e28ee9a7..898282e36df19 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json
@@ -1,15 +1,14 @@
{
- "description": "This rule detects network events that may indicate the use of VNC traffic\nto the Internet. VNC is commonly used by system administrators to remotely\ncontrol a system for maintenance or to use shared resources. It should almost\nnever be directly exposed to the Internet, as it is frequently targeted and\nexploited by threat actors as an initial access or back-door vector.",
+ "description": "This rule detects network events that may indicate the use of VNC traffic to the Internet. VNC is commonly used by system administrators to remotely control a system for maintenance or to use shared resources. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or back-door vector.",
"false_positives": [
- "VNC connections may be made directly to Linux cloud server instances but such\n connections are usually made only by engineers. VNC is less common than SSH or RDP\n but may be required by some work flows such as remote access and support for\n specialized software products or servers. Such work-flows are usually known and not\n unexpected. Usage that is unfamiliar to server or network owners can be unexpected\n and suspicious."
+ "VNC connections may be made directly to Linux cloud server instances but such connections are usually made only by engineers. VNC is less common than SSH or RDP but may be required by some work flows such as remote access and support for specialized software products or servers. Such work-flows are usually known and not unexpected. Usage that is unfamiliar to server or network owners can be unexpected and suspicious."
],
"index": [
"filebeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "VNC (Virtual Network Computing) to the Internet",
- "query": "network.transport: tcp and (destination.port >= 5800 and destination.port <= 5810) and (\n network.direction: outbound or (\n source.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and\n not destination.ip: (10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)\n )\n)\n",
+ "query": "network.transport:tcp and destination.port >= 5800 and destination.port <= 5810 and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16) and not destination.ip:(10.0.0.0/8 or 127.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16 or \"::1\")",
"risk_score": 47,
"rule_id": "3ad49c61-7adc-42c1-b788-732eda2f5abf",
"severity": "medium",
@@ -35,5 +34,5 @@
}
],
"type": "query",
- "version": 2
-}
+ "version": 3
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json
index c08d910a3b355..afbbb2a34d545 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json
@@ -25,9 +25,8 @@
"apm-*-transaction*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Web Application Suspicious Activity: No User Agent",
- "query": "url.path: *",
+ "query": "url.path:*",
"references": [
"https://en.wikipedia.org/wiki/User_agent"
],
@@ -35,9 +34,9 @@
"rule_id": "43303fd4-4839-4e48-b2b2-803ab060758d",
"severity": "medium",
"tags": [
- "Elastic",
- "APM"
+ "APM",
+ "Elastic"
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json
new file mode 100644
index 0000000000000..c70725dcb645a
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected unusually large numbers of DNS queries for a single top-level DNS domain, which is often used for DNS tunneling. DNS tunneling can be used for command-and-control, persistence, or data exfiltration activity. For example, dnscat tends to generate many DNS questions for a top-level domain as it uses the DNS protocol to tunnel data.",
+ "false_positives": [
+ "DNS domains that use large numbers of child domains, such as software or content distribution networks, can trigger this signal and such parent domains can be excluded."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "packetbeat_dns_tunneling",
+ "name": "DNS Tunneling",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "91f02f01-969f-4167-8f66-07827ac3bdd9",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Packetbeat"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json
new file mode 100644
index 0000000000000..3ed40ddf27864
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected a rare and unusual DNS query that indicate network activity with unusual DNS domains. This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload from an uncommon domain. When malware is already running, it may send requests to an uncommon DNS domain the malware uses for command-and-control communication.",
+ "false_positives": [
+ "A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this signal. Network activity that occurs rarely, in small quantities, can trigger this signal. Possible examples are browsing technical support or vendor networks sparsely. A user who visits a new or unique web destination may trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "packetbeat_rare_dns_question",
+ "name": "Unusual DNS Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "746edc4c-c54c-49c6-97a1-651223819448",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Packetbeat"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json
new file mode 100644
index 0000000000000..c49bc95be75d2
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected an unusual network destination domain name. This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload from an uncommon web server name. When malware is already running, it may send requests to an uncommon DNS domain the malware uses for command-and-control communication.",
+ "false_positives": [
+ "Web activity that occurs rarely in small quantities can trigger this signal. Possible examples are browsing technical support or vendor URLs that are used very sparsely. A user who visits a new and unique web destination may trigger this signal when the activity is sparse. Web applications that generate URLs unique to a transaction may trigger this when they are used sparsely. Web domains can be excluded in cases such as these."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "packetbeat_rare_server_domain",
+ "name": "Unusual Network Destination Domain Name",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "17e68559-b274-4948-ad0b-f8415bb31126",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Packetbeat"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json
new file mode 100644
index 0000000000000..02a4a5f729a16
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected a rare and unusual URL that indicates unusual web browsing activity. This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, in a strategic web compromise or watering hole attack, when a trusted website is compromised to target a particular sector or organization, targeted users may receive emails with uncommon URLs for trusted websites. These URLs can be used to download and run a payload. When malware is already running, it may send requests to uncommon URLs on trusted websites the malware uses for command-and-control communication. When rare URLs are observed being requested for a local web server by a remote source, these can be due to web scanning, enumeration or attack traffic, or they can be due to bots and web scrapers which are part of common Internet background traffic.",
+ "false_positives": [
+ "Web activity that occurs rarely in small quantities can trigger this signal. Possible examples are browsing technical support or vendor URLs that are used very sparsely. A user who visits a new and unique web destination may trigger this signal when the activity is sparse. Web applications that generate URLs unique to a transaction may trigger this when they are used sparsely. Web domains can be excluded in cases such as these."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "packetbeat_rare_urls",
+ "name": "Unusual Web Request",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "91f02f01-969f-4167-8f55-07827ac3acc9",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Packetbeat"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json
new file mode 100644
index 0000000000000..76ed6b263a704
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected a rare and unusual user agent indicating web browsing activity by an unusual process other than a web browser. This can be due to persistence, command-and-control, or exfiltration activity. Uncommon user agents coming from remote sources to local destinations are often the result of scanners, bots, and web scrapers, which are part of common Internet background traffic. Much of this is noise, but more targeted attacks on websites using tools like Burp or SQLmap can sometimes be discovered by spotting uncommon user agents. Uncommon user agents in traffic from local sources to remote destinations can be any number of things, including harmless programs like weather monitoring or stock-trading programs. However, uncommon user agents from local sources can also be due to malware or scanning activity.",
+ "false_positives": [
+ "Web activity that is uncommon, like security scans, may trigger this signal and may need to be excluded. A new or rarely used program that calls web services may trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "packetbeat_rare_user_agent",
+ "name": "Unusual Web User Agent",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "91f02f01-969f-4167-8d77-07827ac4cee0",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Packetbeat"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json
new file mode 100644
index 0000000000000..048f93e170656
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies rare processes that do not usually run on individual hosts, which can indicate execution of unauthorized services, malware, or persistence mechanisms. Processes are considered rare when they only run occasionally as compared with other processes running on the host.",
+ "false_positives": [
+ "A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "rare_process_by_host_linux_ecs",
+ "name": "Unusual Process For a Linux Host",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "46f804f5-b289-43d6-a881-9387cf594f75",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json
new file mode 100644
index 0000000000000..7bc46cdc04dd2
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies rare processes that do not usually run on individual hosts, which can indicate execution of unauthorized services, malware, or persistence mechanisms. Processes are considered rare when they only run occasionally as compared with other processes running on the host.",
+ "false_positives": [
+ "A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "rare_process_by_host_windows_ecs",
+ "name": "Unusual Process For a Windows Host",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "6d448b96-c922-4adb-b51c-b767f1ea5b76",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json
index 5c03c3a76e4a7..fd240262d021f 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json
@@ -7,7 +7,6 @@
"apm-*-transaction*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Web Application Suspicious Activity: sqlmap User Agent",
"query": "user_agent.original:\"sqlmap/1.3.11#stable (http://sqlmap.org)\"",
"references": [
@@ -17,9 +16,9 @@
"rule_id": "d49cc73f-7a16-4def-89ce-9fc7127d7820",
"severity": "medium",
"tags": [
- "Elastic",
- "APM"
+ "APM",
+ "Elastic"
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json
new file mode 100644
index 0000000000000..915bc1bcfc051
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies an unusually high number of authentication attempts.",
+ "false_positives": [
+ "Security audits may trigger this signal. Conditions that generate bursts of failed logins, such as misconfigured applications or account lockouts could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "suspicious_login_activity_ecs",
+ "name": "Unusual Login Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "4330272b-9724-4bc6-a3ca-f1532b81e5c2",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Linux",
+ "ML"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json
new file mode 100644
index 0000000000000..72671760c9c8d
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies Windows processes that do not usually use the network but have unexpected network activity, which can indicate command-and-control, lateral movement, persistence, or data exfiltration activity. A process with unusual network activity can denote process exploitation or injection, where the process is used to run persistence mechanisms that allow a malicious actor remote access or control of the host, data exfiltration, and execution of unauthorized network applications.",
+ "false_positives": [
+ "A newly installed program or one that rarely uses the network could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_anomalous_network_activity_ecs",
+ "name": "Unusual Windows Network Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "ba342eb2-583c-439f-b04d-1fdd7c1417cc",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json
new file mode 100644
index 0000000000000..082fce438ca9e
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies processes started from atypical folders in the file system, which might indicate malware execution or persistence mechanisms. In corporate Windows environments, software installation is centrally managed and it is unusual for programs to be executed from user or temporary directories. Processes executed from these locations can denote that a user downloaded software directly from the Internet or a malicious script or macro executed malware.",
+ "false_positives": [
+ "A new and unusual program or artifact download in the course of software upgrades, debugging, or troubleshooting could trigger this signal. Users downloading and running programs from unusual locations, such as temporary directories, browser caches, or profile paths could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_anomalous_path_activity_ecs",
+ "name": "Unusual Windows Path Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "445a342e-03fb-42d0-8656-0367eb2dead5",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json
new file mode 100644
index 0000000000000..93469b5a06223
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Searches for rare processes running on multiple hosts in an entire fleet or network. This reduces the detection of false positives since automated maintenance processes usually only run occasionally on a single machine but are common to all or many hosts in a fleet.",
+ "false_positives": [
+ "A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_anomalous_process_all_hosts_ecs",
+ "name": "Anomalous Process For a Windows Population",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "6e40d56f-5c0e-4ac6-aece-bee96645b172",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json
new file mode 100644
index 0000000000000..1b80e443baae6
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "Identifies unusual parent-child process relationships that can indicate malware execution or persistence mechanisms. Malicious scripts often call on other applications and processes as part of their exploit payload. For example, when a malicious Office document runs scripts as part of an exploit payload, Excel or Word may start a script interpreter process, which, in turn, runs a script that downloads and executes malware. Another common scenario is Outlook running an unusual process when malware is downloaded in an email. Monitoring and identifying anomalous process relationships is a method of detecting new and emerging malware that is not yet recognized by anti-virus scanners.",
+ "false_positives": [
+ "Users running scripts in the course of technical support operations of software upgrades could trigger this signal. A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_anomalous_process_creation",
+ "name": "Anomalous Windows Process Creation",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "0b29cab4-dbbd-4a3f-9e8e-1287c7c11ae5",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json
new file mode 100644
index 0000000000000..4de5443bcaf3f
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected a PowerShell script with unusual data characteristics, such as obfuscation, that may be a characteristic of malicious PowerShell script text blocks.",
+ "false_positives": [
+ "Certain kinds of security testing may trigger this signal. PowerShell scripts that use high levels of obfuscation or have unusual script block payloads may trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_anomalous_script",
+ "name": "Suspicious Powershell Script",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "1781d055-5c66-4adf-9d60-fc0fa58337b6",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json
new file mode 100644
index 0000000000000..7e0641fee68c2
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected an unusual Windows service, This can indicate execution of unauthorized services, malware, or persistence mechanisms. In corporate Windows environments, hosts do not generally run many rare or unique services. This job helps detect malware and persistence mechanisms that have been installed and run as a service.",
+ "false_positives": [
+ "A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this signal."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_anomalous_service",
+ "name": "Unusual Windows Service",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "1781d055-5c66-4adf-9c71-fc0fa58338c7",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json
new file mode 100644
index 0000000000000..217404b6eb474
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected activity for a username that is not normally active, which can indicate unauthorized changes, activity by unauthorized users, lateral movement, or compromised credentials. In many organizations, new usernames are not often created apart from specific types of system activities, such as creating new accounts for new employees. These user accounts quickly become active and routine. Events from rarely used usernames can point to suspicious activity. Additionally, automated Linux fleets tend to see activity from rarely used usernames only when personnel log in to make authorized or unauthorized changes, or threat actors have acquired credentials and log in for malicious purposes. Unusual usernames can also indicate pivoting, where compromised credentials are used to try and move laterally from one host to another.",
+ "false_positives": [
+ "Uncommon user activity can be due to an administrator or help desk technician logging onto a workstation or server in order to perform manual troubleshooting or reconfiguration."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_anomalous_user_name_ecs",
+ "name": "Unusual Windows Username",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "1781d055-5c66-4adf-9c59-fc0fa58336a5",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json
new file mode 100644
index 0000000000000..2cda21cf7d5ef
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json
@@ -0,0 +1,36 @@
+{
+ "description": "Identifies certutil.exe making a network connection. Adversaries could abuse certutil.exe to download a certificate, or malware, from a remote URL.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "max_signals": 33,
+ "name": "Network Connection via Certutil",
+ "query": "process.name:certutil.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
+ "risk_score": 21,
+ "rule_id": "3838e0e3-1850-4850-a411-2e8c5ba40ba8",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0011",
+ "name": "Command and Control",
+ "reference": "https://attack.mitre.org/tactics/TA0011/"
+ },
+ "technique": [
+ {
+ "id": "T1105",
+ "name": "Remote File Copy",
+ "reference": "https://attack.mitre.org/techniques/T1105/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json
index 7ab8034ef4083..2427ab4d7cc55 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json
@@ -7,9 +7,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Command Prompt Network Connection",
- "query": "process.name:cmd.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:10.0.0.0/8 and not destination.ip:172.16.0.0/12 and not destination.ip:192.168.0.0/16",
+ "query": "process.name:cmd.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 21,
"rule_id": "89f9a4b0-9f8f-4ee0-8823-c4751a6d6696",
"severity": "low",
@@ -51,4 +50,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json
index d914fd2e91a07..f8e5bd22576a4 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json
@@ -4,7 +4,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "PowerShell spawning Cmd",
"query": "process.parent.name:powershell.exe and process.name:cmd.exe",
"risk_score": 21,
@@ -48,4 +47,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json
index b7f0c54fedf62..71aafa9984ecb 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json
@@ -4,7 +4,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Svchost spawning Cmd",
"query": "process.parent.name:svchost.exe and process.name:cmd.exe",
"risk_score": 21,
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json
new file mode 100644
index 0000000000000..4ff7891438554
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json
@@ -0,0 +1,38 @@
+{
+ "description": "An instance of MSBuild, the Microsoft Build Engine, loaded DLLs (dynamically linked libraries) responsible for Windows credential management. This technique is sometimes used for credential dumping.",
+ "false_positives": [
+ "The Build Engine is commonly used by Windows developers but use by non-engineers is unusual."
+ ],
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Microsoft Build Engine Loading Windows Credential Libraries",
+ "query": "(winlog.event_data.OriginalFileName: (vaultcli.dll or SAMLib.DLL) or dll.name: (vaultcli.dll or SAMLib.DLL)) and process.name: MSBuild.exe and event.action: \"Image loaded (rule: ImageLoad)\"",
+ "risk_score": 73,
+ "rule_id": "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae5",
+ "severity": "high",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0006",
+ "name": "Credential Access",
+ "reference": "https://attack.mitre.org/tactics/TA0006/"
+ },
+ "technique": [
+ {
+ "id": "T1003",
+ "name": "Credential Dumping",
+ "reference": "https://attack.mitre.org/techniques/T1003/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json
new file mode 100644
index 0000000000000..c08bb7b3315f5
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json
@@ -0,0 +1,36 @@
+{
+ "description": "A spoofing vulnerability exists in the way Windows CryptoAPI (Crypt32.dll) validates Elliptic Curve Cryptography (ECC) certificates. An attacker could exploit the vulnerability by using a spoofed code-signing certificate to sign a malicious executable, making it appear the file was from a trusted, legitimate source.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "max_signals": 33,
+ "name": "Windows CryptoAPI Spoofing Vulnerability (CVE-2020-0601 - CurveBall)",
+ "query": "event.provider:\"Microsoft-Windows-Audit-CVE\" and message:\"[CVE-2020-0601]\"",
+ "risk_score": 21,
+ "rule_id": "56557cde-d923-4b88-adee-c61b3f3b5dc3",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1116",
+ "name": "Code Signing",
+ "reference": "https://attack.mitre.org/techniques/T1116/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json
index 86242fd1081a1..3f97f7aca74f6 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json
@@ -4,7 +4,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Potential Evasion via Filter Manager",
"query": "event.code:1 and process.name:fltMC.exe",
"risk_score": 21,
@@ -33,4 +32,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json
new file mode 100644
index 0000000000000..72e02f8718d03
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json
@@ -0,0 +1,56 @@
+{
+ "description": "An instance of MSBuild, the Microsoft Build Engine, was started by Excel or Word. This is unusual behavior for the Build Engine and could have been caused by an Excel or Word document executing a malicious script payload.",
+ "false_positives": [
+ "The Build Engine is commonly used by Windows developers but use by non-engineers is unusual. It is quite unusual for this program to be started by an Office application like Word or Excel."
+ ],
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Microsoft Build Engine Started by an Office Application",
+ "query": "process.name:MSBuild.exe and process.parent.name:(eqnedt32.exe or excel.exe or fltldr.exe or msaccess.exe or mspub.exe or outlook.exe or powerpnt.exe or winword.exe) and event.action: \"Process Create (rule: ProcessCreate)\"",
+ "references": [
+ "https://blog.talosintelligence.com/2020/02/building-bypass-with-msbuild.html"
+ ],
+ "risk_score": 73,
+ "rule_id": "c5dc3223-13a2-44a2-946c-e9dc0aa0449c",
+ "severity": "high",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1127",
+ "name": "Trusted Developer Utilities",
+ "reference": "https://attack.mitre.org/techniques/T1127/"
+ }
+ ]
+ },
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0002",
+ "name": "Execution",
+ "reference": "https://attack.mitre.org/tactics/TA0002/"
+ },
+ "technique": [
+ {
+ "id": "T1127",
+ "name": "Trusted Developer Utilities",
+ "reference": "https://attack.mitre.org/techniques/T1127/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json
new file mode 100644
index 0000000000000..ad519f1516aa6
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json
@@ -0,0 +1,53 @@
+{
+ "description": "An instance of MSBuild, the Microsoft Build Engine, was started by a script or the Windows command interpreter. This behavior is unusual and is sometimes used by malicious payloads.",
+ "false_positives": [
+ "The Build Engine is commonly used by Windows developers but use by non-engineers is unusual."
+ ],
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Microsoft Build Engine Started by a Script Process",
+ "query": "process.name:MSBuild.exe and process.parent.name:(cmd.exe or powershell.exe or cscript.exe or wscript.exe) and event.action:\"Process Create (rule: ProcessCreate)\"",
+ "risk_score": 21,
+ "rule_id": "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae2",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1127",
+ "name": "Trusted Developer Utilities",
+ "reference": "https://attack.mitre.org/techniques/T1127/"
+ }
+ ]
+ },
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0002",
+ "name": "Execution",
+ "reference": "https://attack.mitre.org/tactics/TA0002/"
+ },
+ "technique": [
+ {
+ "id": "T1127",
+ "name": "Trusted Developer Utilities",
+ "reference": "https://attack.mitre.org/techniques/T1127/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json
new file mode 100644
index 0000000000000..1bbce904f2518
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json
@@ -0,0 +1,53 @@
+{
+ "description": "An instance of MSBuild, the Microsoft Build Engine, was started by Explorer or the WMI (Windows Management Instrumentation) subsystem. This behavior is unusual and is sometimes used by malicious payloads.",
+ "false_positives": [
+ "The Build Engine is commonly used by Windows developers but use by non-engineers is unusual."
+ ],
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Microsoft Build Engine Started by a System Process",
+ "query": "process.name:MSBuild.exe and process.parent.name:(explorer.exe or wmiprvse.exe) and event.action:\"Process Create (rule: ProcessCreate)\"",
+ "risk_score": 47,
+ "rule_id": "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae3",
+ "severity": "medium",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1127",
+ "name": "Trusted Developer Utilities",
+ "reference": "https://attack.mitre.org/techniques/T1127/"
+ }
+ ]
+ },
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0002",
+ "name": "Execution",
+ "reference": "https://attack.mitre.org/tactics/TA0002/"
+ },
+ "technique": [
+ {
+ "id": "T1127",
+ "name": "Trusted Developer Utilities",
+ "reference": "https://attack.mitre.org/techniques/T1127/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json
new file mode 100644
index 0000000000000..eea4b3b4efe10
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json
@@ -0,0 +1,38 @@
+{
+ "description": "An instance of MSBuild, the Microsoft Build Engine, was started after being renamed. This is uncommon behavior and may indicate an attempt to run unnoticed or undetected.",
+ "false_positives": [
+ "The Build Engine is commonly used by Windows developers but use by non-engineers is unusual."
+ ],
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Microsoft Build Engine Using an Alternate Name",
+ "query": "(pe.original_file_name:MSBuild.exe or winlog.event_data.OriginalFileName: MSBuild.exe) and not process.name: MSBuild.exe and event.action: \"Process Create (rule: ProcessCreate)\"",
+ "risk_score": 21,
+ "rule_id": "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae4",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1036",
+ "name": "Masquerading",
+ "reference": "https://attack.mitre.org/techniques/T1036/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json
new file mode 100644
index 0000000000000..81ea14e265388
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json
@@ -0,0 +1,41 @@
+{
+ "description": "An instance of MSBuild, the Microsoft Build Engine, started a PowerShell script or the Visual C# Command Line Compiler. This technique is sometimes used to deploy a malicious payload using the Build Engine.",
+ "false_positives": [
+ "The Build Engine is commonly used by Windows developers but use by non-engineers is unusual. If a build system triggers this rule it can be exempted by process, user or host name."
+ ],
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Microsoft Build Engine Started an Unusual Process",
+ "query": "process.parent.name:MSBuild.exe and process.name:(csc.exe or iexplore.exe or powershell.exe)",
+ "references": [
+ "https://blog.talosintelligence.com/2020/02/building-bypass-with-msbuild.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae6",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1500",
+ "name": "Compile After Delivery",
+ "reference": "https://attack.mitre.org/techniques/T1500/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json
index 7789b0723b3fc..2b6e1fb3daaec 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json
@@ -7,7 +7,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Process Activity via Compiled HTML File",
"query": "event.code:1 and process.name:hh.exe",
"risk_score": 21,
@@ -51,4 +50,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json
new file mode 100644
index 0000000000000..c397c955fe64f
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json
@@ -0,0 +1,51 @@
+{
+ "description": "RegSvcs.exe and RegAsm.exe are Windows command line utilities that are used to register .NET Component Object Model (COM) assemblies. Adversaries can use RegSvcs.exe and RegAsm.exe to proxy execution of code through a trusted Windows utility.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "max_signals": 33,
+ "name": "Execution via Regsvcs/Regasm",
+ "query": "process.name:(RegAsm.exe or RegSvcs.exe) and event.action:\"Process Create (rule: ProcessCreate)\"",
+ "risk_score": 21,
+ "rule_id": "47f09343-8d1f-4bb5-8bb0-00c9d18f5010",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0002",
+ "name": "Execution",
+ "reference": "https://attack.mitre.org/tactics/TA0002/"
+ },
+ "technique": [
+ {
+ "id": "T1121",
+ "name": "Regsvcs/Regasm",
+ "reference": "https://attack.mitre.org/techniques/T1121/"
+ }
+ ]
+ },
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1121",
+ "name": "Regsvcs/Regasm",
+ "reference": "https://attack.mitre.org/techniques/T1121/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json
index bd2376a0897f4..f60a986996d6f 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json
@@ -7,9 +7,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Trusted Developer Application Usage",
- "query": "event.code:1 and (process.name:MSBuild.exe or process.name:msxsl.exe)",
+ "query": "event.code:1 and process.name:(MSBuild.exe or msxsl.exe)",
"risk_score": 21,
"rule_id": "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae1",
"severity": "low",
@@ -51,4 +50,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json
index 32fa953388be3..4b3efead776d2 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Network Connection via Compiled HTML File",
- "query": "process.name:hh.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:10.0.0.0/8 and not destination.ip:172.16.0.0/12 and not destination.ip:192.168.0.0/16",
+ "query": "process.name:hh.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 21,
"rule_id": "b29ee2be-bf99-446c-ab1a-2dc0183394b8",
"severity": "low",
@@ -48,4 +47,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json
new file mode 100644
index 0000000000000..c6310c12ed974
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json
@@ -0,0 +1,53 @@
+{
+ "description": "An instance of MSBuild, the Microsoft Build Engine, created a thread in another process. This technique is sometimes used to evade detection or elevate privileges.",
+ "false_positives": [
+ "The Build Engine is commonly used by Windows developers but use by non-engineers is unusual."
+ ],
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Process Injection by the Microsoft Build Engine",
+ "query": "process.name:MSBuild.exe and event.action:\"CreateRemoteThread detected (rule: CreateRemoteThread)\"",
+ "risk_score": 21,
+ "rule_id": "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae9",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1055",
+ "name": "Process Injection",
+ "reference": "https://attack.mitre.org/techniques/T1055/"
+ }
+ ]
+ },
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0004",
+ "name": "Privilege Escalation",
+ "reference": "https://attack.mitre.org/tactics/TA0004/"
+ },
+ "technique": [
+ {
+ "id": "T1055",
+ "name": "Process Injection",
+ "reference": "https://attack.mitre.org/techniques/T1055/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json
index 0015371f03067..0cd68ba5c1ed8 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Network Connection via Signed Binary",
- "query": "(process.name:expand.exe or process.name:extrac.exe or process.name:ieexec.exe or process.name:makecab.exe) and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:10.0.0.0/8 and not destination.ip:172.16.0.0/12 and not destination.ip:192.168.0.0/16",
+ "query": "process.name:(expand.exe or extrac.exe or ieexec.exe or makecab.exe) and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 21,
"rule_id": "63e65ec3-43b1-45b0-8f2d-45b34291dc44",
"severity": "low",
@@ -48,4 +47,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json
new file mode 100644
index 0000000000000..d761226276496
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json
@@ -0,0 +1,36 @@
+{
+ "description": "Identifies use of bcdedit.exe to delete boot configuration data. This tactic is sometimes used as by malware or an attacker as a destructive technique.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "max_signals": 33,
+ "name": "Modification of Boot Configuration",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.name:bcdedit.exe and process.args:(/set and (bootstatuspolicy and ignoreallfailures or no and recoveryenabled))",
+ "risk_score": 21,
+ "rule_id": "69c251fb-a5d6-4035-b5ec-40438bd829ff",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0005",
+ "name": "Defense Evasion",
+ "reference": "https://attack.mitre.org/tactics/TA0005/"
+ },
+ "technique": [
+ {
+ "id": "T1107",
+ "name": "File Deletion",
+ "reference": "https://attack.mitre.org/techniques/T1107/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json
new file mode 100644
index 0000000000000..9b45d03aae375
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json
@@ -0,0 +1,36 @@
+{
+ "description": "Identifies msxsl.exe making a network connection. This may indicate adversarial activity as msxsl.exe is often leveraged by adversaries to execute malicious scripts and evade detection.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "max_signals": 33,
+ "name": "Network Connection via MsXsl",
+ "query": "process.name:msxsl.exe and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)",
+ "risk_score": 21,
+ "rule_id": "b86afe07-0d98-4738-b15d-8d7465f95ff5",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0002",
+ "name": "Execution",
+ "reference": "https://attack.mitre.org/tactics/TA0002/"
+ },
+ "technique": [
+ {
+ "id": "T1220",
+ "name": "XSL Script Processing",
+ "reference": "https://attack.mitre.org/techniques/T1220/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json
new file mode 100644
index 0000000000000..390c9c278905c
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json
@@ -0,0 +1,36 @@
+{
+ "description": "Identifies the SYSTEM account using the Net utility. The Net utility is a component of the Windows operating system. It is used in command line operations for control of users, groups, services, and network connections.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "max_signals": 33,
+ "name": "Net command via SYSTEM account",
+ "query": "(process.name:net.exe or process.name:net1.exe and not process.parent.name:net.exe) and user.name:SYSTEM and event.action:\"Process Create (rule: ProcessCreate)\"",
+ "risk_score": 21,
+ "rule_id": "2856446a-34e6-435b-9fb5-f8f040bfa7ed",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0007",
+ "name": "Discovery",
+ "reference": "https://attack.mitre.org/tactics/TA0007/"
+ },
+ "technique": [
+ {
+ "id": "T1087",
+ "name": "Account Discovery",
+ "reference": "https://attack.mitre.org/techniques/T1087/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json
index 6eaac7b9e6cab..0488667d06c82 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json
@@ -4,7 +4,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Potential Application Shimming via Sdbinst",
"query": "event.code:1 and process.name:sdbinst.exe",
"risk_score": 21,
@@ -48,4 +47,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json
index b2463633b0c5d..26f0a0bcc245c 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json
@@ -4,9 +4,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Potential Modification of Accessibility Binaries",
- "query": "event.code:1 and process.parent.name:winlogon.exe and (process.name:atbroker.exe or process.name:displayswitch.exe or process.name:magnify.exe or process.name:narrator.exe or process.name:osk.exe or process.name:sethc.exe or process.name:utilman.exe)",
+ "query": "event.code:1 and process.parent.name:winlogon.exe and process.name:(atbroker.exe or displayswitch.exe or magnify.exe or narrator.exe or osk.exe or sethc.exe or utilman.exe)",
"risk_score": 21,
"rule_id": "7405ddf1-6c8e-41ce-818f-48bea6bcaed8",
"severity": "low",
@@ -48,4 +47,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json
index a0542ef59d8cd..28ebdb44fddd2 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json
@@ -7,7 +7,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Process Discovery via Tasklist",
"query": "event.code:1 and process.name:tasklist.exe",
"risk_score": 21,
@@ -36,4 +35,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json
new file mode 100644
index 0000000000000..3dca119b5a28e
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected an unusual user context switch, using the runas command or similar techniques, which can indicate account takeover or privilege escalation using compromised accounts. Privilege elevation using tools like runas are more commonly used by domain and network administrators than by regular Windows users.",
+ "false_positives": [
+ "Uncommon user privilege elevation activity can be due to an administrator, help desk technician, or a user performing manual troubleshooting or reconfiguration."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_rare_user_runas_event",
+ "name": "Unusual Windows User Privilege Elevation Activity",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "1781d055-5c66-4adf-9d82-fc0fa58449c8",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json
new file mode 100644
index 0000000000000..09ff2a0cedf41
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json
@@ -0,0 +1,24 @@
+{
+ "anomaly_threshold": 50,
+ "description": "A machine learning job detected an unusual remote desktop protocol (RDP) username, which can indicate account takeover or credentialed persistence using compromised accounts. RDP attacks, such as BlueKeep, also tend to use unusual usernames.",
+ "false_positives": [
+ "Uncommon username activity can be due to an engineer logging onto a server instance in order to perform manual troubleshooting or reconfiguration."
+ ],
+ "from": "now-16m",
+ "interval": "15m",
+ "machine_learning_job_id": "windows_rare_user_type10_remote_login",
+ "name": "Unusual Windows Remote User",
+ "references": [
+ "https://www.elastic.co/guide/en/siem/guide/current/prebuilt-ml-jobs.html"
+ ],
+ "risk_score": 21,
+ "rule_id": "1781d055-5c66-4adf-9e93-fc0fa69550c9",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "ML",
+ "Windows"
+ ],
+ "type": "machine_learning",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json
index d0f2e809c1aa7..920ff28a9a9cd 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json
@@ -1,5 +1,5 @@
{
- "description": "Identifies the native Windows tools regsvr32.exe and regsvr64.exe making a network connection. This may be indicative of an attacker bypassing whitelisting or running arbitrary scripts via a signed Microsoft binary.",
+ "description": "Identifies the native Windows tools regsvr32.exe and regsvr64.exe making a network connection. This may be indicative of an attacker bypassing whitelisting or running arbitrary scripts via a signed Microsoft binary.",
"false_positives": [
"Security testing may produce events like this. Activity of this kind performed by non-engineers and ordinary users is unusual."
],
@@ -7,9 +7,8 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Network Connection via Regsvr",
- "query": "(process.name:regsvr32.exe or process.name:regsvr64.exe) and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:169.254.169.254/32 and not destination.ip:10.0.0.0/8 and not destination.ip:172.16.0.0/12 and not destination.ip:192.168.0.0/16",
+ "query": "process.name:(regsvr32.exe or regsvr64.exe) and event.action:\"Network connection detected (rule: NetworkConnect)\" and not destination.ip:(10.0.0.0/8 or 169.254.169.254 or 172.16.0.0/12 or 192.168.0.0/16)",
"risk_score": 21,
"rule_id": "fb02b8d3-71ee-4af1-bacd-215d23f17efa",
"severity": "low",
@@ -51,4 +50,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json
new file mode 100644
index 0000000000000..9d4c2438acfb9
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json
@@ -0,0 +1,35 @@
+{
+ "description": "Identifies suspicious child processes of PDF reader applications. These child processes are often launched via exploitation of PDF applications or social engineering.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "name": "Suspicious PDF Reader Child Process",
+ "query": "event.action:\"Process Create (rule: ProcessCreate)\" and process.parent.name:(AcroRd32.exe or Acrobat.exe or FoxitPhantomPDF.exe or FoxitReader.exe) and process.name:(arp.exe or dsquery.exe or dsget.exe or gpresult.exe or hostname.exe or ipconfig.exe or nbtstat.exe or net.exe or net1.exe or netsh.exe or netstat.exe or nltest.exe or ping.exe or qprocess.exe or quser.exe or qwinsta.exe or reg.exe or sc.exe or systeminfo.exe or tasklist.exe or tracert.exe or whoami.exe or bginfo.exe or cdb.exe or cmstp.exe or csi.exe or dnx.exe or fsi.exe or ieexec.exe or iexpress.exe or installutil.exe or Microsoft.Workflow.Compiler.exe or msbuild.exe or mshta.exe or msxsl.exe or odbcconf.exe or rcsi.exe or regsvr32.exe or xwizard.exe or atbroker.exe or forfiles.exe or schtasks.exe or regasm.exe or regsvcs.exe or cmd.exe or cscript.exe or powershell.exe or pwsh.exe or wmic.exe or wscript.exe or bitsadmin.exe or certutil.exe or ftp.exe)",
+ "risk_score": 21,
+ "rule_id": "53a26770-9cbd-40c5-8b57-61d01a325e14",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0002",
+ "name": "Execution",
+ "reference": "https://attack.mitre.org/tactics/TA0002/"
+ },
+ "technique": [
+ {
+ "id": "T1204",
+ "name": "User Execution",
+ "reference": "https://attack.mitre.org/techniques/T1204/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json
new file mode 100644
index 0000000000000..0d4168640bc60
--- /dev/null
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json
@@ -0,0 +1,36 @@
+{
+ "description": "Identifies User Account Control (UAC) bypass via eventvwr.exe. Attackers bypass UAC to stealthily execute code with elevated permissions.",
+ "index": [
+ "winlogbeat-*"
+ ],
+ "language": "kuery",
+ "max_signals": 33,
+ "name": "Bypass UAC via Event Viewer",
+ "query": "process.parent.name:eventvwr.exe and event.action:\"Process Create (rule: ProcessCreate)\" and not process.executable:(\"C:\\Windows\\SysWOW64\\mmc.exe\" or \"C:\\Windows\\System32\\mmc.exe\")",
+ "risk_score": 21,
+ "rule_id": "31b4c719-f2b4-41f6-a9bd-fce93c2eaf62",
+ "severity": "low",
+ "tags": [
+ "Elastic",
+ "Windows"
+ ],
+ "threat": [
+ {
+ "framework": "MITRE ATT&CK",
+ "tactic": {
+ "id": "TA0004",
+ "name": "Privilege Escalation",
+ "reference": "https://attack.mitre.org/tactics/TA0004/"
+ },
+ "technique": [
+ {
+ "id": "T1088",
+ "name": "Bypass User Account Control",
+ "reference": "https://attack.mitre.org/techniques/T1088/"
+ }
+ ]
+ }
+ ],
+ "type": "query",
+ "version": 1
+}
\ No newline at end of file
diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json
index 678160f945ba0..46af0c5b586a5 100644
--- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json
+++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json
@@ -7,7 +7,6 @@
"winlogbeat-*"
],
"language": "kuery",
- "max_signals": 100,
"name": "Whoami Process Activity",
"query": "process.name:whoami.exe and event.code:1",
"risk_score": 21,
@@ -36,4 +35,4 @@
],
"type": "query",
"version": 1
-}
+}
\ No newline at end of file
diff --git a/x-pack/test/siem_cypress/es_archives/prebuilt_rules_loaded/data.json.gz b/x-pack/test/siem_cypress/es_archives/prebuilt_rules_loaded/data.json.gz
index e3f535a5e69e1dbcf97d2b06c6160797ebbc826c..90d4cfe0f2734823f0acccd4ba4ea977fe939f4d 100644
GIT binary patch
literal 40255
zcmZU)Q;;r77j0R#c4?RSm2KO$ZQHhO+qP|Emu=fdpTFZq^o{6z$fu0R*SW?V3qJ}9
z=zj+U<*LWZX;VCv^{vMbe5I>_MvjVNi!O3I#(tufMsAa~C$);|CC5`Ji7nnd00AjM@0KG28Y!840+k}8kby^qBv5#VZmxspwC~4Iqb~C@!`sEW2bsjrB^;5~f_IGU
z7aV`ji1bb?bE=Y~wBl(?`2$dBAni>T0oAk}KTPE6k>0KVD4_(~r3(Ivtc#^(6ovJ?
zY2IBr?mmdZqE_;}1?D}FQAKCr{))TV|K+^$iL3JtXzf$Gu43ZAU0!d`_xP^-ZPIvg
z^MLOoKk@Lre6LdrskZf-C^&dm_9=q7`8!S}flaZa@1)n!YK5{%oclNu8~1&-79*N~
z|22n3_Z1xDPU57=hI#8p2RrE)kt1Gk-S|4=yfe<`;XB55;G@9Syhjh@7N;msX6fh`
zwoYDWc^R#?UfrZqQ&QWjZ6QioOaSeWYfQlH$_x#@^^_(o#*^AY)@BV{SD9uo#1A^kq?qmb9=}d@28%->YlyS_q=UP4TIu`l8NZHNGu-t?
zte&(1O8eg!q#IrFsuW#?-kg2TQoHOO