Commit graph

680 commits

Author SHA1 Message Date
Maxim Palenov
f5aec5de29
[Security Solution] Reapply Auto-bundle Timeline API OpenAPI specs (#189315)
**Addresses**: https://github.com/elastic/kibana/issues/184428
**Relates to:** https://github.com/elastic/kibana/pull/188844

## Summary

The original [PR](https://github.com/elastic/kibana/pull/188844) was
rolled back by @Ikuni17 due to CI failures in `main` branch. It turned
the problem was caused by a bug in `check_for_changed_files()` which is
fixed in https://github.com/elastic/kibana/pull/189316.

This PR reapplies https://github.com/elastic/kibana/pull/188844 and it
also includes changes to reduce CI reruns (has to be rerun manually in
draft PRs) caused by changes to generated files. It's achieved by
reducing a number of `check_for_changed_files()` invocations.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-31 11:48:44 -05:00
Brad White
3d352549e3
[CI] Fix check_for_changed_files from committing to main (#189316)
## Summary

This `if` statement is failing in the on-merge pipeline where
`BUILDKITE_PULL_REQUEST="false"` (See `Environment` tab in
https://buildkite.com/elastic/kibana-on-merge/builds/48189#0190efb6-fae2-415a-85dc-1508717e6e5c).
This cause the function to try to commit changes to a non-existent PR
and fail (see logs in same linked build).
2024-07-31 11:24:12 -05:00
Brad White
6b64a9f803 Revert "[Security Solution] Auto-bundle Timeline API OpenAPI specs (#188844)"
This reverts commit efb2866d84.
2024-07-26 11:13:30 -06:00
Maxim Palenov
218146ee69
[Security Solution] Auto-bundle Endpoint Management API OpenAPI specs (#188853)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of Endpoint Management API OpenAPI specs as a part of PR pipeline. Corresponding result bundles are automatically committed to the Security Solution plugin `x-pack/plugins/security_solution` in the `docs/openapi/ess/` and `docs/openapi/serverless` folders (similar to https://github.com/elastic/kibana/pull/186384).
2024-07-26 14:59:17 +02:00
Maxim Palenov
efb2866d84
[Security Solution] Auto-bundle Timeline API OpenAPI specs (#188844)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of Timeline API OpenAPI
specs as a part of PR pipeline. Corresponding result bundles are
automatically committed to the Security Solution plugin
`x-pack/plugins/security_solution` in the `docs/openapi/ess/` and
`docs/openapi/serverless` folders (similar to
https://github.com/elastic/kibana/pull/186384).

---------

Co-authored-by: Jan Monschke <jan.monschke@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-25 14:26:25 +02:00
Maxim Palenov
cbb91f1f6b
[EDR Workflows] Auto-bundle Osquery API OpenAPI specs (#188920)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of Osquery API OpenAPI specs as a part of PR pipeline. Corresponding result bundles are automatically committed to the Osquery plugin `x-pack/plugins/osquery` in the `docs/openapi/ess` and `docs/openapi/serverless` folders (similar to https://github.com/elastic/kibana/pull/186384).
2024-07-24 18:02:39 -05:00
Maxim Palenov
d7f62b63d5
[Security Solution] Auto-bundle AI Assistant API OpenAPI specs (#188826)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of AI Assistant API OpenAPI specs as a part of PR pipeline. Corresponding result bundles are automatically committed to the Assistant Common package `x-pack/packages/kbn-elastic-assistant-common` in the `docs/openapi/ess/` and `docs/openapi/serverless` folders (similar to https://github.com/elastic/kibana/pull/186384).
2024-07-24 16:46:06 -04:00
Maxim Palenov
dac41c678c
[Security Solution] Auto-bundle Entity Analytics API OpenAPI specs (#188985)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of Entity Analytics API OpenAPI specs as a part of PR pipeline. Corresponding result bundles are automatically committed to the Security Solution plugin `x-pack/plugins/osquery` in the `docs/openapi/ess` and `docs/openapi/serverless` folders (similar to https://github.com/elastic/kibana/pull/186384).
2024-07-24 17:24:11 +02:00
Alejandro Fernández Haro
7eb47670d3
chore():enable autocommit for dirty yarn_deduplicate (#188875) 2024-07-24 16:31:12 +02:00
Jon
a68f812800
[ci] Implement kibana-pointer-compression pipeline (#188480)
Closes https://github.com/elastic/kibana/issues/186631
Closes https://github.com/elastic/kibana-operations/issues/151

Adds a daily pipeline for running our jest and integration tests against
a Node.js distribution with pointer compression enabled. This is enabled
by setting the environment variable
`CI_FORCE_NODE_POINTER_COMPRESSION=true`

I would prefer a cleaner implementation, but I'm not seeing a way around
it without changing our defaults globally. Open to ideas. We have to
update three downloads:

1) base node.js install, for jest
2) build node.js install, for integration tests
3) bazel workspace install, for dependencies

https://buildkite.com/elastic/kibana-pointer-compression/builds/6

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2024-07-22 17:13:27 -05:00
Jon
e93e3034a7
[cloud deploy] Enable ML autoscaling (#188653)
Enables ML autoscaling on Cloud deployments, in support of ELSER models
requiring 4gb of memory.
2024-07-22 16:11:22 -05:00
Alex Szabo
03148d203f
[CI] Prevent skippable changes pr break (#188740)
## Summary
Closes: https://github.com/elastic/kibana-operations/issues/159
2024-07-22 15:32:53 +02:00
Jon
2c8b2ff4a5
Revert org wide PR bot (#188771)
We're seeing frequent check timeouts on the org wide version. This rolls
back to the Kibana version
2024-07-19 13:20:12 -05:00
Maxim Palenov
179b78b499
[Security Solution] Auto-bundle Exceptions API OpenAPI specs (#188408)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of Exceptions API OpenAPI specs as a part of PR pipeline. Corresponding resulting bundles are automatically committed in the Lists common package `kbn-securitysolution-exceptions-common` in the `docs/openapi/ess/` and `docs/openapi/serverless` folders (similar to https://github.com/elastic/kibana/pull/186384).
2024-07-19 00:05:43 +10:00
Maxim Palenov
c76f68e55c
[Security Solution] Auto-bundle Lists API OpenAPI specs (#188407)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of Lists API OpenAPI specs as a part of PR pipeline. Corresponding resulting bundles are automatically committed in the Lists common package `kbn-securitysolution-lists-common` in the `docs/openapi/ess/` and `docs/openapi/serverless` folders (similar to https://github.com/elastic/kibana/pull/186384).
2024-07-18 13:33:53 +02:00
Maxim Palenov
bd0aab6dde
[Security Solution] Enable Detections API bundling in build pipeline (#188436)
**Addresses**: https://github.com/elastic/kibana/issues/184428
**Relates to**: https://github.com/elastic/kibana/pull/186384

## Summary

This PR enables Detections API OpenAPI bundling in build pipeline. It also fixes wrong references which weren't caught by the OpenAPI Linter and code generator.

For some reason https://github.com/elastic/kibana/pull/186384 didn't enable OpenAPI bundling by including `.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh` into `.buildkite/scripts/steps/checks.sh`.
2024-07-17 14:04:50 +01:00
Ahmad Bamieh
7c6aa3fc8a
[i18n][system upgrade] Upgrade i18n tooling (#186519)
Update i18n tools after the main packages upgrade. This upgrade makes
use of formatJS tooling instead of fully implementing the parsers
ourselves. It also changes our custom AST parsing from babel to the
typescript compiler.
- [x] i18n exrtract
- [x] i18n check
- [x] i18n integrate
- [x] add test cases for formatjs runner
- [x] Make sure all CLI flags are handled properly
- [x] Update tooling readme

Closes https://github.com/elastic/kibana/issues/180616
Closes https://github.com/elastic/kibana/issues/187703

### Note to reviewers

Teams outside operations and core are probably requested to review
because the `i18n_check` fixed malformed i18n messages in your plugins.
Please check and approve :elasticheart:
2024-07-16 21:47:54 +01:00
Jon
7a09b82ce2
[build] Fix ci:build-all-platforms (#188350)
The upload build artifacts step matches on a glob, which now resolves to
two distributions, breaking future commands. This swaps find for the
specific distribution.
2024-07-16 10:06:44 -07:00
Alex Szabo
9d43b39f47
[CI] fix unbound variable issue (#188454)
## Summary
Last fix on #188027
2024-07-16 18:11:11 +02:00
Alex Szabo
9d75f32f42
[CI] Fix publish script (#188027)
## Summary
Another attempt to fix the DRY_RUN-enhanced publish call - as it seems
simply emitting the script only works if there are no arguments.

Fixes:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9
Tested here:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490 (the
dry-run is supposedly added? but it seems the artifacts were published
nonetheless - at least there's no more syntax error)

Succesful run with the if-else:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516
2024-07-16 16:14:06 +02:00
Tiago Costa
3c338a82c2
chore(NA): remove usage of re2 and replace it with a non native module (#188134)
This PR removes the usage of the native module version of `re2` and
replaces it with a js port called `re2js`.
It also ends our usage of native node modules in production and it
removes the task from the build as well. Further steps will be taken
along our strategy to avoid future usages of native node modules in prod
environments.
2024-07-15 20:33:28 +01:00
Brad White
333cd207a3
[CI / Build / FIPS] Use xpack.security.experimental.fipsMode.enabled in CI and Docker (#187533)
## Summary

Closes #188272

A check was added to in #181187 which detects if the environment has
FIPS enabled NodeJS, but Kibana is not setup properly. This adds the
Kibana setting for FIPS in CI and the Docker image. Note there are still
license issues on some tests due to #181187 as well, but this will be
handled in another PR.
2024-07-15 18:11:34 +01:00
Maxim Palenov
4d7c36cee9
[Security Solution] Add missing Exceptions API OpenAPI specifications (#185951)
**Resolves:** https://github.com/elastic/kibana/issues/183837

## Summary

This PR adds missing OpenAPI specifications for Exceptions API which are the following

- `POST /api/exception_lists/_export`
- `POST /api/exception_lists/_import`
- `POST /api/exception_lists`
- `GET /api/exception_lists`
- `PUT /api/exception_lists`
- `DELETE /api/exception_lists`
- `GET /api/exception_lists/_find`
- `POST /api/exception_lists/_duplicate`
- `POST /api/exception_lists/items`
- `GET /api/exception_lists/items`
- `PUT /api/exception_lists/items`
- `DELETE /api/exception_lists/items`
- `GET /api/exception_lists/items/_find`
- `GET /api/exception_lists/summary`
- `POST /api/exceptions/shared` 
- `POST /api/detection_engine/rules/{id}/exceptions`
2024-07-15 13:12:56 +02:00
Alex Szabo
8fcf4b9dbb
Revert vault-related changes from #187762 (#187990)
Only revert one bit of the problem. It's failing in the bazel-cache
builds:
https://buildkite.com/elastic/kibana-macos-bazel-cache/builds/37383
because the bazel-cache was never migrated to the new infra, so there
are different `vault` defaults.
2024-07-10 16:36:45 +02:00
Alex Szabo
ba3f83cd3d
[CI] Remove kme leftovers (take 2) (#187947)
## Summary
Retries #187762 again. There was a partially removed step in the
previous attempt, that's now fully removed.
2024-07-10 16:01:06 +02:00
Alex Szabo
54ff3bf249
[CI] Fix heredoc typos (#187971)
## Summary
I've introduced a typo to the artifact publish script in #184018 - this
PR fixes it.
2024-07-10 15:50:10 +02:00
Alex Szabo
ea2509914f
[BK] Migrate es-forward (+add versions.json dependent triggering) (#184018)
## Goal
We'd like to introduce a way to run pipelines that have a dependency on
the currently active branch set (managed in
[versions.json](./versions.json)).

With this, we'd like to migrate over the `es-forward` pipelines
(currently:
[this](https://buildkite.com/elastic/kibana-7-dot-17-es-8-dot-15-forward-compatibility),
and
[this](https://buildkite.com/elastic/kibana-7-dot-17-es-8-dot-14-forward-compatibility))
to the new buildkite infra.

## Summary
This PR introduces a new pipeline:
https://buildkite.com/elastic/kibana-trigger-version-dependent-jobs
(through
[trigger-version-dependent-jobs.yml](.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml)).

The purpose of this new pipeline is to take the name of a "pipelineSet"
that refers to a pipeline, and based on the `versions.json` file, work
out what are the branches on which the referred pipeline should be
triggered.

### Example: `Trigger ES forward compatibility tests`
- a scheduled run on
[kibana-trigger-version-dependent-jobs](https://buildkite.com/elastic/kibana-trigger-version-dependent-jobs)
with the env var `TRIGGER_PIPELINE_SET=es-forward` runs
- the pipeline implementation for
`kibana-trigger-version-dependent-jobs` works out (looking at
`versions.json`), that the `es-forward` set should trigger
https://buildkite.com/elastic/kibana-es-forward (doesn't exist prior to
the PR) for (7.17+8.14) and (7.17+8.15)
- the pipeline implementation uploads two trigger steps, running
https://buildkite.com/elastic/kibana-es-forward in two instances with
the relevant parameterization.

Since the trigger parameters are derived from the `versions.json` file,
if we move on and close `8.14`, and open up `8.16`, this will follow,
without having to update the pipeline resources or schedules.

## Changes
- 2 pipelines created:
[trigger-version-dependent-jobs.yml](.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml),
[kibana-es-forward.yml](.buildkite/pipeline-resource-definitions/kibana-es-forward.yml)
   - [x] add kibana-es-forward.yml
 - implementation for `trigger-version-dependent-jobs` added
- branch configuration removed from pipelines (kibana-artifacts-staging,
kibana-artifacts-snapshot, kibana-artifacts-trigger)
 - added a script for checking RREs validity (moved a few files)

## Verification
I've used the migration staging pipeline (*) to run this:
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/130
   - Env: `TRIGGER_PIPELINE_SET="artifacts-trigger"`
- Result:
[(success):](https://buildkite.com/elastic/kibana-artifacts-trigger/builds/10806)
it triggered for 8.14 only (as expected)
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/131
   - Env: `TRIGGER_PIPELINE_SET="es-forward"`
- Result: (success): it generated 2 trigger steps, but since the
es-forward pipeline doesn't exist, the upload step failed
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/132
   - Env: `TRIGGER_PIPELINE_SET="artifacts-snapshot"`
- Result: (success): it triggered jobs for all 3 open branches
(main/8.14/7.17)
-
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/134
   - Env: `TRIGGER_PIPELINE_SET="artifacts-staging"`
   - Result: (success): it triggered 8.14 / 7.14, but not for main


(*note: this migration staging pipeline will come in handy even after
the migration, to stage newly created pipelines without creating the
resource up-front)
2024-07-10 12:08:16 +02:00
Jonathan Budzenski
369277fcbc Revert "[CI] Remove kme leftovers (#187762)"
This reverts commit 41ee64709f.
2024-07-09 13:05:08 -05:00
Alex Szabo
41ee64709f
[CI] Remove kme leftovers (#187762)
## Summary
These were used for testing the migration from the kibana-buildkite
infra to the elastic-wide buildkite infra. Now we're done with most of
the migration, we can clean these up.
2024-07-10 03:36:34 +10:00
Victor Martinez
1a6b1edf19
obs: deploy serverless when targeting main only (#187741) 2024-07-09 15:46:42 +02:00
Brad White
dd9d6434ca
Remove Agent Debug Info (#187126)
## Summary

- Removes SSH info to avoid confusion since we cannot SSH into agents on
the new infra
- Removes old agent metrics and logs links because they are in a
different cluster and the new links are in an annotation
2024-07-09 07:10:14 +10:00
Jon
cecdf31039
[ci] Skip project image build if manifest exists on pull requests (#187680)
Currently, if a container image already exists for a project the script
exits early with a failure. In cases where CI is re-triggered, this can
be inconvenient and require an upstream merge to rebuild.

Instead of exiting early, this skips the image build on pull requests.
2024-07-09 06:27:40 +10:00
Jon
bd41c659d9
[ci] Use org wide PR status bot (#187386) 2024-07-03 08:07:19 -05:00
Jon
581e88ba81
[ci] Use github action to approve API docs (#187246)
Cleans up our auto-approve scripts a bit to be consistent. This matches
the auto-approve backport workflow.
2024-07-01 11:23:06 -05:00
Tomasz Ciecierski
cf11c5fb3f
[EDR Workflows] change osquery pipeline (#187222) 2024-07-01 15:57:27 +02:00
Jon
9854ecf93c
[build] Rename chainguard -> wolfi (#187095)
To be consistent with other stack products.
2024-06-28 09:13:52 -05:00
Alex Szabo
c9d2b70f84
[CI] Print ES docker images versions (#186885)
## Summary
When we're seeing errors in FTR or on the serverless verification
pipeline, we have difficulty connecting back what version of
ES-Serverless is behind the tag `:latest`.
With a recent addition to the ES Serverless docker image, this info is
now contained in labels of the image.

This PR highlights this info in the verification pipeline, as well as
the FTR output from `kbn-es`.

- Serverless verification pipeline:
https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote/builds/1454
- FTR:
![Screenshot 2024-06-25 at 17 30 48
(1)](b6244f99-52e8-4fc6-ac22-e69e01254f1f)
2024-06-27 10:36:09 +02:00
Brad White
15a0b8e4cf
[CI / FIPS] Convert smoke tests to use FIPS agent (#186858)
## Summary

Closes elastic/kibana-operations#137

- Convert FIPS daily smoke test pipeline to use FIPS agents
  - This allows the smoke tests to run in parallel now
- Removes FIPS Vagrant box from package testing
- Adds verify FIPS enabled check to pipeline 

Pipeline run: https://buildkite.com/elastic/kibana-fips/builds/90
2024-06-26 12:55:51 -07:00
Jon
985a28fd3b
Update obs-onboarding cypress CI config (#186926)
- removes parallelism: 2 from step definition. The test suites are not
sharded.
- Updates the path used to trigger a test run. The previous path is out
of date.
2024-06-26 09:15:03 -05:00
Brad White
8c83173e62
[CI / FIPS] Fix env var for checks (#186565)
In #183777 review iterations `FIPS_ENABLED` was changed, but not updated
here.

`Checks` with FIPS agents enabled:
https://buildkite.com/elastic/kibana-pull-request/builds/217048#019037fd-675f-4860-839a-d5e0602a40c4/281-284
2024-06-24 12:38:02 -07:00
Thibault Richard
548301d6a9
Update deploy.sh to fail if curl doesn't get 2xx (#186546)
This adds the use of the `-f` flag to `curl` commands so that the
`deploy.sh` script will fail if an HTTP response is not 2xx.

This will prevent, for example, us from thinking that an update of a
project worked when instead the API responded `405` and nothing happened.

Related to https://github.com/elastic/kibana/pull/186543.
2024-06-20 22:35:57 +02:00
Brad White
324673c8d6
[ci / FIPS] Dynamic agent selection. Add FIPS agents (#183777)
## Summary

- Closes https://github.com/elastic/kibana-operations/issues/100
- Utilizes FIPS agent from elastic/ci-agent-images#686
- Adds dynamic agent selection during PR pipeline upload
- FIPS agents can be used with `FTR_ENABLE_FIPS_AGENT` env variable or
`ci:enable-fips-agent` label
- Removes agent image config from individual steps in favor of image
config for the whole pipeline.
- Steps can still override this config by adding `image`, `imageProject`
etc
- Adds a conditional assertion to `Check` CI step which validates that
FIPS is working properly


### Testing
- [Pipeline run using FIPS
agents](https://buildkite.com/elastic/kibana-pull-request/builds/215332)
  - Failures are expected and this possibly ran with flaky tests
2024-06-20 13:09:45 -07:00
Alejandro Fernández Haro
8c17c138b9
fix(serverless/deploy): use patch instead of put (#186543)
## Summary

The `PUT` endpoint was deprecated and removed on [February
20](https://groups.google.com/a/elastic.co/g/dev/c/1S0xcVAbmCA/m/Ybkr1H01AQAJ).
We should use `PATCH` when updating the existing projects.
2024-06-20 17:26:23 +02:00
dkirchan
6ce61db2ff
[Security][Serverless] Add Product types in FTR API Integration tests. (#184309)
# Pull Request Overview
This pull request (PR):
1. Enables Product Types for FTR API Integration Test Suites in
Serverless MKI:
- Previously, the test suites ignored product types entirely. With this
PR, scripts to run the tests have been relocated to
x-pack/test/security_solution_api_integration/scripts.
- Users can now run tests from the API Integration tests directory for
security solutions by using the command:
TARGET_SCRIPT={script_from_package_json} node
./scripts/mki_start_api_ftr_execution. This will execute the following
steps:
1. Create a security serverless project, respecting the product types
specified in the serverless configuration found in the config folder of
the relevant test suite.
      2. Reset credentials.
3. Wait for Elasticsearch (ES) and Kibana to be ready and available.
      4. Execute the tests.
      5. Delete the project upon completion.
2. Adds Proxy Services Organizations to .ftr Role Users Files:
- This PR updates the .ftr role_users files to include all proxy
services organizations, ensuring they have the necessary permissions for
the tests.

# Implementation Details
Product Types

  - Previous Setup:
- A project was created and handed over to the test suite to run the API
tests against, without considering product types.
  - Changes Introduced:
- The script execution for tests has moved to
x-pack/test/security_solution_api_integration/scripts.
- Tests can be initiated using the command from the API Integration
tests folder where package.json exists:
      ```
TARGET_SCRIPT={script_from_package_json} node
./scripts/mki_start_api_ftr_execution
      ```
- The mki_start_api_ftr_execution script performs several steps to run
the tests, including creating a security serverless project with
specified product types, resetting credentials, ensuring ES and Kibana
readiness, executing tests, and cleaning up the project afterward.
- The script reads extra configuration (currently only product types are
supported) in the specific format as is, from the following file :
[api_configs.json](https://github.com/elastic/kibana/pull/184309/files#diff-1122baffe7ff843b1f486cee95468bed5851a9a4934be747f540bd42dc9a07daR2).
The key for the JSON file is the name of the script in
[package.json](https://github.com/elastic/kibana/pull/184309/files#diff-c6af1c81947b3a77bed431c688c7ad38c8969bd52e1c3ea92d643f09d422eb61R296)
- If a specific configuration is not required and the default complete
project is needed for the test to run, the key and configuration in the
`api_configs.json` file can be ommitted.

# Summary

This PR enhances the flexibility and functionality of the FTR API
integration test suites for serverless MKI by incorporating product type
considerations and updating the role_users configuration to include
proxy services organizations.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-20 17:30:35 +03:00
Alex Szabo
5259fa6764
[CI] Use legacy vault for deployment credentials (#184944)
## Summary
With the migration to the shared buildkite infra, we've also switched to
using the ci-prod vault (https://vault-ci-prod.elastic.dev) for all
CI-related secrets. We found it reasonable then, to also switch the
storage of the credentials for the deployments there. It's since been
proven unnecessary, even confusing for developers, as they might not be
adequately set up for accessing the two vaults. We've also learned, that
both of these vault instances are here to stay, so there's no push to
migrate everything to the ci-prod instance.

So, this PR switches back to using the legacy vault in all cases for
storing deployment keys, as it fits better with the developers' daily
secret handling duties.

Also, adds a cleanup part to the purge routine.

- [x] extract vault read / write to a parametric shell script, because
the typescript invocations to vault won't have an easy access to the
`set_in_legacy_vault`
2024-06-20 09:51:37 +02:00
Maxim Palenov
858ef15c5a
[Security Solution] Auto-bundle Detections API OpenAPI specs (#186384)
**Addresses:** https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling Detections API OpenAPI spec as a part of PR pipeline. Corresponding resulting bundles are automatically committed to `x-pack/plugins/security_solution/docs/openapi/ess/` and `x-pack/plugins/security_solution/docs/openapi/serverless` folders.
2024-06-18 13:29:29 -07:00
Maxim Palenov
7a0065d5b6
[Security Solution] Add missing Lists API OpenAPI specifications (#185865)
**Resolves:** https://github.com/elastic/kibana/issues/183821

## Summary

This PR adds missing OpenAPI specifications for Lists API which are the following

- `POST /api/lists`
- `GET /api/lists`
- `PUT /api/lists`
- `DELETE /api/lists`
- `PATCH /api/lists`
- `GET /api/lists/_find`
- `GET /api/lists/privileges`
- `POST /api/lists/items`
- `GET /api/lists/items`
- `PUT /api/lists/items`
- `DELETE /api/lists/items`
- `PATCH /api/lists/items`
- `POST /api/lists/items/_export`
- `POST /api/lists/items/_import`
- `GET /api/lists/items/_find`
- `POST /api/lists/index`
- `GET /api/lists/index`
- `DELETE /api/lists/index`

**Note:** Code generation is enabled for the added specs to verify that it works and produces expected results. Generated Zod schemas and types aren't integrated in the route's code.
2024-06-18 13:22:19 -07:00
Alex Szabo
f6968f3091
[CI] Prevent duplicate serverless image build (#186164)
## Summary
Only adds build_project.yml if there's not already a deploy_project.yml
added through labels

## Context
Based on the labeling logic, if we had `ci:build-serverless-image` and
`ci:project-deploy-*`, the steps for building the docker image would be
added twice.

See: https://elastic.slack.com/archives/C0D8P2XK5/p1718268306523329
2024-06-17 10:42:47 +02:00
Drew Tate
ca98a8bd93
[ES|QL] add docs step to sync pipeline (#186011)
## Summary

https://github.com/elastic/kibana/pull/184689 added a script to gather
ES|QL function docs from Elasticsearch.

This PR adds it to our CI pipeline!

Close https://github.com/elastic/kibana/issues/173492
Close https://github.com/elastic/kibana/issues/173817

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-12 17:42:37 -07:00
Alex Szabo
2433131aed
[CI] Remove caching of api-docs (#186050)
## Summary
When building the VM image, especially concerning the cache-warmup step
(https://github.com/elastic/ci-agent-images/pull/736) this step will
fail, because it's running on agents that won't have access to this
repository ([see this
build](https://buildkite.com/elastic/ci-vm-images/builds/5275#01900893-db68-4242-b73e-cda24df6e20c)).

We're probably not losing much by not having this repo cached, or if we
need it, we can always build the VM image with this repo cloned, and use
it through the git-mirrors.
2024-06-12 18:28:27 +02:00