Skip to content

Commit

Permalink
Merge branch 'main' into security/dkirchan-ftr-api-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirchan authored Nov 8, 2023
2 parents 3de5f1a + 5fab32d commit 241c40f
Show file tree
Hide file tree
Showing 187 changed files with 1,012 additions and 395 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh cypress:run:qa:serverless
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless
label: 'Serverless MKI QA Security Cypress Tests'
agents:
queue: n2-4-spot
Expand All @@ -11,7 +11,7 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh cypress:run:qa:serverless:explore
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:explore
label: 'Serverless MKI QA Explore - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
Expand All @@ -23,7 +23,7 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh cypress:run:qa:serverless:investigations
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:investigations
label: 'Serverless MKI QA Investigations - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -euo pipefail

echo "Running the EDR-Workflows testing for Kibana"
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const uploadPipeline = (pipelineContent: string | object) => {
try {
const pipeline = [];

pipeline.push(getPipeline('.buildkite/pipelines/security_solution/base.yml', false));
pipeline.push(
getPipeline('.buildkite/pipelines/security_solution/security_solution_cypress.yml', false)
);
// remove duplicated steps
uploadPipeline([...new Set(pipeline)].join('\n'));
} catch (ex) {
Expand Down
195 changes: 124 additions & 71 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@
"json-stringify-safe": "5.0.1",
"jsonwebtoken": "^9.0.0",
"jsts": "^1.6.2",
"kea": "^2.4.2",
"kea": "^2.6.0",
"langchain": "^0.0.151",
"launchdarkly-js-client-sdk": "^3.1.4",
"launchdarkly-node-server-sdk": "^7.0.3",
Expand Down Expand Up @@ -1276,7 +1276,6 @@
"@storybook/react-docgen-typescript-plugin": "^1.0.1",
"@storybook/testing-react": "^1.3.0",
"@storybook/theming": "^6.5.16",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,52 @@ describe('MessageConversion', () => {
'\\u001b\\u0000[31mESC-INJECTION-LFUNICODE:\\u001b[32mSUCCESSFUL\\u001b[0m\\u0007\n\nInjecting 10.000 lols 😂\\u001b[10000;b\\u0007'
);
});

test('it should encode/escape ANSI chars lines from the message when not a string', () => {
expect(
MessageConversion.convert(
{
...baseRecord,
// @ts-expect-error message is supposed to be a string
message: {
toString: () => 'toString...\u001b[5;7;6mThis is Fine\u001b[27m',
},
},
false
)
).toEqual('toString...\\u001b[5;7;6mThis is Fine\\u001b[27m');
});

test('it should encode/escape ANSI chars lines from the error stack', () => {
const error = new Error('Something went bad');
error.stack = 'stack...\u001b[5;7;6mThis is Fine\u001b[27m';
expect(
MessageConversion.convert(
{
...baseRecord,
message: 'Some message that will be ignored',
error,
},
false
)
).toEqual('stack...\\u001b[5;7;6mThis is Fine\\u001b[27m');
});

test('it should encode/escape ANSI chars lines from the error stack when not a string', () => {
expect(
MessageConversion.convert(
{
...baseRecord,
message: 'Some message that will be ignored',
error: {
// @ts-expect-error message is supposed to be a string
stack: {
toString: () => 'stackToString...\u001b[5;7;6mThis is Fine\u001b[27m',
},
},
},
false
)
).toEqual('stackToString...\\u001b[5;7;6mThis is Fine\\u001b[27m');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ export const MessageConversion: Conversion = {
pattern: /%message/g,
convert(record: LogRecord) {
// Error stack is much more useful than just the message.
const str = record.error?.stack || record.message;
let str = record.error?.stack || record.message;
// typings may be wrong, there's scenarios where the message is not a plain string (e.g error stacks from the ES client)
if (typeof str !== 'string') {
str = String(str);
}

return typeof str === 'string' // We need to validate it's a string because, despite types, there are use case where it's not a string :/
? str.replace(
CONTROL_CHAR_REGEXP,
// Escaping control chars via JSON.stringify to maintain consistency with `meta` and the JSON layout.
// This way, post analysis of the logs is easier as we can search the same patterns.
// Our benchmark didn't show a big difference in performance between custom-escaping vs. JSON.stringify one.
// The slice is removing the double-quotes.
(substr) => JSON.stringify(substr).slice(1, -1)
)
: str;
return str.replace(
CONTROL_CHAR_REGEXP,
// Escaping control chars via JSON.stringify to maintain consistency with `meta` and the JSON layout.
// This way, post analysis of the logs is easier as we can search the same patterns.
// Our benchmark didn't show a big difference in performance between custom-escaping vs. JSON.stringify one.
// The slice is removing the double-quotes.
(substr) => JSON.stringify(substr).slice(1, -1)
);
},
};
2 changes: 1 addition & 1 deletion packages/deeplinks/observability/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/deeplinks-observability",
"owner": "@elastic/apm-ui"
"owner": "@elastic/obs-ux-logs-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-apm-synthtrace-client/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"type": "shared-common",
"id": "@kbn/apm-synthtrace-client",
"devOnly": true,
"owner": "@elastic/apm-ui"
"owner": "@elastic/obs-ux-infra_services-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-apm-synthtrace/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"type": "shared-server",
"id": "@kbn/apm-synthtrace",
"devOnly": true,
"owner": "@elastic/apm-ui"
"owner": "@elastic/obs-ux-infra_services-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-apm-utils/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/apm-utils",
"owner": "@elastic/apm-ui"
"owner": "@elastic/obs-ux-infra_services-team"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
EuiDataGridRefProps,
type EuiDataGridColumnCellAction,
} from '@elastic/eui';
import { render, waitFor } from '@testing-library/react';
import { act, renderHook } from '@testing-library/react-hooks';
import { render, waitFor, act } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import { makeAction } from '../mocks/helpers';
import {
useDataGridColumnsCellActions,
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-custom-integrations/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/custom-integrations",
"owner": "@elastic/infra-monitoring-ui"
"owner": "@elastic/obs-ux-logs-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-es-types/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/es-types",
"owner": ["@elastic/kibana-core", "@elastic/apm-ui"]
"owner": ["@elastic/kibana-core", "@elastic/obs-knowledge-team"]
}
2 changes: 1 addition & 1 deletion packages/kbn-eslint-plugin-i18n/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "shared-common",
"id": "@kbn/eslint-plugin-i18n",
"owner": "@elastic/actionable-observability",
"owner": "@elastic/obs-knowledge-team",
"devOnly": true
}
2 changes: 1 addition & 1 deletion packages/kbn-eslint-plugin-telemetry/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "shared-common",
"id": "@kbn/eslint-plugin-telemetry",
"owner": "@elastic/actionable-observability",
"owner": "@elastic/obs-knowledge-team",
"devOnly": true
}
2 changes: 1 addition & 1 deletion packages/kbn-io-ts-utils/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/io-ts-utils",
"owner": "@elastic/apm-ui"
"owner": "@elastic/obs-knowledge-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-lens-embeddable-utils/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-browser",
"id": "@kbn/lens-embeddable-utils",
"owner": "@elastic/infra-monitoring-ui"
"owner": "@elastic/obs-ux-infra_services-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-profiling-utils/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/profiling-utils",
"owner": "@elastic/profiling-ui"
"owner": "@elastic/obs-ux-infra_services-team"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jest.mock('@elastic/eui', () => ({
}));

