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 9, 2023
2 parents 241c40f + eeaf815 commit 9967f71
Show file tree
Hide file tree
Showing 873 changed files with 5,849 additions and 2,292 deletions.
3 changes: 3 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/actions/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/alerts/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/default_license/risk_engine/configs/ess.config.ts




Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://buildkite.com/elastic/kibana-serverless-emergency-release-branch-testing

## Triggers the artifacts container image build for emergency releases
agents:
queue: kibana-default

notify:
- slack: "#kibana-mission-control"
if: "build.state == 'passed' || build.state == 'failed' || build.state == 'scheduled'"

steps:
- trigger: "kibana-artifacts-container-image"
label: ":docker: Build Kibana Artifacts Container Image"
build:
branch: $BUILDKITE_BRANCH
commit: $BUILDKITE_COMMIT
message: Running PR build for $BUILDKITE_BRANCH
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -euo pipefail

ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.ts
ts-node .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/pipeline.ts
177 changes: 94 additions & 83 deletions .buildkite/scripts/steps/serverless/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,91 +6,102 @@ set -euo pipefail
source .buildkite/scripts/common/util.sh
source .buildkite/scripts/steps/artifacts/docker_image.sh

PROJECT_TYPE=""
is_pr_with_label "ci:project-deploy-elasticsearch" && PROJECT_TYPE="elasticsearch"
is_pr_with_label "ci:project-deploy-observability" && PROJECT_TYPE="observability"
is_pr_with_label "ci:project-deploy-security" && PROJECT_TYPE="security"
if [ -z "${PROJECT_TYPE}" ]; then
echo "Mising project type"
exit 10
fi

PROJECT_NAME="kibana-pr-$BUILDKITE_PULL_REQUEST-$PROJECT_TYPE"
PROJECT_CREATE_CONFIGURATION='{
"name": "'"$PROJECT_NAME"'",
"region_id": "aws-eu-west-1",
"overrides": {
"kibana": {
"docker_image": "'"$KIBANA_IMAGE"'"
}
}
}'
PROJECT_UPDATE_CONFIGURATION='{
"name": "'"$PROJECT_NAME"'",
"overrides": {
"kibana": {
"docker_image": "'"$KIBANA_IMAGE"'"
}
}
}'

echo "--- Create project"
DEPLOY_LOGS=$(mktemp --suffix ".json")

echo "Checking if project already exists..."
curl -s \
-H "Authorization: ApiKey $PROJECT_API_KEY" \
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}" \
-XGET &>> $DEPLOY_LOGS

PROJECT_ID=$(jq -r --slurp '[.[0].items[] | select(.name == "'$PROJECT_NAME'")] | .[0].id' $DEPLOY_LOGS)
if [ -z "${PROJECT_ID}" ] || [ "$PROJECT_ID" = 'null' ]; then
echo "Creating project..."
curl -s \
-H "Authorization: ApiKey $PROJECT_API_KEY" \
-H "Content-Type: application/json" \
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}" \
-XPOST -d "$PROJECT_CREATE_CONFIGURATION" &>> $DEPLOY_LOGS

PROJECT_ID=$(jq -r --slurp '.[1].id' $DEPLOY_LOGS)

echo "Get credentials..."
curl -s -XPOST -H "Authorization: ApiKey $PROJECT_API_KEY" \
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}/${PROJECT_ID}/_reset-credentials" &>> $DEPLOY_LOGS

PROJECT_USERNAME=$(jq -r --slurp '.[2].username' $DEPLOY_LOGS)
PROJECT_PASSWORD=$(jq -r --slurp '.[2].password' $DEPLOY_LOGS)

echo "Write to vault..."
VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)"
VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)"
VAULT_TOKEN=$(retry 5 30 vault write -field=token auth/approle/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID")
retry 5 30 vault login -no-print "$VAULT_TOKEN"
retry 5 5 vault write "secret/kibana-issues/dev/cloud-deploy/$PROJECT_NAME" username="$PROJECT_USERNAME" password="$PROJECT_PASSWORD" id="$PROJECT_ID"
else
echo "Updating project..."
deploy() {
PROJECT_TYPE=$1
case $PROJECT_TYPE in
elasticsearch)
PROJECT_TYPE_LABEL='Elasticsearch Serverless'
;;
observability)
PROJECT_TYPE_LABEL='Observability'
;;
security)
PROJECT_TYPE_LABEL='Security'
;;
esac

