Commit graph

922 commits

Author SHA1 Message Date
Tiago Costa
7177a7630a
chore(NA): remove codeowners from minor branch 2023-08-16 15:46:50 +01:00
Georgii Gorbachev
a3e51bf3fe
[Security Solution] Fix CODEOWNERS for Detection and Response teams (#163964)
## Summary

According to @oatkiller, we have many CODEOWNERS rules that match no
files.

I updated the file according to this and my own audit:

```
$ github-codeowners validate
Found duplicate rules [
  'x-pack/packages/observability/alert_details @elastic/actionable-observability'
]
Found rules which did not match any files [
  'x-pack/test/alerting_api_integration/common/plugins/aad @elastic/response-ops',
  'x-pack/test/alerting_api_integration/common/plugins/actions_simulators @elastic/response-ops',
  'x-pack/test/alerting_api_integration/packages/helpers @elastic/response-ops',
  'x-pack/test/alerting_api_integration/common/plugins/alerts @elastic/response-ops',
  'x-pack/test/alerting_api_integration/common/plugins/alerts_restricted @elastic/response-ops',
  'test/analytics/plugins/analytics_ftr_helpers @elastic/kibana-core',
  'test/analytics/plugins/analytics_plugin_a @elastic/kibana-core',
  'x-pack/test/security_api_integration/plugins/audit_log @elastic/kibana-security',
  'x-pack/test/cases_api_integration/common/plugins/cases @elastic/response-ops',
  'x-pack/plugins/cloud_defend @elastic/sec-cloudnative-integrations',
  'src/plugins/data @elastic/kibana-visualizations @elastic/kibana-data-discovery',
  'x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin @elastic/kibana-security',
  'x-pack/test/ui_capabilities/common/plugins/foo_plugin @elastic/kibana-security',
  'test/interactive_setup_api_integration/plugins/test_endpoints @elastic/kibana-security',
  'x-pack/test/cases_api_integration/common/plugins/observability @elastic/response-ops',
  'x-pack/test/security_api_integration/plugins/oidc_provider @elastic/kibana-security',
  'packages/kbn-performance-testing-dataset-extractor @elastic/kibana-performance-testing',
  'packages/react/kibana_context/common @elastic/appex-sharedux',
  'packages/react/kibana_context/render @elastic/appex-sharedux',
  'packages/react/kibana_context/root @elastic/appex-sharedux',
  'packages/react/kibana_context/styled @elastic/appex-sharedux',
  'packages/react/kibana_context/theme @elastic/appex-sharedux',
  'packages/react/kibana_mount @elastic/appex-sharedux',
  'x-pack/test/security_api_integration/plugins/saml_provider @elastic/kibana-security',
  'x-pack/test/saved_object_api_integration/common/plugins/saved_object_test_plugin @elastic/kibana-security',
  'x-pack/test/security_api_integration/packages/helpers @elastic/kibana-core',
  'x-pack/plugins/security_solution_ess @elastic/security-solution',
  'x-pack/test/cases_api_integration/common/plugins/security_solution @elastic/response-ops',
  'x-pack/plugins/security_solution_serverless @elastic/security-solution',
  'x-pack/test/security_functional/plugins/test_endpoints @elastic/kibana-security',
  'x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin @elastic/kibana-security',
  'x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture @elastic/response-ops',
  'x-pack/test/security_api_integration/plugins/user_profiles_consumer @elastic/kibana-security',
  '/src/plugins/visualize/ @elastic/kibana-visualizations',
  '/x-pack/test/api_integration/apis/lens/ @elastic/kibana-visualizations',
  '/x-pack/test/functional/apps/dashboard/reporting/ @elastic/appex-sharedux',
  '/x-pack/test/functional/es_archives/lens/reporting/ @elastic/appex-sharedux',
  '/src/plugins/kibana_react/public/@elastic/appex-sharedux @elastic/kibana-presentation',
  '/.github/workflows/deploy-my-kibana.yml @elastic/observablt-robots',
  '/.github/workflows/oblt-github-commands @elastic/observablt-robots',
  '/x-pack/test/api_integration/apis/infra @elastic/infra-monitoring-ui',
  '/src/dev/build/tasks/bundle_fleet_packages.ts @elastic/fleet @elastic/kibana-operations',
  '/src/apm.js @elastic/kibana-core @vigneshshanmugam',
  '/src/core/types/elasticsearch @elastic/apm-ui',
  '/packages/kbn-utility-types/src/dot_test.ts @dgieselaar',
  '/x-pack/test/alerting_api_integration/observability/synthetics_rule.ts @elastic/uptime',
  '/x-pack/test/alerting_api_integration/observability/index.ts @elastic/uptime',
  '/x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime',
  '/x-pack/plugins/apm/public/components/app/rum_dashboard @elastic/uptime',
  '/x-pack/test/apm_api_integration/tests/csm/ @elastic/uptime',
  '/x-pack/test/api_integration_basic/apis/ml/ @elastic/ml-ui',
  '/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ml_rule_types/ @elastic/ml-ui',
  '/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/ @elastic/ml-ui',
  '/x-pack/test/screenshot_creation/services/ml_screenshots.ts @elastic/ml-ui',
  '/x-pack/test/functional/es_archives/maps/ @elastic/kibana-gis',
  '/src/dev/license_checker/config.ts @elastic/kibana-operations',
  '/test/visual_regression @elastic/appex-qa',
  '/x-pack/test/visual_regression @elastic/appex-qa',
  '/src/core/public/i18n/  @elastic/kibana-localization @elastic/kibana-core',
  '/x-pack/plugins/security_solution/public/common/components/alerts_viewer @elastic/security-threat-hunting-investigations',
  '/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_action @elastic/security-threat-hunting-investigations',
  '/x-pack/plugins/security_solution/public/detections/components/alerts_info @elastic/security-threat-hunting-investigations',
  '/x-pack/plugins/security_solution/common/search_strategy/security_solution/user @elastic/security-threat-hunting-explore',
  '/x-pack/plugins/security_solution/cypress/upgrade_e2e/threat_hunting/cases @elastic/security-threat-hunting-explore',
  '/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine',
  '/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations @elastic/security-detection-rule-management',
  '/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules @elastic/security-detection-rule-management',
  '/x-pack/plugins/security_solution/common/api/detection_engine/rule_management @elastic/security-detection-rule-management',
  '/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring @elastic/security-detection-rule-management',
  '/x-pack/plugins/security_solution/common/detection_engine/fleet_integrations @elastic/security-detection-rule-management',
  '/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules @elastic/security-detection-rule-management',
  '/x-pack/plugins/security_solution/common/detection_engine/rule_monitoring @elastic/security-detection-rule-management',
  '/x-pack/plugins/security_solution/common/detection_engine/rule_exceptions @elastic/security-detection-engine',
  '/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions_ui @elastic/security-detection-engine',
  '/x-pack/plugins/security_solution/public/common/components/exceptions @elastic/security-detection-engine',
  '/x-pack/plugins/security_solution/server/lib/sourcerer @elastic/security-detection-engine',
  '/x-pack/plugins/security_solution/cypress/e2e/detection_rules @elastic/security-detection-rule-management @elastic/security-detection-engine',
  '/x-pack/plugins/security_solution/cypress/plugins @elastic/security-detections-response @elastic/security-threat-hunting',
  '/x-pack/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations',
  '/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions @elastic/security-detection-engine @elastic/security-detection-rule-management',
  'x-pack/plugins/security_solution/cypress/ccs_e2e @elastic/security-engineering-productivity',
  'x-pack/plugins/security_solution/cypress/upgrade_e2e @elastic/security-engineering-productivity',
  '/x-pack/plugins/security_solution/common/detection_engine/rule_response_actions @elastic/security-defend-workflows',
  '/x-pack/plugins/security_solution/public/common/components/guided_onboarding @elastic/security-threat-hunting-explore',
  '/x-pack/plugins/apm/**/*.scss @elastic/observability-design',
  '/x-pack/plugins/endpoint/**/*.scss @elastic/security-design',
  '/x-pack/plugins/security_solution_ess/**/*.scss @elastic/security-design',
  '/x-pack/plugins/security_solution_serverless/**/*.scss @elastic/security-design'
]
```
2023-08-16 07:27:53 -07:00
Gloria Hornero
e78d61789f
[Security Solution] Updates codeowners file (#164026) 2023-08-16 05:38:11 -07:00
Gloria Hornero
f9c9722c6f
[Security Solution][Serverless] Reusing Cypress tests for Serverless infrastructure (#162698)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
2023-08-15 19:50:54 +02:00
Dzmitry Lemechko
12a10d9855
Add appex-qa as codeowner for FTR serverless base config files (#163914)
## Summary

This way Appex-QA can keep track on config changes and make sure folks
aware that some changes might not work for real MKI-hosted projects.
2023-08-15 02:13:56 -07:00
Clint Andrew Hall
1546490e98
[settings] Extract and fix Section Registry (#163502)
## Summary

While working to extract various portions of the `advancedSettings`
plugin into packages, I found the `ComponentRegistry` in the plugin to
have a number of issues that contributed to a fairly bad UX:

- the API allows for adding/overriding the title, subtitle and footer of
the Advanced Settings page, but only the footer is rendered.
- the API is available to all plugins, but only renders a single
entry... so depending on the plugin load order, the render is not
guaranteed.
- filtering the footer in or out of the display is delegated to the
component itself, so:
  - it only takes effect on render.
- the count is only updated if you click on the page that contains it,
but that logic is currently broken.
  - the error message is inaccurate.

![Aug-09-2023
11-19-06](494aba14-f2c0-4ce7-b3f0-1910824aeb0e)

This PR fixes those issues and more:

- extracts the registry into its own package.
- changes the API to allow for multiple sections from multiple plugins.
- changes the API to filter these sections from the plugin, rather than
from each individual component.
- fixes state management to show sections, keep counts accurate, etc.

![Aug-09-2023
11-02-11](d8e8033c-f9ed-4615-b954-b5c23fda4d7a)

---------

Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
2023-08-14 11:00:33 -07:00
Dmitrii Shevchenko
bc37dc2c5a
[Security Solution] Initial OpenAPI codegen implementation (#163186)
**Resolves: https://github.com/elastic/security-team/issues/7134**

## Summary

Implemented request and response schema generation from OpenAPI
specifications.

The code generator script scans the
`x-pack/plugins/security_solution/common/api` directory, locates all
`*.schema.yaml` files, and generates a corresponding `*.gen.ts` artifact
for each, containing `zod` schema definitions.

<hr/>

Right now, all generation sources are set to `x-codegen-enabled: false`
to prevent the creation of duplicate schemas. Maintaining the old
`io-ts` schemas alongside the new `zod` ones could potentially lead to
confusion among developers. Thus, the recommended migration strategy is
to incrementally replace old schema usages with new ones, subsequently
removing outdated ones. I'll be implementing this approach in the
upcoming PRs.

### How to use the generator

If you need to test the generator locally, enable several sources and
run the generator script to see the results.

Navigate to `x-pack/plugins/security_solution` and run `yarn
openapi:generate`

<img width="916" alt="image"
src="be1a8a61-b9ed-4359-bc3e-bf393f256859">

Important note: if you want to enable route schemas, ensure you also
enable all their dependencies, such as common schemas. Failing to do so
will result in the generated code importing non-existent files.

### Example

Input file
(`x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.schema.yaml`):

```yaml
openapi: 3.0.0
info:
  title: Error Schema
  version: 'not applicable'
paths: {}
components:
  schemas:
    ErrorSchema:
      type: object
      required:
        - error
      properties:
        id:
          type: string
        rule_id:
          $ref: './rule_schema/common_attributes.schema.yaml#/components/schemas/RuleSignatureId'
        list_id:
          type: string
          minLength: 1
        item_id:
          type: string
          minLength: 1
        error:
          type: object
          required:
            - status_code
            - message
          properties:
            status_code:
              type: integer
              minimum: 400
            message:
              type: string
```

Generated output file
(`x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.gen.ts`):

```ts
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

import { z } from 'zod';

/*
 * NOTICE: Do not edit this file manually.
 * This file is automatically generated by the OpenAPI Generator `yarn openapi:generate`.
 */

import { RuleSignatureId } from './rule_schema/common_attributes.gen';

export type ErrorSchema = z.infer<typeof ErrorSchema>;
export const ErrorSchema = z.object({
  id: z.string().optional(),
  rule_id: RuleSignatureId.optional(),
  list_id: z.string().min(1).optional(),
  item_id: z.string().min(1).optional(),
  error: z.object({
    status_code: z.number().min(400),
    message: z.string(),
  }),
});
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-14 18:35:57 +02:00
Carlos Crespo
281cc224c9
Move Lens attribute builder to a package (#163422)
closes [#163491](https://github.com/elastic/kibana/issues/163491)

## Summary

This PR creates a new package that contains a utility API that helps to
generate the JSON with the attributes required to render a Lens chart
with the `EmbeddableComponent`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-14 11:46:47 +02:00
Efe Gürkan YALAMAN
1e7efae56a
[Enterprise Search] Reuse serverless panels on Enterprise Search (#163179)
## Summary

Reuse Serverless panels for API index overview. 
Updated Enterprise Search overview to latests designs.

Note: There will be another PR for layout changes on overview
afterwards.





51537e57-e822-4b9f-b9ed-49d82d192690


a3696897-40a5-4cb3-9fe6-53ce5b8f560f


de752063-04ff-42a3-8538-7fb10a9df1ca

![Screenshot 2023-08-09 at 01 55
33](083504c4-7fa6-424b-a833-89dd73c61e49)



### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[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
- [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))
- [ ] 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>
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2023-08-11 19:00:40 +02:00
Kerry Gallagher
00ffe1d791
[Logs+] Create an integration while on-boarding logs (#163219)
## Summary

This closes https://github.com/elastic/kibana/issues/161960, a basic
integration will now be created whilst onboarding logs (though the
custom logs flow).

This implements the *initial* version of this work, and does not include
things like adding a dataset to an existing integration.

## UI / UX

General:

![Screenshot 2023-08-07 at 15 20
21](3ca4e300-41c3-4554-a095-0f3dcf9e9523)

Naming conflict errors:

![Screenshot 2023-08-11 at 13 34
45](2a138eac-73e2-4cc9-b1e8-56c586b852ee)

![Screenshot 2023-08-11 at 13 34
59](6e651de9-debd-46aa-a3d5-2b6eb4e3bb4f)

Lack of permissions error:

![Screenshot 2023-08-09 at 17 10
35](d47b40c8-fe4a-4b86-abf8-d8fda51515fd)

General errors:

![Screenshot 2023-08-07 at 16 49
40](346c28d0-ec3e-4f7e-ae16-3f1adf440c21)

Success callout on the next panel:

![Screenshot 2023-08-07 at 17 20
45](03e78e45-871b-4224-9999-5b3d7e2ccdf0)

Delete previous flow (happens in the background):


![delete_process](44c18793-9df7-4228-b351-5668f098e138)


## Pointers for reviewers  / next steps

- This PR also creates a new package for the `useTrackedPromise` hook,
as this is used in several places and I didn't want to just duplicate it
again (I haven't replaced other current uses in this PR, but will as a
followup).

- `useFetcher` was avoided as A) it's very tightly coupled with the
observability onboarding server route repository (and `callApi` is
scoped to this) and I wanted to call an "external" API in Fleet and B) I
wanted explicit control over when the request is dispatched (not on
mount), and whilst this can sort of be achieved by not returning a
promise from the callback it gets quite messy. I also wanted more
granular error handling control.

- Moving forward I think we'll need to enhance the state management of
the plugin. We'll want to add the ability to "add to existing
integration" and this is going to make the state more complex (even with
chunks of this functionality likely moved to it's own package). I did
actually have the Wizard state moved in to a constate container at one
point (as a starter) but I reverted this commit to make the changeset
less intrusive. It's for this same reason that, for now, I haven't
focussed too closely on extracting things like generating the friendly
error messages etc as we'll likely want to extract some of the "create
integration" hooks / UI in to a standalone package so they can be used
elsewhere (not just onboarding). There are also quite a few `
eslint-disable-next-line react-hooks/exhaustive-deps` rules in the
plugin at the moment due to the references not being stable, we could
improve that at the same time as any state changes.

- You can technically navigate directly to
`/fox/app/observabilityOnboarding/customLogs/installElasticAgent`, but
no state is stored in the URL, so nothing is rehydrated resulting in a
very empty configuration. I'm not entirely sure this is a behaviour we
want, but for now I've just made the callout conditional on state
existing (so coming from the previous panel).

- The Fleet custom integrations API now throws a 409 (conflict) when
using a name that already exists.

## Testing

- Head to `/app/observabilityOnboarding` to trigger the onboarding flow
- Select "Stream log files"
- When hitting "continue" an integration should be created in the
background (check the network requests for
`api/fleet/epm/custom_integrations`)
- When continuing (to install shipper), then going back **and** making
changes to your integration options, when clicking continue again there
should be a network request that deletes the previously created
integration (to clean things up). This should be seamless to the user.
- You should not be able to use a name that already exists (for an
existing custom integration)
- General errors (like permission issues, asset installation issues)
should display at the bottom
- When you hit the next panel (install shipper) there should be a
success callout that also contains the name of the integration that was
created

## In progress

~Two changes still in progress, but they don't need to hold up the
review (8.10 coming soon 👀):~

- ~To have a friendlier error for permissions issues (not just
"forbidden")~
- ~Fleet API integration test for the naming collision~

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-11 17:18:55 +01:00
Julia Rechkunova
c97d4960bf
[Discover] Inline shard failures warnings (#161271)
- Closes https://github.com/elastic/kibana/issues/155216

## Summary

This PR replaces shard falures toasts with inline warnings in Discover.

- [x] Intercept shard failures in Discover main app
- [x] Show inline warnings above the grid instead
- [x] Handle NoResultsFound case too
- [x] Implement for Discover context app
- [x] Implement for saved search embeddable on Dashboard
- [x] Can we inline timeouts too?
- [x] Check SQL view
- [x] Add tests


Discover view with shard failures
<img width="400" alt="Screenshot 2023-07-06 at 14 23 48"
src="a0799aa0-9d2e-42ee-b89b-e0e1180220a5">

Discover view with shard failures (and no results)
<img width="400" alt="Screenshot 2023-07-07 at 13 24 50"
src="28dc2bad-9776-4aa9-8f51-219d1c87487a">

Dashboard view with shard failures
<img width="400" alt="Screenshot 2023-07-06 at 16 15 49"
src="2a68c19a-1ca8-4f10-a9f5-4aa56f9160b0">

Surrounding documents view with shard failures
<img width="400" alt="Screenshot 2023-07-10 at 17 26 31"
src="ade63cfe-a1c2-4c22-8823-58dcfef9357f">

Discover view with timeouts
<img width="400" alt="Screenshot 2023-07-07 at 16 47 27"
src="0101be19-a555-4f96-b963-7fe418d51fb5">

Dashboard view with timeouts
<img width="400" alt="Screenshot 2023-07-07 at 16 48 18"
src="82979365-4129-4385-8a13-9c139e1acbf1">

Surrounding documents view with timeouts
<img width="400" alt="Screenshot 2023-07-11 at 15 03 41"
src="0ea41b79-ac6b-4456-9cfa-0d038b10da7d">

## Testing

For testing please uncomment
3f102cf688/src/plugins/data/common/search/search_source/search_source.ts (L922)
or
3f102cf688/src/plugins/data/common/search/search_source/search_source.ts (L547)
and switch to `kibana*` data view.


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] 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: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-10 13:49:45 +02:00
Patryk Kopyciński
4637b744d8
Add SentinelOne connector (#159157)
## Summary

Adds new connector type to support https://www.sentinelone.com/

The scope of this PR was limited to the Connector logic, schemas, and
types to make PR more digestible.
In the current PR, the connector is NOT registered, so it's not going to
be available to the users.
In the follow-up PR I'm going to improve the UX of Param's form and then
enable the connector

<img width="1685" alt="Zrzut ekranu 2023-08-3 o 11 18 54"
src="965ef8ef-497f-42a8-983e-38fd0370cba8">
 visual changes include a screenshot or gif.

<img width="1685" alt="image"
src="119d2255-ed9f-4923-886d-eb139223a47d">

<img width="1690" alt="image"
src="e2c569d2-b497-4641-a6a6-454494223ffc">
2023-08-09 11:02:11 -07:00
Marshall Main
db0996f4a3
[Security Solution] Move remaining timeline route schemas to /common/api (#162857)
Closes https://github.com/elastic/security-team/issues/7099
Follow up to https://github.com/elastic/kibana/pull/162314

I mislabeled 3 timeline-related internal APIs as detection engine APIs
on [this
spreadsheet](https://docs.google.com/spreadsheets/d/1VCoJ74EkyGuj59VwWj_3v2ecB84pNCpzGqkYnS0SUKw/edit?pli=1#gid=1102015677)
(create_tags, get_tags_by_name, get_dashboards_by_tags). The APIs are
now correctly categorized on the spreadsheet and this PR establishes
schemas for them in `/common/api`.

I also converted these 3 small schemas to io-ts to make it easier to
avoid pulling in `@kbn/config-schema` to `public`, as that increased the
async chunk size by a full 840KB.
2023-08-09 07:26:08 -07:00
Marshall Main
30ca22c254
[Security Solution] Move risk score API schemas to /common/api (#163032)
Closes https://github.com/elastic/security-team/issues/7101
2023-08-07 07:33:08 -07:00
Davis McPhee
5aac9c5875
Assign functional tests and example plugins code ownership to Data Discovery (#162740)
## Summary

This PR assigns code ownership to the Data Discovery team for various
functional tests as well as a couple of example plugins. All of the
tests assigned to us in `CODEOWNERS` currently have no one else assigned
to them.

### Checklist

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

### For maintainers

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-04 17:21:13 -03:00
Paul Tavares
3efc73ca85
[Security Solution][Endpoint] Add Endpoint with event collection only to Serverless Security Essentials PLI (#162927)
## Summary

- Adds Endpoint Management and Policy Management to the base Security
Essentials Product Line Item in serverless
- Removes access to Endpoint policy protections (Malware, Ransomware,
etc) from the policy form when endpoint is being used without the
Endpoint Essentials/Complete addon
2023-08-04 10:24:12 -07:00
Rachel Shen
d8078b625d
[Reporting] Remove PNG V1 (#162517)
## Summary

Closes https://github.com/elastic/kibana/issues/162293 and partially
addresses [154601](https://github.com/elastic/kibana/issues/154601)

Removes the screenshot diagnostic tool but keeps the browser check
Removes PngV1ExportType from core and the export types registry

### Before
There were two steps so the EuiSteps component definitely made more
sense.

![Screenshot 2023-07-31 at 8 38 50
AM](f054f024-9148-4343-be45-9ddf175b8c71)

![Screenshot 2023-07-31 at 8 41 53
AM](71c6de8a-723c-462a-a7ad-51a4ca45f58f)


### After
I removed the use of the EuiSteps component since there's only the
browser check. Since the EuiSteps also showed some validation, I added a
callout to let users know the status of the diagnostic.

![Screenshot 2023-07-31 at 8 35 05
AM](fce09be1-ec2d-43bf-ab7d-f90df82c0579)

![Screenshot 2023-07-31 at 1 51 00
PM](3fdeb41e-5d3a-4e99-b9aa-63d2d739715f)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-02 14:30:41 -06:00
Dario Gieselaar
49733763ef
[Observability AI Assistant] Change CODEOWNERS (#162905)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-02 08:24:37 -07:00
Marshall Main
b2bf401fe2
[Security Solution] Add threat hunting investigations as codeowners of common/api/timeline (#162858)
`common/api/timeline` is a new folder added as part of
https://github.com/elastic/security-team/issues/7151 - contains schemas
owned by threat hunting investigations team.
2023-08-02 07:20:18 -07:00
Paul Tavares
733e19c5c0
[Security Solution][Serverless][Endpoint] Defines set of available kibana privileges for Endpoint Essentials/Complete add-on (#162281)
## Summary

PR defines the set of available app features for serverless Product Line
Items (PLIs) for Endpoint addon. Changes include:

- Adds new Security Solution Serverless config file group:
`xpack.securitySolutionServerless.developer.*`. Used to facilitate
development. Values can be set via the
`config/serverless.security.dev.yml`
- Includes `disableManagementUrlRedirect` config option, which when set
to `true` will disable the redirect currently in place when a user
attempts to access the kibana Management pages.
- Defines the set of Kibana Privileges that goes along with Endpoint
Essentials and Endpoint Complete addons for serverless
- Includes cypress e2e tests for validating Endpoint Management related
access based on Product Tier (see below for list of test per role/per
product tier)

**Changes to e2e test framework:**

- Cypress `parallel` runner now normalizes the set of ENV variable
passed into each of the cypress runs
- Added support to Cypress for defining `productTier` via a Cypress test
file (`*.cy.ts`) top-level `describe(description, config, testFn)`
block. Will be applied when the stack is running in `serverless` mode.
- NOTE: if opening Cypress locally using `cypress:open`, you likely will
have to change the setup (only locally - don't commit) to only pickup
your 1 test file because the current implementation of Cypress
`parallel` only reads the first test file
- Serverless Security folder structure was altered with the following:
- `ftr` folder was created and all existing FTR tests moved under it (we
already had a `cypress` folder, thus those are clearly separated)
- a new folder was was created here `test_serverless/shared/lib`.
Contains code that should be test framework independent (aka: can be
used from both FTR and Cypress).
- It currently has the security solution role/user loader logic, thus it
can be used by both FTR (ex. API integration) and Cypress


### 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>
2023-08-01 10:20:46 -07:00
Tomasz Ciecierski
e2db0b0e66
[EDR Workflows] Move Endpoint schemas to common/api/endpoint folder (#162788) 2023-08-01 19:04:41 +02:00
Quynh Nguyen (Quinn)
0728003865
[ML] Add new Data comparison view (#161365)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-31 08:24:01 -07:00
Philippe Oberti
b0fbe9340c
[Security Solution] - expandable flyout - code owners (#162792) 2023-07-31 17:06:17 +02:00
Clint Andrew Hall
477505a2dd
[context] Unify Contexts, deprecate others (#161914)
> Pre-req for https://github.com/elastic/kibana/issues/56406

## Summary

We've had a long-standing problem in Kibana around our use of React
context, particularly with EUI and i18n. There hasn't existed an
idempotent context structure, and that has lead to a lot of unexpected
results, (e.g. missing translations, inconsistent dark mode, excess
context providers, etc).

The biggest change coming from this PR is knowing exactly which provider
to use in a particular use case. This means, for example,
`ReactDOM.render` calls won't be missing `i18n` or `theme` due to a
missing context. It also allows consumers to use `darkMode` without
having to read the `uiSetting` themselves, instead allowing the context
to do it for them.

We also haven't been honoring the intended [`EuiProvider`
API](https://eui.elastic.co/#/utilities/provider#theming-and-global-styles)...
in some cases we've been creating and re-creating the Emotion caches,
often by copy/paste of the cache code. We've also been nesting
`EuiThemeProvider` contexts unnecessarily-- thinking we need to render a
theme provider in an isolated component-- which renders an additional
`span` element into the DOM.

This PR attempts to address this inconsistency by creating a set of
context providers divided by use case:


![diagram](e01c6296-1b7a-4639-ae96-946866950efe)

### `KibanaRootContextProvider`
A root context provider for Kibana. This is the top level context
provider that wraps the entire application. It is responsible for
initializing all of the other contexts and providing them to the
application. It's provided as a package for specific use cases, (e.g.
the `RenderingService`, cases where we replace the entire page content,
Storybook, testing, etc), but not intended for plugins.

### `KibanaRenderContextProvider`
A render context provider for Kibana. This context is designed to be
used with ad-hoc renders of React components, (usually with
`ReactDOM.render`).

### `KibanaThemeContextProvider`
A theme context provider for Kibana. A corollary to EUI's
`EuiThemeProvider`, it uses Kibana services to ensure the EUI Theme is
customized correctly.

### (deprecated) `KibanaStyledComponentsThemeProvider`
A styled components theme provider for Kibana. This package is supplied
for compatibility with legacy code, but should not be used in new code.

## Deprecation strategy
This PR does *not* change any use of context by consumers. It maps the
existing contexts in `kibanaReact` to the new contexts, (along with the
loose API). This means that we won't have completely fixed all of our
dark mode issues yet. But this is necessary to keep this PR focused on
the change, rather than drawing in a lot of teams to review individual
uses.

We should, however, see an immediate performance improvement in the UI
from the reduction in `EuiProvider` calls.

## Open questions
- [ ] Does it make sense to expose a `useTheme` hook from
`@kbn/react-kibana-context-theme` to replace `useEuiTheme`?

## Next steps
- [ ] Update deprecated uses to new contexts.
- [ ] Audit and update calls to `ReactDOM.render`.
- [ ] Add ESLint rule to warn for use of EUI contexts.
- [ ] Delete code from `kibanaReact`.
2023-07-28 09:30:08 -07:00
Dario Gieselaar
f0ebb7097d
[Observability AI Assistant]: Move to new plugin, update design and use connectors (#162243)
This PR makes the following changes:

- Update look & feel of contextual insights (previously called prompts)
according to the new design that is being developed. Some things might
still change, but hopefully not too much.
- Move all the Observability AI Assistant (previously called CoPilot)
code into a separate plugin for better isolation, more specific code
ownership and to solve some circular dependency issues
- Use connectors instead of a kibana.yml setting

Note: for OpenAI, the model is currently hardcoded to `gpt-4` until
https://github.com/elastic/kibana/issues/162204 has been addressed.


557676b6-065a-4b6f-86b2-1f0c2fd5e07e

---------

Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 11:52:00 -04:00
Davis McPhee
e0fb467a5c
Add test/examples/discover_customization_examples to CODEOWNERS (#162603)
## Summary

This PR adds `test/examples/discover_customization_examples` to the
`CODEOWNERS` file.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-27 11:53:40 -03:00
Walter Rafelsberger
0ab24e566c
[ML] AIOps: Use Kibana's http service instead of fetch, fix throttling. (#162335)
- Originally Kibana's `http` service did not support receiving streams,
that's why we used plain `fetch` for this. This has been fixed in
#158678, so this PR updates the streaming helpers to use Kibana's `http`
service from now on.
- The PR also breaks out the response stream code into its own package
and restructures it to separate client and server side code. This brings
down the `aiops` bundle size by `~300KB`! 🥳
- The approach to client side throttling/buffering was also revamped:
There was an issue doing the throttling inside the generator function,
it always waited for the timeout. The buffering is now removed from
`fetchStream`, instead `useThrottle` from `react-use` is used on the
reduced `data` in `useFetchStream`. Loading log rate analysis results
got a lot snappier with this update!
2023-07-27 08:57:10 +02:00
Ivan Fernandez Calvo
072ed1ea58
feat: enable /oblt-deploy-serverless (#161951)
## Summary

This PR enables the GitHub command /oblt-deploy-serverless. This command
allows Elasticians to deploy their PRs in a serverless environment with
Observability data.

### For maintainers

- [x] Requiere to merge
https://github.com/elastic/apm-pipeline-library/pull/2288
2023-07-26 10:08:37 +02:00
Sergi Massaneda
3d6dbd4ad7
[Security Solution] Unified IA Project Navigation (#161667)
## Summary

Implementation of serverless-specific pages within the Unified IA
Navigation.

#### Links implemented:

- `Machine Learning`
  - Landing page created on serverless only
  - All links in the landing page go to `/ml` app
  
- `Dev Tools` 
  - Links directly to `/dev_tools` app


![snapshot](bd53c796-02df-4c3a-88e4-0fa043b896cd)

#### Links not implemented:
```// TODO: in a follow-up PR```

- Project Settings
  - Change the _Settings_ name by _Project Settings_
  - Modify the landing page items according to the design

## Changes

### Plugin contract changes

The Machine Learning landing page is the first page that is only available on serverless and should not exist in ess (there are more of this kind in the pipeline), so this PR implements the foundations to enable the _security_solution_serverless_ plugin to implement its own page components, configure the link definition and create new routes to render them in the Security Solution application. 
These new APIs can be called from either `security_solution_serverless` or `security_solution_ess`, allowing those plugins to have their own offering-specific pages.

The new APIs exposed in the security_solution public contract are the following:

 - `extraAppLinks$`: Observable to add extra app_links into the application links configuration, so they are stored and included in the SecuritySolution plugin `deepLinks` registry, to make them accessible from anywhere in the application using the `chrome.navLinks` API.
 
 - `extraRoutes$`: Observable to add extra routes into the main Router, so it can render the new page components. These additional routes are appended after the "sub-plugin" (_alerts_, _timeline_, ...) routes, so it is not possible to override an existing route path.
 
### New `security-solution-navigation` package

Since now we need to use the same navigation components and hooks in different plugins, these functionalities have been extracted to the `@kbn/security-solution-navigation` package, which all Security plugins will depend on (generic, serverless, and ess).

The modules exposed by this package have been extracted from the main security_solution plugin and standardized. They include the Landing pages components (new [storybook](https://ci-artifacts.kibana.dev/storybooks/pr-161667/394abe76676c6a76b2982c1d3f5bb675739c3477/security_solution_packages/index.html?path=/story/landing-links-landing-links-icons-categories--landing-links-icons-categories) available), navigation hooks, and link utilities. Also, some types and constants have been moved to this package.

A new context provider has also been created, which needs to be in place in order to use this package. The `<NavigationProvider core={core}>` is required for the package functionalities to have access to the Kibana core navigation APIs: `navigateToUrl`, `navigateToApp`, and `getUrlForApp`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: YulNaumenko <jo.naumenko@gmail.com>
2023-07-25 14:02:10 -07:00
Georgii Gorbachev
4087316960
[Security Solution] Restructure Cypress tests under security_solution/cypress/e2e/detection_rules folder (#162373)
**Epic:** https://github.com/elastic/kibana/issues/153633
**Partially addresses:** https://github.com/elastic/kibana/issues/153645

## Summary

This PR builds upon https://github.com/elastic/kibana/pull/161900 and
moves tests located in the `e2e/detection_rules` folder into
`e2e/detection_response` and splits them into multiple sub-folders
according to the Detection Engine subdomains we have. It also updates
the CODEOWNERS file accordingly.

<img width="451" alt="Screenshot 2023-07-25 at 21 03 08"
src="fb6052c9-3c5d-4547-98f1-61f44b9f7187">

## Details

Specifically, changes in this PR include:

- The `e2e/detections_response` folder was renamed to
`e2e/detection_response`.
- The `e2e/detections_response/bulk_actions` folder became
`e2e/detection_response/rule_management/rule_actions/bulk_actions`.
- Cypress tests for rule types (which actually test rule creation for
different rule types) were moved to
`e2e/detection_response/rule_creation`.
- The CODEOWNERS file was updated.

Things not addressed in this PR:

- No ownership was assigned for `e2e/detection_response/rule_actions`.
Will need to figure this out with @yctercero.
- No restructuring was done for `security_solution/cypress/screens` and
`security_solution/cypress/tasks`. Will be done in follow-up PRs.
- No refactoring was done for the tests themselves. Some of this work is
also upcoming.

The full file structure of the `detection_response` tests looks like
this:

<img width="452" alt="Screenshot 2023-07-25 at 21 03 44"
src="2b89c6d2-9f2d-4cf6-914f-a71c3fa93595">
2023-07-25 22:31:04 +02:00
Drew Tate
092e988df2
[Lens][Event annotations] Move logic into packages (#161500) 2023-07-19 09:46:57 -05:00
James Gowdy
219426dc7a
[ML] Creating category validation package (#161261)
Moves the server and client side code which performs analysis on data to
see whether it is suitable for categorization.
This is currently only used by the categorization job wizard to display
this callout:

![image](08db5321-0c38-474d-9bfe-90b8a9ad984a)

However this analysis will be useful for the Log Pattern Analysis
feature and so moving the code to a package allows easier sharing
between ML and AIOPs plugins.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-19 12:34:29 +01:00
Lukas Olson
2a689fa787
Create @kbn/discover-utils package (#162004)
## Summary

Creates a shared package for Discover utils/services/hooks,
`@kbn/discover-utils`. Moves a couple of utils there
(`buildDataTableRecord`/`getDocId`). This will be the future home for
many services/utils that are shared between the Discover app and its
packaged components (like unified field list, unified histogram, etc.)

### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-18 13:34:09 -07:00
Marshall Main
d538654763
[Security Solution] Establish unified API schema folder (#160447)
## Summary

In support of https://github.com/elastic/security-team/issues/6726 -
defining a `common/api/` folder for types that must not have breaking
changes made to them.

security_solution/
| - common/
| | - api/
| | | - detection_engine/
| | | | - api_routes/
| | | | - model/
| | | | - sub_domains/
| | | | | - api_routes/
| | | - other_domains/


### Structure
- Every domain can have 3 components: sub-domains, a model, and api
routes
- Every API route has a folder dedicated to that route (e.g.
`/detection_engine/rule_management/crud/create_rule`)
- API route request and response schemas are defined in a single
`*_route.ts` file
- No file in `/common/api/` should import from outside of `/common/api`
(not implemented yet, but this will be enforced by the switch to OpenAPI
yaml files)
- Routes are grouped into domains for convenience
  - Domains may have sub-domains 
- Domains and sub-domains *may* contain a `model` folder for complex
structures that are shared throughout the domain (e.g.
`/detection_engine/model/rule_schema/`)
- `model` folders *must not* contain any routes in any sub-directory.
Any file with `/model/` in its path is a shared component, not a route.
- Every domain *must* contain at least one route
- Instead of creating `/detection_engine/rule_schema/model`, where
`rule_schema` would not have any routes, we should create
`/detection_engine/model/rule_schema`
- When importing API schemas from outside of `/common/api`, e.g. for
usage in `public` or `server` code, prefer importing from
`/common/api/<domain>` rather than `/common/api/<domain>/<sub
domain>/<route>` to avoid depending on the internal structure of the API
folder
- When importing from one API schema to another, prefer fully specifying
the import path (`/common/api/<domain>/<sub domain>/<route>` instead of
`/common/api/<domain>`) to avoid import cycle problems
- `index.ts` files should be created per top level API domain and export
the API schemas
  - `index.ts` files may be created for sub domains if it's convenient
- Avoid importing schemas from one route into another - it's a sign that
the schema should be extracted to the common `model` for the domain
- There are still a number of places where this happens that I haven't
tried to fix yet

### Full List of APIs

https://docs.google.com/spreadsheets/d/1VCoJ74EkyGuj59VwWj_3v2ecB84pNCpzGqkYnS0SUKw/edit#gid=0

To print the full list of APIs for a plugin, add the following code in
`plugin.ts`:
```
const tempGet = router.get;
router.get = (route, handler) => {
  console.log(`GET: ${route.path}`);
  tempGet(route, handler);
};

const tempPost = router.post;
router.post = (route, handler) => {
  console.log(`POST: ${route.path}`);
  tempPost(route, handler);
};

const tempPut = router.put;
router.put = (route, handler) => {
  console.log(`PUT: ${route.path}`);
  tempPut(route, handler);
};

const tempPatch = router.patch;
router.patch = (route, handler) => {
  console.log(`PATCH: ${route.path}`);
  tempPatch(route, handler);
};

const tempDelete = router.delete;
router.delete = (route, handler) => {
  console.log(`DELETE: ${route.path}`);
  tempDelete(route, handler);
};
```
2023-07-17 09:45:06 -07:00
Lisa Cawley
55cc20fc5c
Remove more API docs codeowners (#162066) 2023-07-17 09:36:29 -07:00
Ying Mao
8a56a2bbaa
[Response Ops][Actions] Allow streaming responses from Generative AI connector (#161676)
Resolves https://github.com/elastic/kibana/issues/159598

## Summary

This PR modifies the `test` subaction of the Generative AI connector to
accept a `stream` parameter (default: `false`) that allows for a
streaming response.

The Generative AI connector is basically a pass-through to the Open
AI/Azure OpenAI APIs, where the `stream` parameter is passed in via the
body of the request. This means that with the existing connector, users
could specify `stream: true` in the body which would lead to unexpected
results when the action is unprepared to return streaming results. This
PR sanitizes the body that is passed in the `run` subaction to prevent
the `stream` parameter from being set to `true` and explicitly sets the
`stream` parameter for the `test` subaction.

In order to test the streaming response, I created an example plugin
that prompts users to create a Generative AI connector if one does not
exist and then executes actions using the connector with `stream` set to
`true`. This borrows liberally from @dgieselaar's existing work from
https://github.com/elastic/kibana/pull/158678


441694cb-0154-4450-bd93-3907c4a9995c



## To Verify

1. Navigate to https://localhost:5601/app/GenAiStreamingResponseExample
2. Set up a Generative AI connector
3. Open the network console. Enter a prompt and click `Stream Response`
4. You should see the chat response return streaming results.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-14 19:17:12 -04:00
Lisa Cawley
7f6044a33e
Remove mlr-docs codeowner for OAS (#161820) 2023-07-14 10:41:36 -07:00
Brandon Morelli
d728789f55
[APM] Add missing settings to documentation (#161603)
### Summary

This PR adds missing APM/Observability settings to the documentation:

- `observability:apmAgentExplorerView`
- `observability:apmAWSLambdaPriceFactor`
- `observability:apmAWSLambdaRequestCostPerMillion`
- `observability:apmEnableContinuousRollups`
- `observability:apmEnableServiceMetrics`
- `observability:apmLabsButton`
- `observability:apmServiceGroupMaxNumberOfServices`
- `observability:apmDefaultServiceEnvironment`

This PR also adds @elastic/obs-docs as a codeowner to
`/x-pack/plugins/observability/server/ui_settings.ts` so that we don't
miss documenting settings moving forward.

Closes https://github.com/elastic/kibana/issues/118795.
2023-07-13 15:33:01 -07:00
Georgii Gorbachev
15a86c355a
[Security Solution] Move test plans from /cypress to /docs (#161517)
**Related to:** https://github.com/elastic/security-team/issues/6867
(internal)

## Summary

As requested in
https://github.com/elastic/kibana/pull/160685#issuecomment-1621635262.

In test plans, we mention how scenarios are going to be automated --
whether a given scenario will be automated using Cypress for e2e tests,
Jest for integration tests and unit tests, etc. But currently, test
plans are under `x-pack/plugins/security_solution/cypress/`.

Since test plans are in fact technology agnostic, it does not make much
sense to keep them inside a specific framework technology folder. That's
why we're moving them to a generic
`x-pack/plugins/security_solution/docs/testing` folder.
2023-07-11 02:27:00 -07:00
Walter Rafelsberger
a39531edce
[ML] Explain Log Rate Spikes: Reenable API integration tests. (#160180)
Fixes #155737. This passed 350 flaky test runner runs, reenabling. These API
integration tests were missing from CODEOWNERS, adding that in this PR
too (`/x-pack/test/api_integration/apis/aiops/ @elastic/ml-ui`).
2023-07-11 11:21:43 +02:00
Khristinin Nikita
1765a45fee
Risk score management page (#160507)
## Risc score management page - Part I

For testing enable: `riskScoringRoutesEnabled`

This PR include:
- Entity analytics as a separate folder and lazy sub plugin - in the
future should include all entity analytics related frontend code
- Adding item to Security -> Manage page
- Layout for Entity Analytics management page
- Integrating with preview API

Not include:
- Integration with enable/disable risk score API
 




4499f3fb-ca19-46a8-8d4d-33fd7080738d

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-10 18:35:33 +02:00
Shahzad
93fc2a85d6
[Synthetics] Fixed action connectors and added api test for default alerting (#161218) 2023-07-05 21:46:18 +02:00
Sergi Massaneda
f2e773d435
[SecuritySolution] Rename security solution plugins (#161153)
## Summary

closes: https://github.com/elastic/kibana/issues/159685

- Renaming _x-pack/plugins_:
`serverless_security` -> `security_solution_serverless`
`ess_security` -> `security_solution_ess`

- All the related configurations and types have also been renamed.
- i18n translation prefixes updated
- relocation of internal `security_solution_serverless` directories to
be consistent with `security_solution_ess`

### Eslint
I also added the plugins in the `.eslintrc` configuration, defining the
same rules as the `security_solution` plugin.
All eslint errors have been addressed (mainly _type_ imports errors)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-05 13:51:49 +02:00
Marco Antonio Ghiani
abe58cb011
[Logs Shared] Move LogStream and LogView into new shared plugin (#161151)
## 📓 Summary

Closes #159128 

Due to a dependencies issue when disabling a plugin in serverless mode,
the LogStream feature and related logic were disabled for every
consumer.

We decided to split this shared component and endpoint into their own
plugin of shared logs utilities, reducing to the minimum the required
dependency that could disable the plugin.

What we moved can be summarized with:
- `infrastructure-monitoring-log-view` saved object definition and
registration
- LogViews server/client services (exposed with start contract) +
related endpoints
- LogEntries server service + related endpoints
- LogEntriesDomain logic (exposed with start contract)
- `<LogStream />` component
- `<ScrollableLogTextStreamView />` component and related logic
- LogView state machine
- Containers/Hooks to consume the moved APIs.
- Common types/utils definition, now exported and consumed as a
dependency from the `infra` plugin.

## 🤓 Review hints

Most of the changes are just renaming and moving stuff into the new
plugin, but for some operations was required to implement new logic,
which may deserve a more critical review:
- server/public `plugin.ts` files for the `infra` and `logs_shared`
plugins. The new plugin now registers the fallback actions to retrieve a
source configuration if there's no stored log view. It also set the
configuration for the message field and registers the log view saved
object.
- the `logEntriesDomain` has also been moved inside the new plugin, but
is also used by the logs-analysis endpoints, so it is exposed by the
logs_shared plugin and consumed by `infra`.

## 👣 Following steps

We currently are still using the `observability` plugin for consuming
the CoPilot feature on our LogsStream flyout.
The plugin dependency is marked as optional, so disabling the
`observability` plugin in a serverless environment won't disable also
the exposed features in this new plugin, but it'll affect only the
CoPilot feature, which won't be loaded.

In future, would be nice to extract the CoPilot feature into its own
package/plugin, so that also serverless projects can consume it without
depending on `observability.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-05 10:30:28 +02:00
Zacqary Adam Xeper
e31ede27de
[RAM] Remove third party RRule library, replace with own timezone-compliant lib (#152873)
## Summary

Closes #152630

~Adds a fix for the weird UTC-but-not-really expected inputs in
rrule.js~

This PR removes the third-party `rrule` package and replaces it with
`@kbn/rrule`.

The third party RRule library's functions produced different results
depending on what system timezone you ran it in. It would output local
timestamps in UTC, making it impossible to do reliable math on them.
It's now replaced with our own library that passes all of our own tests
for the limited cross-section of the RRule spec that we need to support.
It's possible that it wouldn't stand up to the rigor of more complex
RRule queries, but it supports the ones that our Recurrence Scheduler UI
supports just fine.

### 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>
2023-07-02 17:03:45 -04:00
Patrick Mueller
1f3426942c
[examples] add routes to access v8 profiling (#155956)
Adds routes to run v8 profiling tools, when running the examples plugins
via `--run-examples`

See the included README.md for more info
2023-06-30 08:42:38 -04:00
Ignacio Rivas
ec620e7fb3
[Deployment Management] Add cards navigation in management landing page for serverless (#160096) 2023-06-30 11:27:56 +02:00
Alex Szabo
e3a35b9515
[Ops] Fix auto-approve script (#160856)
## Summary
Our original intent of kibanamachine approving their own PRs didn't
work, we switch to the default github-actions as an approver for
kibanamachine's PRs.
2023-06-29 12:04:55 +02:00
Tiago Costa
5ac9390916
chore(NA): remove debug step on auto approve backport action (#160826)
I believe I found out what was wrong with the previous implementation of
the action.
We were trying to check for the existence of the backport label when the
PR is created which is never there (as it gets added afterwards).

This PR is replacing the checking of the label by the assert that the
branch name on a backport starts with `backport` and the creator of the
PR is kibanamachine.
2023-06-28 16:09:20 -07:00
Tiago Costa
0a14a21038
chore(NA): adds debug action to audit auto approve backports action (#160814)
This PR adds a separate debug step to the auto approve backport action
so we can understand whats going on with the event payload.
2023-06-28 22:07:53 +01:00