Skip to content

Commit

Permalink
Merge branch 'main' into kql-named-arg
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Dec 7, 2021
2 parents 8229c21 + d0f7d7c commit ecc31cf
Show file tree
Hide file tree
Showing 786 changed files with 55,670 additions and 6,714 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
/x-pack/test/functional/services/ml/ @elastic/ml-ui
/x-pack/test/functional_basic/apps/ml/ @elastic/ml-ui
/x-pack/test/functional_with_es_ssl/apps/ml/ @elastic/ml-ui
/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ml_rule_types/ @elastic/ml-ui
/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/ @elastic/ml-ui

# ML team owns and maintains the transform plugin despite it living in the Data management section.
/x-pack/plugins/transform/ @elastic/ml-ui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ readonly links: {
readonly usersAccess: string;
};
readonly workplaceSearch: {
readonly apiKeys: string;
readonly box: string;
readonly confluenceCloud: string;
readonly confluenceServer: string;
Expand Down Expand Up @@ -289,7 +290,14 @@ readonly links: {
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly plugins: {
azureRepo: string;
gcsRepo: string;
hdfsRepo: string;
s3Repo: string;
snapshotRestoreRepos: string;
mapperSize: string;
};
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
Expand Down

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions docs/osquery/osquery.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,21 @@ This is useful for teams who need in-depth and detailed control.

[float]
=== Customize Osquery configuration
By default, all Osquery Manager integrations share the same osquery configuration. However, you can customize how Osquery is configured by editing the Osquery Manager integration for each agent policy
experimental[] By default, all Osquery Manager integrations share the same osquery configuration. However, you can customize how Osquery is configured by editing the Osquery Manager integration for each agent policy
you want to adjust. The custom configuration is then applied to all agents in the policy.
This powerful feature allows you to configure
https://osquery.readthedocs.io/en/stable/deployment/file-integrity-monitoring[File Integrity Monitoring], https://osquery.readthedocs.io/en/stable/deployment/process-auditing[Process auditing],
and https://osquery.readthedocs.io/en/stable/deployment/configuration/#configuration-specification[others].

IMPORTANT: Take caution when editing this configuration. The changes you make are distributed to all agents in the policy.
[IMPORTANT]
=========================
* Take caution when editing this configuration. The changes you make are distributed to all agents in the policy.
* Take caution when editing `packs` using the Advanced *Osquery config* field.
Any changes you make to `packs` from this field are not reflected in the UI on the Osquery *Packs* page in {kib}, however, these changes are deployed to agents in the policy.
While this allows you to use advanced Osquery functionality like pack discovery queries, you do lose the ability to manage packs defined this way from the Osquery *Packs* page.
=========================

. From the {kib} main menu, click *Fleet*, then the *Agent policies* tab.

Expand All @@ -315,6 +323,16 @@ IMPORTANT: Take caution when editing this configuration. The changes you make ar
* (Optional) To load a full configuration file, drag and drop an Osquery `.conf` file into the area at the bottom of the page.

. Click *Save integration* to apply the custom configuration to all agents in the policy.
+
As an example, the following configuration disables two tables.
+
```ts
{
"options":{
"disable_tables":"curl,process_envs"
}
}
```

[float]
=== Upgrade Osquery versions
Expand Down
3 changes: 3 additions & 0 deletions docs/settings/monitoring-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ For more information, see
| `monitoring.ui.elasticsearch.ssl`
| Shares the same configuration as <<elasticsearch-ssl-cert-key, `elasticsearch.ssl`>>. These settings configure encrypted communication between {kib} and the monitoring cluster.

| `monitoring.cluster_alerts.allowedSpaces` {ess-icon}
| Specifies the spaces where cluster Stack Monitoring alerts can be created. You must specify all spaces where you want to generate alerts, including the default space. Defaults to `[ "default" ]`.

|===

[float]
Expand Down
8 changes: 0 additions & 8 deletions docs/settings/spaces-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,3 @@ The maximum number of spaces that you can use with the {kib} instance. Some {kib
return all spaces using a single `_search` from {es}, so you must
configure this setting lower than the `index.max_result_window` in {es}.
The default is `1000`.

`monitoring.cluster_alerts.allowedSpaces` {ess-icon}::
Specifies the spaces where cluster alerts are automatically generated.
You must specify all spaces where you want to generate alerts, including the default space.
When the default space is unspecified, {kib} is unable to generate an alert for the default space.
{es} clusters that run on {es} services are all containers. To send monitoring data
from your self-managed {es} installation to {es} services, set to `false`.
The default is `true`.
2 changes: 1 addition & 1 deletion docs/setup/docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ services:

==== Persist the {kib} keystore

By default, {kib] auto-generates a keystore file for secure settings at startup. To persist your {kibana-ref}/secure-settings.html[secure settings], use the `kibana-keystore` utility to bind-mount the parent directory of the keystore to the container. For example:
By default, {kib} auto-generates a keystore file for secure settings at startup. To persist your {kibana-ref}/secure-settings.html[secure settings], use the `kibana-keystore` utility to bind-mount the parent directory of the keystore to the container. For example:

["source","sh",subs="attributes"]
----
Expand Down
6 changes: 3 additions & 3 deletions docs/setup/install/deb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ locations for a Debian-based system:
| path.data

| logs
| Logs files location
| /var/log/kibana
| path.logs
| Logs files location
| /var/log/kibana
| path.logs

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
Expand Down
7 changes: 3 additions & 4 deletions docs/setup/install/rpm.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,16 @@ locations for an RPM-based system:
| Configuration files including `kibana.yml`
| /etc/kibana
| <<settings,KBN_PATH_CONF>>
d|

| data
| The location of the data files written to disk by Kibana and its plugins
| /var/lib/kibana
| path.data

| logs
| Logs files location
| /var/log/kibana
| path.logs
| Logs files location
| /var/log/kibana
| path.logs

| plugins
| Plugin files location. Each plugin will be contained in a subdirectory.
Expand Down
3 changes: 1 addition & 2 deletions docs/setup/install/targz.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ important data later on.
| home
| Kibana home directory or `$KIBANA_HOME`
d| Directory created by unpacking the archive
d|
|

| bin
| Binary scripts including `kibana` to start the Kibana server
Expand All @@ -137,7 +137,6 @@ important data later on.
| Configuration files including `kibana.yml`
| $KIBANA_HOME\config
| <<settings,KBN_PATH_CONF>>
d|

| data
| The location of the data files written to disk by Kibana and its plugins
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
"@types/file-saver": "^2.0.0",
"@types/flot": "^0.0.31",
"@types/geojson": "7946.0.7",
"@types/getopts": "^2.0.1",
"@types/getos": "^3.0.0",
"@types/glob": "^7.1.2",
"@types/gulp": "^4.0.6",
Expand Down Expand Up @@ -568,6 +567,7 @@
"@types/kbn__config": "link:bazel-bin/packages/kbn-config/npm_module_types",
"@types/kbn__config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module_types",
"@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types",
"@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types",
"@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types",
"@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types",
"@types/license-checker": "15.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ filegroup(
"//packages/kbn-config:build_types",
"//packages/kbn-config-schema:build_types",
"//packages/kbn-crypto:build_types",
"//packages/kbn-docs-utils:build_types",
"//packages/kbn-i18n:build_types",
"//packages/kbn-i18n-react:build_types",
],
Expand Down
19 changes: 10 additions & 9 deletions packages/kbn-apm-config-loader/src/init_apm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { initApm } from './init_apm';
import apm from 'elastic-apm-node';

describe('initApm', () => {
let apmAddFilterSpy: jest.SpyInstance;
let apmStartSpy: jest.SpyInstance;
let apmAddFilterMock: jest.Mock;
let apmStartMock: jest.Mock;
let getConfig: jest.Mock;

beforeEach(() => {
apmAddFilterSpy = jest.spyOn(apm, 'addFilter').mockImplementation(() => undefined);
apmStartSpy = jest.spyOn(apm, 'start').mockImplementation(() => undefined as any);
apmAddFilterMock = apm.addFilter as jest.Mock;
apmStartMock = apm.start as jest.Mock;
getConfig = jest.fn();

mockLoadConfiguration.mockImplementation(() => ({
Expand All @@ -27,7 +27,8 @@ describe('initApm', () => {
});

afterEach(() => {
jest.restoreAllMocks();
apmAddFilterMock.mockReset();
apmStartMock.mockReset();
mockLoadConfiguration.mockReset();
});

Expand All @@ -48,8 +49,8 @@ describe('initApm', () => {
it('registers a filter using `addFilter`', () => {
initApm(['foo', 'bar'], 'rootDir', true, 'service-name');

expect(apmAddFilterSpy).toHaveBeenCalledTimes(1);
expect(apmAddFilterSpy).toHaveBeenCalledWith(expect.any(Function));
expect(apmAddFilterMock).toHaveBeenCalledTimes(1);
expect(apmAddFilterMock).toHaveBeenCalledWith(expect.any(Function));
});

it('starts apm with the config returned from `getConfig`', () => {
Expand All @@ -60,7 +61,7 @@ describe('initApm', () => {

initApm(['foo', 'bar'], 'rootDir', true, 'service-name');

expect(apmStartSpy).toHaveBeenCalledTimes(1);
expect(apmStartSpy).toHaveBeenCalledWith(config);
expect(apmStartMock).toHaveBeenCalledTimes(1);
expect(apmStartMock).toHaveBeenCalledWith(config);
});
});
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ TYPES_DEPS = [
"@npm//chokidar",
"@npm//elastic-apm-node",
"@npm//execa",
"@npm//getopts",
"@npm//moment",
"@npm//rxjs",
"@npm//supertest",
"@npm//@types/hapi__h2o2",
"@npm//@types/hapi__hapi",
"@npm//@types/getopts",
"@npm//@types/jest",
"@npm//@types/lodash",
"@npm//@types/node",
Expand Down
26 changes: 22 additions & 4 deletions packages/kbn-docs-utils/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_BASE_NAME = "kbn-docs-utils"
PKG_REQUIRE_NAME = "@kbn/docs-utils"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__docs-utils"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -77,7 +78,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand All @@ -96,3 +97,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)
1 change: 0 additions & 1 deletion packages/kbn-docs-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": "true",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"kibana": {
"devOnly": true
}
Expand Down
12 changes: 6 additions & 6 deletions packages/kbn-es/src/artifact.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ const artifactTest = (requestedLicense, expectedLicense, fetchTimesCalled = 1) =
`${PERMANENT_SNAPSHOT_BASE_URL}/${MOCK_VERSION}/manifest.json`
);
}
expect(artifact.getUrl()).toEqual(MOCK_URL + `/${expectedLicense}`);
expect(artifact.getChecksumUrl()).toEqual(MOCK_URL + `/${expectedLicense}.sha512`);
expect(artifact.getChecksumType()).toEqual('sha512');
expect(artifact.getFilename()).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.${expectedLicense}`);
expect(artifact.spec.url).toEqual(MOCK_URL + `/${expectedLicense}`);
expect(artifact.spec.checksumUrl).toEqual(MOCK_URL + `/${expectedLicense}.sha512`);
expect(artifact.spec.checksumType).toEqual('sha512');
expect(artifact.spec.filename).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.${expectedLicense}`);
};
};

Expand Down Expand Up @@ -158,7 +158,7 @@ describe('Artifact', () => {

it('should return artifact metadata for the correct architecture', async () => {
const artifact = await Artifact.getSnapshot('oss', MOCK_VERSION, log);
expect(artifact.getFilename()).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.oss`);
expect(artifact.spec.filename).toEqual(MOCK_FILENAME + `-${ARCHITECTURE}.oss`);
});
});

Expand All @@ -182,7 +182,7 @@ describe('Artifact', () => {

describe('with latest unverified snapshot', () => {
beforeEach(() => {
process.env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = 1;
process.env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = '1';
mockFetch(MOCKS.valid);
});

Expand Down
Loading

0 comments on commit ecc31cf

Please sign in to comment.