Commit graph

1253 commits

Author SHA1 Message Date
Maxim Kholod
6e73444ca3
[Cloud Security] kick off the work on the DistributionBar component (#188509)
## Summary

Contributes to:
- https://github.com/elastic/security-team/issues/9954

The PR contains the base for the `DistributionBar` component to be used
in the new Entity Flyout Insights.

Not included:
- badges per distribution with the number of documents and pretty names
- on hover interaction

## Screenshots
<img width="980" alt="Screenshot 2024-07-17 at 15 13 48"
src="https://github.com/user-attachments/assets/f2ca53ee-c054-4923-aa3f-7dd4017754cb">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-19 10:38:01 +02:00
Candace Park
14498a0221
[Security Solution][Admin][AVC Banner] AVC banner logic moved into a kbn package (#188359)
## Summary

- [x] This is an improvement pr to move all the avc banner logic into a
reusable kibana package (security solution and fleet integrations)
- [x] Compresses the svg used in the banner's  background 
- [x] Fixes a bug where the blog link didn't previously open in a new
tab

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-19 09:24:28 +10:00
Lisa Cawley
1a1c7d6101
Remove API doc workflow, add codeowners (#188169)
Co-authored-by: Jon <jon@budzenski.me>
2024-07-17 14:21:12 -07: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
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
Konrad Szwarc
f96d55a4f5
[EDR Workflows] MKI API tests (#187560)
This pull request introduces two changes to our existing API integration
tests:
1. It restructures the files to follow the security solution-wide
standard.
2. It adds our API integration tests to the periodic MKI pipeline.
[Example
build](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/818)

**Change of Structure:**
All tests have been moved to
`x-pack/test/security_solution_api_integration/test_suites/edr_workflows`
and are grouped by feature and then by licensing.
![Screenshot 2024-07-10 at 11 52
42](223c9138-8702-42f2-a801-a35be87304cb)

**MKI:**
Due to the nature of our tests – their dependence on switching users
and/or modifying internal indices – only 3 out of 7 test suites qualify
to be run in MKI. I've added all test suites to
`.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_defend_workflows.yml`.
However, the ones that would be skipped are commented out to avoid
consuming resources without providing any value.

**Testing for Regression:**
I've noticed that the `@skipInServerlessMKI` tag is not working as
expected. Tests tagged with `@serverless @skipInServerlessMKI Test Name`
were not being run in the PR pipelines. The grep pattern we were using
in individual configs and in
`x-pack/test/security_solution_api_integration/scripts/index.js`
(`'/^(?!.*@skipInServerless).*@serverless.*/'`) would also match
`@skipInServerlessMKI`.

I've modified the pattern to look for a full word, expecting it to be at
the beginning or end of a string, and to be followed or not followed by
a whitespace. We could use unit tests for these grep patterns 😄

Here is a screenshot of the new regex being tested:

![Screenshot 2024-07-10 at 12 09
28](8b9dd49a-3ca5-458d-9567-ad938847f169)

This led me to double-check whether all our API integration tests are
being executed in both PR and MKI pipelines, all seems to be in place:

**MKI:**
1. Artifacts -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81ae-47c3-a867-b16de4bfa20e/262-380)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
2. Authentication -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b0-4824-a658-3a881607eb56)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
3. Metadata -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b1-4730-9b51-512b1b554f64/261-386)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
4. Package -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b3-418c-ad33-0cd7dd68ad46/261-370)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
5. Policy Response -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b4-4034-a575-3ddbdde42e24/261-422)
- all tests were executed
6. Resolver -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b5-482d-8023-e1f819d3c56e/261-711)
- all but the tests with `@skipInServerless` were executed
7. Response actions -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b7-4561-83a3-6896523cff8f/262-403)
- only one file was executed due to the second one being tagged as
`@skipInServerlessMKI`

**PR:**

All tests are accounted for and executed as expected, no regression.
package suite was never executed since it's `.skip`


policy_response/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-675b-4fab-a787-e5e472711fb0/3394)
policy_response/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-678f-49c6-ae4f-aee3738713c2/3446)
authentication/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-6768-4330-9b6c-8328a46a5a99/2352)
authentication/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67b3-4b9b-ba31-110f737a1f3f/1970)
resolver/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-6759-49a3-8cb7-4b0097cf8975/6266)
resolver/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-676a-4dfe-bc19-6fd50e42980a/3302)
metadata/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-676c-49ff-b0a5-cf7acc9c5506/4827)
metadata/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-679e-45e8-aa52-5672baf344df/3000)
response_actions/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67ad-4826-bb58-4b6330fef338/2760)
response_actions/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67b7-4a6a-a37d-d138a7054a41/9654)
artifacts/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67d6-4926-a93f-b193ab2859be/1158)
artifacts/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-672e-4350-8820-c7fd8d7ef010/2328)

