Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Init Osquery plugin #87109

Merged
merged 64 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
4a8791b
[Fleet] Use fleet server indices for enrollment keys
nchaulet Dec 16, 2020
e704999
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 22, 2020
272926f
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 22, 2020
4b93480
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 27, 2020
87c3452
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 28, 2020
cae8106
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 29, 2020
f738b37
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 29, 2020
47be337
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 29, 2020
d75033e
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Dec 30, 2020
cfd49c4
WIP
patrykkopycinski Dec 30, 2020
b828357
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 3, 2021
5f04a27
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Jan 3, 2021
175a379
[Fleet Server] Add support for index based agents
patrykkopycinski Jan 3, 2021
0989147
add missing files
patrykkopycinski Jan 3, 2021
1fa3c49
fix types
patrykkopycinski Jan 3, 2021
3bd57b1
Merge branch 'feature-poc-kibana-fleet-server-feature-flag-2' of gith…
patrykkopycinski Jan 4, 2021
a87337a
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 4, 2021
d40e18a
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 4, 2021
1ae8494
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 4, 2021
9da7de1
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 5, 2021
4f34ef5
Merge branch 'master' of github.com:elastic/kibana into feature-poc-k…
patrykkopycinski Jan 6, 2021
8c0d9f7
Merge branch 'feature-poc-kibana-fleet-server-feature-flag' of github…
patrykkopycinski Jan 7, 2021
bd1835f
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 7, 2021
1a36c03
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 8, 2021
97a2de7
WIP
patrykkopycinski Jan 9, 2021
d4f7885
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 9, 2021
328d562
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 11, 2021
5da5bb5
WIP
patrykkopycinski Jan 11, 2021
1049773
WIP
patrykkopycinski Jan 11, 2021
84e5757
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 11, 2021
43d9266
WIP
patrykkopycinski Jan 12, 2021
6a26cc2
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 12, 2021
dcd94ea
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 13, 2021
8aa8ef1
WIP
patrykkopycinski Jan 13, 2021
43c8848
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 13, 2021
dc0f1cd
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 13, 2021
c34d70f
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 13, 2021
de46ac4
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 14, 2021
cef4e1c
WIP
patrykkopycinski Jan 15, 2021
19117c4
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 15, 2021
ff66dd0
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 15, 2021
c2136ab
fix import
patrykkopycinski Jan 15, 2021
c5c5456
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 25, 2021
f04bbc0
sql autocomplete
lykkin Jan 20, 2021
0644248
added osquery mode to autocomplete
lykkin Jan 25, 2021
6f5a04c
Merge pull request #3 from lykkin/osquery-autocomplete
patrykkopycinski Jan 25, 2021
f81349b
cleanup
patrykkopycinski Jan 25, 2021
52cb197
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 25, 2021
6c1bb5c
docs
patrykkopycinski Jan 25, 2021
92a3894
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 26, 2021
5f7c561
cleanup
patrykkopycinski Jan 26, 2021
6d692e5
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 26, 2021
fd93e71
WIP
patrykkopycinski Jan 26, 2021
650e7d5
add osquery config
patrykkopycinski Jan 26, 2021
3303ecc
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 26, 2021
395abff
fix types
patrykkopycinski Jan 26, 2021
6f42f46
update i18n config
patrykkopycinski Jan 26, 2021
dc7e5b6
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 26, 2021
44e66d2
fix i18n
patrykkopycinski Jan 26, 2021
3ded958
fix types
patrykkopycinski Jan 26, 2021
c19334a
Merge branch 'master' of github.com:elastic/kibana into feat/init-osq…
patrykkopycinski Jan 26, 2021
049aa08
update readme
patrykkopycinski Jan 26, 2021
00b6ea1
Update plugin-list.asciidoc
patrykkopycinski Jan 26, 2021
69d5bb9
Merge branch 'master' into feat/init-osquery
patrykkopycinski Jan 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,32 @@ module.exports = {
},
},

/**
* Osquery overrides
*/
{
extends: ['eslint:recommended', 'plugin:react/recommended'],
plugins: ['react'],
files: ['x-pack/plugins/osquery/**/*.{js,mjs,ts,tsx}'],
rules: {
'arrow-body-style': ['error', 'as-needed'],
'prefer-arrow-callback': 'error',
'no-unused-vars': 'off',
'react/prop-types': 'off',
},
},
{
// typescript and javascript for front end react performance
files: ['x-pack/plugins/osquery/public/**/!(*.test).{js,mjs,ts,tsx}'],
plugins: ['react', 'react-perf'],
rules: {
'react-perf/jsx-no-new-object-as-prop': 'error',
'react-perf/jsx-no-new-array-as-prop': 'error',
'react-perf/jsx-no-new-function-as-prop': 'error',
'react/jsx-no-bind': 'error',
},
},

/**
* Prettier disables all conflicting rules, listing as last override so it takes precedence
*/
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
# Security Intelligence And Analytics
/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics

# Security Asset Management
/x-pack/plugins/osquery @elastic/security-asset-management
spalger marked this conversation as resolved.
Show resolved Hide resolved

