-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into test-ironbank-context
- Loading branch information
Showing
327 changed files
with
5,571 additions
and
3,265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
steps: | ||
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh cypress:run:qa:serverless | ||
label: 'Serverless MKI QA Security Cypress Tests' | ||
agents: | ||
queue: n2-4-spot | ||
# TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate. | ||
timeout_in_minutes: 300 | ||
parallelism: 6 | ||
retry: | ||
automatic: | ||
- exit_status: '*' | ||
limit: 1 | ||
|
||
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh cypress:run:qa:serverless:explore | ||
label: 'Serverless MKI QA Explore - Security Solution Cypress Tests' | ||
agents: | ||
queue: n2-4-spot | ||
# TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate. | ||
timeout_in_minutes: 300 | ||
parallelism: 4 | ||
retry: | ||
automatic: | ||
- exit_status: '*' | ||
limit: 1 | ||
|
||
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh cypress:run:qa:serverless:investigations | ||
label: 'Serverless MKI QA Investigations - Security Solution Cypress Tests' | ||
agents: | ||
queue: n2-4-spot | ||
# TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate. | ||
timeout_in_minutes: 300 | ||
parallelism: 8 | ||
retry: | ||
automatic: | ||
- exit_status: '*' | ||
limit: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.buildkite/scripts/pipelines/security_solution_quality_gate/mki_security_solution_cypress.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "No target script from the package.json file, is supplied" | ||
exit 1 | ||
fi | ||
|
||
source .buildkite/scripts/common/util.sh | ||
source .buildkite/scripts/steps/functional/common_cypress.sh | ||
.buildkite/scripts/bootstrap.sh | ||
|
||
export JOB=kibana-security-solution-chrome | ||
|
||
buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true" | ||
|
||
cd x-pack/test/security_solution_cypress | ||
set +e | ||
|
||
QA_API_KEY=$(retry 5 5 vault read -field=qa_api_key secret/kibana-issues/dev/security-solution-qg-enc-key) | ||
|
||
CLOUD_QA_API_KEY=$QA_API_KEY yarn $1; status=$?; yarn junit:merge || :; exit $status |
18 changes: 2 additions & 16 deletions
18
.buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
source .buildkite/scripts/common/util.sh | ||
source .buildkite/scripts/steps/functional/common_cypress.sh | ||
.buildkite/scripts/bootstrap.sh | ||
|
||
export JOB=kibana-security-solution-chrome | ||
|
||
buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true" | ||
|
||
echo "--- Serverless Security Second Quality Gate" | ||
cd x-pack/test/security_solution_cypress | ||
set +e | ||
|
||
VAULT_DEC_KEY=$(vault read -field=key secret/kibana-issues/dev/security-solution-qg-enc-key) | ||
ENV_PWD=$(echo $TEST_ENV_PWD | openssl aes-256-cbc -d -a -pass pass:$VAULT_DEC_KEY) | ||
set -euo pipefail | ||
|
||
CYPRESS_ELASTICSEARCH_URL=$TEST_ENV_ES_URL CYPRESS_BASE_URL=$TEST_ENV_KB_URL CYPRESS_ELASTICSEARCH_USERNAME=$TEST_ENV_USERNAME CYPRESS_ELASTICSEARCH_PASSWORD=$ENV_PWD CYPRESS_KIBANA_URL=$CYPRESS_BASE_URL yarn cypress:run:qa:serverless; status=$?; yarn junit:merge || :; exit $status | ||
ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.ts |
38 changes: 38 additions & 0 deletions
38
.buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { execSync } from 'child_process'; | ||
import fs from 'fs'; | ||
|
||
const getPipeline = (filename: string, removeSteps = true) => { | ||
const str = fs.readFileSync(filename).toString(); | ||
return removeSteps ? str.replace(/^steps:/, '') : str; | ||
}; | ||
|
||
const uploadPipeline = (pipelineContent: string | object) => { | ||
const str = | ||
typeof pipelineContent === 'string' ? pipelineContent : JSON.stringify(pipelineContent); | ||
|
||
execSync('buildkite-agent pipeline upload', { | ||
input: str, | ||
stdio: ['pipe', 'inherit', 'inherit'], | ||
}); | ||
}; | ||
|
||
(async () => { | ||
try { | ||
const pipeline = []; | ||
|
||
pipeline.push(getPipeline('.buildkite/pipelines/security_solution/base.yml', false)); | ||
// remove duplicated steps | ||
uploadPipeline([...new Set(pipeline)].join('\n')); | ||
} catch (ex) { | ||
console.error('PR pipeline generation error', ex.message); | ||
process.exit(1); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
docs/api/synthetics/private-locations/create-private-location.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
[[create-private-location-api]] | ||
== Create Private Location API | ||
++++ | ||
<titleabbrev>Create Private Location</titleabbrev> | ||
++++ | ||
|
||
Creates a private location with the following schema. | ||
|
||
=== {api-request-title} | ||
|
||
`POST <kibana host>:<port>/api/synthetics/private_locations` | ||
|
||
`POST <kibana host>:<port>/s/<space_id>/api/synthetics/private_locations` | ||
|
||
=== {api-prereq-title} | ||
|
||
You must have `all` privileges for the *Synthetics and Uptime* feature in the *{observability}* section of the | ||
<<kibana-feature-privileges,{kib} feature privileges>>. | ||
|
||
[[private-location-request-body]] | ||
==== Request body | ||
|
||
The request body should contain the following attributes: | ||
|
||
`label`:: | ||
(Required, string) A label for the private location. | ||
|
||
`agentPolicyId`:: | ||
(Required, string) The ID of the agent policy associated with the private location. | ||
|
||
`tags`:: | ||
(Optional, array of strings) An array of tags to categorize the private location. | ||
|
||
`geo`:: | ||
(Optional, object) Geographic coordinates (WGS84) for the location. It should include the following attributes: | ||
|
||
- `lat` (Required, number): The latitude of the location. | ||
- `lon` (Required, number): The longitude of the location. | ||
|
||
[[private-location-create-example]] | ||
==== Example | ||
|
||
Here is an example of a POST request to create a private location: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
POST /api/private_locations | ||
{ | ||
"label": "Private Location 1", | ||
"agentPolicyId": "abcd1234", | ||
"tags": ["private", "testing"], | ||
"geo": { | ||
"lat": 40.7128, | ||
"lon": -74.0060 | ||
} | ||
} | ||
-------------------------------------------------- | ||
|
||
The API returns the created private location as follows: | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"id": "unique-location-id", | ||
"label": "Private Location 1", | ||
"agentPolicyId": "abcd1234", | ||
"tags": ["private", "testing"], | ||
"geo": { | ||
"lat": 40.7128, | ||
"lon": -74.0060 | ||
} | ||
} | ||
-------------------------------------------------- | ||
|
||
If the `agentPolicyId` is already used by an existing private location, or if the `label` already exists, the API will return a `400 Bad Request` response with a corresponding error message. |
41 changes: 41 additions & 0 deletions
41
docs/api/synthetics/private-locations/delete-private-location.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[[delete-private-location-api]] | ||
== Delete Private Location API | ||
++++ | ||
<titleabbrev>Delete Private Location</titleabbrev> | ||
++++ | ||
|
||
Deletes a private location using the provided location ID. | ||
|
||
=== {api-request-title} | ||
|
||
`DELETE <kibana host>:<port>/api/synthetics/private_locations/<location_id>` | ||
|
||
`DELETE <kibana host>:<port>/s/<space_id>/api/synthetics/private_locations/<location_id>` | ||
|
||
=== {api-prereq-title} | ||
|
||
You must have `all` privileges for the *Synthetics and Uptime* feature in the *{observability}* section of the | ||
<<kibana-feature-privileges,{kib} feature privileges>>. | ||
|
||
|
||
[[private-location-delete-params]] | ||
==== Path Parameters | ||
|
||
`location_id`:: | ||
(Required, string) The unique identifier of the private location to be deleted. It must be between 1 and 1024 characters. | ||
|
||
[[private-location-delete-example]] | ||
==== Example | ||
|
||
Here is an example of a DELETE request to delete a private location: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
DELETE /api/private-locations/<location_id> | ||
-------------------------------------------------- | ||
|
||
The API does not return a response body for deletion, but it will return an appropriate status code upon successful deletion. | ||
|
||
This API will delete the private location with the specified `locationId`. | ||
|
||
A location cannot be deleted if it has associated monitors in use. You must delete all monitors associated with the location before deleting the location. |
Oops, something went wrong.