Skip to content

Commit c6cd551

Browse files
committed
Merge branch 'master' into search/telemetry
2 parents b874ddc + cbe8f00 commit c6cd551

File tree

26 files changed

+2897
-75
lines changed

26 files changed

+2897
-75
lines changed

x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from '../../common/schemas';
1717

1818
import { getExceptionListClient } from './utils/get_exception_list_client';
19+
import { endpointDisallowedFields } from './endpoint_disallowed_fields';
1920

2021
export const createExceptionListItemRoute = (router: IRouter): void => {
2122
router.post(
@@ -70,6 +71,22 @@ export const createExceptionListItemRoute = (router: IRouter): void => {
7071
statusCode: 409,
7172
});
7273
} else {
74+
if (exceptionList.type === 'endpoint') {
75+
for (const entry of entries) {
76+
if (entry.type === 'list') {
77+
return siemResponse.error({
78+
body: `cannot add exception item with entry of type "list" to endpoint exception list`,
79+
statusCode: 400,
80+
});
81+
}
82+
if (endpointDisallowedFields.includes(entry.field)) {
83+
return siemResponse.error({
84+
body: `cannot add endpoint exception item on field ${entry.field}`,
85+
statusCode: 400,
86+
});
87+
}
88+
}
89+
}
7390
const createdList = await exceptionLists.createExceptionListItem({
7491
_tags,
7592
comments,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export const endpointDisallowedFields = [
8+
'file.Ext.quarantine_path',
9+
'file.Ext.quarantine_result',
10+
'process.entity_id',
11+
'process.parent.entity_id',
12+
'process.ancestry',
13+
];

x-pack/plugins/reporting/server/export_types/csv_from_savedobject/execute_job.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { CONTENT_TYPE_CSV, CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../common
1010
import { RunTaskFnFactory, ScheduledTaskParams, TaskRunResult } from '../../types';
1111
import { createGenerateCsv } from '../csv/generate_csv';
1212
import { JobParamsPanelCsv, SearchPanel } from './types';
13-
import { getFakeRequest } from './lib/get_fake_request';
1413
import { getGenerateCsvParams } from './lib/get_csv_job';
1514

1615
/*
@@ -44,19 +43,10 @@ export const runTaskFnFactory: RunTaskFnFactory<ImmediateExecuteFn> = function e
4443
const { jobParams } = jobPayload;
4544
const jobLogger = logger.clone([jobId === null ? 'immediate' : jobId]);
4645
const generateCsv = createGenerateCsv(jobLogger);
47-
const { isImmediate, panel, visType } = jobParams as JobParamsPanelCsv & {
48-
panel: SearchPanel;
49-
};
46+
const { panel, visType } = jobParams as JobParamsPanelCsv & { panel: SearchPanel };
5047

5148
jobLogger.debug(`Execute job generating [${visType}] csv`);
5249

53-
if (isImmediate && req) {
54-
jobLogger.info(`Executing job from Immediate API using request context`);
55-
} else {
56-
jobLogger.info(`Executing job async using encrypted headers`);
57-
req = await getFakeRequest(jobPayload, config.get('encryptionKey')!, jobLogger);
58-
}
59-
6050
const savedObjectsClient = context.core.savedObjects.client;
6151

6252
const uiConfig = await reporting.getUiSettingsServiceFactory(savedObjectsClient);

x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_fake_request.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

x-pack/plugins/security_solution/public/common/components/exceptions/builder/index.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import { BuilderButtonOptions } from './builder_button_options';
2323
import { getNewExceptionItem, filterExceptionItems } from '../helpers';
2424
import { ExceptionsBuilderExceptionItem, CreateExceptionListItemBuilderSchema } from '../types';
2525
import { Loader } from '../../loader';
26+
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
27+
import exceptionableFields from '../exceptionable_fields.json';
2628

2729
const MyInvisibleAndBadge = styled(EuiFlexItem)`
2830
visibility: hidden;
@@ -172,6 +174,17 @@ export const ExceptionBuilder = ({
172174
);
173175
}, [exceptions]);
174176

177+
// Filters index pattern fields by exceptionable fields if list type is endpoint
178+
const filterIndexPatterns = useCallback(() => {
179+
if (listType === 'endpoint') {
180+
return {
181+
...indexPatterns,
182+
fields: indexPatterns.fields.filter(({ name }) => exceptionableFields.includes(name)),
183+
};
184+
}
185+
return indexPatterns;
186+
}, [indexPatterns, listType]);
187+
175188
// The builder can have existing exception items, or new exception items that have yet
176189
// to be created (and thus lack an id), this was creating some React bugs with relying
177190
// on the index, as a result, created a temporary id when new exception items are first
@@ -216,7 +229,7 @@ export const ExceptionBuilder = ({
216229
key={getExceptionListItemId(exceptionListItem, index)}
217230
exceptionItem={exceptionListItem}
218231
exceptionId={getExceptionListItemId(exceptionListItem, index)}
219-
indexPattern={indexPatterns}
232+
indexPattern={filterIndexPatterns()}
220233
isLoading={indexPatternLoading}
221234
exceptionItemIndex={index}
222235
andLogicIncluded={andLogicIncluded}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
[
2+
"Endpoint.policy.applied.id",
3+
"Target.process.Ext.code_signature.status",
4+
"Target.process.Ext.code_signature.subject_name",
5+
"Target.process.Ext.code_signature.trusted",
6+
"Target.process.Ext.code_signature.valid",
7+
"Target.process.Ext.services",
8+
"Target.process.Ext.user",
9+
"Target.process.command_line",
10+
"Target.process.executable",
11+
"Target.process.hash.md5",
12+
"Target.process.hash.sha1",
13+
"Target.process.hash.sha256",
14+
"Target.process.hash.sha512",
15+
"Target.process.name",
16+
"Target.process.parent.Ext.code_signature.status",
17+
"Target.process.parent.Ext.code_signature.subject_name",
18+
"Target.process.parent.Ext.code_signature.trusted",
19+
"Target.process.parent.Ext.code_signature.valid",
20+
"Target.process.parent.command_line",
21+
"Target.process.parent.executable",
22+
"Target.process.parent.hash.md5",
23+
"Target.process.parent.hash.sha1",
24+
"Target.process.parent.hash.sha256",
25+
"Target.process.parent.hash.sha512",
26+
"Target.process.parent.name",
27+
"Target.process.parent.pgid",
28+
"Target.process.parent.working_directory",
29+
"Target.process.pe.company",
30+
"Target.process.pe.description",
31+
"Target.process.pe.file_version",
32+
"Target.process.pe.original_file_name",
33+
"Target.process.pe.product",
34+
"Target.process.pgid",
35+
"Target.process.working_directory",
36+
"agent.id",
37+
"agent.type",
38+
"agent.version",
39+
"elastic.agent.id",
40+
"event.action",
41+
"event.category",
42+
"event.code",
43+
"event.hash",
44+
"event.kind",
45+
"event.module",
46+
"event.outcome",
47+
"event.provider",
48+
"event.type",
49+
"file.Ext.code_signature.status",
50+
"file.Ext.code_signature.subject_name",
51+
"file.Ext.code_signature.trusted",
52+
"file.Ext.code_signature.valid",
53+
"file.attributes",
54+
"file.device",
55+
"file.directory",
56+
"file.drive_letter",
57+
"file.extension",
58+
"file.gid",
59+
"file.group",
60+
"file.hash.md5",
61+
"file.hash.sha1",
62+
"file.hash.sha256",
63+
"file.hash.sha512",
64+
"file.inode",
65+
"file.mime_type",
66+
"file.mode",
67+
"file.name",
68+
"file.owner",
69+
"file.path",
70+
"file.pe.company",
71+
"file.pe.description",
72+
"file.pe.file_version",
73+
"file.pe.original_file_name",
74+
"file.pe.product",
75+
"file.size",
76+
"file.target_path",
77+
"file.type",
78+
"file.uid",
79+
"group.Ext.real.id",
80+
"group.domain",
81+
"group.id",
82+
"host.architecture",
83+
"host.domain",
84+
"host.id",
85+
"host.os.Ext.variant",
86+
"host.os.family",
87+
"host.os.full",
88+
"host.os.kernel",
89+
"host.os.name",
90+
"host.os.platform",
91+
"host.os.version",
92+
"host.type",
93+
"process.Ext.code_signature.status",
94+
"process.Ext.code_signature.subject_name",
95+
"process.Ext.code_signature.trusted",
96+
"process.Ext.code_signature.valid",
97+
"process.Ext.services",
98+
"process.Ext.user",
99+
"process.command_line",
100+
"process.executable",
101+
"process.hash.md5",
102+
"process.hash.sha1",
103+
"process.hash.sha256",
104+
"process.hash.sha512",
105+
"process.name",
106+
"process.parent.Ext.code_signature.status",
107+
"process.parent.Ext.code_signature.subject_name",
108+
"process.parent.Ext.code_signature.trusted",
109+
"process.parent.Ext.code_signature.valid",
110+
"process.parent.command_line",
111+
"process.parent.executable",
112+
"process.parent.hash.md5",
113+
"process.parent.hash.sha1",
114+
"process.parent.hash.sha256",
115+
"process.parent.hash.sha512",
116+
"process.parent.name",
117+
"process.parent.pgid",
118+
"process.parent.working_directory",
119+
"process.pe.company",
120+
"process.pe.description",
121+
"process.pe.file_version",
122+
"process.pe.original_file_name",
123+
"process.pe.product",
124+
"process.pgid",
125+
"process.working_directory",
126+
"rule.uuid"
127+
]

x-pack/plugins/security_solution/public/detections/components/alerts_histogram_panel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const NO_LEGEND_DATA: LegendItem[] = [];
8383
export const AlertsHistogramPanel = memo<AlertsHistogramPanelProps>(
8484
({
8585
chartHeight,
86-
defaultStackByOption = alertsHistogramOptions[0],
86+
defaultStackByOption = alertsHistogramOptions[8], // signal.rule.name
8787
deleteQuery,
8888
filters,
8989
headerChildren,

x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
*/
66

77
import { FormattedMessage } from '@kbn/i18n/react';
8-
import { EuiText, EuiLink } from '@elastic/eui';
8+
import { EuiLink } from '@elastic/eui';
9+
import styled from 'styled-components';
910
import React from 'react';
1011

1112
import { ML_TYPE_DESCRIPTION } from './translations';
@@ -15,11 +16,15 @@ interface MlCardDescriptionProps {
1516
hasValidLicense?: boolean;
1617
}
1718

19+
const SmallText = styled.span`
20+
font-size: ${({ theme }) => theme.eui.euiFontSizeS};
21+
`;
22+
1823
const MlCardDescriptionComponent: React.FC<MlCardDescriptionProps> = ({
1924
subscriptionUrl,
2025
hasValidLicense = false,
2126
}) => (
22-
<EuiText size="s">
27+
<SmallText>
2328
{hasValidLicense ? (
2429
ML_TYPE_DESCRIPTION
2530
) : (
@@ -38,7 +43,7 @@ const MlCardDescriptionComponent: React.FC<MlCardDescriptionProps> = ({
3843
}}
3944
/>
4045
)}
41-
</EuiText>
46+
</SmallText>
4247
);
4348

4449
MlCardDescriptionComponent.displayName = 'MlCardDescriptionComponent';

x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/default_value.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const stepAboutDefaultValue: AboutStepRule = {
1818
author: [],
1919
name: '',
2020
description: '',
21+
isAssociatedToEndpointList: false,
2122
isBuildingBlock: false,
2223
isNew: true,
2324
severity: { value: 'low', mapping: [] },

x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/index.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ describe('StepAboutRuleComponent', () => {
165165
await wait();
166166
const expected: Omit<AboutStepRule, 'isNew'> = {
167167
author: [],
168+
isAssociatedToEndpointList: false,
168169
isBuildingBlock: false,
169170
license: '',
170171
ruleNameOverride: '',
@@ -223,6 +224,7 @@ describe('StepAboutRuleComponent', () => {
223224
await wait();
224225
const expected: Omit<AboutStepRule, 'isNew'> = {
225226
author: [],
227+
isAssociatedToEndpointList: false,
226228
isBuildingBlock: false,
227229
license: '',
228230
ruleNameOverride: '',

0 commit comments

Comments
 (0)