PROJECT_NAME="kibana-pr-$BUILDKITE_PULL_REQUEST-$PROJECT_TYPE"
PROJECT_CREATE_CONFIGURATION='{
"name": "'"$PROJECT_NAME"'",
"region_id": "aws-eu-west-1",
"overrides": {
"kibana": {
"docker_image": "'"$KIBANA_IMAGE"'"
}
}
}'
PROJECT_UPDATE_CONFIGURATION='{
"name": "'"$PROJECT_NAME"'",
"overrides": {
"kibana": {
"docker_image": "'"$KIBANA_IMAGE"'"
}
}
}'

echo "--- Create $PROJECT_TYPE_LABEL project"
DEPLOY_LOGS=$(mktemp --suffix ".json")

echo "Checking if project already exists..."
curl -s \
-H "Authorization: ApiKey $PROJECT_API_KEY" \
-H "Content-Type: application/json" \
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}/${PROJECT_ID}" \
-XPUT -d "$PROJECT_UPDATE_CONFIGURATION" &>> $DEPLOY_LOGS
fi

PROJECT_KIBANA_URL=$(jq -r --slurp '.[1].endpoints.kibana' $DEPLOY_LOGS)
PROJECT_KIBANA_LOGIN_URL="${PROJECT_KIBANA_URL}/login"
PROJECT_ELASTICSEARCH_URL=$(jq -r --slurp '.[1].endpoints.elasticsearch' $DEPLOY_LOGS)

