Commit graph

793 commits

Author SHA1 Message Date
Gloria Hornero
7b7f19f565
[Security Solution] Adding missing rule management groups to the flaky test suite runner (#172354) 2023-12-01 08:26:58 -07:00
Alex Szabo
1208a8e6b5
[Ops] Buildkite job for serverless deployment (#170655)
## Summary
Connected to: https://github.com/elastic/kibana-operations/issues/18
Pre-requisite for:
https://github.com/elastic/kibana-operations/issues/30

You can test the current assistant from the branch:
https://buildkite.com/elastic/kibana-serverless-release-1/builds?branch=buildkite-job-for-deployment
- use `DRY_RUN=1` in the runtime params to not trigger an actual release
:)

This PR creates the contents of a Buildkite job to assist the Kibana
Serverless Release initiation process at the very beginning and lay some
groundwork for further additions to the release management.

At the end of the day, we would like to create a tag deploy@<timestamp>
which will be picked up by another job that listens to these tags:
https://buildkite.com/elastic/kibana-serverless-release. However,
several parts of the preparation for release require manual research,
collecting information about target releases, running scripts, etc.

Any further addition to what would be useful for someone wanting to
start a release could be contained here.

Furthermore, we could also trigger downstream jobs from here. e.g.:
https://buildkite.com/elastic/kibana-serverless-release is currently set
up to listen for a git tag, but we may as well just trigger the job
after we've created a tag.

Check out an example run at:
https://buildkite.com/elastic/kibana-serverless-release-1/builds/72
(visible only if you're a
member of @ elastic/kibana-release-operators) 

Missing features compared to the git action:

- [x] Slack notification about the started deploy
- [x] full "useful links" section

Missing features:
- [x] there's a bit of useful context that should be integrated to the
display of the FTR results (*)
- [x] skip listing and analysis if a commit sha is passed in env


(*) - Currently, we display the next FTR test suite that ran after the
merge of the PR. However, the next FTR that will contain the changes,
and show useful info related to the changeset is ONLY in the FTR that's
ran after the first successful onMerge after the merge commit. Meaning:
if main is failing when the change is merged, an FTR suite won't pick up
the change right after.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: Thomas Watson <watson@elastic.co>
2023-12-01 07:10:52 -07:00
Jon
6fceda6351
Revert "Update page for missing Short URL (#171679)" (#172334)
This reverts commit e6f3f06f82.

See
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/3610#018c22ec-6c1e-4b63-92de-58d63d688f94
2023-11-30 19:40:45 -06:00
Tim Sullivan
e6f3f06f82
Update page for missing Short URL (#171679)
## Summary

Closes https://github.com/elastic/kibana/issues/169935

### Screenshots
<details>
<summary>Before</summary>
<img width="1259" alt="image"
src="dbc91683-4088-48df-a402-1432615a2ff4">
</details>

<details>
<summary>After</summary>
<img width="1260" alt="image"
src="a1efabba-9402-4e97-935e-93656069c650">
</details>


### Testing

1. Create a simple dashboard
2. Use the Share > Short URL feature to create a short link to the
dashboard.
3. Copy the shortened URL link to the clipboard, create a browser
bookmark using the link.
4. Navigate to Saved Objects Management and delete the backing saved
object of the short link
5. Click the new bookmark to try to open the shortened URL
6. Land on this new page

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-30 14:22:46 -07:00
Jonathan Budzenski
042974fda8 Revert "[Security]Grouping steps/functional scripts (#172151)"
This reverts commit c96b63c5a2.
2023-11-30 12:57:26 -06:00
dkirchan
c96b63c5a2
[Security]Grouping steps/functional scripts (#172151)
## Summary

This PR is reducing the amount of functional test scripts for buildkite.

Each different target and team was having an identical cypress init
script with chaning only:
- message
- package.json target
- working directory
- job name

With this PR a new unified way to trigger cypress tests, is introduced,
in order to reduce maintenance cost and improve consistency and
readability.

All Cypress test executions are going through the script:
`.buildkite/scripts/steps/functional/security_cypress_exec.sh`

In the buildkite `*.yml` files all we need to do is target this script
with the command and then pass env params for the above mentioned
variables. E.g:

<img width="566" alt="Screenshot 2023-11-29 at 6 17 35 PM"
src="55475300-7e98-45fa-a3e9-18f4ffdeb5c2">


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
2023-11-30 14:34:24 +02:00
Jon
0796976a27
[build] Rename ubi9 image to ubi (#171424)
Future ubi image names will be version agnostic.  Removal of ubi8 TBD.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-11-29 11:50:22 -06:00
Alex Szabo
becae464a4
[Ops] Fix deployment/project purging logic (#172082)
## Summary
We've noticed that on certain PRs, the deployments are cleaned up right
after they're creating, with the indication that it was stale.
(https://github.com/elastic/kibana/pull/170579 - cleaned up in
https://buildkite.com/elastic/kibana-purge-cloud-deployments/builds/15440#018c1605-144b-4db5-b29a-e3af3c9b1c70)

Turns out, the logic that acquires the last commit's timestamp is
relying on the `gh pr` api, and commits are limited there to 100. It's
easier to look at the pr's `updatedAt` value.

- change purge logic to be based on the PRs updatedAt label instead of
the max-100th commit's timestamp

See: https://elastic.slack.com/archives/C5UDAFZQU/p1701093461763989
2023-11-29 14:08:24 +01:00
Brad White
57118a3e6e
Fix Project Build and Deploy exit status (#172113)
## Summary

The last line of the script will evaluate to false if the security label
is not set, which results in the exit status being reported as 1
(failure), but the project is actually deployed properly.


[Example](https://buildkite.com/elastic/kibana-pull-request/builds/179784#018c17c0-5dd6-4e1f-b6ef-73fa50e1de74/4142-4148)
2023-11-28 17:32:01 -08:00
David Sánchez
1823d94240
[Security Solution][Endpoint] New enroll endpoint host function CI specific for Cypress tests to use cached agent files (#171399)
## Summary

In order to avoid downloading the elastic agent installer file on each
Cypress test, we have introduced a new method CI specific that will
cache elastic agent files and reuse it across all tests.

Old code about `if CI` conditions will be removed in a follow up pr.

It also introduces a CLI script to download a specific version of
elastic agent using the existing methods in place.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-11-28 17:27:25 +01:00
Gloria Hornero
87e192ff23
[Security Solution] Indent fix (#172070)
Co-authored-by: Georgii Gorbachev <banderror@gmail.com>
2023-11-28 09:11:31 -07:00
Wafaa Nasr
a4ed14bec8
[Security Solution][API testing] Move and restructures Lists APIS (#171992)
## Summary

Following the initial work in this
https://github.com/elastic/kibana/pull/166755
- Addresses part of https://github.com/elastic/kibana/issues/151902 for
List APIs tests
- Added a new folder under the `security_solution_api_integration`
called `lists_and_exception_lists` to hold the lists and exception lists
tests, and split the `List` APIs into two groups since the execution
time in Serverless was close to 30 mins
- Modified the
[x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts](https://github.com/elastic/kibana/pull/171992/files#diff-4e3545fdeb8c8d9467cfa1c4aa88194e189193a92fa6f1cf5f859b1ef1beb45c),
[x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts](https://github.com/elastic/kibana/pull/171992/files#diff-c3cc18faf07aab86e307185d41599c3596a3f8b360d3e4829591afa148283238)
,
[x-pack/plugins/lists/common/schemas/response/list_item_schema.mock.ts](https://github.com/elastic/kibana/pull/171992/files#diff-608579ca5e65da74f41319a58d81ab12cc3d79d389b087806c7b74949fbc6cc3),
[x-pack/plugins/lists/common/schemas/response/list_schema.mock.ts](https://github.com/elastic/kibana/pull/171992/files#diff-efc64eb35937a8da28fc982c527253c0923650ae4163d4bbc203d3ebc2949835)
to accept `elastic user` input because it changes in ESS and Serverless
- Deleted the `x-pack/test/lists_api_integration` folder
- Moved the utility files associated with Basic tests to the new
directory `security_solution_api_integration`. Files not actively used
in the previous folder were moved, while duplicate files remained in
their original positions.
- Updated the below files imports from the old `lists_api_integration`
folder to the new `lists_and_exception_lists`

    ```
      lists_api_integration/  
        - exceptions/operators_data_types/date_numeric_types/date.ts
        - exceptions/operators_data_types/date_numeric_types/double.ts
        - exceptions/operators_data_types/date_numeric_types/float.ts 
        - exceptions/operators_data_types/date_numeric_types/integer.ts
        - exceptions/operators_data_types/ips/ip.ts
        - exceptions/operators_data_types/ips/ip_array.ts
        - exceptions/operators_data_types/keyword/keyword.ts
        - exceptions/operators_data_types/keyword/keyword_array.ts
        - exceptions/operators_data_types/long/long.ts
        - exceptions/operators_data_types/text/text.ts
        - exceptions/operators_data_types/text/text_array.ts
        - exceptions/workflows/create_endpoint_exceptions.ts
        - exceptions/workflows/create_rule_exceptions.ts
        - exceptions/workflows/find_rule_exception_references.ts
        - exceptions/workflows/role_based_add_edit_comments.ts
        - exceptions/workflows/role_based_rule_exceptions_workflows.ts
        - exceptions/workflows/rule_exception_synchronizations.ts
        - rule_execution_logic/execution_logic/esql.ts
        - rule_execution_logic/execution_logic/machine_learning.ts
        - rule_execution_logic/execution_logic/new_terms.ts
        - rule_execution_logic/execution_logic/query.ts
        - telemetry/task_based/all_types.ts
        - telemetry/task_based/detection_rules.ts
        - telemetry/task_based/security_lists.ts
     ```
     ```
These files should be moved too soon to the new `lists_api_integration`
        detection_engine_api_integration/security_and_spaces/group10
            - import_export_rules.ts 
            - import_rules.ts
            - perform_bulk_actions   
     ```

- Updated the below files imports to the
`ftr_provider_context_with_spaces.d.ts`
` - risk_engine/risk_scoring_task/task_execution_nondefault_spaces.ts`

- The QA phase concluded with all tests passing successfully. 🟢  

- Updated the CodeOwner file for the newly moved tests

- Add a new util file to `deleteAllExceptions` under the old
`detection_engine_api` folder since the Rule management related-tests
are still need to be moved over to the new folder

- Old/new group details, decisions, and execution time are mentioned in
this
[document](https://docs.google.com/document/d/1CRFfDWMzw3ob03euWIvT4-IoiLXjoiPWI8mTBqP4Zks/edit)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-28 16:40:09 +01:00
Jonathan Budzenski
177dbd1da5 Revert "[Security Solution] Specific Cypress executions for Rule Management team (#171868)"
This reverts commit 242cb6f1d5.
2023-11-28 08:00:28 -06:00
Gloria Hornero
242cb6f1d5
[Security Solution] Specific Cypress executions for Rule Management team (#171868)
Co-authored-by: Georgii Gorbachev <banderror@gmail.com>
2023-11-28 14:35:17 +01:00
Dzmitry Lemechko
0c49603883
[ftr] split x-pack accessibility config in 3 groups (#171186)
## Summary

Splitting long running FTR config:

<img width="1573" alt="image"
src="160b97b4-6468-4c2f-9827-17f6bb9a742a">



After split:

| Config Path | Runtime |
| ------------- | ------------- |
| x-pack/test/accessibility/apps/group1/config.ts |  10m 15s  |
| x-pack/test/accessibility/apps/group2/config.ts | 14m 31s |
| x-pack/test/accessibility/apps/group3/config.ts | 11m 30s  |

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-11-28 05:35:43 -07:00
Thomas Watson
f8e992393a
[Serverless] Improve stability of prod quality gate SLO check (#171917) 2023-11-27 13:50:26 -07:00
Alex Szabo
750989beb9
[Ops] Trim long stat blocks (#171997)
## Summary
Some post-build steps are failing because sometimes we're outgrowing the
buildkite metadata limits.

This PR will prevent upload of a text block too big, instead it will try
to gesture towards the build for more info.
2023-11-27 11:43:03 -07:00
Wafaa Nasr
5fa20cc3a7
[Security Solution][API testing] Move and restructures Basic detection engine tests (#171531)
## Summary

Following the initial work in this
https://github.com/elastic/kibana/pull/166755
- Addresses part of https://github.com/elastic/kibana/issues/151902 for
basic detection engine-related tests
- Introduced a new license folder to hold the `Basic` Ess tests and the
`Essentials` Serverless tests, is called `basic_essentials_license`
- Added new base configurations files for
`serverless/config.base.essentials` and `ess/config.base.basic`
- Moved the utility files associated with Basic tests to the new
directory `security_solution_api_integration`. Files not actively used
in the previous folder were moved, while duplicate files remained in
their original positions.
- Updated the CodeOwner file for the newly moved tests
- Old/new group details, decisions, and execution time are mentioned in
this
[document](https://docs.google.com/document/d/1CRFfDWMzw3ob03euWIvT4-IoiLXjoiPWI8mTBqP4Zks/edit)
- The **Privileges** Tests are skipped in Serverless now until the FTR
Roles [PR](https://github.com/elastic/kibana/pull/170131) gets merged

| Action | File | New Path  |
|--------|------|----------|
| Moved|basic/create_rules|
basic_essentials_license/detection_engine/rules/create_rules|
| Moved|basic/create_rules|
basic_essentials_license/detection_engine/rules/create_ml_rules_privileges|
| Moved|basic/create_rules|
basic_essentials_license/detection_engine/alerts/open_close_alerts|
| Moved|basic/create_rules|
basic_essentials_license/detection_engine/alerts/query_alerts_backword_compatibility|
| Moved|basic/create_rules|
basic_essentials_license/detection_engine/alerts/query_alerts|
2023-11-23 09:03:50 +01:00
Brad White
17ed0748e8
fix/redact axios headers (#171803)
Fix token things

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-11-22 22:12:33 +00:00
Kurt
66019dfe05
Adding user profiles tests for regular and serverless (#171554)
## Summary

Adding functional tests for User Profiles and Dark Mode


## Flaky Test Runner for new tests

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4034
🟢
2023-11-22 10:43:03 -05:00
Wafaa Nasr
f3851c5934
[Security Solution][API testing] Rename the commands to be consistent with the query and add the new ones (#171532)
## Summary


Rename the commands to be consistent with the query and add the new ones
2023-11-22 11:05:55 +01:00
Jon
07df5966b2
Revert "Revert "re-enable kme pipeline for testing (#171451)"" (#171694)
I pushed this revert up initially via
e79ca5e9d6 while debugging an issue with
CI waiting for agents. This was not the root cause and can be
unreverted.
2023-11-21 22:13:27 +00:00
Brad White
1919c87b90
Remove CI Composite Storybook (#171258)
## Summary
Closes #160803

This PR removes the `CI Composite` story because it has been broken
since at least ac23dce29f (and possibly
since b862a6c181). The functionality is
covered by the generated `index.html` in
dda4498fee/.buildkite/scripts/steps/storybooks/build_and_upload.ts (L105-L120)

To fix the composite story requires generating `stories.json` for every
storybook, which requires migrating the repo off the deprecated
`storiesOf` API. That task is quite extensive and would be better
handled alongside an upgrade to Storybook 7.x
2023-11-21 14:59:39 -07:00
Jonathan Budzenski
e79ca5e9d6 Revert "re-enable kme pipeline for testing (#171451)"
This reverts commit c0978dbe1b.
2023-11-21 13:13:55 -06:00
Jonathan Budzenski
f51e6cd248 Revert "Upgrade to Node.js 20 (#162696)"
This reverts commit 029b3ba81d.
2023-11-21 07:15:23 -06:00
Thomas Watson
029b3ba81d
Upgrade to Node.js 20 (#162696)
Co-authored-by: Jonathan Budzenski <jon@elastic.co>
2023-11-20 21:47:48 +01:00
Alex Szabo
c0978dbe1b
re-enable kme pipeline for testing (#171451)
## Summary
Re-enables the test pipeline used for testing the migration to the
elastic-wide buildkite setup.

To avoid having the previous problem
(https://github.com/elastic/kibana/pull/169238) I disabled the
triggering from comments, and changed the check context (even if it
runs, it shouldn't mess with the required checks).
2023-11-20 11:42:18 +01:00
Nathan L Smith
a16e12fe5a
Remove observability manual testing gate for serverless (#171449)
We've decided to remove the quality gate for observability at this time.
2023-11-20 10:28:09 +00:00
Davis McPhee
921067c95b
[Data Discovery] Run Data Discovery functional tests in Serverless (#164656)
## Summary

This PR copies the Data Discovery functional tests to `test_serverless`
and adds support for running them against each of the project types.

Part of #162347.

Flaky test runs:
- x300:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3977

### Checklist

- [ ] ~Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-17 00:35:19 -04:00
Dzmitry Lemechko
44fa330086
[ftr] split alerting api-integration group2 (#171105)
## Summary

Splitting some of the long running Alerting FTR configs:

| Config Path | Runtime |
| ------------- | ------------- |
|
x-pack/test/alerting_api_integration/security_and_spaces/group2/config.ts
| 36m 55s |
|
x-pack/test/alerting_api_integration/security_and_spaces/group2/config_non_dedicated_task_runner.ts
| 36m 58s |

<img width="1576" alt="image"
src="c73374c6-d769-4536-a277-5a2a38b83fa4">

After split:

| Config Path | Runtime |
| ------------- | ------------- |
|
x-pack/test/alerting_api_integration/security_and_spaces/group2/config.ts
| 22m 59s |
|
x-pack/test/alerting_api_integration/security_and_spaces/group2/config_non_dedicated_task_runner.ts
| 23m 15s |
|
x-pack/test/alerting_api_integration/security_and_spaces/group4/config.ts
| 22m 26s |
|
x-pack/test/alerting_api_integration/security_and_spaces/group4/config_non_dedicated_task_runner.ts
| 21m 36s |
2023-11-16 17:59:35 -05:00
Wafaa Nasr
53a37f0415
[Security Solution][API testing] Move and restructures Telemetry logic (#171159)
## Summary

Following the initial work in this
https://github.com/elastic/kibana/pull/166755
- Addresses part of https://github.com/elastic/kibana/issues/151902 for
Telemetry
- Moved the utility files associated with telemetry to the new directory
`security_solution_api_integration`. Files not actively used in the
previous folder were moved, while duplicate files remained in their
original positions.
- Updated the CodeOwner file for the newly moved tests
- Old/new group details, decisions, and execution time are mentioned in
this
[document](https://docs.google.com/document/d/1CRFfDWMzw3ob03euWIvT4-IoiLXjoiPWI8mTBqP4Zks/edit)

| Action | File | New Path if moved |
|--------|------|----------|
| Delete| security_and_spaces/group4| - |
|
Move|detection_engine_api_integration/security_and_spaces/group4|detections_response/default_license/telemetry/keyword_family|
2023-11-16 19:12:16 +01:00
Wafaa Nasr
7c80161b05
[Security Solution][API testing] Move and restructures Privileges related tests and Action Throttle (#171397)
## Summary

Following the initial work in this
https://github.com/elastic/kibana/pull/166755
- Addresses part of https://github.com/elastic/kibana/issues/151902 for
Privileges related tests and Action Throttle
- Moved the utility files associated with telemetry to the new directory
`security_solution_api_integration`. Files not actively used in the
previous folder were moved, while duplicate files remained in their
original positions.
- Updated the CodeOwner file for the newly moved tests
- Old/new group details, decisions, and execution time are mentioned in
this
[document](https://docs.google.com/document/d/1CRFfDWMzw3ob03euWIvT4-IoiLXjoiPWI8mTBqP4Zks/edit)
- The **Privileges** Tests are skipped in Serverless now until the FTR
Roles [PR](https://github.com/elastic/kibana/pull/170131) gets merged

| Action | File | New Path if moved |
|--------|------|----------|
| Delete| security_and_spaces/group4| - |
|
Move|detection_engine_api_integration/security_and_spaces/group10/throttle|detections_response/default_license/action/throttle|
|
Move|detection_engine_api_integration/security_and_spaces/group1/check_privileges|detections_response/default_license/actions/check_privileges|
|
Move|detection_engine_api_integration/security_and_spaces/group10/read_privileges|detections_response/default_license/user_roles/read_privileges|
2023-11-16 17:37:21 +01:00
Yngrid Coello
84fcf949e9
[Dataset quality] Adding datastreams stats end point (#170838)
Related to https://github.com/elastic/kibana/issues/169759.

## Summary
The Data streams stats endpoint can be queried like so (example with all
parameters):

`GET
/internal/dataset_quality/data_streams/stats?type=logs&sortOrder=asc&datasetQuery=nginx`

### Notes/questions
Our intial idea was to place this endpoint within fleet, after some
discussions we decided to place the endpoint inside our plugin
`dataset_quality`.

- ~~Is `/epm` still the best place to include this new api?~~
    We decided to place the new endpoint in `dataset_quality` plugin.
- ~~Should we include an `uncategorisedOnly` option as part of the Data
Streams Stats endpoint as we do for [Data streams
endpoint](c1681c8d49/x-pack/plugins/fleet/server/types/rest_spec/epm.ts (L62))?
We are not planning to have the a filter for this but it could favor
consistency in this area.~~
uncategorizedOnly is not part of the new endpoint although it's easily
extensible to include such parameter.
- ~~We are modifying
`x-pack/plugins/fleet/server/services/epm/data_streams/get.ts` to
include a property for extendedResults, as of now this method only
returns a list of objects that include only the name. We would like to
extend this method to include also information related to the `package`.
Is this the right approach? should we create a new method just for doing
this? Also, this is the method we are using for `GET
/api/fleet/epm/data_streams` since this new property
(`extendedResponse`) is false by default the api is not being directly
affected, but should we include this new param as part of the api
params?~~
We are not working with fleet api anymore, instead we are using an
internal route.
- ~~How does `GetEpmDataStreamsStatsResponse` looks like? is this
reponse type aligned with fleet responses?~~
- ~~We have configured `fleetAuthz: READ_PACKAGE_INFO_AUTHZ` for this
new endpoint, would it be possible to not have this restriction and use
the internal user when querying elastic search?~~

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-16 08:57:52 -07:00
Wafaa Nasr
2b136a2d77
[Security Solution][API testing] Move and restructures Rule execution logic (#170765)
## Summary

Following the initial work in this
https://github.com/elastic/kibana/pull/166755
 
- Addresses part of https://github.com/elastic/kibana/issues/151902 for
rule execution logic

- Moved the utility files associated with rule execution logic to the
new directory `security_solution_api_integration`. Files not actively
used in the previous folder were moved, while duplicate files remained
in their original positions.
- Updated the CodeOwner file for the newly moved tests

- Old/new group details, decisions, and execution time are mentioned in
this[document](https://docs.google.com/document/d/1CRFfDWMzw3ob03euWIvT4-IoiLXjoiPWI8mTBqP4Zks/edit)
- Added new `Alert` archive for version `8.8.0`

- Resolved the issue with the `query.ts` test where the execution logic
is executed last, encompassing the "query" test because it was unloading
the alerts document and led to failures in subsequent tests.

- For `Alert As Data` in **Serverless** the alert ancestor will be a
data-stream however in **ESS** will be
`.internal.alerts-security.alerts-default-000001'`


| Action | File | New Path if moved |
|--------|------|----------|
| Delete| security_and_spaces/rule_execution_logic| - |
| Delete|security_and_spaces/group5  | - |
|
Move|detection_engine_api_integration/security_and_spaces/group5|detections_response/default_license/rule_execution_logic/keyword_family|
|
Move|detection_engine_api_integration/security_and_spaces/rule_execution_logic|
detections_response/default_license/rule_execution_logic/execution_logic
|
| Move
|detection_engine_api_integration/security_and_spaces/group1/ignore_fields|
detections_response/default_license/rule_execution_logic/ignore_fields.ts|
|
Move|detection_engine_api_integration/security_and_spaces/group1/runtime|
detections_response/default_license/rule_execution_logic/runtime.ts |
|
Move|detection_engine_api_integration/security_and_spaces/group1/timestamps|
detections_response/default_license/rule_execution_logic/timestamps.ts|

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-16 16:14:02 +01:00
Giorgos Bamparopoulos
26b62c9e2c
[Observability] Change the ping to the @apm-ui-team for the Observability manual quality gate (#171199)
Adding ping for the APM UI team temporarily until we switch to Infra &
Services team.
2023-11-15 09:40:51 +00:00
Jonathan Budzenski
3960204f91 disable failing jest config (#171256) 2023-11-14 16:29:01 -06:00
Yara Tercero
7728c8440f
[Security Solution][DE][FTR] Split FTRs to smaller runtime groups (#171148)
## Summary

This PR aims to split a long running FTR group into smaller ones that
should run under ~15min.
2023-11-14 13:14:13 -08:00
Thomas Watson
b1e0d90cdb
[QG] Improve comments in quality gate pipelines (#170921) 2023-11-14 12:09:55 +01:00
mohamedhamed-ahmed
65e65a834e
[Dataset quality] Creating initial plugin (#171009)
Related to https://github.com/elastic/kibana/issues/169759.

## Summary

This PR creates the initial plugin for Dataset Quality.
The plugin has the basic boilerplate that allows us to continue working
on the UI and Server sides in parallel.

Further configs are to be added along with upcoming commits like:
1. Storybook 
2. FTR configs

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-10 16:02:12 +01:00
Alex Szabo
45a160b805
[Ops] Fix cache build (#171019)
## Summary
There was a small change introduced in
https://github.com/elastic/kibana/pull/170918 that exposes a custom env
var, that started to fail on cache builds on CI
(https://buildkite.com/elastic/kibana-agent-packer-cache/builds/474#018bb945-4910-4f5e-b78b-f020574c5b89).
Apparently the BUILDKITE_BRANCH is not available in the script, it's
because it's the same build script called not from buildkite, but
through packer, which probably doesn't forward all the environment
variables.

In this case, we can probably default to `""` and let the script ignore
that section where this variable is exported, because this export is
probably not meant for the cache build. However, we should keep this in
mind, that the packer/cache build is invoking some scripts with a
different env context (might lead to different results if we depend on
some of these vars).

chore: use an empty default when missing BUILDKITE_BRANCH to prevent
error
2023-11-10 07:28:00 -07:00
Juan Pablo Djeredjian
4b28ec4397
[Security Solution] Migrate Prebuilt rules API integration tests to security_solution_api_integration folder (#169951)
Addresses partially: https://github.com/elastic/kibana/issues/151902

## Summary

- Migrates Prebuilt rules-related API integration tests to
`security_solution_api_integration` folder.
- Moves tests from
`x-pack/test/detection_engine_api_integration/security_and_spaces` into
`x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license`.
    - PR moves following folders:
        - `/prebuilt_rules`
        - `/bundled_prebuilt_rules_package`
        - `/large_prebuilt_rules_package`
        - `/update_prebuilt_rules_package`
-  Duplicates or completely moves needed utils into:
-
`x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules`,
depending if they are no longer used in the original folder or they
still are in the remaining test (should be moved shortly as well)
- All tests run on both **ESS** and **Serverless**

## Flaky test runner

- [ ]
[`/prebuilt_rules`](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3888)
🟢
- [ ]
[`/bundled_prebuilt_rules_package`](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3916)🟢
- [ ]
[`/large_prebuilt_rules_package`](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3917)🟢
- [ ]
[`/update_prebuilt_rules_package`](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3920)🟢

[Link to all for
PR](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds?branch=refs%2Fpull%2F169951%2Fhead)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-10 09:42:18 +01:00
Tiago Costa
afd020c63d
chore(NA): exports target branch when using a merge queue system at buildkite env script (#170918)
This PR adds the ability for us to have an env var on buildkite to allow
us to understand what is the final end target when running inside a
merge queue environment. It will be useful to redirect a couple of
dependent scripts that will start running inside the merge queue
environment once we activate it again

---------

Co-authored-by: Jon <jon@budzenski.me>
2023-11-10 00:16:29 +00:00
Jon
f92dbb76c7
[ci/artifacts] Fix docker context args (#170944)
I incorrectly removed this previously, not finding any arguments
missing. There was one - the `--release` flag, used to remove snapshot
from the filename.

https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/3472
~https://buildkite.com/elastic/kibana-artifacts-staging/builds/2337~
I'll verify on the backport, the failure here is expected.
2023-11-09 15:16:35 -06:00
Jon
ce33484da2
[ci/cloud-deploy] Skip CDN assets build (#170959)
The cloud deploy image is created using a resume build, relying on an
existing kibana.tar.gz. The source files needed to build CDN assets are
not available and this step is not needed.
2023-11-09 09:18:58 -07:00
dkirchan
397061aebc
FTR Api Integration with the Second Security Quality Gate (#169422)
## Summary

FTR Api Integration tests for Security Solution are now integrated with
the Second Security Quality Gate. The tests are running in 5 scripts in
`x-pack/test/security_solution_api_integration/package.json`.
Each different script is creating its own task in buildkite so 5 scripts
could be running in parallel, depending on the agents availability,
however they all target the same environment for this first integration.

Future needs: 
- The FTR runner serverless is needed to be introduced. 


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Jon <jon@elastic.co>
2023-11-09 08:27:02 -07:00
Gergő Ábrahám
60c64906f1
[Defend Workflows] Enable FTR API tests for serverless using tags (#170418)
## Summary

With a similar solution as #169946, almost all of our FTR API tests
(`x-pack/test/security_solution_endpoint_api_int/`) can now run against
serverless, using `suiteTags` under the hood.

## Usage
```ts
describe('This is the suite.', function() {
    // a custom function wraps the `this.tags()` function to provide type safety
    targetTags(this, ['@ess', '@serverless', '@skipInServerless']);
})
```

> **Note**
> Only `describe()` blocks can be tagged.

## Changes:

- serverless config is added for endpoint FTR API tests:
`x-pack/test/security_solution_endpoint_api_int/serverless.config.ts`
- roles are created only when running against ESS. when running against
serverless, a subset of users/roles already exist (see [this
list](https://github.com/elastic/kibana/pull/170418/files#diff-5aaeaeaedad4321151d5388437084b27f271a6254e95f0352c9a10c3126eddc8R54))
- tests that use roles that doesn't exist on serverless
(`artifact_read_privileges`, `hunter`) are therefore skipped against
serverless
2023-11-09 15:32:10 +01:00
Wafaa Nasr
eeaf815d23
[Security Solution][API testing] Move and restructures Risk Engine tests (#170530)
## Summary

Following the initial work in this
https://github.com/elastic/kibana/pull/166755
- Addresses part of https://github.com/elastic/kibana/issues/151902 for
Entity Analytics/Risk Engine
- Introduced new folders called `entity_analytics/risk_engine` under
`security_solution_api_integration`
- Moved the utility files associated with risk_engine to the new
directory `security_solution_api_integration`. Files that were not
actively used in the previous folder were moved, while any duplicate
files remained in their original positions.
- Updated the CodeOwner file for the newly moved tests
- Old / new groups details and execution time
[document](https://docs.google.com/document/d/1CRFfDWMzw3ob03euWIvT4-IoiLXjoiPWI8mTBqP4Zks/edit)


| Action | File | New Path if moved |
|--------|------|----------|
| Moved|
group10/risk_engine/init_and_status_apis|/entity_analytics/default_license/risk_engine/init_and_status_apis.ts
|
| Moved|
group10/risk_engine/risk_score_calculation|/entity_analytics/default_license/risk_engine/risk_score_calculation.ts
|
| Moved|
group10/risk_engine/risk_score_preview|/entity_analytics/default_license/risk_engine/risk_score_preview.ts
|
| Moved|
group10/risk_engine/risk_scoring_task_execution|/entity_analytics/default_license/risk_engine/risk_scoring_task_execution.ts
|
| Moved|
group10/risk_engine/telemetry_usage|/entity_analytics/default_license/risk_engine/telemetry_usage.ts
|
| Moved| group10/risk_engine/utils|entity_analytics/utils/risk_engine.ts
|
| Moved| utils/get_stats|entity_analytics/utils/get_risk_engine_stats.ts
|

Tests skipped on main:


https://github.com/elastic/kibana/blob/main/x-pack/test/detection_engine_api_integration/security_and_spaces/group10/risk_engine/init_and_status_apis.ts#L363

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nikita Khristinin <nkhristinin@gmail.com>
2023-11-09 14:52:45 +01:00
Jon
82953b5d27
[ci] Support multiple project deployments (#170783) 2023-11-09 06:48:45 -06:00
Alex Szabo
c29ce0d27b
[Ops] Create emergency serverless release testing pipeline (#170863)
## Summary
This pipeline job runs sanity checks for changes on a one-off branch
(such as a serverless emergency-release) and creates serverless docker
images required for deployment.

Closes: https://github.com/elastic/kibana/issues/170828

Pipeline created by:
https://github.com/elastic/kibana-buildkite/pull/130
2023-11-09 10:53:35 +01:00
dkirchan
55d8ea45ac
[Security][Fix] Fixed wrong path file invocation error (#170881)
## Summary

An error occured in our pipeline after merging a wrong filepath. This PR
fixes this error defining the correct path.


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-11-08 17:10:33 +01:00