import * as eui from '@elastic/eui';
import { waitFor } from '@testing-library/dom';
import { waitFor } from '@testing-library/react';
import { ResizableLayoutDirection } from '../types';

describe('Panels resizable', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-rule-data-utils/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "@kbn/rule-data-utils",
"owner": [
"@elastic/security-detections-response",
"@elastic/actionable-observability",
"@elastic/response-ops"
"@elastic/response-ops",
"@elastic/obs-ux-management-team"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { waitFor } from '@testing-library/dom';
import { waitFor } from '@testing-library/react';
import { act, renderHook } from '@testing-library/react-hooks';
import { useExceptionListHeader } from './use_list_header';

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-server-route-repository/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/server-route-repository",
"owner": "@elastic/apm-ui"
"owner": ["@elastic/obs-knowledge-team", "@elastic/obs-ux-management-team"]
}
2 changes: 1 addition & 1 deletion packages/kbn-shared-svg/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/shared-svg",
"owner": "@elastic/apm-ui"
"owner": "@elastic/obs-ux-infra_services-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-typed-react-router-config/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/typed-react-router-config",
"owner": "@elastic/apm-ui"
"owner": ["@elastic/obs-knowledge-team", "@elastic/obs-ux-management-team"]
}
2 changes: 1 addition & 1 deletion packages/kbn-use-tracked-promise/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/use-tracked-promise",
"owner": "@elastic/infra-monitoring-ui"
"owner": "@elastic/obs-ux-logs-team"
}
2 changes: 1 addition & 1 deletion packages/kbn-xstate-utils/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/xstate-utils",
"owner": "@elastic/infra-monitoring-ui"
"owner": "@elastic/obs-ux-logs-team"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/serverless-observability-settings",
"owner": "@elastic/appex-sharedux @elastic/apm-ui @elastic/platform-deployment-management"
"owner": "@elastic/appex-sharedux @elastic/platform-deployment-management @elastic/obs-ux-management-team"
}
1 change: 1 addition & 0 deletions src/cli/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
require('../setup_node_env/dist');
require('./apm')();
require('../setup_node_env/root');
require('../setup_node_env/mute_libraries');
require('./cli');
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ COPY --chown=1000:0 config/serverless.oblt.yml /usr/share/kibana/config/serverle
COPY --chown=1000:0 config/serverless.security.yml /usr/share/kibana/config/serverless.security.yml
# Supportability enhancement: enable capturing heap snapshots. See https://nodejs.org/api/cli.html#--heapsnapshot-signalsignal
RUN echo '\n--heapsnapshot-signal=SIGUSR2' >> config/node.options
RUN echo '--diagnostic-dir=./data' >> config/node.options
{{/serverless}}
{{^opensslLegacyProvider}}
RUN sed 's/\(--openssl-legacy-provider\)/#\1/' -i config/node.options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React from 'react';
import { waitFor } from '@testing-library/dom';
import { waitFor } from '@testing-library/react';
import { render } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { createInteractionPositionTracker } from './open_context_menu';
import { fireEvent } from '@testing-library/dom';
import { fireEvent } from '@testing-library/react';

let targetEl: Element;
const top = 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ActionDefinition } from '../actions';
import { openContextMenu } from '../context_menu';
import { uiActionsPluginMock } from '../mocks';
import type { Trigger } from '@kbn/ui-actions-browser';
import { waitFor } from '@testing-library/dom';
import { waitFor } from '@testing-library/react';

jest.mock('../context_menu');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { renderHook } from '@testing-library/react-hooks';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks';
import { of, Subject, throwError } from 'rxjs';
import { waitFor } from '@testing-library/dom';
import { waitFor } from '@testing-library/react';
import { RequestAdapter } from '@kbn/inspector-plugin/common';
import { DataViewType, SearchSourceSearchOptions } from '@kbn/data-plugin/common';
import { expressionsPluginMock } from '@kbn/expressions-plugin/public/mocks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import {
import React from 'react';
import { I18nProvider } from '@kbn/i18n-react';
import { mount } from 'enzyme';
import { waitFor } from '@testing-library/dom';
import { render } from '@testing-library/react';
import { waitFor, render } from '@testing-library/react';

import { EuiTextArea, EuiIcon } from '@elastic/eui';

Expand Down
Loading

0 comments on commit 241c40f

Please sign in to comment.