Commit graph

1541 commits

Author SHA1 Message Date
Tre
4ad1586148
[Ownership] Fixup wrong assignment (#195462)
## Summary

Fixup line broken by this
[merge](https://github.com/elastic/kibana/pull/195272).

Contributes to: https://github.com/elastic/kibana/issues/194815
2024-10-08 21:23:33 +02:00
Kyle Pollich
da88bb2c01
[Fleet] Update GitHub action to route Fleet issues to new project (#195417)
## Summary

The UI & Integrations team is moving to a new GitHub project. This PR
updates our automation to automatically place issues in the new project
instead of the old one.
2024-10-08 10:37:04 -04:00
Victor Martinez
a7be9cf44f
github-actions: use GH app to deploy my kibana PRs (#195354) 2024-10-08 14:35:38 +02:00
Tre
cfc8aaf9cb
[Codeowners] Fix broken line (#195357)
## Summary

Last merge to this file included a broken line, mistakenly.
This PR fixes that.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-10-08 12:36:13 +02:00
Tre
bc4b01ca70
[FTR][Ownership] Assign the rest of test_serverless (#195272)
## Summary

Contributes to: https://github.com/elastic/kibana/issues/194815

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-10-08 09:05:58 +01:00
Victor Martinez
94aa915169
github-actions: notify github commands for all the observability code (#195219) 2024-10-07 22:19:08 +02:00
Tre
ad986d4c26
[FTR][Ownership] Assign some test files in x-pack/test_serverless to a small group of owners (#194819)
## Summary

### Ownership Assigned
- Various files for my team.
- `x-pack/test_serverless/functional/test_suites/security/cypress` to
security solution 🤞🏾
-
`/x-pack/test_serverless/functional/page_objects/svl_ingest_pipelines.ts`
to search team due to [this
pr](https://github.com/elastic/kibana/pull/180422).
- From this pr, I decided to add more ownership based on the contents.
   
-
`/x-pack/test_serverless/functional/page_objects/svl_management_page.ts`
from [this pr](https://github.com/elastic/kibana/pull/176200/files)
- From this pr, I decided to add more ownership based on the contents.
- Also, as I was in the "security" realm so to speak, I started adding
more files for the security solution team
-
`x-pack/test_serverless/functional/test_suites/security/screenshot_creation/index.ts`
to response ops due to this
[pr](https://github.com/elastic/kibana/pull/174556)
    

Contributes to: https://github.com/elastic/kibana/issues/194815

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-10-07 15:24:34 +01:00
Pierre Gayvallet
1ab1add68e
[KB] create @kbn/product-doc-artifact-builder package (#193847)
## Summary

Related https://github.com/elastic/kibana/issues/193473

Add initial implementation of the knowledge base artifact builder. This
PR only introduces the builder script, it doesn't do anything about
automation.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-07 07:21:09 -05:00
Victor Martinez
103acda747
github-actions: undeploy observability deployments using ephemeral GH tokens (#195215) 2024-10-07 14:14:50 +02:00
Rickyanto Ang
0b92c268f9
[Cloud Security] Vulnerabilities Preview & Refactor CSP Plugin PHASE 2 (#193638)
In an attempt to make Reviewing easier and more accurate, the
implementation of Vulnerabilities on Host.name flyout in Alerts Page
will be split into 2 Phases

Phase 1: Move Functions, Utils or Helpers, Hooks, constants to Package
Phase 2: Implementing the feature

This is Phase 2
<img width="1465" alt="Screenshot 2024-09-20 at 5 33 01 PM"
src="https://github.com/user-attachments/assets/cabe2f3a-d35a-4825-9fe5-61fe2d570328">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Maxim Kholod <maxim.kholod@elastic.co>
2024-10-04 12:28:18 -07:00
Tre
446750cb9d
[FTR][Ownership] Assign Ownership to Auditbeat ES Archives (#194118)
## Summary

Modify code owner declarations for
`x-pack/test/functional/es_archives/auditbeat/**/*` in
.github/CODEOWNERS

### For reviewers

To verify this pr, you can use the `scripts/get_owners_for_file.js`
script
E.g:
```
 node scripts/get_owners_for_file.js --file x-pack/test/functional/es_archives/auditbeat/users # Or any other file
```

#### Notes
All of these are a best guess effort. The more help from the dev teams,
the more accurate this will be for reporting in the future.

Contributes to: https://github.com/elastic/kibana/issues/192979

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-03 17:29:18 +01:00
Yan Savitski
c5aa739914
[Search][Onboarding] api-key plugin (#191926)
## Summary
Kibana plugin that helps manage the session for the api-key that
provides two exports:
- React custom hook to read the api-key stored in session. This hook
should return the api-key if it exists, otherwise null.
- Component to present either the api key in storage or action to create
api key and store into sessionStorage after callback.
<img width="1255" alt="Screenshot 2024-09-27 at 20 52 52"
src="https://github.com/user-attachments/assets/dc5bcd39-7fe6-433c-8aaa-ad3578a68b62">
<img width="1248" alt="Screenshot 2024-09-27 at 20 52 39"
src="https://github.com/user-attachments/assets/d760c163-9017-4f57-ba1a-38ee8ee21534">
<img width="676" alt="Screenshot 2024-09-27 at 20 52 28"
src="https://github.com/user-attachments/assets/e908d20a-7e0c-4f3b-9ea2-8e2d1a74c9eb">
2024-10-02 09:45:20 +01:00
Shahzad
82d0b008cd
[Synthetics] Improve synthetics alerting (#186585)
## Summary

Fixes https://github.com/elastic/kibana/issues/175298

Improve synthetics alerting !!

User will be able to create custom synthetics status alert by defining
three kind of criteria

### Monitor is down over last consective checks with threshold

<img width="639" alt="image"
src="390da238-f7f2-4eb0-9606-3279b3199fdf">

### From Locations threshold

Will be considered down only when from defined number of locations

<img width="618" alt="image"
src="24741a10-0880-4247-9048-8ce03df25bf5">


### Over time with checks threshold just like uptime custom status alert

<img width="631" alt="image"
src="64e1c808-8d4b-4dd0-b794-eb7f4e5d1e6b">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
Co-authored-by: Justin Kambic <jk@elastic.co>
2024-10-01 18:48:39 +02:00
Elena Shostak
12ea569eb9
Added 8.x to CodeQL scan (#194014)
## Summary

Added `8.x` to CodeQL scan


__Closes: https://github.com/elastic/kibana/issues/194000__

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-01 11:23:04 +02:00
elastic-renovate-prod[bot]
c5d75b9857
Update actions/checkout action to v4.2.0 (main) (#194078)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/checkout](https://togithub.com/actions/checkout) | action |
minor | `v4.1.7` -> `v4.2.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>actions/checkout (actions/checkout)</summary>

###
[`v4.2.0`](https://togithub.com/actions/checkout/blob/HEAD/CHANGELOG.md#v420)

[Compare
Source](https://togithub.com/actions/checkout/compare/v4.1.7...v4.2.0)

- Add Ref and Commit outputs by
[@&#8203;lucacome](https://togithub.com/lucacome) in
[https://github.com/actions/checkout/pull/1180](https://togithub.com/actions/checkout/pull/1180)
- Dependency updates by
[@&#8203;dependabot-](https://togithub.com/dependabot-)
[https://github.com/actions/checkout/pull/1777](https://togithub.com/actions/checkout/pull/1777),
[https://github.com/actions/checkout/pull/1872](https://togithub.com/actions/checkout/pull/1872)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOk9wZXJhdGlvbnMiLCJiYWNrcG9ydDphbGwtb3BlbiIsInJlbGVhc2Vfbm90ZTpza2lwIl19-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2024-09-30 18:51:20 -05:00
Sandra G
6ed731cad5
[Obs AI Assistant] Serverless API integration tests (#192219)
Tests for serverless

- copies over and modifies all tests from stateful to work in
serverless. ~~deployment agnostic tests do not yet support enterprise
license for stateful, so are tests don't yet qualify as being deployment
agnostic~~. Given how difficult it is to see differences from the
stateful tests, I've added PR comments where I've changed something that
might be of interest.
- changes to `createObservabilityAIAssistantApiClient` to use supertest
without basic auth and accept headers for serverless and use roles
- removes creating persisted users when tests start and [use
roles](https://github.com/elastic/kibana/blob/main/x-pack/test_serverless/README.md#roles-based-testing)
within tests. its not possible to create custom users with the
serverless test framework at the moment. See
https://github.com/elastic/kibana/issues/192711

Skipped tests
- knowledge base tests https://github.com/elastic/kibana/issues/192886
- any test suite that uses the LLM proxy has been skipped on MKI
https://github.com/elastic/kibana/issues/192751
- all tests that depend on the config.modelId skipped in MKI
https://github.com/elastic/kibana/issues/192757

TODO:

- [x] move over remaining tests
- [x]  test in MKI environment before merging
- [x] create issues for skipped tests
- [ ] this will not run on MKI (after merging) unless we ping the
appex-qa team to add it to the pipeline. this is due to creating a
separate config. ask appex-qa team to add our config.


Followup / related issues to be tracked in a newly created issue:

- [ ] https://github.com/elastic/kibana/issues/192757
- [ ] https://github.com/elastic/kibana/issues/192886
- [ ] https://github.com/elastic/kibana/issues/192751
- [ ] https://github.com/elastic/kibana/issues/192701
- [ ] https://github.com/elastic/kibana/issues/192497
- [ ] https://github.com/elastic/kibana/issues/192711
- [ ] https://github.com/elastic/kibana/issues/192718
- [ ] serverless functional tests
- [ ] inquire with ml-ui-team to have the ability to delete system
indices which we do after uninstalling tiny elser with .ml indices
2024-09-30 19:07:01 -04:00
Jan Monschke
00789609ad
[Threat Hunting Investigations] Migrate all timeline routes to OpenAPI types (#190238)
## Summary

fixes: https://github.com/elastic/security-team/issues/10235
fixes: https://github.com/elastic/security-team/issues/10237

This is the final PR for migrating over all timeline-related schemas and
types to the new generated zod schemas from our OpenAPI specs. (see
https://github.com/elastic/security-team/issues/10110)
On top of moving to the new schemas/types, this PR also cleans up usage
of now outdated types.

I'm aware of the size of this PR but rest assured, the changes are easy
to review and for most teams, only a handful of files need to be
reviewed:

```markdown
### elastic/security-defend-workflows

* x-pack/test/security_solution_endpoint/apps/endpoint/endpoint_solution_integrations.ts

### elastic/security-detection-rule-management

* x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts
* x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/perform_timelines_installation.ts

### elastic/security-detections-response

* x-pack/test/security_solution_cypress/cypress/objects/timeline.ts

### elastic/security-engineering-productivity

* x-pack/test/security_solution_cypress/cypress/objects/timeline.ts
* x-pack/test/security_solution_cypress/cypress/tasks/api_calls/timelines.ts
```


### Checklist

- [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-30 20:55:23 +02:00
Tre
b79855d0e9
[FTR][Ownership] Assign Ownership to canvas/logstash_lens ES Archives (#194412)
## Summary

Modify code owner declarations for
`x-pack/test/functional/es_archives/canvas/logstash_lens` in
.github/CODEOWNERS

### For reviewers

To verify this pr, you can use the `scripts/get_owners_for_file.js`
script
E.g:
```
 node scripts/get_owners_for_file.js --file x-pack/test/functional/es_archives/canvas/logstash_lens # Or any other file
```

#### Notes
All of these are a best guess effort. The more help from the dev teams,
the more accurate this will be for reporting in the future.

Contributes to: https://github.com/elastic/kibana/issues/192979

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-30 14:38:06 +01:00
Jon
4591aa28e5
Reapply "[workflows] Add condition to if backport:skip event (#194158)" (#194192)
This reverts commit 1992a39443.

Reapply's #194158 without the extraneous semicolon.

Tested at
1105677457
2024-09-26 13:25:40 -05:00
Jonathan Budzenski
1992a39443 Revert "[workflows] Add condition to if backport:skip event (#194158)"
This reverts commit 97d9ab2964.
2024-09-26 11:47:53 -05:00
Jon
97d9ab2964
[workflows] Add condition to if backport:skip event (#194158)
To only run when the label is removed and a backport:* label exists.

The on-merge workflow has historically supported version labels without
the existence of backport labels when a pull request is closed.
This isn't an expected use case now that we've enforced the label check,
but it still is possible to trigger.

Testing

1) Merge pull request
2) Add v8.16.0 , backport:skip labels 
3) Remove backport:skip label (current trigger 1)
4) Add backport:prev-minor label (current trigger 2)

Should trigger the action once via step 4.

This PR is split into two commits, the first with the condition and the
second with the changes run through a formatter.
2024-09-26 11:47:06 -05:00
Tre
37342c882b
[FTR][Ownership] add @elastic/security-detection-engine to es archives (#193571)
## Summary

Modify code owner declarations for @elastic/security-detection-engine
team in `.github/CODEOWNERS`

### Update for Reviewers
With the merge of [this](https://github.com/elastic/kibana/pull/193277),
you can now do this:
`node scripts/get_owners_for_file.js --file
x-pack/test/functional/es_archives/asset_criticality`

```
 succ elastic/security-detection-engine
```
_So, you can use this script to see if the code owners file is reporting
erroneously_

### Only one un-contested change:

1. `/x-pack/test/functional/es_archives/asset_criticality
@elastic/security-detection-engine`

### Note
Oringinally I included
`/x-pack/test/functional/es_archives/security_solution
@elastic/security-detection-engine` but this was contested.
We will circle back around to this.


Contributes to: https://github.com/elastic/kibana/issues/192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-26 12:40:17 +01:00
Brad White
6fbb038fb7
[CI] Handle unlabeled events in on-merge workflow (#194058)
## Summary

Closes #194051

As far as I can tell from the docs the `unlabeled` event sends
information about the removed label. I'm not sure the best way to test
this aside from merging the PR and adjusting the labels on this PR
afterwards. Reverting if needed.

Plan:
1. Merge PR
2. Add `backport:prev-minor`
3. Verify the workflow ran and _did not_ trigger a backport since
`backport:skip` is still a label
4. Remove `backport:skip`
5. Verify the workflow ran and _did_ trigger a backport to `8.x`
6. Revert the labels and close the backport PR since it is not actually
needed.
2024-09-25 16:24:55 -07:00
Jon
17455d8874
Update kbn-flot-charts codeowners (#193351)
As best I can tell this was default assigned to operations during a
large refactor - https://github.com/elastic/kibana/pull/138965.

Operations is mostly disconnected from the UI. I'm proposing
transferring this over to area teams where flot is in use - stack
monitoring, canvas, and timelion.
2024-09-25 11:34:36 -05:00
Walter Rafelsberger
b2d85d5f8f
[ML] Move FieldStatsFlyout, parseInterval, validators to packages. (#193657)
## Summary

Part of #159917.

Moves code from `plugins/ml/common|public` to packages that is used by
transforms too.

While the transforms plugin is maintained by the ML team too, the
transform plugin itself is independently available from the ML UI in the
Kibana management section. We should try to avoid that the transform
plugin is directly depending on the `ml` plugin. This PR moves some code
from `plugins/ml/common|public` to packages so that we can remove `ml`
from the list of `requiredBundles` of the `transform` plugin.

The packages were created with these commands:

```
node scripts/generate package @kbn/ml-field-stats-flyout --dir ./x-pack/packages/ml/field_stats_flyout
node scripts/generate package @kbn/ml-parse-interval --dir ./x-pack/packages/ml/parse_interval
node scripts/generate package @kbn/ml-validators --dir ./x-pack/packages/ml/validators
```

The following commands were used to check missing jsdoc comments and
exports:

```
node scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats comments
node scripts/build_api_docs --plugin @kbn/ml-field-stats-flyout --stats exports
node scripts/build_api_docs --plugin @kbn/ml-parse-interval  --stats comments
node scripts/build_api_docs --plugin @kbn/ml-parse-interval  --stats exports
node scripts/build_api_docs --plugin @kbn/ml-validators --stats comments
node scripts/build_api_docs --plugin @kbn/ml-validators --stats exports
```

### Checklist

- [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] 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)
2024-09-24 14:00:55 +02:00
Stratoula Kalafateli
d56a1bbbba
[ES|QL] Renames the textbased editor to esql editor (#193521)
## Summary

Renames the text-based-editor to esql-editor

I tried to also rename components, data-test-subj, classNames and files.
My focus is mostly on the plugin and package of the esql editor

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-23 12:06:53 +02:00
Stratoula Kalafateli
9d0d41ce87
[ES|QL] Renames the language package to a more generic name (#193517)
## Summary

Renames the language-documentation-popover to language-documentation as
it stores additional layouts:
- popover
- flyout
- inline
2024-09-23 09:58:53 +02:00
Tre
d30b9c8bc4
[FTR][Ownership] add @elastic/response-ops to es archives (#193449)
## Summary

Modify code owner declarations for @elastic/response-ops team in
`.github/CODEOWNERS`

### Update for Reviewers
With the merge of [this](https://github.com/elastic/kibana/pull/193277),
you can now do this:
`node scripts/get_owners_for_file.js --file
x-pack/test/functional/es_archives/action_task_params`

```
 succ elastic/response-ops
```
_So, you can use this script to see if the code owners file is reporting
erroneously_

### For Reviewers
Added these lines:
```
/x-pack/test/functional/es_archives/actions @elastic/response-ops
/x-pack/test/functional/es_archives/alerting @elastic/response-ops
/x-pack/test/functional/es_archives/alerts @elastic/response-ops
/x-pack/test/functional/es_archives/alerts_legacy @elastic/response-ops
/x-pack/test/functional/es_archives/observability/alerts @elastic/response-ops
/x-pack/test/functional/es_archives/actions @elastic/response-ops
/x-pack/test/functional/es_archives/rules_scheduled_task_id  @elastic/response-ops
/x-pack/test/functional/es_archives/alerting/8_2_0  @elastic/response-ops
```

Most of these changes come from searching for `esArchiver.load`, within
`x-pack/test/alerting_api_integration`
Obviously this can easily be erroneous, so please keep me honest.

#### Notes

This is a best guess effort, as we march towards having zero files
within `test` && `x-pack/test` && `x-pack/test_serverless` without a
code owner.

In the end, this will contribute to better reporting.

Contribues to: https://github.com/elastic/kibana/issues/192979

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-09-20 15:53:53 +01:00
Sandra G
bda08590f1
[Data Usage] New plugin (#193466)
The initial serverless only plugin for viewing data usage and retention
in Management. The purpose of this PR is to provide a place for other
engineers to work on it, hidden from public use.

- Plugin is hidden by default and can be enabled through kibana.yml
`xpack.dataUsage.enabled: true`
- Currently it will show up in both stateful and serverless (if enabled
using config above). When we are ready to make the plugin available we
will enable it in config/serverless.yml
- Renders a card in Management (serverless) when enabled:
<img width="1269" alt="Screenshot 2024-09-19 at 4 14 15 PM"
src="https://github.com/user-attachments/assets/705e3866-bc88-436a-8532-2af53167f7b1">


https://github.com/elastic/kibana/issues/192965
https://github.com/elastic/kibana/issues/192966

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-20 08:30:07 -04:00
Jon
af0582c346
[codeql] Collect statistics weekly (#193308)
Moves stats collection from after the analyze scan to a weekly cron.
2024-09-19 08:48:39 -05:00
Alejandro Fernández Haro
02ce1b9101
[Feature Flags Service] Hello world 👋 (#188562)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
2024-09-18 11:02:55 -05:00
Jon
d58e82272a
[ci] Run codeql alerts after analyze matrix (#193217)
Instead of alerting as each branch finishes, this waits for the entire
analyze run before sending out alerts.
2024-09-17 17:24:45 -05:00
Jon
5bb42e5b1e
[ci] Triage codeql results (#191497) 2024-09-17 13:17:43 -05:00
Klim Markelov
2b2d9f74a7
Update search-design Github team in CODEOWNERS (#192890)
## Summary

In preparation for the GitHub team's renaming, it's required to update
this team in the codeowners file too.

This PR is dedicated to renaming @elastic/ent-search-design team to the
@elastic/search-design team
2024-09-17 15:08:24 +00:00
Nick Peihl
6689169687
Move @elastic/kibana-gis ownership to @elastic/kibana-presentation (#192521)
## Summary

The legacy `@elastic/kibana-gis` team is now a part of
`@elastic/kibana-presentation`. So we should move ownership of all code
to the correct team.
2024-09-16 09:50:50 -05:00
Tiago Vila Verde
c26ee22db6
[Entity Manager] Extract the entity manager out of Observability solution (#190304)
## Summary

Moving the Entity Manager out of Observability and into a Kibana plugin
as per [this
ticket](https://github.com/elastic/security-team/issues/10156)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-16 14:07:03 +02:00
Saarika Bhasi
7264d3a548
[Index Management] [Onboarding] Create new package folder for index_management (#192594)
## Summary

We have to extract few components from `index_management` plugin to
shared packages for onboarding project. These extracted files would be
separated into small subject matter packages within a common folder -
`index-management` in `x-pack/packages/`.


What is covered in this PR? 

* Created new folder `index-management` under [
x-pack/packages/](https://github.com/elastic/kibana/tree/main/x-pack/packages)
as a home for subject matter packages.
* moved existing package -
[@kbn/index-management](https://github.com/elastic/kibana/tree/main/x-pack/packages/index-management)
under `x-pack/packages/index-management`
* update name of
[@kbn/index-management](https://github.com/elastic/kibana/tree/main/x-pack/packages/index-management)
to `@kbn/index-management-shared-types`
* updated related files which use `@kbn/index-management` to use
`@kbn/index-management-shared-types`

**Note** 
Extracting components required for onboarding project will be part of
another PR
2024-09-13 07:46:00 -04:00
Philippe Oberti
8377275c44
[Security Solution] remove old and skipped Threat Intelligence Cypress tests (#191166) 2024-09-12 08:59:56 -05:00
Dario Gieselaar
98aa1ab769
[Inventory] Inventory plugin (#191798)
## Description

This PR adds an inventory plugin, which renders an inventory UI.
Currently only data streams are rendered. This is part of the LogsAI
initiative - basically we need a UI for tasks like structuring data,
extracting entities, listing the results etc. This is mostly POC-level
stuff. Eventually some of this code might be handed over to ECO but
let's cross that bridge when we get to it.

## Notes for reviewers:

@elastic/appex-ai-infra @elastic/security-generative-ai: added a
`truncateList` utility function that takes the first n elements of an
array and appends a `{l-n} more` string value if there are more values
than n. Really simple but I expect will also be very often used because
we cannot send a huge amount of items to the LLM.

@elastic/kibana-core @elastic/kibana-operations: just boiler plate stuff
for adding a new plugin (and thank you for enabling us to run
`quick_checks` locally!

@elastic/obs-knowledge-team: added support for streaming using an
Observable.

@elastic/obs-ux-management-team: added links to the Inventory UI in the
Observability plugin

@elastic/obs-entities: I've added an entity manager client to be able to
fetch entity definitions on the server. Maybe there's a better way? LMK.

@elastic/obs-ux-logs-team: added a deeplink to the Inventory UI. I've
also moved CODEOWNERS for this package to
@elastic/obs-ux-management-team as they own the Observability plugin
where this is mostly used.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-12 15:07:09 +02:00
Lisa Cawley
f558291554
Update oas_docs ownership (#192647) 2024-09-11 18:29:48 -05:00
Maxim Palenov
31bd6acae7
[Security Solution] Fix Security Solution OpenAPI bundles ownership (#192348)
**Relates to:** https://github.com/elastic/kibana/issues/190035

## Summary

This PR sets proper teams ownership to Security Solution OpenAPI domain
bundles. It will help to avoid unnecessary code review dependencies and
allow teams to focus on OpenAPI domain changes.
2024-09-09 12:19:33 +02:00
Elena Shostak
9a187df02d
Revert "[CodeQL] Added bootstrap step" (#192274)
Reverts elastic/kibana#191746
2024-09-06 17:27:41 +02:00
Gloria Hornero
4041d274b3
[ON-WEEK][POC] Playwright (#190803)
## UPDATE
It has been removed the execution of the playwright tests on buildkite,
the execution will be re-enabled as soon as we are ready and as
described below in the PR, there are still steps pending to be done.

## Motivation

**Cypress is not performing well lately.**
* We have been facing significant performance issues with Cypress. For
instance, it takes a long time to open the visual interface and start
executing tests.

**Teams are finding it increasingly challenging to write new tests and
debug existing ones.**
* The time and effort required to create new tests or troubleshoot
existing ones have become burdensome.

**Concern about the impact this could have on our testing practices.**
* Lose motivation to write tests or, worse, skip writing crucial tests.

## Why Playwright?

* Compared to Cypress, Playwright seems to be known for its faster
execution times and lower resource consumption. What could have a
positive impact by having faster feedback during development and
execution of new tests as well as more efficient use of CI resources.

* Provides powerful debugging tools which can make easier to write,
debug and execute tests.

* Seems to provide the same capabilities we currently use in our Cypress
tests.

* Given Playwright's active development and backing by Microsoft, it is
likely to continue evolving rapidly, making it a safe long-term choice.

Considering all the above, Playwright seems to be a strong candidate to
replace Cypress and address all the issues we are facing lately
regarding UI test automation.

## Objective of this POC

To write in Playwright a couple of tests we currently have on Cypress to
check the performance of the tool as well as the development experience.

The tests selected have been:
-
[enable_risk_score_redirect.cy.ts](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/dashboards/enable_risk_score_redirect.cy.ts)
- Owned by Entity Analytics team and selected by its simplicity since it
does not need any special setup to be executed and is short.

-
[manual_rule_run.cy.ts](https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_gaps/manual_rule_run.cy.ts)
- Owned by Detection Engine team and selected because is short and adds
a bit more of complexity due to it needs of clean-up and setting up
initial data through the API.
  
## How to execute the tests

### Visual mode
- Navigate to: `x-pack/test/security_solution_playwright`
- Execute: `yarn open:ess` for ESS environment or `yarn open:serverless`
for serverless environment.

### Headless mode
- Navigate to: `x-pack/test/security_solution_playwright`
- Execute: `yarn run:ess` for ESS environment or `yarn run:serverless`
for serverless environment.

### From VScode
- Install `Playwright Test for VScode` extension by Microsoft
- Navigate to: `x-pack/test/security_solution_playwright`
- Execute: `yarn open:ess` for ESS environment or `yarn open:serverless`
for serverless environment.
- Open your IDE
- Click on the `Testing` icon
- On the `Test Explorer` click on the three dots to select the profile
you are going to execute `ess` or `serverless`
- Click on the test you want to execute or navigate to the spec file of
the test and execute it from the same spec.

## My experience
- Tests are way easier to implement than with Cypress.
- Playwright does not rely on chainable commands. Chainable commands on
Cypress can lead to confusing code.
- Without chainable commands, the flow of the tests is more explicit and
easier to understand.
- You can notice that the tool has been designed with Typescript in
mind.
- Is super easy to implement the Page Object Model pattern (POM).
- With POM the test code is clean and focused on "what" rather than
"how".
- Love the fact that you can execute the tests from the same IDE without
having to switch windows during test development.
- The visual mode execution gives you lots of information out of the
box.

## The scope of this PR
- Sets the initial infrastructure to write and execute tests with
Playwright.
- Has examples and set a basis about how to write tests using the POM.
- Allows the execution of the tests in ESS and serverless (just
stateless environment).
- Integrates the execution of the tests with buildkite.

## Pending to be done/investigate
- Proper readme
- How to split tests and PO between the different teams
- Good reports on CI
- Upload screenshots on CI
- Flaky test suite runner 
- Complete the labeling
- Execution of the tests on MKI environments

## FAQ
**Can I start adding tests to playwright?**
Currently, you can explore and experiment with Playwright, but there is
still work pending to be done to make the tool officially usable.

**Why security engineering productivity is the owner of the playwright
folder?**
This is something temporary to make sure that good practices are
followed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: dkirchan <diamantis.kirchantzoglou@elastic.co>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Jon <jon@budzenski.me>
2024-09-06 13:09:18 +02:00
Jon
1bcc3d602f
[workflows] Add ref and sha to codeql analyze action (#191882)
This workflow currently checkouts out two separate branches, but uses
the default branch as a reference when analyzing. We want the results to
split by the branch.

See https://github.com/github/codeql-action/blob/main/analyze/action.yml
for a description of supported options.
2024-09-05 13:18:19 -05:00
Elena Shostak
270b9aec0d
[CodeQL] Added max-old-space-size for CodeQL workflow (#192192)
## Summary

Added `--max-old-space-size=6144` to increase the maximum heap memory
size for the workflow run.

__Fixes: https://github.com/elastic/kibana/issues/192190__
2024-09-05 17:05:53 +02:00
Rickyanto Ang
8b7d965752
[Cloud Security] Misconfiguration preview & Refactor CSP Plugin to include new package PHASE 4 (#191677)
The previous https://github.com/elastic/kibana/pull/190105 was way too
big and made it hard to review without missing any bugs or potential
bugs, Thus we decided we are going to make series of smaller PR to make
things more manageable

We will be splitting it into 4 PR
Phase 1: Creating empty packages for csp and csp-common
Phase 2: Move Types from CSP plugin to the Package + Deleting duplicates
in the CSP plugin where possible
Phase 3: Move Functions, Utils or Helpers, Hooks to Package
Phase 4: Misconfiguration Preview feature (with Cypress test and other
required test)

<img width="681" alt="353329193-5ad22c4e-81c2-4a8b-89f7-fdbc2a686c2d"
src="https://github.com/user-attachments/assets/b369625a-efc5-4292-a690-2c5dffb5483d">


This is Phase 4 of the Process,

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-04 07:32:06 -07:00
elena-shostak
37bd5f6781
[CodeQL] Added bootstrap step (#191746)
## Summary

Added bootstrap step before CodeQL scan. 

Tested the run on push -
2942236822.
The workflow run was successful and had almost the same timing. Although
no new issues were identified, it's safe to keep the bootstrap step
before the scan.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-30 14:38:30 +02:00
Alejandro Fernández Haro
52cbd493c2
[Move @kbn/config-schema to server] kbn-object-versioning (#191691) 2024-08-29 05:39:09 -05:00
Pierre Gayvallet
02a3992edb
Inference plugin: Add Gemini model adapter (#191292)
## Summary

Add the `gemini` model adapter for the `inference` plugin. Had to
perform minor changes on the associated connector

Also update the codeowner files to add the `@elastic/appex-ai-infra`
team as (one of the) owner of the genAI connectors

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-08-28 08:02:06 -05:00
Dario Gieselaar
ecec57ca52
[Obs utils] Add Observability utils package (#189712)
Adds a `@kbn/observability-utils` package.

```md
# @kbn/observability-utils

This package contains utilities for Observability plugins. It's a separate package
to get out of dependency hell. You can put anything in here that is stateless and
has no dependency on other plugins (either directly or via other packages).

The utility functions should be used via direct imports to minimize impact on
bundle size and limit the risk on importing browser code to the server and vice versa.
```

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-08-28 06:03:25 -05:00