-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into security/rules/4680-new-preview
- Loading branch information
Showing
43 changed files
with
435 additions
and
1,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...ic/applications/enterprise_search_content/components/search_index/pipelines/pipelines.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { DataPanel } from '../../../../shared/data_panel/data_panel'; | ||
|
||
export const SearchIndexPipelines: React.FC = () => { | ||
return ( | ||
<> | ||
<EuiSpacer /> | ||
<EuiFlexGroup direction="row"> | ||
<EuiFlexItem> | ||
<DataPanel | ||
hasBorder | ||
title={ | ||
<h2> | ||
{i18n.translate( | ||
'xpack.enterpriseSearch.content.indices.pipelines.ingestionPipeline.title', | ||
{ | ||
defaultMessage: 'Ingest Pipelines', | ||
} | ||
)} | ||
</h2> | ||
} | ||
iconType="logstashInput" | ||
> | ||
<div /> | ||
</DataPanel> | ||
<EuiSpacer /> | ||
<DataPanel | ||
hasBorder | ||
title={ | ||
<h2> | ||
{i18n.translate( | ||
'xpack.enterpriseSearch.content.indices.pipelines.mlInferencePipelines.title', | ||
{ | ||
defaultMessage: 'ML Inference pipelines', | ||
} | ||
)} | ||
</h2> | ||
} | ||
iconType="compute" | ||
> | ||
<div /> | ||
</DataPanel> | ||
</EuiFlexItem> | ||
<EuiFlexItem /> | ||
</EuiFlexGroup> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
.../plugins/security_solution/common/endpoint/data_generators/endpoint_metadata_generator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { DeepPartial } from 'utility-types'; | ||
import { merge } from 'lodash'; | ||
import { gte } from 'semver'; | ||
import { BaseDataGenerator } from './base_data_generator'; | ||
import type { HostMetadataInterface, OSFields } from '../types'; | ||
import { EndpointStatus, HostPolicyResponseActionStatus } from '../types'; | ||
|
||
/** | ||
* Metadata generator for docs that are sent by the Endpoint running on hosts | ||
*/ | ||
export class EndpointMetadataGenerator extends BaseDataGenerator { | ||
/** Generate an Endpoint host metadata document */ | ||
generate(overrides: DeepPartial<HostMetadataInterface> = {}): HostMetadataInterface { | ||
const ts = overrides['@timestamp'] ?? new Date().getTime(); | ||
const hostName = this.randomHostname(); | ||
const agentVersion = overrides?.agent?.version ?? this.randomVersion(); | ||
const agentId = this.seededUUIDv4(); | ||
const isIsolated = this.randomBoolean(0.3); | ||
const capabilities = ['isolation']; | ||
|
||
// v8.4 introduced additional endpoint capabilities | ||
if (gte(agentVersion, '8.4.0')) { | ||
capabilities.push('kill_process', 'suspend_process', 'running_processes'); | ||
} | ||
|
||
const hostMetadataDoc: HostMetadataInterface = { | ||
'@timestamp': ts, | ||
event: { | ||
created: ts, | ||
id: this.seededUUIDv4(), | ||
kind: 'metric', | ||
category: ['host'], | ||
type: ['info'], | ||
module: 'endpoint', | ||
action: 'endpoint_metadata', | ||
dataset: 'endpoint.metadata', | ||
}, | ||
data_stream: { | ||
type: 'metrics', | ||
dataset: 'endpoint.metadata', | ||
namespace: 'default', | ||
}, | ||
agent: { | ||
version: agentVersion, | ||
id: agentId, | ||
type: 'endpoint', | ||
}, | ||
elastic: { | ||
agent: { | ||
id: agentId, | ||
}, | ||
}, | ||
host: { | ||
id: this.seededUUIDv4(), | ||
hostname: hostName, | ||
name: hostName, | ||
architecture: this.randomString(10), | ||
ip: this.randomArray(3, () => this.randomIP()), | ||
mac: this.randomArray(3, () => this.randomMac()), | ||
os: this.randomOsFields(), | ||
}, | ||
Endpoint: { | ||
status: EndpointStatus.enrolled, | ||
policy: { | ||
applied: { | ||
name: 'With Eventing', | ||
id: 'C2A9093E-E289-4C0A-AA44-8C32A414FA7A', | ||
status: HostPolicyResponseActionStatus.success, | ||
endpoint_policy_version: 3, | ||
version: 5, | ||
}, | ||
}, | ||
configuration: { | ||
isolation: isIsolated, | ||
}, | ||
state: { | ||
isolation: isIsolated, | ||
}, | ||
capabilities, | ||
}, | ||
}; | ||
|
||
return merge(hostMetadataDoc, overrides); | ||
} | ||
|
||
protected randomOsFields(): OSFields { | ||
return this.randomChoice([ | ||
{ | ||
name: 'Windows', | ||
full: 'Windows 10', | ||
version: '10.0', | ||
platform: 'Windows', | ||
family: 'windows', | ||
Ext: { | ||
variant: 'Windows Pro', | ||
}, | ||
}, | ||
{ | ||
name: 'Windows', | ||
full: 'Windows Server 2016', | ||
version: '10.0', | ||
platform: 'Windows', | ||
family: 'windows', | ||
Ext: { | ||
variant: 'Windows Server', | ||
}, | ||
}, | ||
{ | ||
name: 'Windows', | ||
full: 'Windows Server 2012', | ||
version: '6.2', | ||
platform: 'Windows', | ||
family: 'windows', | ||
Ext: { | ||
variant: 'Windows Server', | ||
}, | ||
}, | ||
{ | ||
name: 'Windows', | ||
full: 'Windows Server 2012R2', | ||
version: '6.3', | ||
platform: 'Windows', | ||
family: 'windows', | ||
Ext: { | ||
variant: 'Windows Server Release 2', | ||
}, | ||
}, | ||
{ | ||
Ext: { | ||
variant: 'Debian', | ||
}, | ||
kernel: '4.19.0-21-cloud-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30)', | ||
name: 'Linux', | ||
family: 'debian', | ||
type: 'linux', | ||
version: '10.12', | ||
platform: 'debian', | ||
full: 'Debian 10.12', | ||
}, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.