Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-56367
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Feb 6, 2020
2 parents d6a77b7 + 8577233 commit da97113
Show file tree
Hide file tree
Showing 322 changed files with 3,452 additions and 2,954 deletions.
Binary file added docs/siem/images/detections-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/siem/images/hosts-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/siem/images/network-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/siem/images/overview-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/siem/siem-ui.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ investigation.
[role="screenshot"]
image::siem/images/network-ui.png[]

[float]
[[detections-ui]]
=== Detections

The Detections feature automatically searches for threats and creates
signals when they are detected. Signal detection rules define the conditions
for creating signals. The SIEM app comes with prebuilt rules that search for
suspicious activity on your network and hosts. Additionally, you can
create your own rules.

See {siem-guide}/detection-engine-overview.html[Detections] in the SIEM
Guide for information on managing detection rules and signals via the UI
or the Detections API.

[role="screenshot"]
image::siem/images/detections-ui.png[]

[float]
[[timelines-ui]]
=== Timeline
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
"strip-ansi": "^3.0.1",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
"tree-kill": "^1.2.1",
"tree-kill": "^1.2.2",
"typescript": "3.7.2",
"typings-tester": "^0.3.2",
"vinyl-fs": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"load-json-file": "^6.2.0",
"moment": "^2.24.0",
"rxjs": "^6.5.3",
"tree-kill": "^1.2.1",
"tree-kill": "^1.2.2",
"tslib": "^1.9.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"node-fetch": "^2.6.0",
"simple-git": "^1.91.0",
"tar-fs": "^1.16.3",
"tree-kill": "^1.2.1",
"tree-kill": "^1.2.2",
"yauzl": "^2.10.0"
}
}
31 changes: 23 additions & 8 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36382,15 +36382,24 @@ var spawn = childProcess.spawn;
var exec = childProcess.exec;

module.exports = function (pid, signal, callback) {
if (typeof signal === 'function' && callback === undefined) {
callback = signal;
signal = undefined;
}

pid = parseInt(pid);
if (Number.isNaN(pid)) {
if (callback) {
return callback(new Error("pid must be a number"));
} else {
throw new Error("pid must be a number");
}
}

var tree = {};
var pidsToProcess = {};
tree[pid] = [];
pidsToProcess[pid] = 1;

if (typeof signal === 'function' && callback === undefined) {
callback = signal;
signal = undefined;
}

switch (process.platform) {
case 'win32':
Expand Down Expand Up @@ -56572,12 +56581,18 @@ function runScriptInPackageStreaming(script, args, pkg) {
});
}
async function yarnWorkspacesInfo(directory) {
const workspacesInfo = await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['workspaces', 'info', '--json'], {
const {
stdout
} = await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['--json', 'workspaces', 'info'], {
cwd: directory,
stdio: 'pipe'
});
const stdout = JSON.parse(workspacesInfo.stdout);
return JSON.parse(stdout.data);

try {
return JSON.parse(JSON.parse(stdout).data);
} catch (error) {
throw new Error(`'yarn workspaces info --json' produced unexpected output: \n${stdout}`);
}
}

/***/ }),
Expand Down
9 changes: 6 additions & 3 deletions packages/kbn-pm/src/utils/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ export function runScriptInPackageStreaming(script: string, args: string[], pkg:
}

export async function yarnWorkspacesInfo(directory: string): Promise<WorkspacesInfo> {
const workspacesInfo = await spawn('yarn', ['workspaces', 'info', '--json'], {
const { stdout } = await spawn('yarn', ['--json', 'workspaces', 'info'], {
cwd: directory,
stdio: 'pipe',
});

const stdout = JSON.parse(workspacesInfo.stdout);
return JSON.parse(stdout.data);
try {
return JSON.parse(JSON.parse(stdout).data);
} catch (error) {
throw new Error(`'yarn workspaces info --json' produced unexpected output: \n${stdout}`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,12 @@ export class StepIndexPattern extends Component {

render() {
const { isIncludingSystemIndices, allIndices } = this.props;
const { query, partialMatchedIndices, exactMatchedIndices } = this.state;
const { partialMatchedIndices, exactMatchedIndices } = this.state;

const matchedIndices = getMatchedIndices(
allIndices,
partialMatchedIndices,
exactMatchedIndices,
query,
isIncludingSystemIndices
);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
* under the License.
*/

import { canAppendWildcard } from '../can_append_wildcard';
import { canAppendWildcard } from './can_append_wildcard';

describe('canAppendWildcard', () => {
test('ignores no data', () => {
expect(canAppendWildcard({})).toBeFalsy();
});

test('ignores symbols', () => {
expect(canAppendWildcard('%')).toBeFalsy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

export const canAppendWildcard = keyPressed => {
export const canAppendWildcard = (keyPressed: string) => {
// If it's not a letter, number or is something longer, reject it
if (!keyPressed || !/[a-z0-9]/i.test(keyPressed) || keyPressed.length !== 1) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
* under the License.
*/

export function containsIllegalCharacters(pattern, illegalCharacters) {
export function containsIllegalCharacters(pattern: string, illegalCharacters: string[]) {
return illegalCharacters.some(char => pattern.includes(char));
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { containsIllegalCharacters } from '../contains_illegal_characters';
import { containsIllegalCharacters } from './contains_illegal_characters';

describe('containsIllegalCharacters', () => {
it('returns true with illegal characters', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { ensureMinimumTime } from '../ensure_minimum_time';
import { ensureMinimumTime } from './ensure_minimum_time';

describe('ensureMinimumTime', () => {
it('resolves single promise', async done => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
export const DEFAULT_MINIMUM_TIME_MS = 300;

export async function ensureMinimumTime(
promiseOrPromises,
promiseOrPromises: Promise<any> | Array<Promise<any>>,
minimumTimeMs = DEFAULT_MINIMUM_TIME_MS
) {
let returnValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
* under the License.
*/

import { extractTimeFields } from '../extract_time_fields';
import { extractTimeFields } from './extract_time_fields';

describe('extractTimeFields', () => {
it('should handle no date fields', () => {
const fields = [{ type: 'text' }, { type: 'text' }];
const fields = [
{ type: 'text', name: 'name' },
{ type: 'text', name: 'name' },
];

expect(extractTimeFields(fields)).toEqual([
{ display: `The indices which match this index pattern don't contain any time fields.` },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
*/

import { i18n } from '@kbn/i18n';
import { IFieldType } from '../../../../../../../../../plugins/data/public';

export function extractTimeFields(fields) {
export function extractTimeFields(fields: IFieldType[]) {
const dateFields = fields.filter(field => field.type === 'date');
const label = i18n.translate('kbn.management.createIndexPattern.stepTime.noTimeFieldsLabel', {
defaultMessage: "The indices which match this index pattern don't contain any time fields.",
Expand Down
Loading

0 comments on commit da97113

Please sign in to comment.