cat << EOF | buildkite-agent annotate --style "info" --context project
### Project Deployment
Kibana: $PROJECT_KIBANA_LOGIN_URL
Elasticsearch: $PROJECT_ELASTICSEARCH_URL
Credentials: \`vault read secret/kibana-issues/dev/cloud-deploy/$PROJECT_NAME\`
Kibana image: \`$KIBANA_IMAGE\`
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}" \
-XGET &>> $DEPLOY_LOGS

PROJECT_ID=$(jq -r --slurp '[.[0].items[] | select(.name == "'$PROJECT_NAME'")] | .[0].id' $DEPLOY_LOGS)
if [ -z "${PROJECT_ID}" ] || [ "$PROJECT_ID" = 'null' ]; then
echo "Creating project..."
curl -s \
-H "Authorization: ApiKey $PROJECT_API_KEY" \
-H "Content-Type: application/json" \
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}" \
-XPOST -d "$PROJECT_CREATE_CONFIGURATION" &>> $DEPLOY_LOGS

PROJECT_ID=$(jq -r --slurp '.[1].id' $DEPLOY_LOGS)

echo "Get credentials..."
curl -s -XPOST -H "Authorization: ApiKey $PROJECT_API_KEY" \
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}/${PROJECT_ID}/_reset-credentials" &>> $DEPLOY_LOGS

PROJECT_USERNAME=$(jq -r --slurp '.[2].username' $DEPLOY_LOGS)
PROJECT_PASSWORD=$(jq -r --slurp '.[2].password' $DEPLOY_LOGS)

echo "Write to vault..."
VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)"
VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)"
VAULT_TOKEN=$(retry 5 30 vault write -field=token auth/approle/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID")
retry 5 30 vault login -no-print "$VAULT_TOKEN"
retry 5 5 vault write "secret/kibana-issues/dev/cloud-deploy/$PROJECT_NAME" username="$PROJECT_USERNAME" password="$PROJECT_PASSWORD" id="$PROJECT_ID"
else
echo "Updating project..."
curl -s \
-H "Authorization: ApiKey $PROJECT_API_KEY" \
-H "Content-Type: application/json" \
"${PROJECT_API_DOMAIN}/api/v1/serverless/projects/${PROJECT_TYPE}/${PROJECT_ID}" \
-XPUT -d "$PROJECT_UPDATE_CONFIGURATION" &>> $DEPLOY_LOGS
fi

PROJECT_KIBANA_URL=$(jq -r --slurp '.[1].endpoints.kibana' $DEPLOY_LOGS)
PROJECT_KIBANA_LOGIN_URL="${PROJECT_KIBANA_URL}/login"
PROJECT_ELASTICSEARCH_URL=$(jq -r --slurp '.[1].endpoints.elasticsearch' $DEPLOY_LOGS)

cat << EOF | buildkite-agent annotate --style "info" --context "project-$PROJECT_TYPE"
### $PROJECT_TYPE_LABEL Deployment
Kibana: $PROJECT_KIBANA_LOGIN_URL
Elasticsearch: $PROJECT_ELASTICSEARCH_URL
Credentials: \`vault read secret/kibana-issues/dev/cloud-deploy/$PROJECT_NAME\`
Kibana image: \`$KIBANA_IMAGE\`
EOF

buildkite-agent meta-data set pr_comment:deploy_project:head "* [Project Deployment](${PROJECT_KIBANA_LOGIN_URL})"
buildkite-agent meta-data set pr_comment:early_comment_job_id "$BUILDKITE_JOB_ID"
buildkite-agent meta-data set "pr_comment:deploy_project_$PROJECT_TYPE:head" "* [$PROJECT_TYPE_LABEL Deployment](${PROJECT_KIBANA_LOGIN_URL})"
buildkite-agent meta-data set pr_comment:early_comment_job_id "$BUILDKITE_JOB_ID"
}

is_pr_with_label "ci:project-deploy-elasticsearch" && deploy "elasticsearch"
is_pr_with_label "ci:project-deploy-observability" && deploy "observability"
is_pr_with_label "ci:project-deploy-security" && deploy "security"
20 changes: 10 additions & 10 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ src/plugins/embeddable @elastic/kibana-presentation
x-pack/examples/embedded_lens_example @elastic/kibana-visualizations
x-pack/plugins/encrypted_saved_objects @elastic/kibana-security
x-pack/plugins/enterprise_search @elastic/enterprise-search-frontend
examples/error_boundary @elastic/appex-sharedux
packages/kbn-es @elastic/kibana-operations
packages/kbn-es-archiver @elastic/kibana-operations @elastic/appex-qa
packages/kbn-es-errors @elastic/kibana-core
Expand Down Expand Up @@ -445,7 +446,7 @@ x-pack/plugins/index_lifecycle_management @elastic/platform-deployment-managemen
x-pack/plugins/index_management @elastic/platform-deployment-management
test/plugin_functional/plugins/index_patterns @elastic/kibana-data-discovery
x-pack/packages/kbn-infra-forge @elastic/obs-ux-management-team
x-pack/plugins/infra @elastic/infra-monitoring-ui
x-pack/plugins/infra @elastic/infra-monitoring-ui @elastic/obs-ux-logs-team @elastic/obs-ux-infra_services-team
x-pack/plugins/ingest_pipelines @elastic/platform-deployment-management
src/plugins/input_control_vis @elastic/kibana-presentation
src/plugins/inspector @elastic/kibana-presentation
Expand Down Expand Up @@ -926,18 +927,11 @@ packages/kbn-monaco/src/esql @elastic/kibana-visualizations

### Observability Plugins

# Actionable observability
x-pack/packages/observability/alert_details @elastic/obs-ux-management-team
x-pack/test/observability_functional @elastic/obs-ux-management-team
x-pack/plugins/infra/public/alerting @elastic/obs-ux-management-team
x-pack/plugins/infra/server/lib/alerting @elastic/obs-ux-management-team

# Observability robots
/.github/workflows/deploy-my-kibana.yml @elastic/observablt-robots
/.github/workflows/oblt-github-commands @elastic/observablt-robots

# Infra Monitoring
/x-pack/plugins/infra @elastic/obs-ux-infra_services-team @elastic/obs-ux-logs-team
/x-pack/plugins/infra/server/routes @elastic/obs-ux-infra_services-team
/x-pack/plugins/infra/server/routes/log_analysis @elastic/obs-ux-logs-team
/x-pack/plugins/infra/server/routes/log_alerts @elastic/obs-ux-logs-team
Expand Down Expand Up @@ -995,6 +989,12 @@ x-pack/plugins/infra/server/lib/alerting @elastic/obs-ux-management-team
/x-pack/test/functional/apps/infra @elastic/infra-monitoring-ui @elastic/obs-ux-infra_services-team @elastic/obs-ux-logs-team
/x-pack/test/api_integration/apis/infra @elastic/infra-monitoring-ui @elastic/obs-ux-infra_services-team

# Actionable observability
x-pack/packages/observability/alert_details @elastic/obs-ux-management-team
x-pack/test/observability_functional @elastic/obs-ux-management-team
x-pack/plugins/infra/public/alerting @elastic/obs-ux-management-team
x-pack/plugins/infra/server/lib/alerting @elastic/obs-ux-management-team

# Elastic Stack Monitoring
/x-pack/test/functional/apps/monitoring @elastic/obs-ux-infra_services-team
/x-pack/test/api_integration/apis/monitoring @elastic/obs-ux-infra_services-team
Expand Down Expand Up @@ -1436,9 +1436,9 @@ x-pack/plugins/security_solution/public/entity_analytics @elastic/security-entit
x-pack/plugins/security_solution/public/explore/components/risk_score @elastic/security-entity-analytics
x-pack/plugins/security_solution/public/overview/pages/entity_analytics.tsx @elastic/security-entity-analytics
x-pack/plugins/security_solution/public/overview/components/entity_analytics
x-pack/plugins/security_solution/server/lib/risk_engine @elastic/security-entity-analytics
x-pack/plugins/security_solution/server/lib/entity_analytics @elastic/security-entity-analytics
x-pack/plugins/security_solution/server/lib/risk_score @elastic/security-entity-analytics
x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine @elastic/security-entity-analytics
x-pack/test/security_solution_api_integration/test_suites/entity_analytics @elastic/security-entity-analytics

# Security Defend Workflows - OSQuery Ownership
/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions @elastic/security-defend-workflows
Expand Down
2 changes: 1 addition & 1 deletion api_docs/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions
title: "actions"
image: https://source.unsplash.com/400x175/?github
description: API docs for the actions plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
---
import actionsObj from './actions.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/advanced_settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings
title: "advancedSettings"
image: https://source.unsplash.com/400x175/?github
description: API docs for the advancedSettings plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings']
---
import advancedSettingsObj from './advanced_settings.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/aiops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops
title: "aiops"
image: https://source.unsplash.com/400x175/?github
description: API docs for the aiops plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops']
---
import aiopsObj from './aiops.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/alerting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting
title: "alerting"
image: https://source.unsplash.com/400x175/?github
description: API docs for the alerting plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting']
---
import alertingObj from './alerting.devdocs.json';
Expand Down
4 changes: 2 additions & 2 deletions api_docs/apm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/apm
title: "apm"
image: https://source.unsplash.com/400x175/?github
description: API docs for the apm plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm']
---
import apmObj from './apm.devdocs.json';

The user interface for Elastic APM

Contact [@elastic/apm-ui](https://github.com/orgs/elastic/teams/apm-ui) for questions regarding this plugin.
Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) for questions regarding this plugin.

**Code health stats**

Expand Down
4 changes: 2 additions & 2 deletions api_docs/apm_data_access.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/apmDataAccess
title: "apmDataAccess"
image: https://source.unsplash.com/400x175/?github
description: API docs for the apmDataAccess plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess']
---
import apmDataAccessObj from './apm_data_access.devdocs.json';



Contact [@elastic/apm-ui](https://github.com/orgs/elastic/teams/apm-ui) for questions regarding this plugin.
Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) for questions regarding this plugin.

**Code health stats**

Expand Down
4 changes: 2 additions & 2 deletions api_docs/asset_manager.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/assetManager
title: "assetManager"
image: https://source.unsplash.com/400x175/?github
description: API docs for the assetManager plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'assetManager']
---
import assetManagerObj from './asset_manager.devdocs.json';

Asset manager plugin for entity assets (inventory, topology, etc)

Contact [@elastic/infra-monitoring-ui](https://github.com/orgs/elastic/teams/infra-monitoring-ui) for questions regarding this plugin.
Contact [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) for questions regarding this plugin.

**Code health stats**

Expand Down
2 changes: 1 addition & 1 deletion api_docs/banners.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners
title: "banners"
image: https://source.unsplash.com/400x175/?github
description: API docs for the banners plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners']
---
import bannersObj from './banners.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/bfetch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch
title: "bfetch"
image: https://source.unsplash.com/400x175/?github
description: API docs for the bfetch plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch']
---
import bfetchObj from './bfetch.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/canvas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas
title: "canvas"
image: https://source.unsplash.com/400x175/?github
description: API docs for the canvas plugin
date: 2023-11-08
date: 2023-11-09
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas']
---
import canvasObj from './canvas.devdocs.json';
Expand Down
Loading

0 comments on commit 9967f71

Please sign in to comment.