Commit graph

74972 commits

Author SHA1 Message Date
Kris Gross
74e889bbd9 merge conflict 2024-05-29 14:50:42 -04: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
christineweng
993903bb61
[Security Solution][Alert table] Fix alert table refresh with bulk action (#183674)
## Summary

Currently components outside of alert table do not refresh after
changing status with bulk action. This PR adds global query refresh in
bulk actions

- https://github.com/elastic/kibana/issues/183025

No grouping


0490187d-9f3e-49d0-80b3-4cd75e8fdbf8



Grouping


80e55fda-2f89-4c8d-a882-2df413cb3560
2024-05-29 13:43:24 -05:00
Tim Sullivan
e221be3cde
[EuiProvider] Fix Obs-Ux-Logs code (#183877)
## Summary

Fixes needed for getting CI to pass when EUI throws an error if
attempting to render a component without the EuiProvider in the render
tree.

## Detailed description
In https://github.com/elastic/kibana/pull/180819, I will deliver a
change that will cause EUI components to throw an error if the
EuiProvider context is missing. This PR comes in as part of the final
work to get all functional tests passing in an environment where EUI
will throw the error. The tied to the ["Fix 'dark mode' inconsistencies
in Kibana" Epic](https://github.com/elastic/kibana-team/issues/805) has
so far been in preparation for this.

**Reviewers: Please interact with critical paths through the UI
components touched in this PR, ESPECIALLY in terms of testing dark mode
and i18n.**

<img width="1107" alt="image"
src="c0d2ce08-ac35-45a7-8192-0b2256fceb0e">

### 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
- [ ] 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)
2024-05-29 11:42:14 -07:00
Aleh Zasypkin
c1846c34b8
fix(tests): update built-in ES privileges to expect remote_cluster only starting from 8.15.0+. (#184454)
## Summary

Update built-in ES privileges to expect `remote_cluster` only starting
from 8.15.0+.

```http
GET /_security/privilege/_builtin HTTP/1.1
x-elastic-product-origin: kibana
user-agent: Kibana/8.15.0
x-elastic-client-meta: es=8.13.0,js=20.13.1,t=8.4.1,hc=20.13.1
accept: application/vnd.elasticsearch+json; compatible-with=8,text/plain
Host: localhost:9220

HTTP/1.1 200 OK
X-elastic-product: Elasticsearch
content-type: application/json
content-length: 1562

{
  "cluster": [
    "all",
    ...
  ],
  "index": [
    "all",
    ...
  ],
  "remote_cluster": [
    "monitor_enrich"
  ]
}
```

__Fixes: https://github.com/elastic/kibana/issues/184431__
__Fixes: https://github.com/elastic/kibana/issues/184432__
2024-05-29 21:11:24 +03:00
Kibana Machine
0f1f08b99b skip failing test suite (#183493) 2024-05-29 13:26:11 -04: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
Thom Heymann
5715ee8347
Add install integrations endpoint (#184167)
Resolves #183472
Resolves #183020

## Summary

1. Decouples integration installation from fleet privilege
2. Creates API endpoint to install all selected integrations as a single
request:

  - Should accept list of selected integrations and log files
- Should respond in a format easy to parse using native bash / standard
unix commands like awk/sed/grep
- Should return unified config for Elastic Agent for all installed
integrations
- ~Should update saved object with selected integrations and
installation status~ Waiting for designs/requirements

## Screenshot

```text
curl --request POST \
    --url "598bc802-0616-47c2-8895-c9cc24b959dd/integrations/install" \
    --header "Authorization: ApiKey emRMWHBvOEJOMmJEaFRKNnN4LS06SVJwcldSTkxTUjZtU1VpNXRLU2ZBdw==" \
    --header "Content-Type: text/tab-separated-values" \
    --data $'system\tregistry\nproduct_service\tcustom\t/path/to/access.log\ncheckout_service\tcustom\t/path/to/access.log\ncheckout_service\tcustom\t/path/to/error.log'

outputs:
  default:
    type: elasticsearch
    hosts:
      - 'http://localhost:9200'
    api_key: 'zdLXpo8BN2bDhTJ6sx--:IRprWRNLSR6mSUi5tKSfAw'
inputs:
  - id: logfile-system.auth-96f640d3-2365-4008-b634-dcbe8278b583
    data_stream:
      dataset: system.auth
      type: logs
    paths:
      - /var/log/auth.log*
      - /var/log/secure*
    exclude_files:
      - .gz$
    multiline:
      pattern: ^s
      match: after
    tags:
      - system-auth
    processors:
      - add_locale: null
  - id: logfile-system.syslog-96f640d3-2365-4008-b634-dcbe8278b583
    data_stream:
      dataset: system.syslog
      type: logs
    paths:
      - /var/log/messages*
      - /var/log/syslog*
      - /var/log/system*
    exclude_files:
      - .gz$
    multiline:
      pattern: ^s
      match: after
    processors:
      - add_locale: null
  - id: custom-logs-4e07e609-ba8e-4dbe-9490-0b4aaf9e637b
    type: logfile
    data_stream:
      namespace: default
    streams:
      - id: logs-onboarding-product_service
        data_stream:
          dataset: product_service
        paths:
          - /path/to/access.log
  - id: custom-logs-c665eb58-effe-4530-be01-8b510f969140
    type: logfile
    data_stream:
      namespace: default
    streams:
      - id: logs-onboarding-checkout_service
        data_stream:
          dataset: checkout_service
        paths:
          - /path/to/access.log
          - /path/to/error.log
```

<img width="1228" alt="Screenshot 2024-05-23 at 20 05 59"
src="c2759491-b9ae-4b89-8f24-e196708d76f6">

## Testing

1. Start a Quickstart onboarding flow and copy the onboarding ID from
DEV tools network tab
2. Create a new API key
3. Run the following curl:

```bash
curl --request POST \
  --url "http://localhost:5601/internal/observability_onboarding/flow/${ONBOARDING_ID}/integrations/install" \
  --header "Authorization: ApiKey ${ENCODED_API_KEY}" \
  --header "Content-Type: text/tab-separated-values" \
  --data $'system\tregistry\nproduct_service\tcustom\t/path/to/access.log\ncheckout_service\tcustom\t/path/to/access.log'
```

4. Go to installed integrations page
5. You should see the the system integration and 2 custom integrations
installed.
2024-05-29 18:04:24 +01:00
Larry Gregory
a5613515ee
Upgrade octokit/rest to 17.11.2 (#176224)
## Summary

Bumps `@octokit/rest` to version `17.11.2`
2024-05-29 12:50:35 -04:00
Lukas Olson
848510dc5f
[KQL] Remove unnecessary contrived wildcard match_all handling (#184351)
## Summary

The following code was was introduced in
https://github.com/elastic/kibana/pull/96902:


69b28f317b/packages/kbn-es-query/src/kuery/functions/is.ts (L109-L112)

As far as I can tell it was really just added to ensure that a contrived
behavior stayed exactly the same after the optimization that PR made. I
thought it was related to the case where we have a query like `*` or
`*:*` (in other words, a query that matches all documents) but we are
already handling that in this code:


69b28f317b/packages/kbn-es-query/src/kuery/functions/is.ts (L62-L68)

As we are moving to a scenario where we expect the field list passed to
this code to be a subset of the entire list of fields (see
https://github.com/elastic/kibana/pull/183694), this condition and the
corresponding contrived test are removed in this PR.

### 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
2024-05-29 09:48:51 -07:00
Cee Chen
d381e6e1e7
[EuiCollapsibleNavBeta] Fix @ts-ignore TODOs (#184382)
## Summary

Fixes several `@ts-ignore TODO`s added in a previous EUI upgrade. The
primary source of typescript errors comes from the fact that type-wise,
`EuiCollapsibleNavItem` wants **either** `items/accordionProps` or
`href/linkProps` but **not both**. See the following ExclusiveUnion
logic:


7209db96ee/packages/eui/src/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.tsx (L63-L102)

### Checklist

- [x] Existing tests/CI passes
2024-05-29 09:38:20 -07:00
Efe Gürkan YALAMAN
cd9cd89bbf
[Search] Add example status for OpenText Documentum (#184426)
## Summary

Adds example status for OpenText Documentum connector

<img width="1579" alt="Screenshot 2024-05-29 at 14 35 55"
src="a81bf662-79bc-4650-9611-443478f0206b">
<img width="452" alt="Screenshot 2024-05-29 at 14 36 05"
src="15c34d9a-42fd-4c2e-bda8-f6ac9d136e42">



### 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)
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2024-05-29 09:21:35 -07:00
Drew Tate
58f1c67a50
[Discover] fix flaky test (#184180)
## Summary

Fix https://github.com/elastic/kibana/issues/183493
Fix https://github.com/elastic/kibana/issues/183479

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6079
2024-05-29 11:18:19 -05:00
Paulo Henrique
12f35c9a31
[Security Solution] [Grouping] Re-add support to custom Group By title in the useGetGroupSelector hook (#184165)
## Summary

This PR fixes a regression from PR #180016 where the support to the
custom title on the `useGetGroupSelector` hook was dropped and the
Findings DataTables was displaying "Group alerts by" instead of "Group
findings by". Unit tests were added to prevent further regressions.


## Screenshots


![image](97ac29f7-d314-4df9-a4d8-9a11b198f021)


![image](6e6a3eef-fd4e-4619-a460-a3b0fb46ec37)


![image](e6bcd40c-45e6-4444-8905-7c7c2c900926)
2024-05-29 09:15:40 -07:00
Lisa Cawley
f2a4bba137
[HTTP/OAS] Add description for task manager health API (#184249) 2024-05-29 09:02:51 -07:00
Mark Hopkin
c75560bcf5
[Entity Analytics] Add more logging to flaky test (#183753)
## Summary

Closes https://github.com/elastic/kibana/issues/181402 (for now)

This test has only failed once so far, there is nothing obvious in the
logs as to why the transform is in a stopped state, I have added some
more logging so we can dig further if it fails again.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 08:48:49 -07:00
Rachel Shen
4741e291bd
[a11y] use alt text to convey stream entry within log stream (#183666)
## Summary

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


### 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)
2024-05-29 17:42:19 +02:00
Christos Nasikas
60f5ebee25
[Cases] Fix useGetCaseConnectors flaky test (#184430)
## Summary

Following @JiaweiWu advice I replaced `waitForNextUpdate` with
`waitFor`.

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

### 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)
2024-05-29 08:12:34 -07:00
Rickyanto Ang
a42f6a716f
[Cloud Security][Serverless] Added Cloud Security and Cloud Defend Plugins into Excluded Package list for Observability project in Serverless (#184186)
## Summary
Added CSP and Cloud Defend plugins into Exclude Package list for oblt
projects in Serverless

Co-authored-by: Maxim Kholod <maxim.kholod@elastic.co>
2024-05-29 08:09:02 -07:00
Shahzad
1d57047f5c
[Synthetics] Decouple synthetics settings from uptime (#184009)
## Summary

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

Decouple synthetics settings from uptime , since uptime isn't available
in serverless !!

### Test cases

- [ ] Make sure synthetics settings continue to work as expected in
serverless/stateful
- [ ] Make sure uptime settings continues to work as expected in
serverless/stateful
- [ ] if User have uptime settings saved, those should be copied over to
synthetics first time

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 17:05:08 +02:00
Anton Dosov
88757a30a6
Add updated_by to saved objects (#182687)
## Summary

close https://github.com/elastic/kibana-team/issues/899

- Adds `updated_by` to saved object, similar to recently added
`created_by` https://github.com/elastic/kibana/pull/179344
- Fixes `created_by` / `created_at` should be set during upsert
- Improves functional tests coverage
2024-05-29 08:03:11 -07:00
Devon Thomson
f7b9777f40
[Embeddables Rebuild] Fix sharing (#184264)
Extends the usage of runtime state for backups to the snapshot sharing system.
2024-05-29 10:59:41 -04:00
Alex Szabo
8bbba600c1
[CI] Make cypress reporting more resilient (#184397)
## Summary
cypress reporter will occasionally get an empty result object - it draws
attention from other error messages in the stream, and allows misleading
conclusions

let's not fail reporting because of that, and hope that the real error
will also surface.


See:
https://buildkite.com/elastic/kibana-pull-request/builds/212655#018fc04b-e385-4760-87db-41b65f86fb40

---------

Co-authored-by: Patryk Kopycinski <contact@patrykkopycinski.com>
2024-05-29 07:13:54 -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
Tomasz Kajtoch
74bf81663c
chore: upgrade @elastic/eui to v94.5.2 (#184421)
`v94.5.1`  `v94.5.2`

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

## [`v94.5.2`](https://github.com/elastic/eui/releases/v94.5.2)

**Bug fixes**

- Fixed `EuiDatePicker` to more gracefully handle incorrectly formatted
`selected` Moment dates, instead of simply crashing
([#7784](https://github.com/elastic/eui/pull/7784))
- Fixed `EuiFlexGroup` and `EuiFlexItem` types to correctly accept
global attribute props and simplify type resolution when used with
`styled()`-like wrappers
([#7792](https://github.com/elastic/eui/pull/7792))
2024-05-29 16:04:28 +02:00
Jon
17789e1380
Update ftr drivers (#184263) 2024-05-29 09:02:32 -05:00
elena-shostak
e8cdde2fb6
[Spaces] Added disabled features back to mappings (#184195)
## Summary

We aggregate on disabledFeatures in [Spaces Usage
Collector](5e95a76796/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts (L38)),
but field was removed from mappings. Added `disabledFeatures` back to
mappings.

### How to Test

1. Create a couple of spaces with disabled features.
   ```
   POST kbn:/api/spaces/space 
   {
      "name": "my-space-1",
      "id": "my-space-1",
      "description": "a description",
      "color": "#5c5959",
      "disabledFeatures": ["canvas", "discover"]
   }
   
   POST kbn:/api/spaces/space 
   {
      "name": "my-space-2",
      "id": "my-space-2",
      "description": "a description",
      "color": "#5c5959",
      "disabledFeatures": ["savedObjectsManagement", "canvas"]
   }
   ```
2. Make a request to stats endpoint and check that `disabledFeatures`
counters.
    ```
    POST kbn:/internal/telemetry/clusters/_stats
    {
      "unencrypted": true, "refreshCache": true
    }
    ```

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

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

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

## Release note
Added `disabledFeatures` back to mappings, so it can be aggregated on.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 15:55:21 +02:00
Karen Grigoryan
d6c2909ed4
[Security Solution] add new route for fetching results by index pattern (#184297)
Address #183698

This MR introduces a new internal DQD `GET` endpoint for fetching index
results by pattern without aggregation in descending order by
`@timestamp`:

`GET  /internal/ecs_data_quality_dashboard/results/:pattern`

This new endpoint supports additional query params like:

 - `from` - es search pagination offset
 - `size`- es search query response size
- `outcome` - es search query response filter by presence/absence of
`incompatibleFieldCount` field
- `startDate` - es search query response filter by `@timestamp`
(inclusive)
- `endDate`- es search query response filter by `@timestamp` (inclusive)
 
This endpoint returns a list of historical index `results` sorted by
`@timestamp` and a `total` number of results for facilitating pagination
on client.
 
Additionally this MR updates latest results endpoint to have simplified
naming for improved consistency, lifts shared functionality into a
helper function and adds necessary unit tests.

In particular:

- `GET
/internal/ecs_data_quality_dashboard/results/indices_latest/:pattern`
has been simplified to just `GET
/internal/ecs_data_quality_dashboard/results_latest/:pattern`. All
respective server and client code has been updated.
  
## How to test

Example:
- `GET
/internal/ecs_data_quality_dashboard/results/logs-*?from=5&size=5&outcome=fail&startDate=now-1w/w&endDate=now`
 - `GET  /internal/ecs_data_quality_dashboard/results_latest/logs-*`
2024-05-29 15:53:40 +02:00
Kevin Delemme
09a81439df
chore(slo): Use timeslice window as interval for timeslice SLO (#184366) 2024-05-29 09:42:02 -04:00
Mykola Harmash
2369bae382
[Onboarding] Logs auto-detection logic in Bash (#184299)
Closes https://github.com/elastic/kibana/issues/183360
Partially addresses https://github.com/elastic/kibana/issues/183361

## Summary

Adds logs auto-detection script that scans the system and prompts user
to confirm their selection for logs to ingest.


98aefb60-e3a4-4c19-a7bd-fdfdb8ca4af2
2024-05-29 06:23:10 -07:00
Rachel Shen
405be1af73
[ConnectionDetails] add aria-labels (#184243)
## Summary

Closes https://github.com/elastic/kibana-team/issues/741

### 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)
2024-05-29 07:13:20 -06:00
Achyut Jhunjhunwala
6f7f133806
[Dataset Quality]Add logic to display degraded fields in DQ Flyout (#183934)
## Summary

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


## Description

This PR adds the Degraded Fields Table to the Dataset Quality Flyout for
individual Data Stream. Following tasks were done as part of this PR

1. A new server side endpoint created which queries the `datastream`
directly and aggregates `_ignored` fields for that data stream during
the given time range and also adds a sub aggregation for last occurence.
2. On the UI Side, the table was added with 3 columns as mentioned in
the Original ticket - Field, Count and Last Occurrence
3. The UI currently supports clients side sorting and pagination. We can
move this to server side pagination sorting if required in the future.
4. The Flyout also supports sync with the URL which means user can
navigate to the Dataset Quality page where the flyout would be open and
Sorting and Pagination would be pre-applied
5. API Tests
6. Stateful and Serverless FTR tests


## Screenshot

<img width="1278" alt="image"
src="36a9b5cd-de05-4d17-99a2-cc08ec4583dd">


## Scenario

1. Spin up a 8.14-snapshot instance
2. Ingest degraded docs
3. Upgrade to 8.15-snapshot
4. Open Data Set Quality Flyout and see how the page looks like

<img width="1286" alt="image"
src="100f3c8c-b697-4f81-ac7e-427d0f468407">
2024-05-29 05:13:39 -07:00
Vitalii Dmyterko
75e0b3bc47
[Security Solution][Detection Engine] enables Cypress and FTR tests for ES|QL rule type on serverless (#182789)
## Summary
- addresses https://github.com/elastic/kibana/issues/181937
- enables Cypress and FTR tests for ES|QL rule type on serverless

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Cypress ES|QL tests(x100):
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5881
FTR(x100):
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5875
2024-05-29 12:24:08 +01:00
Sébastien Loix
9e2b401f2c
[Stateful sidenav] Register observabilty nav from inside plugin (#184215) 2024-05-29 03:36:59 -07:00
Christos Nasikas
b9e47025fa
[ResponseOps][Rules] Fix KQL wildcards in alerts filtering in actions and MW (#183901)
## Summary

This PR 

1. Show KQL error messages to the UI
2. Respect the `query:allowLeadingWildcards` advance setting in the MW

## Testing

Verify that the bug except the one about DSL filtering described in
https://github.com/elastic/kibana/issues/168600 is fixed. Also, test the
following scenarios.

### Actions

**Error**:
1. Go to Stack -> Advanced setting and disable
`query:allowLeadingWildcards`
2. Create a rule with an action and make the action conditional by
toggling the "If alert matches query"
3. Add a KQL like `kibana.alert.instance.id : *development`. The leading
`*` is important
4. Save the rule. You should see a toaster error with a message about
`query:allowLeadingWildcards`

**Happy path**:
1. Go to Stack -> Advanced setting and make sure
`query:allowLeadingWildcards` is enabled
2. Create a rule with an action and make the action conditional by
toggling the "If alert matches query"
3. Add a KQL like `kibana.alert.instance.id : *development`. The leading
`*` is important
4. Save the rule. You should not see any errors.

### Maintenance Windows

**Error**:
1. Go to Stack -> Advanced setting and disable
`query:allowLeadingWildcards`
2. Go to Stack -> Maintenance Windows -> Create window
3. Toggle "Filter alerts" and add a KQL like `kibana.alert.instance.id :
*development`. The leading `*` is important
4. Create the MW. You should see a toaster error with a message about
`query:allowLeadingWildcards`

**Happy path**:
1. Go to Stack -> Advanced setting and make sure
`query:allowLeadingWildcards` is enabled
2. Go to Stack -> Maintenance Windows -> Create window
3. Toggle "Filter alerts" and add a KQL like `kibana.alert.instance.id :
*development`. The leading `*` is important
4. Create the MW. You should not see any errors.

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

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

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

## Release notes
Show errors about invalid KQL in conditional actions and respect the
`query:allowLeadingWildcards` advanced setting in maintenance windows
2024-05-29 03:32:12 -07:00
Eyo O. Eyo
690690ea21
Simplify workflow for dashboard copy creation in both view and edit interaction modes (#180938)
## Summary

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

- Removes the `save as` top nav menu button
- Also renames nav menu item `clone` to `duplicate` and make it
available in edit mode.
- The save dashboard modal no longer displays and open to save the
dashboard in context as new, given that we've chosen to explicitly
create a copy of the dashboard in context when either of the the
`duplicate` or `saveas` menu option is selected.
- includes bug fix for an issue where clicking the dashboard modal
scrolled the user to the content bottom, see
https://github.com/elastic/kibana/pull/180938#issuecomment-2117586572

## Before
### View mode
<img width="1728" alt="Screenshot 2024-04-16 at 15 59 10"
src="48dc4565-1f75-4f46-839c-8d76f4fedefe">

### Edit mode
<img width="1725" alt="Screenshot 2024-04-16 at 15 59 00"
src="1ac743ac-33b4-4f68-ab59-ad19ab58fa1c">

## After

#### Managed Dashboard

5072a501-8d16-4f25-9575-6f11fed6e580

#### View mode

610d0952-97f0-46b8-a0ea-1546a799d387

#### Edit mode

4f596c07-7bd1-4c5a-9131-0c78731cb113



<!-- ### 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)


### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 11:46:23 +02:00
Alexey Antonov
d5842d766a
fix: [Obs AI Ops > Anomaly Detection][KEYBOARD]: Anomalies table has a number of tooltips that cannot receive keyboard focus (#184198)
Closes: https://github.com/elastic/observability-dev/issues/3397

## Description

The Obs Anomaly Detection Single Metric Viewer has an Anomalies table
with at least three tooltips that cannot be reached by keyboard focus.
Screenshot attached below.

### Steps to recreate
1. Open the [Obs Anomaly
Detection](https://issue-serverless-alpbx-pr180406-c06b1b.kb.eu-west-1.aws.qa.elastic.cloud/app/ml/jobs)
view
2. Create a new anomaly detection job
3. From the Anomaly Detection Jobs table, click the Single Metric Viewer
icon
4. Tab through the page, to the Anomalies table underneath the chart
5. Keep tabbing through the table
6. Verify the tooltips in the Severity, Actual, and Typical columns do
not become visible
2024-05-29 02:19:49 -07:00
Dmitrii Shevchenko
81191c9548
[Security Solution] Write the rule source field together with the immutable (#183895)
**Resolves: https://github.com/elastic/kibana/issues/180141**

## Summary

As part of our migration strategy to the new schema, we need to start
writing the `rule_source` field together with the `immutable` field to
prepare for data migration. We need to ensure that all our endpoints
write the `rule_source` field before we start migrating detection rules
so we do not end up in a situation when our data is migrated but rule
CRUD endpoints continue writing the old format.

With this PR, we start writing `rule_source` on every rule modification
or creation. The `immutable` field is treated as the main field, and
`rule_source` is always derived from it.
2024-05-29 11:03:26 +02:00
Stratoula Kalafateli
b3f64b6f10
[ES|QL] Remove version from _query requests (#184289)
### Summary

Removes the versioning from the _query api requests.

This ES PR removes the version from the _query requests
https://github.com/elastic/elasticsearch/pull/108919 and got backported
at 8.14 too. We need to also remove it from our side too to be in sync
with ES changes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 10:48:31 +02:00
Kaan Yalti
957e1342ef
Feat/179915 suport data tagging (#183563)
## Summary

This PR updates kibana backend so that users can add global data tags to
agent policy inputs

Relates: #179915

### 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
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)

### Manual Testing
- start elasticsearch and kibana 
- navigate to stack management and create an api key
- download agent
- create agent policy with system integration
- update the agent to add data tags
```
curl --location --request PUT 'http://localhost:5601/api/fleet/agent_policies/:policyId' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey <your api key>' \
--header 'Elastic-Api-Version: 2023-10-31' \
--header 'kbn-xsrf: true' \
--data '{
    "name": "asdfasdf",
    "namespace": "default",
    "global_data_tags": [
        {
            "name": "newtag",
            "value": "testing"
        }
    ]
}'
```
- deploy a standalone agent
- go to the discovery tab and search for the tag name and validate that
the values are populated. (note: seeing a value may take some time, 2~3
min)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-29 10:47:45 +02:00
renovate[bot]
dbc16cb897
Update dependency @elastic/charts to v65 (main) (#184031) 2024-05-29 09:09:10 +01:00
Christos Nasikas
a365891c68
[ResponseOps][Connectors] Fix bug with deprecated icon in the connectors table (#184342)
## Summary

If the connector's table shows a deprecated connector it crashes. This
PR fixes this issue by removing any usage of the deprecated access to
the EUI theme variables.

## Screenshots

<img width="541" alt="Screenshot 2024-05-28 at 1 34 48 PM"
src="a2aad5e3-c49c-476a-b7bf-37ec57ed03b9">

<img width="456" alt="Screenshot 2024-05-28 at 1 33 13 PM"
src="b2953215-1744-481b-8fbf-70a5df26fc30">

<img width="743" alt="Screenshot 2024-05-28 at 1 34 11 PM"
src="66b1e86f-f618-4a68-bdc0-7c6e1727a4b7">


## Testing

1. Create a deprecated SN connector.
2. Verify that the page that list all connectors (Stack Management ->
Connectors) does not crash

You can create a deprecated SN connector like:

```
curl --location 'https://localhost:5601/api/actions/connector' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <basic auth token>' \
--data-raw '{
    "name": "SN",
    "connector_type_id": ".servicenow",
    "config": {
        "apiUrl": "https://<whatever>.service-now.com/",
        "usesTableApi": true <-- This makes the connector deprecated
    },
    "secrets": {
        "username": "admin",
        "password": "<whatever>"
    }
}'
```

### 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)
2024-05-29 10:52:37 +03:00
Katerina
ead45955c3
Add documentation for kibana:plugin_render_time (#184206)
## Summary

closes https://github.com/elastic/observability-dev/issues/3374

1. Added the section # Report `kibana:plugin_render_time` metric event.
2. The rest changes are just auto-format

---------

Co-authored-by: Vignesh Shanmugam <vignesh.shanmugam22@gmail.com>
2024-05-29 10:09:52 +03:00
Kibana Machine
e50054cb70
[api-docs] 2024-05-29 Daily api_docs build (#184388)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/721
2024-05-29 05:27:00 +00:00
amyjtechwriter
25812971d0
[DOCS] Adds the whats new page for 8.14 (#183556) 2024-05-28 21:13:13 -04:00
Julia Bardi
8ecee1f7e1
[Fleet] moved root privilege callout with data stream info to create/edit package policy page (#184190)
## Summary

Address feedback in
https://github.com/elastic/kibana/pull/184119#issuecomment-2127689576

Relates https://github.com/elastic/ingest-dev/issues/3357

Moved root privileges callout with data streams from package policy
submit modal to the create/edit package policy page itself, so it is
more persistent than a modal window.

To verify:
- Go to System integration / Add integration
- Verify that the require root callout shows the data streams that
require root

<img width="974" alt="image"
src="bafdd556-c837-414d-8bbc-26a4463a8390">

- Go to System integration / Existing policies / Edit integration
- Verify that the require root callout is visible with data stream info

<img width="901" alt="image"
src="793ace68-7618-482e-a200-6b831d293c99">

- For package where all data streams require root, the callout is
unchanged.

<img width="876" alt="image"
src="902f7d3c-ddbc-4131-a19d-341aa1209430">
<img width="878" alt="image"
src="085e32df-033d-41ca-9805-5414854d9750">

- The require root callout is removed from the submit confirmation
modal.

<img width="1135" alt="image"
src="e360d74b-09d1-4a41-b2ff-f4a36656e3d4">


### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-28 12:57:06 -07:00
Tiago Costa
5a74376da0
skip failing ES promotion suites (#184319) 2024-05-28 20:07:06 +01:00
Ersin Erdal
5794235d0d
Set validation errors in subaction framework as user errors (#184317)
Resolves: #183867

This PR sets schema validation errors in subaction framework as user
error.

## To validate: 
- Create a connector with subaction. (e.g. IBM Resilient)
- Modify schema validation code to get it throw an error 
```
 action.schema.validate({...subActionParams, foo:'bar'});
```
- Create a rule with that connector. And let it run, there should be a
user error on /`api/task_manager/metrics` API
2024-05-28 20:16:18 +02:00
Ersin Erdal
08901cdb0c
Allow the rule types to throw user errors (#184213)
Fixes: #180421

This PR allows ruleType executors to throw errors with source info
(FRAMEWORK or USER).

Please follow the instructions in the issue to validate the PR.
2024-05-28 20:14:55 +02:00
Patrick Mueller
c7eda998a9
[ResponseOps] add license check for connector execution (#181504)
resolves https://github.com/elastic/response-ops-team/issues/198

## Summary

Ensures that connector execution doesn't occur for connectors that need a higher license than what is currently being used.

## To Verify

The basic idea is to create a > basic license connector in a trial license, and then downgrade the license to basic and see if that connector can still be run. Any connector besides server log and index can be used - those are the only connectors licensed for basic.

Start ES as follows to run with a trial license:

    yarn es snapshot --license trial

Create a connector, and also create an alerting rule which uses the connector, and is arranged to always be active and alert on check intervals (not on status change). Ensure the connector runs when the alert is active, and that you can run it in "test" mode from the connector page.

Then go here, to change your license to basic:

  http://localhost:5601/app/management/stack/license_management

You should now see the following sorts of messages logged by Kibana:

```
[ERROR][plugins.taskManager] Task actions:.email "a0df7b77-b6e5-461e-9699-178d6878f235" failed: Error: Action type .email is disabled because your basic license does not support it. Please upgrade your license.
[WARN ][plugins.alerting.index-threshold] Rule "c6780109-15b8-4816-ba96-266e4ddc482d" skipped scheduling action "gmail" because it is disabled
[ERROR][plugins.actions] Action 'gmail' failed: Action type .email is disabled because your basic license does not support it. Please upgrade your license.
```

When attenpting to "test" the connector, you should see the following result:

```
Test failed to run

The following error was found:
Forbidden
```

(we'll attempt to improve the message later as a follow-up)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-05-28 13:57:50 -04:00