diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1ee8936a725c0..8209f032ca848 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -862,6 +862,7 @@ packages/kbn-stdio-dev-helpers @elastic/kibana-operations packages/kbn-storybook @elastic/kibana-operations x-pack/plugins/observability_solution/synthetics/e2e @elastic/obs-ux-management-team x-pack/plugins/observability_solution/synthetics @elastic/obs-ux-management-team +x-pack/packages/kbn-synthetics-private-location @elastic/obs-ux-management-team x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture @elastic/response-ops x-pack/test/plugin_api_perf/plugins/task_manager_performance @elastic/response-ops x-pack/plugins/task_manager @elastic/response-ops diff --git a/package.json b/package.json index c287872dd5788..3797434824a6a 100644 --- a/package.json +++ b/package.json @@ -870,6 +870,7 @@ "@kbn/status-plugin-b-plugin": "link:test/server_integration/plugins/status_plugin_b", "@kbn/std": "link:packages/kbn-std", "@kbn/synthetics-plugin": "link:x-pack/plugins/observability_solution/synthetics", + "@kbn/synthetics-private-location": "link:x-pack/packages/kbn-synthetics-private-location", "@kbn/task-manager-fixture-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture", "@kbn/task-manager-performance-plugin": "link:x-pack/test/plugin_api_perf/plugins/task_manager_performance", "@kbn/task-manager-plugin": "link:x-pack/plugins/task_manager", diff --git a/tsconfig.base.json b/tsconfig.base.json index d4b0d76a56413..a88413e811ebd 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1718,6 +1718,8 @@ "@kbn/synthetics-e2e/*": ["x-pack/plugins/observability_solution/synthetics/e2e/*"], "@kbn/synthetics-plugin": ["x-pack/plugins/observability_solution/synthetics"], "@kbn/synthetics-plugin/*": ["x-pack/plugins/observability_solution/synthetics/*"], + "@kbn/synthetics-private-location": ["x-pack/packages/kbn-synthetics-private-location"], + "@kbn/synthetics-private-location/*": ["x-pack/packages/kbn-synthetics-private-location/*"], "@kbn/task-manager-fixture-plugin": ["x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture"], "@kbn/task-manager-fixture-plugin/*": ["x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture/*"], "@kbn/task-manager-performance-plugin": ["x-pack/test/plugin_api_perf/plugins/task_manager_performance"], diff --git a/x-pack/packages/kbn-synthetics-private-location/README.md b/x-pack/packages/kbn-synthetics-private-location/README.md new file mode 100644 index 0000000000000..57fea6207dd10 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/README.md @@ -0,0 +1,56 @@ +# @kbn/synthetics-private-location + +Quickily start Fleet, enroll Elastic Agent, and create a private location. + +## Usage + +``` +node x-pack/scripts/synthetics_private_location.js +``` + +For available options, run `--help`. + +## Prerequistes + +This script requires `docker` and the following `kibama.yml` configuration. + +``` +# Create an agent policy for Fleet Server. +xpack.fleet.agentPolicies: + - name: Fleet Server policy + id: fleet-server-policy + is_default_fleet_server: true + # is_managed: true # Useful to mimic cloud environment + description: Fleet server policy + namespace: default + package_policies: + - name: Fleet Server + package: + name: fleet_server + inputs: + - type: fleet-server + keep_enabled: true + vars: + - name: host + value: 0.0.0.0 + frozen: true + - name: port + value: 8220 + frozen: true + +# Set a default Fleet Server host. +xpack.fleet.fleetServerHosts: + - id: default-fleet-server + name: Default Fleet server + is_default: true + host_urls: ['https://host.docker.internal:8220'] # For running a Fleet Server Docker container + +# Set a default Elasticsearch output. +xpack.fleet.outputs: + - id: es-default-output + name: Default output + type: elasticsearch + is_default: true + is_default_monitoring: true + hosts: ['http://host.docker.internal:9200'] # For enrolling dockerized agents +``` diff --git a/x-pack/packages/kbn-synthetics-private-location/index.ts b/x-pack/packages/kbn-synthetics-private-location/index.ts new file mode 100644 index 0000000000000..9411c1c3b0eea --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export type { CliOptions } from './src/types'; +export { run } from './src/run'; +export { cli } from './src/cli'; +// export { cleanup } from './src/cleanup'; +export { DEFAULTS } from './src/constants'; diff --git a/x-pack/packages/kbn-synthetics-private-location/jest.config.js b/x-pack/packages/kbn-synthetics-private-location/jest.config.js new file mode 100644 index 0000000000000..658017a2f17c9 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/x-pack/packages/kbn-synthetics-private-location'], +}; diff --git a/x-pack/packages/kbn-synthetics-private-location/kibana.jsonc b/x-pack/packages/kbn-synthetics-private-location/kibana.jsonc new file mode 100644 index 0000000000000..6ff6d3f1645c2 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/synthetics-private-location", + "owner": "@elastic/obs-ux-management-team" +} diff --git a/x-pack/packages/kbn-synthetics-private-location/package.json b/x-pack/packages/kbn-synthetics-private-location/package.json new file mode 100644 index 0000000000000..3b3e435e6feb3 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/synthetics-private-location", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/packages/kbn-synthetics-private-location/src/cli.ts b/x-pack/packages/kbn-synthetics-private-location/src/cli.ts new file mode 100644 index 0000000000000..4a25b5323b7ab --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/cli.ts @@ -0,0 +1,17 @@ +/* + * 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 { ToolingLog } from '@kbn/tooling-log'; +import { parseCliOptions } from './lib/parse_cli_options'; +import { CliOptions } from './types'; +import { run } from './run'; + +export async function cli(cliOptions?: CliOptions) { + const options = cliOptions ?? parseCliOptions(); + const logger = new ToolingLog({ level: 'info', writeTo: process.stdout }); + return run(options, logger); +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/constants.ts b/x-pack/packages/kbn-synthetics-private-location/src/constants.ts new file mode 100644 index 0000000000000..41fcfcb112c6b --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/constants.ts @@ -0,0 +1,17 @@ +/* + * 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 { v4 as uuidv4 } from 'uuid'; + +export const DEFAULTS = { + LOCATION_NAME: `Default location ${uuidv4()}`, + AGENT_POLICY_NAME: `Synthetics agent policy ${uuidv4()}`, + ELASTICSEARCH_HOST: 'http://localhost:9200', + KIBANA_URL: 'http://localhost:5601', + KIBANA_USERNAME: 'elastic', + KIBANA_PASSWORD: 'changeme', +}; diff --git a/x-pack/packages/kbn-synthetics-private-location/src/lib/create_agent_policy.ts b/x-pack/packages/kbn-synthetics-private-location/src/lib/create_agent_policy.ts new file mode 100644 index 0000000000000..5171abcca6906 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/lib/create_agent_policy.ts @@ -0,0 +1,40 @@ +/* + * 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 { isError } from 'lodash'; +import { ToolingLog } from '@kbn/tooling-log'; +import { CliOptions } from '../types'; +import type { KibanaAPIClient } from './kibana_api_client'; + +export async function createElasticAgentPolicy( + { agentPolicyName }: CliOptions, + logger: ToolingLog, + kibanaApiClient: KibanaAPIClient +) { + try { + const response = await kibanaApiClient.sendRequest({ + method: 'post', + url: 'api/fleet/agent_policies', + data: { + name: agentPolicyName, + description: '', + namespace: 'default', + monitoring_enabled: ['logs', 'metrics'], + inactivity_timeout: 1209600, + is_protected: false, + }, + }); + + logger.info(`Generated elastic agent policy`); + return response.data; + } catch (error) { + if (isError(error)) { + logger.error(`Error generating elastic agent policy: ${error.message} ${error.stack}`); + } + throw error; + } +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/lib/create_private_location.ts b/x-pack/packages/kbn-synthetics-private-location/src/lib/create_private_location.ts new file mode 100644 index 0000000000000..a0d389eafa4a5 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/lib/create_private_location.ts @@ -0,0 +1,37 @@ +/* + * 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 { isError } from 'lodash'; +import { ToolingLog } from '@kbn/tooling-log'; +import { CliOptions } from '../types'; +import { KibanaAPIClient } from './kibana_api_client'; + +export async function createPrivateLocation( + { kibanaUrl, kibanaPassword, kibanaUsername, locationName }: CliOptions, + logger: ToolingLog, + kibanaApiClient: KibanaAPIClient, + agentPolicyId: string +) { + try { + const response = await kibanaApiClient.sendRequest({ + method: 'post', + url: 'api/synthetics/private_locations', + data: { + label: locationName, + agentPolicyId, + }, + }); + + logger.info(`Synthetics private location created successfully`); + return response.data; + } catch (error) { + if (isError(error)) { + logger.error(`Error creating synthetics private location: ${error.message} ${error.stack}`); + } + throw error; + } +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/lib/enroll_agent.ts b/x-pack/packages/kbn-synthetics-private-location/src/lib/enroll_agent.ts new file mode 100644 index 0000000000000..143ff08642fff --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/lib/enroll_agent.ts @@ -0,0 +1,86 @@ +/* + * 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 { spawn, spawnSync } from 'child_process'; +import * as path from 'path'; +import { CliOptions } from '../types'; +import { KibanaAPIClient } from './kibana_api_client'; + +export async function enrollAgent( + { kibanaUrl, elasticsearchHost }: CliOptions, + enrollmentToken: string, + kibanaApiClient: KibanaAPIClient +) { + const formattedKibanaURL = new URL(kibanaUrl); + const formattedElasticsearchHost = new URL(elasticsearchHost); + if (formattedKibanaURL.hostname === 'localhost') { + formattedKibanaURL.hostname = 'host.docker.internal'; + } + if (formattedElasticsearchHost.hostname === 'localhost') { + formattedElasticsearchHost.hostname = 'host.docker.internal'; + } + const version = `${await kibanaApiClient.getKibanaVersion()}-SNAPSHOT`; + await new Promise((res, rej) => { + try { + const fleetProcess = spawn( + 'docker', + [ + 'run', + '-e', + 'FLEET_SERVER_ENABLE=1', + '-e', + `FLEET_SERVER_ELASTICSEARCH_HOST=${formattedElasticsearchHost.origin}`, + '-e', + 'FLEET_SERVER_POLICY_ID=fleet-server-policy', + '-e', + 'FLEET_INSECURE=1', + '-e', + `KIBANA_HOST=${formattedKibanaURL.origin}`, + '-e', + 'KIBANA_USERNAME=elastic', + '-e', + 'KIBANA_PASSWORD=changeme', + '-e', + 'KIBANA_FLEET_SETUP=1', + '-p', + '8220:8220', + '--rm', + `docker.elastic.co/beats/elastic-agent:${version}`, + ], + { + shell: true, + cwd: path.join(__dirname, '../'), + timeout: 120000, + } + ); + setTimeout(res, 10_000); + fleetProcess.on('error', rej); + } catch (error) { + rej(error); + } + }); + + spawnSync( + 'docker', + [ + 'run', + '-e', + 'FLEET_URL=https://host.docker.internal:8220', + '-e', + 'FLEET_ENROLL=1', + '-e', + `FLEET_ENROLLMENT_TOKEN=${enrollmentToken}`, + '-e', + 'FLEET_INSECURE=1', + '--rm', + `docker.elastic.co/beats/elastic-agent-complete:${version}`, + ], + { + stdio: 'inherit', + } + ); +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/lib/fetch_agent_policy_enrollment_token.ts b/x-pack/packages/kbn-synthetics-private-location/src/lib/fetch_agent_policy_enrollment_token.ts new file mode 100644 index 0000000000000..0eeecc2529289 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/lib/fetch_agent_policy_enrollment_token.ts @@ -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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isError } from 'lodash'; +import { ToolingLog } from '@kbn/tooling-log'; +import { KibanaAPIClient } from './kibana_api_client'; +import { CliOptions } from '../types'; + +export async function fetchAgentPolicyEnrollmentToken( + { kibanaUrl, kibanaPassword, kibanaUsername }: CliOptions, + logger: ToolingLog, + kibanaApiClient: KibanaAPIClient, + agentPolicyId: string +) { + try { + const response = await kibanaApiClient.sendRequest({ + method: 'get', + url: `api/fleet/enrollment_api_keys?kuery=policy_id:${agentPolicyId}`, + }); + + logger.info(`Fetching agent policy enrollment token`); + return response.data; + } catch (error) { + if (isError(error)) { + logger.error(`Error fetching agent enrollment token: ${error.message} ${error.stack}`); + } + throw error; + } +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/lib/generate_fleet_service_token.ts b/x-pack/packages/kbn-synthetics-private-location/src/lib/generate_fleet_service_token.ts new file mode 100644 index 0000000000000..c754840ed8a11 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/lib/generate_fleet_service_token.ts @@ -0,0 +1,32 @@ +/* + * 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 { isError } from 'lodash'; +import { ToolingLog } from '@kbn/tooling-log'; +import { CliOptions } from '../types'; +import { KibanaAPIClient } from './kibana_api_client'; + +export async function generateFleetServiceToken( + { kibanaUrl, kibanaPassword, kibanaUsername }: CliOptions, + logger: ToolingLog, + kibanaApiClient: KibanaAPIClient +) { + try { + const response = await kibanaApiClient.sendRequest({ + method: 'post', + url: 'api/fleet/service_tokens', + }); + + logger.info(`Generated fleet server service token saved`); + return response.data; + } catch (error) { + if (isError(error)) { + logger.error(`Error generating fleet server service token: ${error.message} ${error.stack}`); + } + throw error; + } +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/lib/kibana_api_client.ts b/x-pack/packages/kbn-synthetics-private-location/src/lib/kibana_api_client.ts new file mode 100644 index 0000000000000..f6f0709218499 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/lib/kibana_api_client.ts @@ -0,0 +1,76 @@ +/* + * 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 { isError } from 'lodash'; +import { ToolingLog } from '@kbn/tooling-log'; +import { KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils'; +import fs from 'fs'; +import https, { Agent } from 'https'; +import axios from 'axios'; + +export class KibanaAPIClient { + private isHTTPS: boolean; + private httpsAgent: Agent | undefined; + + constructor( + private kibanaUrl: string, + private kibanaUsername: string, + private kibanaPassword: string, + private logger: ToolingLog + ) { + this.isHTTPS = new URL(kibanaUrl).protocol === 'https:'; + this.httpsAgent = this.isHTTPS + ? new https.Agent({ + ca: fs.readFileSync(KBN_CERT_PATH), + key: fs.readFileSync(KBN_KEY_PATH), + // hard-coded set to false like in packages/kbn-cli-dev-mode/src/base_path_proxy_server.ts + rejectUnauthorized: false, + }) + : undefined; + } + + public async sendRequest({ + method, + url, + data, + headers, + }: { + method: string; + url: string; + data?: Record; + headers?: Record; + }) { + try { + const response = await axios({ + method, + url: `${this.kibanaUrl}/${url}`, + data, + headers: { + 'kbn-xsrf': 'true', + 'elastic-api-version': '2023-10-31', + ...headers, + }, + auth: { + username: this.kibanaUsername, + password: this.kibanaPassword, + }, + httpsAgent: this.httpsAgent, + }); + return response; + } catch (e) { + if (isError(e)) { + this.logger.error(`Error sending request to Kibana: ${e.message} ${e.stack}`); + } + throw e; + } + } + + public async getKibanaVersion() { + const res = await this.sendRequest({ method: 'GET', url: 'api/status' }); + return res.data.version.number; + } +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/lib/parse_cli_options.ts b/x-pack/packages/kbn-synthetics-private-location/src/lib/parse_cli_options.ts new file mode 100644 index 0000000000000..f4fc29411db1d --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/lib/parse_cli_options.ts @@ -0,0 +1,48 @@ +/* + * 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 { Command } from 'commander'; +import { CliOptions } from '../types'; +import { DEFAULTS } from '../constants'; + +export function parseCliOptions(): CliOptions { + const program = new Command(); + program + .name('synthetics_private_location.js') + .description( + 'A script to start Fleet Server, enroll Elastic Agent, and create a Synthetics private location' + ) + .option( + '--elasticsearch-host
', + 'The address to the Elasticsearch cluster', + DEFAULTS.ELASTICSEARCH_HOST + ) + .option('--kibana-url
', 'The address to the Kibana server', DEFAULTS.KIBANA_URL) + .option( + '--kibana-username ', + 'The username for the Kibana server', + DEFAULTS.KIBANA_USERNAME + ) + .option( + '--kibana-password ', + 'The password for the Kibana server', + DEFAULTS.KIBANA_PASSWORD + ) + .option( + '--location-name ', + 'The name of the Synthetics private location', + DEFAULTS.LOCATION_NAME + ) + .option( + '--agent-policy-name ', + 'The name of the agent policy', + DEFAULTS.AGENT_POLICY_NAME + ); + + program.parse(process.argv); + return program.opts() as CliOptions; +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/run.ts b/x-pack/packages/kbn-synthetics-private-location/src/run.ts new file mode 100644 index 0000000000000..c9a0931b3733d --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/run.ts @@ -0,0 +1,36 @@ +/* + * 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 { ToolingLog } from '@kbn/tooling-log'; +import type { CliOptions } from './types'; +import { createElasticAgentPolicy } from './lib/create_agent_policy'; +import { fetchAgentPolicyEnrollmentToken } from './lib/fetch_agent_policy_enrollment_token'; +import { enrollAgent } from './lib/enroll_agent'; +import { createPrivateLocation } from './lib/create_private_location'; +import { KibanaAPIClient } from './lib/kibana_api_client'; + +export async function run(options: CliOptions, logger: ToolingLog) { + const kibanaClient = new KibanaAPIClient( + options.kibanaUrl, + options.kibanaUsername, + options.kibanaPassword, + logger + ); + const { + item: { id: agentPolicyId }, + } = await createElasticAgentPolicy(options, logger, kibanaClient); + await createPrivateLocation(options, logger, kibanaClient, agentPolicyId); + const { list } = await fetchAgentPolicyEnrollmentToken( + options, + logger, + kibanaClient, + agentPolicyId + ); + const [enrollmentTokenConfig] = list; + const { api_key: enrollmentToken } = enrollmentTokenConfig; + enrollAgent(options, enrollmentToken, kibanaClient); +} diff --git a/x-pack/packages/kbn-synthetics-private-location/src/types.ts b/x-pack/packages/kbn-synthetics-private-location/src/types.ts new file mode 100644 index 0000000000000..1ec7f6ad9d595 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/src/types.ts @@ -0,0 +1,15 @@ +/* + * 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. + */ + +export interface CliOptions { + locationName: string; + agentPolicyName: string; + kibanaUrl: string; + kibanaUsername: string; + kibanaPassword: string; + elasticsearchHost: string; +} diff --git a/x-pack/packages/kbn-synthetics-private-location/tsconfig.json b/x-pack/packages/kbn-synthetics-private-location/tsconfig.json new file mode 100644 index 0000000000000..c6a5932133cb3 --- /dev/null +++ b/x-pack/packages/kbn-synthetics-private-location/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/dev-utils", + ] +} diff --git a/x-pack/scripts/synthetics_private_location.js b/x-pack/scripts/synthetics_private_location.js new file mode 100644 index 0000000000000..2352c8238cc40 --- /dev/null +++ b/x-pack/scripts/synthetics_private_location.js @@ -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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +require('../../src/setup_node_env'); +require('@kbn/synthetics-private-location').cli(); diff --git a/yarn.lock b/yarn.lock index 959a7b4ad5db2..88e404ef09a39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6716,6 +6716,10 @@ version "0.0.0" uid "" +"@kbn/synthetics-private-location@link:x-pack/packages/kbn-synthetics-private-location": + version "0.0.0" + uid "" + "@kbn/task-manager-fixture-plugin@link:x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture": version "0.0.0" uid ""