# Design (at the bottom for specificity of SASS files)
**/*.scss @elastic/kibana-design
#CC# /packages/kbn-ui-framework/ @elastic/kibana-design
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ Elastic.
|This plugin provides shared components and services for use across observability solutions, as well as the observability landing page UI.


|{kib-repo}blob/{branch}/x-pack/plugins/osquery/README.md[osquery]
|This plugin adds extended support to Security Solution Fleet Osquery integration


|{kib-repo}blob/{branch}/x-pack/plugins/painless_lab/README.md[painlessLab]
|This plugin helps users learn how to use the Painless scripting language.

Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ pageLoadAssetSize:
stackAlerts: 29684
presentationUtil: 28545
spacesOss: 18817
osquery: 107090
mapsFileUpload: 23775
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"xpack.maps": ["plugins/maps"],
"xpack.ml": ["plugins/ml"],
"xpack.monitoring": ["plugins/monitoring"],
"xpack.osquery": ["plugins/osquery"],
"xpack.painlessLab": "plugins/painless_lab",
"xpack.remoteClusters": "plugins/remote_clusters",
"xpack.reporting": ["plugins/reporting"],
Expand Down
9 changes: 9 additions & 0 deletions x-pack/plugins/osquery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# osquery

This plugin adds extended support to Security Solution Fleet Osquery integration

---

## Development

See the [kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) for instructions setting up your development environment.
8 changes: 8 additions & 0 deletions x-pack/plugins/osquery/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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.
*/

export const DEFAULT_MAX_TABLE_QUERY_SIZE = 10000;
export const DEFAULT_DARK_MODE = 'theme:darkMode';
9 changes: 9 additions & 0 deletions x-pack/plugins/osquery/common/ecs/agent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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.
*/

export interface AgentEcs {
type?: string[];
}
33 changes: 33 additions & 0 deletions x-pack/plugins/osquery/common/ecs/auditd/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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.
*/

export interface AuditdEcs {
result?: string[];
session?: string[];
data?: AuditdDataEcs;
summary?: SummaryEcs;
sequence?: string[];
}

export interface AuditdDataEcs {
acct?: string[];
terminal?: string[];
op?: string[];
}

export interface SummaryEcs {
actor?: PrimarySecondaryEcs;
object?: PrimarySecondaryEcs;
how?: string[];
message_type?: string[];
sequence?: string[];
}

export interface PrimarySecondaryEcs {
primary?: string[];
secondary?: string[];
type?: string[];
}
20 changes: 20 additions & 0 deletions x-pack/plugins/osquery/common/ecs/cloud/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

export interface CloudEcs {
instance?: CloudInstanceEcs;
machine?: CloudMachineEcs;
provider?: string[];
region?: string[];
}

export interface CloudMachineEcs {
type?: string[];
}

export interface CloudInstanceEcs {
id?: string[];
}
16 changes: 16 additions & 0 deletions x-pack/plugins/osquery/common/ecs/destination/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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 { GeoEcs } from '../geo';

export interface DestinationEcs {
bytes?: number[];
ip?: string[];
port?: number[];
domain?: string[];
geo?: GeoEcs;
packets?: number[];
}
16 changes: 16 additions & 0 deletions x-pack/plugins/osquery/common/ecs/dns/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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.
*/

export interface DnsEcs {
question?: DnsQuestionEcs;
resolved_ip?: string[];
response_code?: string[];
}

export interface DnsQuestionEcs {
name?: string[];
type?: string[];
}
56 changes: 56 additions & 0 deletions x-pack/plugins/osquery/common/ecs/ecs_fields/extend_map.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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 { extendMap } from './extend_map';

describe('ecs_fields test', () => {
describe('extendMap', () => {
test('it should extend a record', () => {
const osFieldsMap: Readonly<Record<string, string>> = {
'os.platform': 'os.platform',
'os.full': 'os.full',
'os.family': 'os.family',
'os.version': 'os.version',
'os.kernel': 'os.kernel',
};
const expected: Record<string, string> = {
'host.os.family': 'host.os.family',
'host.os.full': 'host.os.full',
'host.os.kernel': 'host.os.kernel',
'host.os.platform': 'host.os.platform',
'host.os.version': 'host.os.version',
};
expect(extendMap('host', osFieldsMap)).toEqual(expected);
});

test('it should extend a sample hosts record', () => {
const hostMap: Record<string, string> = {
'host.id': 'host.id',
'host.ip': 'host.ip',
'host.name': 'host.name',
};
const osFieldsMap: Readonly<Record<string, string>> = {
'os.platform': 'os.platform',
'os.full': 'os.full',
'os.family': 'os.family',
'os.version': 'os.version',
'os.kernel': 'os.kernel',
};
const expected: Record<string, string> = {
'host.id': 'host.id',
'host.ip': 'host.ip',
'host.name': 'host.name',
'host.os.family': 'host.os.family',
'host.os.full': 'host.os.full',
'host.os.kernel': 'host.os.kernel',
'host.os.platform': 'host.os.platform',
'host.os.version': 'host.os.version',
};
const output = { ...hostMap, ...extendMap('host', osFieldsMap) };
expect(output).toEqual(expected);
});
});
});
14 changes: 14 additions & 0 deletions x-pack/plugins/osquery/common/ecs/ecs_fields/extend_map.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* 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.
*/

export const extendMap = (
path: string,
map: Readonly<Record<string, string>>
): Readonly<Record<string, string>> =>
Object.entries(map).reduce<Record<string, string>>((accum, [key, value]) => {
accum[`${path}.${key}`] = `${path}.${value}`;
return accum;
}, {});
Loading