---------

Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
2024-07-12 14:41:41 +02:00
Angela Chuang
756e9c100b
[SecuritySolution] Revert defend-workflows integration tests (#187257)
## Summary

https://github.com/elastic/kibana/pull/183611

I moved x-pack/test/security_solution_endpoint to
x-pack/test/security_solution_api_integration in
https://github.com/elastic/kibana/pull/183611 as I thought all the tests
regarding Security Solution should live there.

However security_solution_endpoint are not api tests , they are UI
tests. After discussions, we decided to move security_solution_endpoint
back to `x-pack/test/`

The two files below are shared between
`x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int`
and `x-pack/test/security_solution_endpoint`, moved them to `services`
in this PR to avoid type check confusion.
-
x-pack/test/common/services/security_solution/endpoint_data_stream_helpers.ts
-
x-pack/test/common/services/security_solution/endpoint_registry_helpers.ts

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-11 15:23:49 +01:00
Kevin Delemme
40a2bdf651
change codeownsers investigate plugin (#187939)
Change ownership of investigate plugin to obs-ux-management
2024-07-10 20:35:49 +10:00
Anton Dosov
e03fc63e48
[TableListView] Dashboard listing recently viewed sorting (#187564)
## Summary

Close https://github.com/elastic/kibana/issues/183686

Adds a new sorting option "Recently viewed". Recently viewed dashboards
will be shown at the top of the list. The remaining dashboards are
sorted by last updated at.
- This is a default option unless another option was explicitly selected
before (and saved in local storage)
- If there are no recently viewed dashboards, then this sorting option
is hidden, and "last updated at" is default like before
- This option is only added to the dashboard listing

Implementation: 

- Recently viewed dashboard are stored in local storage as a queue with
20 items max
- I reused the existing RecentlyAccessedService we've been using for
sidenav's recently viewed section. For this, I moved it to a separate
package. The service already handles a lot of edge cases like spaces,
key hashing, and deduping.
- The sorting part in EUITable is a bit hacky. It doesn't support custom
internal sorting (like we do with title and lastUpdatedAt), so I had to
sort the list myself and then tell EUITable not to do any sorting in
case "Recently viewed" option is selected. [slack
discussion](https://elastic.slack.com/archives/C7QC1JV6F/p1720008717120589)

<img width="1265" alt="Screenshot 2024-07-05 at 10 59 25"
src="9cc46fd2-4270-494f-9272-302007a7efc0">
2024-07-09 16:38:56 +02:00
Vadim Kibana
7e4c8a83e1
[ES|QL] Rename text-based-languages pugin to esql plugin (#187520)
## Summary

Renames `@kbn/text-based-languages` plugin to `@kbn/esql` plugin. This
has been discussed internally, the rationale is that now there will be
only one language: ES|QL; and we may use this plugin for ES|QL related
HTTP routes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-10 00:16:32 +10:00
Dominique Clarke
436ff94f2e
[Synthetics] switch codeowners (#187775)
## Summary

Switches codeowners for Synthetics

![Come back to
me](https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmZydzA0dXA0N2FnbWJydWU3bzF2a2VibnY5NWUyaWs1dzA3bTM3NiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/czE57x4A8axa3BlYkY/giphy.gif)

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-09 09:44:24 -04:00
Jon
06d84b2b60
Fix codeowners (#187780) 2024-07-08 14:29:53 -05:00
Umberto Pepato
f99f83428c
[ResponseOps][Alerts] Implement platform alerts grouping components (#184635)
## Summary

Adds solution-agnostic components to create hierarchical alerts grouping
UIs, adapting the original implementation from Security Solution.

Closes #184398 

## To Verify

For existing usages of the `@kbn/grouping` package: verify that the
grouped UIs work correctly (Security Alerts, Cloud Security Posture).

New alerting UI components: checkout
https://github.com/elastic/kibana/pull/183114 (PoC PR), where the
updated `@kbn/grouping` package and these new components are used in
Observability's main Alerts page.

### 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: Gerard Soldevila <gerard.soldevila@elastic.co>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
Co-authored-by: Tre <wayne.seymour@elastic.co>
2024-07-08 19:23:49 +02:00
Kevin Lacabane
a493e4075b
[eem] rename asset_manager to entity_manager (#186617)
## Summary

Renames the experimental asset_manager plugin (never
documented/officially released) into entity_manager. I've used `node
scripts/lint_ts_projects --fix` and `node scripts/lint_packages.js
--fix` to help with the procedure and also renamed manually the
asset_manager references left.

The change also removes the deprecated asset_manager code, including the
`assetManager.alphaEnabled` plugin configuration. This means
entityManager plugin will be enabled by default.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-26 14:25:32 +02:00
Sander Philipse
b20732a297
[Search] Use security plugin's API key flyout in Serverless (#186171)
## Summary

This consumes the security solution's API key flyout and token selector
in Serverless search to have a consistent experience across the stack.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-25 12:15:38 +02:00
Liam Thompson
1cbe34ba35
[Search] Update CODEOWNERS for Search org doc links updates (#186822) 2024-06-24 18:11:06 +02:00
Elena Stoeva
66c56629ba
[Rollups] Update Rollup badge for deprecation (#186321)
## Summary

This PR updates the Rollup badge in the indices list and the data views
list so that it provides deprecation information. The tooltip component
is stored in a new package to avoid cyclical dependencies as it is used
in both the Index management plugin and in the Data views management
plugin.

<details><summary>Screenshots</summary>
<img width="1679" alt="Screenshot 2024-06-17 at 18 08 35"
src="1d3daa9d-3f62-49f8-803f-1b3d4605f9a4">

<img width="1679" alt="Screenshot 2024-06-17 at 18 08 53"
src="2e88d119-88e7-4d01-bab9-bc2add82b91c">

<img width="1679" alt="Screenshot 2024-06-17 at 18 09 18"
src="29d3d3f2-de46-45ea-96a1-b83495d122df">
</details>

**How to test:**
1. Start Es and Kibana
2. Add the sample data "Sample web logs"
3. Elasticsearch only allows creating a rollup job if there is an
existing rollup usage in the cluster. To simulate rollup usage, create a
mock rollup index through Console:

```
PUT /mock_rollup_index
{
  "mappings": {
    "_meta": {
      "_rollup": {
        "id": "logs_job"
      }
    }
  }
}
```


4. Create a sample rollup job through Console:

```
PUT _rollup/job/logs_job
{
  "id": "logs_job",
  "index_pattern": "kibana_sample_data_logs",
  "rollup_index": "rollup_logstash",
  "cron": "* * * * * ?",
  "page_size": 1000,
  "groups": {
    "date_histogram": {
      "interval": "60m",
      "delay": "7d",
      "time_zone": "UTC",
      "field": "@timestamp"
    },
    "terms": {
      "fields": [
        "geo.src",
        "machine.os.keyword"
      ]
    },
    "histogram": {
      "interval": "1003",
      "fields": [
        "bytes",
        "memory"
      ]
    }
  }
}
```


5. Delete the mock rollup index since it causes issues for the rollup
API that we use to fetch rollup indices:
`DELETE /mock_rollup_index`
6. Navigate to Index Management and toggle the "Include rollup indices"
switch
7. Verify that the rollup indices have the deprecation badge.
8. Navigate to Data Views and create a rollup data view with index
pattern that matches the created rollup index (`rollup*`).
9. In the list of data views, verify that the rollup data view has the
correct rollup deprecation badge.
10. Click on the rollup data view and verify that the details panel also
has the deprecation badge.

### Checklist

- [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] 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>
2024-06-21 19:42:25 +01:00
Dima Arnautov
4c3afc5f42
[ML] Update code editors for Transform, Data Frame and Anomaly Detection wizards (#184518)
## Summary

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

Improves code editors in Anomaly detection, Data frame analytics and
Transform wizards with autocomplete, data types validation and inline
documentation from elasticsearch specification.

![Jun-19-2024
15-33-00](c230deae-962e-4295-8146-0bf3579a66bd)


Adds a package with JSON schemas extracted from the [openapi output of
elasticsearch-specification](https://github.com/elastic/elasticsearch-specification/tree/main/output/openapi).

Schema file is generated per editor/endpoint, keeping only relevant
components.

To test the script locally, execute 
```
yarn run jsonSchema
```
from `/x-pack/packages/ml/json_schemas`.

By default it assumes that your `elasticsearch-specification` folder is
located next to the `kibana` repo, but you can also provide a path to
`openapi` file as a parameter, e.g. `yarn run jsonSchema
/Users/my_user/dev/elasticsearch-specification/output/openapi/elasticsearch-serverless-openapi.json`

#### How JSON files are served 

JSON files are asynchronously imported at the React component level and
passed to the `CodeEditor` instances on mount.

Initially I tried different approaches to take advantage of CDN, but
unfortunately it didn't work out:

#####  Using static assets
 
I made an attempt to retrieve a URL to the JSON schema file as a static
asset using Kibana service
```typescript
const schemaJsonAsset = http?.staticAssets.getPluginAssetHref('my_schema.json') ?? '';
```
and passing it as part of the schema definition, but the browser was
blocking a request 🤔


![image](accf47b1-2a89-4408-9c5a-36bb269e8889)

![image](aa64ae66-8749-4d4d-b645-6cd11b221c68)

##### Using raw loader

Approach with a raw loader also didn't succeed.

```typescript
import mySchema from '!!raw-loader!./my_schema.json';
```

<details>
  <summary>See error </summary>
 
  ```
ERROR in
./public/app/sections/create_transform/components/advanced_pivot_editor/my_schema.json
(/Users/dimaarnautov/Repos/kibana/node_modules/raw-loader/dist/cjs.js!./public/app/sections/create_transform/components/advanced_pivot_editor/my_schema.json)
│ Module parse failed: Unexpected token 'e', "export def"... is not
valid JSON while parsing 'export default "{\n \"type\": \"object\'
       │          File was processed with these loaders:
       │           * ../../../node_modules/raw-loader/dist/cjs.js
│ You may need an additional loader to handle the result of these
loaders.
│ SyntaxError: Unexpected token 'e', "export def"... is not valid JSON
while parsing 'export default "{\n \"type\": \"object\'
       │              at JSON.parse (<anonymous>)
│ at parseJson
(/Users/dimaarnautov/Repos/kibana/node_modules/json-parse-better-errors/index.js:7:17)
│ at JsonParser.parse
(/Users/dimaarnautov/Repos/kibana/node_modules/webpack/lib/JsonParser.js:16:16)
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/webpack/lib/NormalModule.js:482:32
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/webpack/lib/NormalModule.js:358:12
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:373:3
│ at iterateNormalLoaders
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
│ at iterateNormalLoaders
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:236:3
│ at runSyncOrAsync
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
│ at iterateNormalLoaders
(/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/loader-runner/lib/LoaderRunner.js:205:4
│ at
/Users/dimaarnautov/Repos/kibana/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:85:15
│ at processTicksAndRejections (node:internal/process/task_queues:77:11)
  ```
</details>



### Checklist

- [ ] [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
2024-06-21 16:43:20 +02:00
Philippe Oberti
153ec668e3
[Security Solution][Notes] - store setup (#186433) 2024-06-20 09:34:17 -05:00
Rodney Norris
74c4d3a85e
[Search] Homepage Plugin setup (#186224)
## Summary

Introducing the `search_homepage` plugin along with integration into
`enterprise_search` and `serverless_search` behind a feature flag. This
will allow implementing the feature gated behind the feature flag.

To test these changes you can enable the feature flag with the Kibana
Dev Console using the following command:
```
POST kbn:/internal/kibana/settings/searchHomepage:homepageEnabled
{"value": true}
```

You can then disable the feature flag with the following command:
```
DELETE kbn:/internal/kibana/settings/searchHomepage:homepageEnabled
```

### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-19 12:47:18 +02: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
Anton Dosov
e2a98cf965
Add dashboard metadata to the info flyout (#185941)
## Summary

Close https://github.com/elastic/kibana-team/issues/898

- Show createdAt, createdBy, updatedAt, updatedBy in info flyout. Add a
bit of special handling for managed objects and when info is not
available.
- I had to extract some components into a separate package to use them
in contentEditor package
- tiny tweaks to column width and "no creator" state 



![Screenshot 2024-06-12 at 17 01
45](b2093c03-67a0-49a5-8a45-93d9e57813ca)

**Unknown creator:**


![Screenshot 2024-06-12 at 17 01
53](3e520f6a-9a19-455f-b564-571c3ad81b16)

**For managed objects:**

![Screenshot 2024-06-12 at 17 01
57](36ce1465-09a4-4936-a9f1-ca5794d45a7a)

**Just created, no updates yet**

![Screenshot 2024-06-12 at 17 02
18](1431210e-ce83-4409-ab99-6184b6f87d3a)
2024-06-18 10:25:51 -07:00
Alejandro Fernández Haro
ab21d4fee4
[EBT] Combine packages (#186048)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-18 14:23:16 +02:00
Paul Tavares
f820f78807
[Security Solution][Endpoint] Refactor UI response actions code (#184543)
## Summary

This PR does a major refactor of Response Actions functionality usage
outside of the `management` section of the code base. The impact
(although should be transparent from a user's standpoint) is mostly to
the Alert Details "Take Action" menu and specifically to the
"Isolate/Release" and "Respond" menu actions and the UI's it displays
when clicked. The changes can be summarized as:

- Centralized (moved) all code associated with Response Actions under
one of the following three directories:
    - `public/common/component/endpoint`
    - `public/common/hooks/endpoint`
    - `public/common/lib/endpoint`
    - Most changed files in this PR were a result of this activity
- Deleted several utilities that were used to determine the Alert's host
support for Response actions and replaced with a single `hook`
(`useAlertResponseActionsSupport()`)
- The "Isolate/Release" Take Action menu item now behaves similar to the
"Respond" menu option (on Alerts) in that:
    - Its only NOT displayed if the user is not authorized to use it
- It will show up as disabled while we are attempting to determine
support for response actions on the alert's host
    - Tooltips will be displayed when options is disabled
2024-06-18 08:21:48 -04:00
Jordan
6fc0663d2a
[Cloud Security] Serverless PLI auth block using UI extension infra (#184665) 2024-06-17 16:46:16 +03:00
Marius Iversen
9ed2865838
New Integration Assistant plugin (#184296)
## Summary

This is a PR to add a new backend plugin (frontend will be done in
separate [PR](https://github.com/elastic/kibana/pull/184546)).

The purpose of the plugin is to provide a set of API routes that is used
to perform a variety of GenAI workflows to generate new integrations
based on provided inputs.

It reuses the existing GenAI connectors for its LLM communication, and
provides a set of API's to create ECS mapping, Categorization, Related
Fields and an API to generate the actual integration package zip, which
is forwarded to the UI component.

### Planned follow-up changes:

As the PR is getting way too large, some planned changes would be added
in much smaller follow-ups. This includes mostly more improved try/catch
for certain routes, adding debug/error log entries where relevant,
especially for the API endpoints themself, some more unit and end2end
tests.

- OpenAPI spec for the API will be handled in a separate PR
- All the missing unit tests will be added as a followup PR

### Testing

The `integration_assistant` plugin will be disabled by default while
it's being implemented so we can iterate and merge partial PRs without
interfering with the releases. This config will work as our feature
flag:


6aefd4ff7b/x-pack/plugins/integration_assistant/server/config.ts (L11-L13)

To test it add this to your _kibana.dev.yml_:
```
xpack.integration_assistant.enabled: true
```

### Checklist

Delete any items that are not applicable to this PR.

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

### 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: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Bharat Pasupula <saibharatchandra.pasupula@elastic.co>
Co-authored-by: Bharat Pasupula <123897612+bhapas@users.noreply.github.com>
2024-06-13 16:48:36 -06:00
Patrick Mueller
f016398f8b
[ResponseOps] implement task claiming strategy mget (#180485)
resolves: https://github.com/elastic/kibana/issues/181325

## Summary

Adds a new task claiming strategy `unsafe_mget`, which can be used instead of
the default one `default`. Add the following to your `kibana.yml` to
enable it:

    xpack.task_manager.claim_strategy: 'unsafe_mget'
2024-06-13 16:04:23 -04:00
Saikat Sarkar
db425e3f4f
Add inference endpoints management page (#184614)
## Description

In this PR, we implemented a view for managing inference endpoints. The
changes include the following items for both **Serverless** and
**Stack**.

- A blank page will be displayed if no inference endpoints are
available.
- A page displaying a list of inference endpoints. The user can view
various details about each endpoint, such as the endpoint itself, the
provider, and the type. The table supports pagination and sorting.
- Users can add a new inference endpoint using Elasticsearch models and
third-party APIs, including Hugging Face, Cohere, and OpenAI.

To keep the changes in this PR manageable, the following items are **out
of scope** but will be added in subsequent PRs
- Option to delete an inference endpoint
- Filtering and Search bar
- Information about allocations, thread.
- Icons for **Provider**
- Deployment status of underlying trained models

## Empty page in Stack Management


e2064ee8-3623-457f-8a04-19603e97e815

## Page with all inference endpoints in Stack Management


89bec450-1569-4425-b013-5058b577b95a

## Inference Endpoints Management in Serverless


bd8b6b71-0e09-49f4-aa9a-19338a1da225

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-13 10:00:33 -07:00
Christos Nasikas
fe59dd48c7
[ResponseOps] Package for feature flags (#185000)
## Summary

This PR creates a package to expose tools for managing feature flags in
the ResponseOps codebase.

Usage:

```
const featureFlagService = createFeatureFlagService(['test.myFeature', 'test.myFeature.subFeature']);


if (featureFlagService.isFeatureFlagSet('test.myFeature')) {
  // my feature code
}
```

The code is typed so if you do
`featureFlagService.isFeatureFlagSet('foo')` and `foo` is not part of
the feature flags set TS will report an error.

### Checklist

Delete any items that are not applicable to this PR.

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

### For maintainers

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-13 03:11:32 -07: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
Tomasz Ciecierski
8119aac0fe
[EDR Workflows] fix hidden saved query flyout and unskip test (#185004) 2024-06-10 12:37:43 +02:00
Ignacio Rivas
1e197cf718
[Ingest Pipelines] Add unsaved changes prompt (#183699) 2024-06-07 20:35:56 +02:00
Dario Gieselaar
15b6ba9bd8
[Investigate] Create plugin (#184908)
Create the Investigate plugin (naming TBD). Part of
https://github.com/elastic/kibana/pull/183293, splitting up the work in
several PRs.

The investigate plugin is mostly a registry to allow plugins to register
their widgets without creating dependency issues.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-07 15:05:36 +02:00
honeyn303
1ff87eb551
Gemini connector integration (#183668) 2024-06-06 11:52:35 -06:00
Aleh Zasypkin
53b445833f
Add support for a declarative (via configuration) way to specify Kibana feature overrides (#180362)
## Summary

This PR extends the features plugin to accept feature definition
overrides via Kibana configuration. The functionality is limited to the
Serverless offering only. Additionally, the PR updates Kibana serverless
configurations to include overrides based on the "simplified feature
toggles" proposals discussed with the solution teams.

The configuration might look like this:

```yaml
## Fine-tune the feature privileges.
xpack.features.overrides:
  dashboard:
    privileges:
      ### Dashboard's `All` feature privilege should implicitly
      ### grant `All` access to Maps and Visualize features.
      all.composedOf:
        - feature: "maps"
          privileges: [ "all" ]
        - feature: "visualize"
          privileges: [ "all" ]
    ### All Dashboard sub-feature privileges should be hidden: 
    ### reporting capabilities will be granted via dedicated
    ### Reporting feature and short URL sub-feature privilege
    ### should be granted for both `All` and `Read`.
    subFeatures.privileges:
      download_csv_report.disabled: true
      url_create:
        disabled: true
        includeIn: "read"
  ### Maps feature is disabled since it's automatically granted by Dashboard feature.
  maps.disabled: true
```


## How to test

Log in as the `admin` using SAML and navigate to the `Custom roles`
management section to edit role and see tuned role management UX:

<p align="center">
<img
src="ad6e4b07-53bd-4f5a-ae91-66d6534c711a"
/>
<img
src="8ab4d5a3-f719-42d5-a278-3aee87603c33"
/>
</p>


![image](5e27a49b-4382-4a91-bb85-eca929a27961)

### Search project
```bash
yarn es serverless --projectType=es --ssl -E xpack.security.authc.native_roles.enabled=true
yarn start --serverless=es --ssl --xpack.security.roleManagementEnabled=true
```

Refer to the proposal document, `config/serverless.yml`, and
`config/serverless.es.yml` in this PR to see the specific changes made
for your project type:


![image](9f9d0341-32a1-4258-be3b-d3a809f5bacc)

Create a custom `custom-search` role and re-login as the user with this
role to test your project type (you need to manually type role name if
the role selector):

<p align="center">
<img
src="5088320b-3cc8-4de9-984c-d70fc6277659"
/>
</p>

### Observability project
```bash
yarn es serverless --projectType=oblt --ssl -E xpack.security.authc.native_roles.enabled=true
yarn start --serverless=oblt --ssl --xpack.security.roleManagementEnabled=true
```

Refer to the proposal document, `config/serverless.yml`, and
`config/serverless.oblt.yml` in this PR to see the specific changes made
for your project type:


![image](1d2b360a-24ab-47f7-ac9b-8ad944949c32)

Create a custom `custom-o11y` role and re-login as the user with this
role to test your project type (you need to manually type role name if
the role selector):

<p align="center">
<img
src="110572b1-f08a-4427-a687-5c2e0240a36b"
/>
</p>

### Security project
```bash
yarn es serverless --projectType=security --ssl -E xpack.security.authc.native_roles.enabled=true
yarn start --serverless=security --ssl --xpack.security.roleManagementEnabled=true
```

Refer to the proposal document, `config/serverless.yml`, and
`config/serverless.security.yml` in this PR to see the specific changes
made for your project type:


![image](2dbca002-59f1-44f0-9ab2-1dd205e48da8)

Create a custom `custom-security` role and re-login as the user with
this role to test your project type (you need to manually type role name
if the role selector):

<p align="center">
<img
src="2bec6ae2-8d19-4142-a479-9a81bc1fca14"
/>
</p>

__Fixes: https://github.com/elastic/kibana/issues/178963__

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-06 15:55:19 +02:00
Stratoula Kalafateli
5860259222
[ES|QL] Render a Discover-like table in the assistant instead of a Lens chart (#184106)
## Summary

This PR does 2 things:

- Creates a new plugin that is a wrapper of the unified datatable and is
only for rendering as a table ES|QL results. The UnifiedDatatable
package is good but the consumers need to know all the properties to
understand how to use it and the necessity of displaying in a table the
results of an ES|QL query comes a lot lately. This plugin has only 3
required properties (rows, columns, query) which make it very easy for
the consumers to use it. It also integrates the Row Viewer flyout

- It changes the implementation of the obs ai assistant to render a
Discover like table instead of a Lens table. The Discover-like table is
much better on rendering a table with thousands of columns and is going
to be much more helpful for our users.

The same plugin can be used later for the inline ediitng flyout too in a
dashboard if we want to also display the results of an ES|QL query.

Some screenshots of the new possibilities in the assistant:

- I can see the results of an ES|QL query in a visualization


![meow](27f77ca3-633b-45f2-b935-42c62c184a04)

- I can render my results as a Document view

<img width="880" alt="image"
src="e8034e10-325d-4d9e-b8a5-34d01b0dbd9d">

<img width="1095" alt="image"
src="c8236e65-96aa-4fcb-b7c3-835e2a5665bd">

<img width="955" alt="image"
src="78b1d664-6863-42bf-a337-659143b7683d">


### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-05 20:20:20 +02:00
Marco Antonio Ghiani
0a0853bef9
[Spacetime] Fields metadata services (#183806)
## 📓 Summary

Closes https://github.com/elastic/observability-dev/issues/3331

Given the needs described in the linked issue about having a centralized
and async way to consume field metadata across Kibana, this work focuses
on providing server/client services to consume field metadata on demand
from static ECS definition and integration manifests, with the chance to
extend further the possible resolution sources.


3b2d9027-5c29-4081-ab17-1b43618c62a7

## 💡 Reviewers hints

This PR got quite long as it involves and touches different parts of the
codebase, so I'll break down the interesting parts for an easier review.

More details, code examples and mechanics description can be found in
the README file for the plugin.

### `@kbn/fields-metadata-plugin`

To avoid bundling and consuming the whole ECS static definition
client-side, a new plugin `@kbn/fields-metadata-plugin` is created to
expose the server/client services which enable retrieving only the
fields needed on a use-case basis.

### FieldsMetadataService server side

A `FieldsMetadataService` is instantiated on the plugin setup/start
server lifecycle, exposing a client to consume the fields and setup
tools for registering external dependencies.

The start contract exposes a `FieldsMetadataClient` instance. With this,
any application in Kibana can query for some fields using the available
methods, currently:
- `FieldsMetadataClient.prototype.getByName()`: retrieves a single
`FieldMetadata` instance.
- `FieldsMetadataClient.prototype.find()`: retrieves a record of
matching `FieldMetadata` instances.

`FieldsMetadataClient` is instantiated with the source repositories
dependencies. They act as encapsulated sources which are responsible for
fetching fields from their related source. Currently, there are 2 field
repository sources used in the resolution step, but we can use this
concept to extend the resolution step in future with more sources (LLM,
OTel, ...).
The currently used sources are:
- `EcsFieldsRepository`: allows fetching static ECS field metadata.
- `IntegrationFieldsRepository`: allows fetching fields from an
integration package from EPR, where the fields metadata are stored. To
correctly consume these fields, the `fleet` plugin must be enabled,
otherwise, the service won't be able to access the registered fields
extractor implemented with the fleet services.
As this service performs a more expensive retrieval process than the
`EcsFieldsRepository` constant complexity access, a caching layer is
applied to the retrieved results from the external source to minimize
latency.

### Fields metadata API

To expose this service to the client, a first API endpoint is created to
find field metadata and filter the results to minimize the served
payload.
- `GET /internal/fields_metadata/find` supports some initial query
parameters to narrow the fields' search.

### FieldsMetadataService client side

As we have a server-side `FieldsMetadataService`, we need a client
counterpart to consume the exposed API safely and go through the
validation steps.

The client `FieldsMetadataService` works similarly to the server-side
one, exposing a client which is returned by the public start contract of
the plugin, allowing any other to directly use fields metadata
client-side.

This client would work well with existing state management solutions, as
it's not decoupled from any library.

### useFieldsMetadata

For simpler use cases where we need a quick and easy way to consume
fields metadata client-side, the plugin start contract also exposes a
`useFieldsMetadata` react custom hook, which is pre-created accessing
the FieldsMetadataService client described above. It is important to
retrieve the hook from the start contract of this plugin, as it already
gets all the required dependencies injected minimizing the effort on the
consumer side.

The `UnifiedDocViewer` plugin changes exemplify how we can use this hook
to access and filter fields' metadata quickly.

### `registerIntegrationFieldsExtractor` (@elastic/fleet)

Getting fields from an integration dataset is more complex than
accessing a static dictionary of ECS fields, and to achieve that we need
access to the PackageService implemented by the fleet team.

To get access to the package, maintain a proper separation of concerns
and avoid a direct dependency on the fleet plugin, some actions were
taken:
- the `PackageService.prototype.getPackageFieldsMetadata()` method is
implemented to keep the knowledge about retrieving package details on
this service instead of mixing it on parallel services.
- a fleet `registerIntegrationFieldsExtractor` service is created and
used during the fleet plugin setup to register a callback that accesses
the service as an internal user and retrieves the fields by the given
parameters.
- the fields metadata plugin returns a
`registerIntegrationFieldsExtractor` function from its server setup so
that we can use it to register the above-mentioned callback that
retrieves fields from an integration.

This inverts the dependency between `fields_metadata` and `fleet`
plugins so that the `fields_metadata` plugin keeps zero dependencies on
external apps.

## Adoption

We currently have places where the `@elastic/ecs` package is directly
accessed and where we might be able to refactor the codebase to consume
this service.

**[EcsFlat usages in
Kibana](https://github.com/search?q=repo%3Aelastic%2Fkibana%20EcsFlat&type=code)**

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-05 09:51:50 +02:00
Angela Chuang
7ab3676af4
[SecuritySolution] Relocate endpoint tests (#183611)
## Summary

https://github.com/elastic/kibana/issues/181683

This PR moves 

1. x-pack/test/security_solution_endpoint_api_int to
`x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int`
2. x-pack/test/security_solution_endpoint to
`x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint`
3. x-pack/test/timeline to
`x-pack/test/security_solution_api_integration/test_suites/investigation/timeline`

### To test:

1. ```cd x-pack/test/security_solution_api_integration```

2. ```node ../../../scripts/functional_tests_server.js --config
./test_suites/security_solution_endpoint/serverless.endpoint.config.ts```

Once the server is launched (you might need Docker to run the serverless
tests), open another terminal, go to the same path, and execute the
command appears in the original:

The command should look like: ```node
../../../scripts/functional_test_runner
--config=test_suites/security_solution_endpoint/serverless.endpoint.config.ts```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-04 13:04:01 +01:00
Sander Philipse
95eb12cc45
[Search] Renaming the search frontend group (#184565)
## Summary

This renames the enterprise-search-frontend group to search-kibana to
better align with what our group actually does.
2024-06-03 13:14:49 -07:00
Luke G
f9e30fa328
transition sourcerer code ownership to threat hunting investigations (#184666)
## Summary

All this PR does is it changes the Sourcerer code ownership to threat
hunting investigations team.
2024-06-03 10:30:41 -07:00
Ahmad Bamieh
f1c854b9db
[i18n][system upgrade] Upgrade Intl Packages from v2 to v6 (#179506)
## Summary

Upgrading intl packages from v2 to v6

### Packages upgrade:

- [x] Add @formatJS packages
- [x] `react-intl` Upgraded
- [x] `intl-messageformat` Upgraded
- [x] `intl-format-cache` removed
- [x] `intl-relativeformat` removed
- [x] `intl-messageformat-parser` removed

### Todo list:
- [x] Refactor HTML tags
- [x] Refactor Upgrade tags
- [x] Refactor `kbn-i18n`
- [x] Refactor `kbn-i18n-react`
- [x] Refactor `FormattedRelative` to `FormattedRelativeTime`
- [x] Refactor polyfills
- [x] Refactor IntlShape types
- [x] Rewrite Providers
- [x] Rewrite tests using i18n
- [x] Removed current pseudolocale implementation (tracker:
https://github.com/elastic/kibana/issues/180244)
- [x] Fix jest tests using rendered `Provider`
- [x] Remove no longer valid i18n packages documentation (tracker:
https://github.com/elastic/kibana/issues/180259)

Closes https://github.com/elastic/kibana/issues/178968
Closes https://github.com/elastic/kibana/issues/38642


## Notes to code reviewers
For team other than the core team, please review your plugins code
changes by filtering files by codeowners.


### Test Snapshot updates
Most of the changes are refactors of renamed functions and changed ICU
syntax.

The main updates are snapshot changes where `FormattedMessage` is now
memoized so snapshots capturing the html tree needed to be updated to
use `<Memo(MemoizedFormattedMessage)` instead of `<FormattedMessage`


### ICU now supports HTML tags:
before:
```
<FormattedMessage
  defaultMessage="To buy a shoe, { link } and { cta }"
  values={{
    link: (
      <a class="external_link" target="_blank" href="https://www.shoe.com/">
        visit our website
      </a>
    ),
    cta: <strong class="important">eat a shoe</strong>,
  }}
/>
```
after:
```
<FormattedMessage
  defaultMessage="To buy a shoe, <a>visit our website</a> and <cta>eat a shoe</cta>"
  values={{
    a: msg => (
      <a class="external_link" target="_blank" href="https://www.shoe.com/">
        {msg}
      </a>
    ),
    cta: msg => <strong class="important">{msg}</strong>,
  }}
/>
```

### Escape character to prevent ICU parsing changed from double slashes
to single quotes:
before: `\\{escaped\\}`
after: `'{escaped}'`

### No need for Intl Shape
the new packages under formatJS are written in typescript and come with
types support out of the box so no need to set types when using i18n.

Renamed `InjectedIntlProps` with `WrappedComponentProps`.
Removed `prop-types` and `intlShape` in favor of `IntlShape`.

### FormattedRelative has been renamed to FormattedRelativeTime and its
API has changed significantly. See
[FormattedRelativeTime](https://formatjs.io/docs/react-intl/upgrade-guide-3x#formattedrelativetime)
for more details.

### All tags specified must have corresponding values and will throw
error if it's missing
All tags are now parsed and expected to be formatted properly (all
opened tags must be closed).

To skip this check you can use the `ignoreTag: true` property

```
i18n.translate('xpack.apm.agentConfig.captureJmxMetrics.description', {
      defaultMessage: 'This is not an HTML tag <JMX object name pattern>' +
      ignoreTag: true,
    }),
```

**When do I use ignore tags?**

If your message has HTML tags, it is preferred not to ignore the Tag to
have some string verification that the html tags you are adding are
properly formatted and closed.

If it the text between brackets is not an HTML tag and it is just a
fomat preference then using `ignoreTag` makes sense.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2024-06-02 16:50:33 +03:00
Jean-Louis Leysens
975eeed255
[HTTP/OAS] Commit OAS snapshot (#183338)
Close https://github.com/elastic/kibana/issues/181992

## Summary

First iteration of a CLI to capture an OAS snapshot.

## How to test

Run `node ./scripts/capture_oas_snapshot.js --update --include-path
/api/status` and see result in `oas_docs/bundle.json`.

If you have the [bump CLI](https://www.npmjs.com/package/bump-cli)
installed you can preview the hosted output with `bump preview
./oas_docs/bundle.json`

## Notes
* Added ability to filter by `version`, `access` (public/internal) and
excluding paths explicitly to the OAS generation lib
* Follows the same general pattern as our other "capture" CLIs like
`packages/kbn-check-mappings-update-cli`
* Result includes only `/api/status` for now, waiting for other paths to
add missing parts

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-30 06:02:19 -07:00
Khristinin Nikita
aa7ffc499f
Initial backfull group (#184144)
## Show backfill group for manual runs 

UX - copy is not final, there will be an additional ticket for that,
which we address later

After user execute manual rule API we will present backfill group.
Backfill group contains 1 to N scheduled entries. Each of the entry - is
associated with rule run (potential, in progress, completed)
Backfill group is removed after all task completed, so this why they
disappear from UI in the video



- Show amount of tasks
- Ability to cancel run
- There auto refresh - which is disabled by default, as backfills group
remove after completion



35823ac5-de20-4082-819f-030ccc524e82


### How to test 

1 . Enable feature flag - `manualRuleRunEnabled`
2. For you rule call schedule api
`/internal/alerting/rules/backfill/_schedule` `POST`
With this body (put your values for rule id and date range):
```
[{"rule_id":"58b4b926-6348-4c23-be1f-870a461fa342","start":"2024-05-21T13:00:00.000Z","end":"2024-05-21T14:05:00.000Z"}]
```

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 20:44:14 +02:00
Joe Reuter
c766dd33e2
Observability onboarding: Adjust codeowners (#184303)
This PR adjusts the codeowners to allow code reviews within the virtual
observability onboarding plugin
2024-05-29 10:15:32 -07:00
Yngrid Coello
d39739ee85
[Dataset quality] Move page to stack management > Data (#184122)
Relates to https://github.com/elastic/kibana/issues/183406.

## 📝  Summary
This PR creates a new plugin `data_quality` in order to register dataset
quality as a Stack management page under data section. For now there is
no reference to this new page in the sideNav in stateful or serverless.

In order to navigate to this new page you can use the url
`/app/management/data/data_quality`

Changes included in this PR:
- New plugin created
- Plugin registered in stack management, data section
- Dataset quality plugin is instantiated and the state is in sync with
URL
- Removed references to dataset quality in Logs explorer

## 🎥 Demo


501c9c47-4a1b-4f91-9be6-d022a821e88e

## 🙅🏼 Missing

- Dataset quality locator
- There are still references to logs explorer (table and flyout) that
will be handled in a follow up PR.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 07:06:43 -07:00
Sébastien Loix
9e2b401f2c
[Stateful sidenav] Register observabilty nav from inside plugin (#184215) 2024-05-29 03:36:59 -07:00
Drew Tate
cf1ff97c12
[ES|QL] add function definition sync to CI (#184225)
## Summary

Runs the script added in https://github.com/elastic/kibana/pull/179584
on the weekly schedule.

Successful run:
https://buildkite.com/elastic/kibana-es-ql-grammar-sync/builds/21#018fab3b-d051-4852-a03e-889cf156fb70/838

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-05-28 11:02:20 -05:00
Faisal Kanout
4396bf6e2e
[OBS-UX-MNGMT] Move the Alerting comparators from TriggersActionsUI plugin to the alerting-types package (#181584)
## Summary
 It fixes #179633

Observability created a Comparator type/enum, when ResponseOps is
already exporting one and other rules using it.
The only difference is the wording of not in between [I put the two
types side by side to compare]
Currently, we import the one in triggers-actions-ui-plugin , and then
update the not in between to match our Comparator.

### Comparing the two enums:
![Screenshot 2024-04-23 at 18 17
23](16429ff9-e672-4c16-92ed-488a2f66007d)

## For reviewers 🧪 
- Everything should work as expected: Alert flyout, Alert reason
message, Rule creation flyout, etc.
- I kept the `outside` comparator (replaced by `NOT BETWEEN`) for
backward compatibility
2024-05-28 15:34:52 +02:00
Umberto Pepato
df15fe1b06
[ResponseOps][Security Solution] Transfer ownership of the alerts grouping package to ResponseOps (#184131)
## Summary

As agreed in the recent ResponseOps/Security/Observability meeting, the
ResponseOps team will take ownership of the alerts grouping package
(formerly `@kbn/securitysolution-grouping`) in order to provide a
solution-agnostic API surface for future usages in Observability and
Stack rules.

This PR implements this transfer, while also renaming the package to
`@kbn/grouping` to reflect the change in scope.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-28 11:15:04 +02:00
Steph Milovic
e2e1fb3504
[Security solution] AI Assistant, replace LLM with SimpleChatModel + Bedrock streaming (#182041) 2024-05-22 16:29:14 -06:00