Skip to content

Commit

Permalink
Merge branch 'main' into unskipping-detection-page-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Nov 6, 2023
2 parents e43300c + 38ad5d8 commit 8758d43
Show file tree
Hide file tree
Showing 185 changed files with 3,650 additions and 1,789 deletions.
36 changes: 36 additions & 0 deletions .buildkite/pipelines/security_solution/base.yml
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
1 change: 1 addition & 0 deletions .buildkite/scripts/lifecycle/post_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
buildkite-agent artifact upload 'target/kibana-coverage/functional/**/*'
buildkite-agent artifact upload 'target/kibana-*'
buildkite-agent artifact upload 'target/kibana-security-solution/**/*.png'
buildkite-agent artifact upload 'target/kibana-security-solution/**/management/**/*.mp4'
buildkite-agent artifact upload 'target/kibana-osquery/**/*.png'
buildkite-agent artifact upload 'target/kibana-osquery/**/*.mp4'
buildkite-agent artifact upload 'target/kibana-fleet/**/*.png'
Expand Down
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
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
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);
}
})();
13 changes: 5 additions & 8 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ x-pack/plugins/infra/server/lib/alerting @elastic/actionable-observability
/x-pack/test/fleet_cypress @elastic/fleet
/x-pack/test/fleet_functional @elastic/fleet
/src/dev/build/tasks/bundle_fleet_packages.ts @elastic/fleet @elastic/kibana-operations
/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts @elastic/fleet @elastic/obs-cloudnative-monitoring

# APM
/x-pack/test/functional/apps/apm/ @elastic/apm-ui
Expand Down Expand Up @@ -1360,14 +1361,10 @@ x-pack/plugins/security_solution/server/usage/ @elastic/security-data-analytics
x-pack/plugins/security_solution/server/lib/telemetry/ @elastic/security-data-analytics

## Security Solution sub teams - security-engineering-productivity
x-pack/test/security_solution_cypress/cypress/README.md @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/cli_config.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/config.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/runner.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/serverless_config.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/cypress/tags.ts @elastic/security-engineering-productivity
x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror
/x-pack/test/security_solution_cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity
/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror

## Security Solution sub teams - adaptive-workload-protection
x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/kibana-cloud-security-posture
Expand Down
3 changes: 3 additions & 0 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ enterpriseSearch.enabled: false
monitoring.ui.enabled: false
xpack.fleet.enabled: false

## Cloud settings
xpack.cloud.serverless.project_type: search

## Enable the Serverless Search plugin
xpack.serverless.search.enabled: true

Expand Down
5 changes: 4 additions & 1 deletion config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ xpack.securitySolution.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false

## Cloud settings
xpack.cloud.serverless.project_type: observability

## Enable the Serverless Observability plugin
xpack.serverless.observability.enabled: true

Expand Down Expand Up @@ -58,7 +61,7 @@ xpack.fleet.internal.registry.excludePackages: [
xpack.fleet.packages:
- name: apm
version: latest
# fleet_server package installed to publish agent metrics
# fleet_server package installed to publish agent metrics
- name: fleet_server
version: latest
## Disable APM UI components and API calls
Expand Down
3 changes: 3 additions & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ xpack.observability.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false

## Cloud settings
xpack.cloud.serverless.project_type: security

## Enable the Security Solution Serverless plugin
xpack.securitySolutionServerless.enabled: true
xpack.securitySolutionServerless.productTypes:
Expand Down
6 changes: 5 additions & 1 deletion config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,8 @@ xpack.task_manager.requeue_invalid_tasks.enabled: true
# Reporting feature
xpack.screenshotting.enabled: false
xpack.reporting.roles.enabled: false
xpack.reporting.statefulSettings.enabled: false
xpack.reporting.statefulSettings.enabled: false


# Disabled Observability plugins
xpack.ux.enabled: false
4 changes: 2 additions & 2 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ Discover::
* Adds resize support to the Discover field list sidebar ({kibana-pull}167066[#167066]).
Elastic Security::
For the Elastic Security 8.11.0 release information, refer to {security-guide}/release-notes.html[_Elastic Security Solution Release Notes_].
Enterprise Search::
For the Elastic Enterprise Search 8.11.0 release information, refer to {enterprise-search-ref}/changelog.html[_Elastic Enterprise Search Documentation Release notes_].
Enterprise Search service::
For the Elastic Enterprise Search service 8.11.0 release information, refer to {enterprise-search-ref}/changelog.html[_Elastic Enterprise Search Release notes_].
Fleet::
* Set env variable `ELASTIC_NETINFO:false` in {kib} ({kibana-pull}166156[#166156]).
* Added restart upgrade action ({kibana-pull}166154[#166154]).
Expand Down
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.
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.
Loading

0 comments on commit 8758d43

Please sign in to comment.