Commit graph

73838 commits

Author SHA1 Message Date
Thomas Neirynck
cb2c9d97b0
[Chore] Remove allocation from flattenHit (#180647)
## Summary

`flattenHit` is in a tight loop, and allocates numerous temporary
objects. This removes the majority of them.

For comparison, this implementation will now be more in line with
`collectBucket`, which uses a similar approach to avoid temporary
allocations.
84304bc0dc/src/plugins/data/common/search/tabify/tabify.ts (L30)

### 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-04-26 09:44:08 -04:00
Panagiota Mitsopoulou
f1e02f6422
[Embeddable rebuild] Fix kibana reporting screenshot issue (#181392)
Fixes https://github.com/elastic/kibana/issues/181389

It turns out that a [data-shared-item is
needed](https://github.com/elastic/kibana/pull/169929/files#r1373148068),
otherwise reporting doesn't work properly. This PR is adding the
required `data-shared-item` to the presentation panel component, and
fixes the reporting screenshot issue.

**UPDATE**: Adding `data-shared-item` to the presentation panel caused
some test failures. The approach we followed for now, was to add this
attribute to each migrated embeddable, the `image` and `swim lane`
embeddables. As part of this
https://github.com/elastic/kibana/issues/179376, Kibana presentation
team will investigate further the proper use of data-* attributes

## Before the fix
<img width="600" alt="Screenshot 2024-04-23 at 10 41 59"
src="cee076a1-b989-4d5f-8462-4021ce9e5e4d">

<img width="600" alt="Screenshot 2024-04-23 at 10 41 27"
src="83677ad1-b1d2-4915-a747-9afe5a1d447a">


## ✔️ Acceptance criteria
- No timeout error should appear in the generated PDF reports

## After the fix
<img width="600" alt="Screenshot 2024-04-23 at 11 02 32"
src="e0452e32-8c1e-4075-b9c9-b1225f9bd852">

<img width="600" alt="Screenshot 2024-04-23 at 11 19 54"
src="08284774-a4ff-47b0-b496-3570416f0e57">


<img width="600" alt="Screenshot 2024-04-23 at 11 07 43"
src="95e9adae-cd07-42fe-9dea-cd22b9711155">

cc @Heenawter 
@darnautov Can you check the swim lane embeddable with real data and see
if reporting works properly with the change I added?

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <hannah.wright@elastic.co>
2024-04-26 08:31:24 -05:00
dkirchan
328609e349
[Security][Serverless] Fixed PROXY_URL in api integration tests (#181835)
## Summary

Removed hard coded value for PROXY_URL.
2024-04-26 15:00:53 +02:00
Kibana Machine
0f607051fe
[api-docs] 2024-04-26 Daily api_docs build (#181834)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/688
2024-04-26 12:56:58 +00:00
Cauê Marcondes
ad2af69cc2
[Synthrace] Create Asset documents based on signals (Traces/Logs) (#181387)
closes https://github.com/elastic/kibana/issues/180932
closes https://github.com/elastic/kibana/issues/180943

Running it:
```
node scripts/synthtrace.js traces_logs_assets.ts --clean --from=2024-04-17T08:00:00.000Z --to=2024-04-17T08:15:00.000Z --logLevel=debug
```

`assets` index output based on the scenario (traces_logs_assets):
```
"hits": [
      {
        "_index": "assets",
        "_id": "Ydx-FY8BEwTL0kdepnZC",
        "_score": 1,
        "_source": {
          "asset": {
            "id": "synth-node-0",
            "type": "service",
            "identifying_metadata": [
              "service.name"
            ],
            "first_seen": "2024-04-17T08:00:00.000Z",
            "last_seen": "2024-04-17T08:14:00.000Z",
            "signalTypes": {
              "asset.traces": true,
              "asset.logs": true
            }
          },
          "service": {
            "environment": "Synthtrace: traces_logs_assets",
            "name": "synth-node-0",
            "node": {
              "name": "instance"
            },
            "language": {}
          }
        }
      },
      {
        "_index": "assets",
        "_id": "Ytx-FY8BEwTL0kdepnZC",
        "_score": 1,
        "_source": {
          "asset": {
            "id": "synth-node-1",
            "type": "service",
            "identifying_metadata": [
              "service.name"
            ],
            "first_seen": "2024-04-17T08:00:00.000Z",
            "last_seen": "2024-04-17T08:14:00.000Z",
            "signalTypes": {
              "asset.traces": true
            }
          },
          "service": {
            "environment": "Synthtrace: traces_logs_assets",
            "name": "synth-node-1",
            "node": {
              "name": "instance"
            },
            "language": {}
          }
        }
      },
      {
        "_index": "assets",
        "_id": "Y9x-FY8BEwTL0kdepnZC",
        "_score": 1,
        "_source": {
          "asset": {
            "id": "synth-node-2",
            "type": "service",
            "identifying_metadata": [
              "service.name"
            ],
            "first_seen": "2024-04-17T08:00:00.000Z",
            "last_seen": "2024-04-17T08:14:00.000Z",
            "signalTypes": {
              "asset.traces": true
            }
          },
          "service": {
            "environment": "Synthtrace: traces_logs_assets",
            "name": "synth-node-2",
            "node": {
              "name": "instance"
            },
            "language": {}
          }
        }
      },
      {
        "_index": "assets",
        "_id": "ZNx-FY8BEwTL0kdepnZC",
        "_score": 1,
        "_source": {
          "asset": {
            "id": "synth-java",
            "type": "service",
            "identifying_metadata": [
              "service.name"
            ],
            "first_seen": "2024-04-17T08:00:00.000Z",
            "last_seen": "2024-04-17T08:14:00.000Z",
            "signalTypes": {
              "asset.logs": true
            }
          },
          "service": {
            "name": "synth-java"
          }
        }
      }
    ]
```

Updates:
- After talking to @tommyers-elastic we agreed to remove the
`asset.signalTypes` field and add `has_traces` and `has_logs`. Mainly
because updating list type field in ES is hard.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 05:51:10 -07:00
Paul Tavares
22faf26bb2
[Security Solution][Endpoint] Fix index names used to query agents and activity indexes for SentinelOne response actions (#181765)
## Summary

- Changes the names of the Activity and Agents indexes to `*` patterns
in order to account for when the SentinelOne integration is configured
with a namespace other than `default`
2024-04-26 08:30:02 -04:00
Mykola Harmash
f957a08354
[Onboarding] Remove feature flag for the new onboarding (#181677)
Closes https://github.com/elastic/kibana/issues/181378

Removes the new onboarding feature flag and the hidden route.

---------

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2024-04-26 14:15:03 +02:00
elena-shostak
63cbdb8be7
Added ui capabilities to role management (#181424)
## Summary

Part of the Spaces UX redesign requires us to show the list of roles
which grant access to the space. Since not all users who manage spaces
can also manage roles, we need to make this a conditional view based on
user privileges.

Added `view` UI Capability to role management, it will be available at
`capabilities.roles?.view`


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

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

## Release note
Added UI Capability to role management.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 14:10:54 +02:00
Konrad Szwarc
96bf7b1f06
[MKI][EDR Workflows] Enable MKI on EDR Workflows Cypress tests (#181080)
This PR sets up everything required for running Cypress tests for EDR
Workflows on the MKI QA environment.

MKI pipeline triggered with these changes -
https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/20

---------

Co-authored-by: dkirchan <diamantis.kirchantzoglou@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Paul Tavares <paul.tavares@elastic.co>
Co-authored-by: dkirchan <55240027+dkirchan@users.noreply.github.com>
2024-04-26 14:10:36 +02:00
Julian Gernun
8623c91cc4
[MGMTEX] Fix rules order in create rule modal (#181743)
## Summary

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

Fix how rules in create rule modal are sorted. Rules not enabled will be
shown at the end of the list and as disabled.

We did not implement "Close modal when outside of modal is clicked" as
mentioned in
https://github.com/elastic/kibana/issues/181527#issuecomment-2078821162

<details>
  <summary>Recording</summary>


9f6f8519-4f90-4b66-b790-c0144427e776


</details>
2024-04-26 05:00:28 -07:00
Kibana Machine
c485a6db6c skip failing test suite (#181778) 2024-04-26 07:56:40 -04:00
Alex Szabo
098448e3e3
[Fix/BK] Add missing file (#181825)
## Summary
This PR adds a missing file that's referenced in one of the recently
migrated pipelines.

I probably forgot to push the last commit to the fork, and only got
tested in the elastic/kibana branch.

Follow up on: https://github.com/elastic/kibana/pull/180784
2024-04-26 13:29:21 +02:00
Gerard Soldevila
9d01ab1ee8
Add per SO type telemetry to core usage counters (#181063)
## Summary

Tackles https://github.com/elastic/kibana/issues/180366

Leverages existing `'core'` _Usage Counters_ to add per SO type
telemetry for the HTTP SO API calls.
2024-04-26 13:14:38 +02:00
Liam Thompson
7bb7f21426
[ESQL] Update bucket function inline docs for 8.14 (#181809)
Adds new **Grouping functions** section and moves updated `BUCKET` docs
there.
2024-04-26 12:36:34 +02:00
Tomasz Ciecierski
d282d17be1
[EDR Workflows] Add Crowdstrike Response Actions client (#180197) 2024-04-26 03:28:23 -07:00
Coen Warmer
d7b1dfd7fe
[ESLint i18n Rules] Fix issue with quotes in text strings (#181592)
## Summary

This fixes an issue where strings with a quote in it would not get
correctly escaped, leading to the ESLint rule autofix suggestion leading
to non-compiling javascript.
2024-04-26 03:19:52 -07:00
Ash
a64a1d791d
[SentinelOne][Security Solution] Show observer.serial_number info on Table view for SentinelOne alerts (instead of agent status) (#181038)
## Summary

For SentinelOne alerts, since. 8.13, on the overview tab, we show
`agent.status` field in the Highlighted Fields section. On the table
view we should show the `observer.serial_number` info for that field
instead of showing agent status.

**before**
![Screenshot 2024-04-17 at 1 59
53 PM](2d196444-cbef-4308-99fd-29f34fe3ee38)

**after**
![Screenshot 2024-04-22 at 10 57
49 AM](2b0dd093-caac-4b5d-a11e-9f8e3ce103cf)


**clip showing details on alert view and timeline views**
![sentinel-one-agent
status](75de4db9-9966-4c91-94a5-4139ea81869e)


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2024-04-26 12:09:56 +02:00
Florian Lehner
ea80debecc
Profiling: Add color for .NET (#181126)
## Summary

Support for .NET was just recently added to Universal Profiling. This PR
adds a color to represent this interpreter in the flamegraph.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
2024-04-26 12:02:58 +02:00
Ash
8a05b593f3
[8.14][Security Solution][Endpoint] Unskip isolate/release responder tests (#181382)
## Summary

closes elastic/kibana/issues/172204
closes elastic/kibana/issues/172418

**flaky runner**


https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5761
x 50 - all pass

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
2024-04-26 02:45:40 -07:00
Khristinin Nikita
aa0d52a477
Don't fetch data view on store initialization (#177007)
## Sourcerer page load improvements

This PR contains 2 fixes:

1. Don't fetch data view when we initialise redux store, which blocks
page loading.
2. Don't fetch the default data view, when we open the alerts page, and
just use `@timestamp`


I added a 3-second delay for this API request, so you can see that the
new version doesn't block page load

# Before



02313c02-af91-468c-bfc4-d0525c5aa30a



# After


3d4be9e2-a9f6-455b-8b6e-60641d1c2aff


## Testing needed

As we change how we initialise sourcerer, additional testing is needed,
as I maybe don't manually tests all corner cases

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 02:32:22 -07:00
Marta Bondyra
52ca6ad98f
[Lens] support legendStats along with valuesInLegend in preparation for legend statistics (#180917)
## Summary

This PR addresses phase one of
https://github.com/elastic/kibana/issues/181035.

Doesn't introduce any user facing changes. 
It starts supporting a new saved object property `legendStats` while
supporting a old `valuesInLegend` property. In this PR, `legendStats:
['values']` and `valuesInLegend:true` are treated as equal. When loading
the saved object, `valuesInLegend:true` is transformed to
`legendStats:['values']`. After loading the document, the Lens app logic
is built around the new `legendStats` property.
When user saves the saved object, we do a reverse operation- we save the
runtime state `legendStats:['values']` as `valuesInLegend: true` to
ensure backwards compatibility.


![image](5e09b062-b4d3-424d-b8a8-79a08f4d6260)


Changes for runtime state:

- For xyCharts, the `valuesInLegend?: boolean ` property is replaced
with a more extensible `legend.legendStats?: LegendStats[]` interface

- For partition charts, the `showValuesInLegend?: boolean` property is
replaced with `legendStats?: LegendStats[]`.

after loading - in initialize function:

```ts
export function convertToRuntime(
  state: XYPersistedState,
  annotationGroups?: AnnotationGroups,
  references?: SavedObjectReference[]
) {
  const outputState = needsInjectReferences(state)
    ? injectReferences(state, annotationGroups, references)
    : state;
  if ('valuesInLegend' in outputState) {
    return convertToLegendStats(outputState);
  }
  return outputState;
}
```

before saving :

```ts
export function convertToPersistable(state: XYState) {
  const persistableState: XYPersistedState = convertToValuesInLegend(state);
  /.../
}
```

In the future the `legendStats` prop would contain also other types of
stats -see the [issue](https://github.com/elastic/kibana/issues/176583).
2024-04-26 11:03:49 +02:00
Alex Szabo
7ad17c36a2
[BK] Migrate batch 6 (api-docs, fleet-packages, secsol-qg-api) (#180784)
## Summary
Migrates 3 pipelines:
- kibana / api-docs / daily
[kibana-api-docs.yml](https://buildkite.com/elastic/kibana-api-docs-daily)
- kibana / serverless / security-solution-quality-gate / api-integration
[kibana-serverless-security-solution-quality-gate-api-integration.yml](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-api-integration)
- kibana / fleet-packages
[kibana-fleet-packages-daily.yml](https://buildkite.com/elastic/kibana-fleet-packages)

Verification:
 - [x] locally tested the RREs for validity
 - [x] pipelines tested through the migration staging pipeline:
- [x] API-docs -
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/80

- [x] serverless security solution api-integration -
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/48#018ef1ed-853d-4649-b008-3a38b9f97923

- [x] fleet packages -
https://buildkite.com/elastic/kibana-migration-pipeline-staging/builds/49


Part of: https://github.com/elastic/kibana-operations/issues/79
2024-04-26 10:36:30 +02:00
dkirchan
ed76f4a485
[Security] Changing the URL of proxy service to prod (#181802)
## Summary

Changing the URL of proxy service to prod
2024-04-26 10:29:12 +02:00
Bena Kansara
c6e704dbbd
[Custom threshold] [Alert details page] Fix intervalFactor to be based on rule interval (#181714)
Fixes https://github.com/elastic/kibana/issues/181713

### Current
<img width="1209" alt="Screenshot 2024-04-25 at 15 18 11"
src="b4a5bc3d-b39d-40a5-a1bd-2ee48f2a95e0">

### After change
<img width="1222" alt="Screenshot 2024-04-25 at 15 21 17"
src="6f802a27-9e37-4902-8cfc-8f8c2f1640a4">
2024-04-26 10:20:35 +02:00
Ievgen Sorokopud
75adf475c0
[Security Solution] Failing test: should have the bulk close checkbox enabled (#173360) (#181149)
## Summary

Addresses https://github.com/elastic/kibana/issues/173360

This is an attempt to fix a failing test:

`Failing test: Jest
Tests.x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout
- When the add exception modal is opened exception list type of
"endpoint" bulk closeable alert data is passed in should have the bulk
close checkbox enabled`

According to the ticket it failed only once. Also, I was not able to
reproduce the failure locally. After analysing the code and UI behaviour
the `Close all alerts that match this exception and were generated by
selected rule/s` checkbox can be disabled in three cases:
1. One of the condition items is of a list type (`is in list`, `is not
in list` etc.)
2. One of the condition items contains value not in the specified ECS
mapping
3. There are no condition items

First two points are covered in the test:
1. We use `type: 'match'`
2. Field `file.hash.sha256` is specified in the mocked index mapping as
```
'file.hash.sha256': {
  name: 'file.hash.sha256',
  type: 'string',
  aggregatable: true,
  searchable: true,
}
```

The only possibility for the checkbox to be disabled is if we did not
specify any condition item. After playing with the UI, I noticed that if
we did not set value for the `match` operator that would not count that
item as existing one.

Thus the fix is to make sure we pass a value to the condition item.

Instead of using:
```
entries: [{field: 'file.hash.sha256', operator: 'included', type: 'match'}]
```
we pass value as well:
```
entries: [{field: 'file.hash.sha256', operator: 'included', type: 'match', value: 'some value'}]
```

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 10:19:50 +02:00
Pierre Gayvallet
2911f597a4
Add translation files to CDN assets (#181650)
## Summary

Part of https://github.com/elastic/kibana/issues/72880

- Generate translation files for all locales (including all internal
plugins) during the CDN asset generation task
- Adapt the `rendering` service to use the translation files from the
CDN if configured/enabled

### How to test

Connect to the serverless project that was created for the PR, and
confirm the translation file is being loaded from the CDN

<img width="907" alt="Screenshot 2024-04-25 at 15 55 23"
src="5a6d9110-2e92-41e5-b066-e792e0015134">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 08:27:36 +02:00
Stratoula Kalafateli
e2aa9fdbac
[ES|QL] Retrieve the indices from AST parsing (#181271)
## Summary

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

Retrieves the indices from ast parsing. This ensures that the index
patterns we get from the `from` command is always the correct one. I
have replaced it everywhere expect from specific places where I still
use the deprecated function. I am not sure how to test the app and I
don't want to cause regressions so I prefer the responsible teams to do
the migration.


Before

Could not retrieve the index correctly
<img width="1677" alt="image"
src="77cdac00-ffff-4b91-88ba-0fc523c5f54d">

After
Correct retrieval of the index and the @timestamp info

<img width="1067" alt="image"
src="bc14718a-30f5-4f3c-8a56-cf57f69cff14">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: dej611 <dej611@gmail.com>
2024-04-26 07:52:00 +02:00
Kibana Machine
1d03e29c19
[api-docs] 2024-04-26 Daily api_docs build (#181792)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/685
2024-04-26 05:14:22 +00:00
Jatin Kathuria
b34c8a9ec9
[Security Solution] Unskip tests - detection_page_filters.cy.ts (#173163)
## Summary

### Flaky Tests to be fixed
 
  - https://github.com/elastic/kibana/issues/163544
  
  - https://github.com/elastic/kibana/issues/163757
  
  - https://github.com/elastic/kibana/issues/164018
  
  - https://github.com/elastic/kibana/issues/168276
  
  - https://github.com/elastic/kibana/issues/168277

### Fixes to make the tests more stable

- Disable `scrollBehaviour` for a [particular
test](https://github.com/elastic/kibana/pull/173163/files#diff-864d08982a2a67111903c3308f8b7ee797b34ec736f6747fedf46f8c36e08859R230)
- default `scrollBehavior` was true, which scrolls the element into view
automatically without any scroll Margin if an element has some hover
actions above the element, they get hidden on top of the window. So, we
need to set scrollBehavior to false to avoid scrolling the element into
view and we can scroll ourselves when needed
- Ref :
https://docs.cypress.io/guides/core-concepts/interacting-with-elements#Scrolling
    
- One code change has included a new
[parameter](https://github.com/elastic/kibana/pull/173163/files#diff-864d08982a2a67111903c3308f8b7ee797b34ec736f6747fedf46f8c36e08859R260)
which was a cause of failing a couple of tests. (Not flaky but failing)

 

### Flaky Test Runner Report

- [50
Runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5751)
    - Severless -  50/50 Pass
    - ESS -  50/50 Pass
- [100
Runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5753)
    - Severless -  100/100 Pass
    - ESS -   100/100 Pass

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-26 07:09:28 +02:00
Matthew Kime
e3c3f0c35e
[data views] Runtime field creation - display index values instead of source values in preview pane (#181246)
## Summary

The preview pane has two different groups - values relevant to the
currently edited field and other values in the same document.

For other values in the same doc, we were showing source values which
are often but not always the same as indexed values. This has been fixed
- its showing indexed values now.

As for the current field values, those were picking from _source or
indexed values but the code provided one as the fallback for another.
While this worked, the code didn't read as though it was doing the right
thing due to context not present in the code. Now, a runtime field
without a script obviously only returns a source value and the preview
of a mapped field only returns a mapped value.

```
PUT test
{
  "mappings": {
    "dynamic": false,
    "properties": {
      "percentage1": {
        "type": "long"
      },
      "percentage2": {
        "type": "long"
      },
      "percentage3": {
        "type": "long"
      }
    }
  }
}

PUT test/_doc/doc1
{
  "key": "value",
  "percentage1": 0.28,
  "percentage2": 0,
  "percentage3": 0.04,
  "percentage4": 0.21
}
```

Useful starting point for testing runtime field results -

```
GET test/_search
{
  "runtime_mappings": {
    "key.keyword": {
      "type": "keyword"
    }
  },
  "fields" : ["*"]
}
```

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

## Release notes

The runtime field creation modal now shows indexed values instead of
source values in the preview pane.

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-25 18:58:00 -07:00
Ying Mao
5b2300bf0e
Fixes Failing test: X-Pack Alerting API Integration Tests - Alerting - group4.x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/alerts_as_data/install_resources·ts - Alerting alerts_as_data install alerts as data resources should install context specific alerts as data resources on startup (#181759)
Resolves https://github.com/elastic/kibana/issues/181296

## Summary

Inspecting the logs of the flaky runs, everything looks like it's
getting installed correctly but the test is checking for the existence
of the concrete index before it has a chance to get installed. Added a
retry in order to allow for more time to let the index get installed.

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5766
2024-04-25 20:28:09 -04:00
Abdul Wahab Zahid
e6843c9717
[Dataset quality] - Improve links behavior on flyout (#181717)
## Summary

The PR improves/changes the behavior of external links on Dataset
Quality flyout:
1. The "Show all" link to Degraded Docs now considers flyout's time
range rather than table's time range.
2. The "Open in Lens" link will now use an Ad-Hoc Data View representing
the current Data Stream rather than an in memory Data View. Thus
removing the need to specifying an explicit `_index: ...` based query.
Previously a generic Data View (e.g. `logs-*-*`) along with __index_
query was used.
3. The "Show all" link for Hosts metric has been hidden for now awaiting
https://github.com/elastic/kibana/issues/181705.


310c7609-b5c3-49e4-9312-2e9083f9757d
2024-04-26 02:03:31 +02:00
Jon
97365ddcb3
[build/validate-cdn] Add retry (#181760) 2024-04-25 17:47:29 -05:00
Philippe Oberti
84e3ea51a8
[Security Solution][Alert details] - remove old flyout unnecessary z-index change (#181480) 2024-04-25 16:39:50 -05:00
Nathan Reese
cff6de2ecf
[maps] add required parameter 'version' to ESQL get columns request (#181752)
https://github.com/elastic/kibana/pull/180248 added `version` ESQL
requests. [This PR](https://github.com/elastic/kibana/pull/180248)
missed adding version to get columns request, resulting in get column
request failing. Resolves issue by populating `version` parameter.
2024-04-25 14:16:39 -06:00
christineweng
519f65a1fb
[Security Solution][Event flyout] Fix session preview in event details (#181764)
## Summary

Address: https://github.com/elastic/kibana/issues/181238

To display session viewer, a valid index is required. `useSessionView`
fetches `kibana.alert.ancestors.index` for alerts, and uses `_index` as
a fall back. This PR updates how the hook fetches `_id` and `_index`.
Previously, they always return null, because they are not included in
`getFieldsData`
([code](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts#L93)).

<img width="192" alt="image"
src="0a435d49-e314-4176-986a-66e13e4db4fe">

**How to test**
- Enable feature flag `expandableEventFlyoutEnabled`
- Have enterprise license active
- Generate some events and go to Host/User, event table
- Expand on a row with session view
- Session preview should be present under Overview -> Visulization

<img width="1259" alt="image"
src="ca806fc4-9ff0-4265-a6d7-e85b71f85142">

### 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-04-25 15:09:31 -05:00
Dominique Clarke
b2a8bfb209
[SLO] filter no data values for slo preview chart (#181619)
## Summary

Resolves https://github.com/elastic/kibana/issues/179075

Filters out no data values (-1) for slo preview chart, in order to
ensure that the bounds do not end up spanning all the way to -100%.

Before
<img width="822" alt="Screenshot 2024-04-24 at 1 46 20 PM"
src="30b7cd9e-d4a1-4e9a-b5a0-e5fb8d1fe857">

After
<img width="833" alt="Screenshot 2024-04-24 at 1 42 54 PM"
src="ea63be37-46f8-4212-b0b4-f01038f5b353">
2024-04-25 15:54:30 -04:00
Jen Huang
b913e3f143
[Fleet] Introduce enrollment settings API (#181357)
## Summary

Resolves https://github.com/elastic/kibana/issues/180764. Resolves
https://github.com/elastic/kibana/issues/180761. Resolves
https://github.com/elastic/kibana/issues/180762.

Per
https://github.com/elastic/kibana/issues/180764#issuecomment-2058049841,
it should be possible for users without access to Fleet settings to
enroll agents, i.e. users with `agents: all` and `settings: none`
privileges.

This is really tricky because the enrollment flyout UI relies on a
number of APIs in order to display the correct state (enroll fleet
server or enroll agent?) and instructions (which fleet server host?
which proxy, if any? agent download location? etc). Prior to this PR,
the simplest path forward was to enforce `settings: read` privilege as a
requirement for adding agents.

This PR introduces a new "enrollment settings" API that consolidates all
these API calls into the bare minimum information needed for enrollment
instructions. This solves the privilege issues as this API can be called
without having full read access to Fleet settings.

Abbreviated version of the spec of this API:
```
## Request
GET /api/fleet/settings/enrollment?agentPolicyId=OPTIONAL_POLICY_ID

## RESPONSE
{
  fleet_server: {
    policies: Array<{
        id: string;
        name: string;
        is_default_fleet_server?: boolean;
        has_fleet_server?: boolean;
        is_managed: boolean;
      download_source_id?: string;
      fleet_server_host_id?: string;
    }>;
    has_active: boolean;
    host?: FleetServerHost;
    host_proxy?: FleetProxy;
  };
  download_source?: DownloadSource;
```

The full spec can be viewed here at Swagger:
https://petstore.swagger.io/?url=https://raw.githubusercontent.com/jen-huang/kibana/fix/privilege/add-agent-no-settings/x-pack/plugins/fleet/common/openapi/bundled.json#/Fleet%20internals/get-enrollment-settings

If there is an fleet server (agent) policy ID provided in the query
params, it will return information scoped to that policy, such as if
there are active fleet servers enrolled into that policy, the host and
proxy used, download source configured, etc. If no ID is provided, it
will return info scoped to the default fleet server policy. If there is
no default fleet server policy, it will return an empty list of policy
IDs and `has_active: false`.

<details>
<summary>This PR also adds a new permission denied screen if there is no
fleet server and user does not have privileges to add one (similar to
the ES privileges check. Click for screenshot:</summary>

<img width="1137" alt="image"
src="afaeded3-fcfd-4549-a6da-742d705f2e5a">
</details>

### 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
2024-04-25 12:52:44 -07:00
christineweng
725b9bfc58
[Security Solution][Details Flyout] Enable toggle column action in event flyout (#181755)
## Summary

Address https://github.com/elastic/kibana/issues/181552. Toggle column
was previously disabled for non-alerts, enabling in this PR.


![image](7f4dcf8f-8290-4423-8a31-2d4e7e351342)

**How to test**

- Enable feature flag `expandableEventFlyoutEnabled`
- Generate some events and go to Host/User, event table
- Expand on a row with session view
- Hover actions (in table or highlighted fields) should have toggle
column action
2024-04-25 14:42:00 -05:00
Ying Mao
ee1552f10d
[Response Ops][Alerting] Backfill Rule Runs (#177622)
This is the feature branch that contains the following commits. Each
individual PR contains a summary and verification instructions.

- [Schedule backfill API](https://github.com/elastic/kibana/pull/176185)
- [Backfill task runner](https://github.com/elastic/kibana/pull/177640)
- [Get/Find/Delete backfill
API](https://github.com/elastic/kibana/pull/179975)
- [API key invalidation
update](https://github.com/elastic/kibana/pull/180749)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-25 15:36:01 -04:00
Saikat Sarkar
19b0543fd9
[Semantic Text UI] Add toast, modal and banner for deployment status (#180246)
In this PR, we added the following items.

- Add a toast for letting the user know that the underlying model is
being deployed
- Start the deployment of trained model if the model deployment has not
been started
- Add a modal to display the current status of trained model deployment
- Show a link to the model management page.
- Create a inference endpoint for default inference_ids if they are
missing
- Display a badge for inference_endpoint
- Show warning if mappingsDefinition is null


Please be aware that currently, we won't be able to save the mapping
using the 'Save mappings' button because the 'semantic_text'
functionality doesn't support 'inference_id'. However, there is ongoing
parallel work in a GitHub
[branch](https://github.com/elastic/elasticsearch/tree/feature/semantic-text)
to enable 'inference_id' in 'semantic_text' for Elasticsearch.

### How to test the changes locally
- Download the elasticsearch changes from GitHub
[branch](https://github.com/elastic/elasticsearch/tree/feature/semantic-text)
- Run the elasticsearch: `./gradlew :run -Drun.license_type=trial`
- Download the changes of this PR in local kibana and do the following
steps
+ Set isSemanticTextEnabled = true in this
[location](https://github.com/elastic/kibana/pull/180246/files#diff-92f4739f8a4a6917951a1b6e1af21a96d54313eaa2b5ce4c0e0553dd2ee11fcaL80)
    +  Run `yarn start`
-  Create an index named 'books' using the following command:

<details>
<summary>Click to expand</summary>

```
PUT books
{
  "mappings": {
    "dynamic_templates": [],
    "properties": {
      "date_published": {
        "type": "date"
      },
      "price": {
        "type": "float"
      },
      "title": {
        "type": "text"
      },
      "attributes": {
        "type": "nested",
        "properties": {
          "authors": {
            "type": "nested",
            "properties": {
              "author_name": {
                "type": "text"
              },
              "author_birthdate": {
                "type": "date"
              }
              // Add more author attributes as needed
            }
          },
          "genres": {
            "type": "nested",
            "properties": {
              "genre_name": {
                "type": "keyword"
              },
              "genre_description": {
                "type": "text"
              }
              // Add more genre attributes as needed
            }
          }
        }
      }
    }
  }
}
```

</details>

- Follow the steps mentioned in this video: 


f1ef71e3-8adf-4bcd-837c-754929fe6f1c

### Screenshots

![Screenshot 2024-04-12 at 9 52
02 AM](ebdec41e-23ee-4622-aed9-aa7ad5b091b8)
![Screenshot 2024-04-12 at 9 52
14 AM](1bec637e-9fe3-4add-b7d6-55fb687f2ce0)
![Screenshot 2024-04-12 at 9 52
29 AM](8c362d25-6d71-4504-ba80-e1b9914dd701)
![Screenshot 2024-04-12 at 9 53
07 AM](b3a0b148-4b3f-4679-bf99-c27bfa27d1fd)
![Screenshot 2024-04-12 at 9 53
46 AM](29e93d39-e84f-4d6f-b3f4-0bfd1405b24d)
![Screenshot 2024-04-12 at 9 54
05 AM](243b87e1-89d3-440d-8848-e30d03c0262f)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sander Philipse <sander.philipse@elastic.co>
2024-04-25 12:20:53 -07:00
Elena Stoeva
b92890a051
[Index Templates][Serverless] Update api integration tests for _source field (#181742)
## Summary

This PR updates the Index templates API integration tests for serverless
to not use the `_source` property in the mock template as this property
is not supported in serverless.
2024-04-25 19:43:01 +01:00
Nicolas Chaulet
90b4c1ca4a
[Fleet] Scroll to top when changing agent activity date filter (#181727) 2024-04-25 14:32:55 -04:00
Sander Philipse
35974ca816
[Search] Fix mapping tab breaking docLinks and refresh (#181729)
## Summary

This fixes two issues on the mappings tab in Search:
- A frequent refresh caused by input changes unrelated to the mappings
component
- Doclinks breaking because they hadn't been initialized yet
2024-04-25 10:44:49 -07:00
Tim Sullivan
a65c11b087
[Presentation/Dashboard] Remove usage of deprecated React rendering utilities (#181597)
Pulled from https://github.com/elastic/kibana/pull/181356
2024-04-25 10:08:52 -07:00
Bhavya RM
3a65e17d78
[a11y] Remove jext-axe and supporting code from kibana (#180694)
Removing jest-axe and supporting code from Kibana because this library
(not regularly updated anymore and used only in one test file) is
blocking me from updating axe-core.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-25 22:24:18 +05:30
James Gowdy
2ab8875a36
[ML] Removing datafeed preview frozen tier message in serverless (#181440)
When running in serverless, the warning about frozen tiers when no data
is available for the datafeed preview is hidden.


![image](a49a5df0-cece-4172-9bac-c51fa26ce6df)

Also updates the page template for all ML pages to ensure a background
colour is always used.

Fixes https://github.com/elastic/kibana/issues/180020
2024-04-25 09:53:57 -07:00
James Gowdy
1c0ece5fc6
[ML] Hide file upload doc count chart until data is searchable (#181460)
Fixes https://github.com/elastic/kibana/issues/179131

In serverless, there is a larger delay in when the newly ingested data
becomes searchable. Rather than displaying an empty chart, we now hide
the chart until we see some non-zero values.
2024-04-25 09:40:15 -07:00
Kevin Delemme
6ac0b5d73a
fix(slo): remove assertion on deleted rollup documents (#181725)
Resolves https://github.com/elastic/kibana/issues/180982

## Summary

When deleting an SLO, we also start a delete_by_query on the rollup
documents. This request is done asynchronously in the background. The
serverless integration test asserts on the deletion of the rollup
documents but fails some time.
As the deletion of the rollup document causes no harms if not done, I'm
removing this assertion from the test.
2024-04-25 17:32:17 +01:00
Kibana Machine
974158880d skip failing test suite (#181466) 2024-04-25 12:23:37 -04:00