Commit graph

45084 commits

Author SHA1 Message Date
Josh Dover
f3d8431dd6
Add test harness for SO migration integration tests (#106116)
Co-authored-by: Mikhail Shustov <restrry@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 13:08:56 -04:00
Christiane (Tina) Heiligers
fe0fb4efb5
Changes tag saved object namespaceType to multiple-isolated (#106341)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 13:03:14 -04:00
Alejandro Fernández Gómez
3eac913c34
[Observability RAC] Leave the severity of the alerts empty if it's unknown (#107029)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 12:39:20 -04:00
Tiago Costa
da8edcbb37
chore(NA): moving @kbn/analytics to babel transpiler (#107781)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 17:08:53 +01:00
Byron Hulcher
be5f538a1b
[App Search] Migrate Delete Domain Panel (#107795)
* Add deleteDomain action to CrawlerSingleDomainLogic

* New DeleteDomainPanel component

* Added DeleteDomainPanel to CrawlerSingleDomain

* Missing tests for DeleteDomainPanel

* Abstract getDeleteDomainConfirmationMessage
2021-08-09 11:43:02 -04:00
Tiago Costa
58054c3325
chore(NA): moving @kbn/cli-dev-mode to babel transpiler (#107779)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 16:20:34 +01:00
Tiago Costa
2558194f80
chore(NA): moving @kbn/config to babel transpiler (#107763)
* chore(NA): moving @kbn/config to babel transpiler

* chore(NA): fix types

* chore(NA): include missing deps

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 16:20:01 +01:00
Liza Katz
21f4de833c
Clear out unused imports (#107638)
* Clear out unused imports
Add public to some exports

* types and funzies

* flattenHitWrapper

* t

* restore

* SAD

* bad merge
2021-08-09 16:35:10 +02:00
Ester Martí Vilaseca
fafac5b488
Remove ui-library (#107533)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 16:26:25 +02:00
Liza Katz
8d90df3bca
filter FilterBar suggestions by time (according to flag) (#107192)
* filter filter bar suggestions by time (according to flag)
add api integration tests for autocomplete apis

* test fix: setDefaultAbsoluteRange

* timeRangeForSuggestionsOverride

* revert

* tests

* doc

* set time range

* Added tests following code review

* eslint

* fun-ctional tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 15:58:27 +02:00
Esteban Beltran
417d093a29
[Security Solution] Move endpointdetails into its own middleware function (#107632) 2021-08-09 09:17:08 -04:00
Josh Dover
e7a05c0110
Move src/core/TESTING.md to mdx (#107039)
* Move src/core/TESTING.md to mdx

* PR comments

* Fix conventions link

* Fix FTR api config link
2021-08-09 14:03:35 +02:00
Tiago Costa
4fb20e71e1
skip flaky suite (#107856) 2021-08-09 13:02:51 +01:00
Tiago Costa
854faa4bb7
skip flaky suite (#107831) 2021-08-09 12:55:49 +01:00
Yulia Čech
c79f37f976
[ILM] Refactored policies list to use EuiInMemoryTable (#107510)
* [ILM] Created policy list context

* [ILM] Created policy action component

* [ILM] Fixed i18n errors

* [ILM] Implemented code review suggestion

* [ILM] Fixed a11y tests

* [ILM] Updated the test description

* [ILM] Renamed policy table components

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 13:50:55 +02:00
Anton Dosov
bc8530e591
Fix search sessions management UI displays wrong warning (#107556) 2021-08-09 07:43:07 -04:00
Esteban Beltran
10efecf585
[Security Solution] Adds behavior protection support for mac and linux (#107749)
* Add behaviour-protection-for-mac-and-linux

* Display the correct os names in the OS section

* Fix policy config returning windows values
2021-08-09 13:03:27 +02:00
David Sánchez
37084f759c
[Security solution][Endpoint] Refactor of event filters form test in order to use context provider. (#107725)
* adds entries.list.id field in the searchable event filters fields list

* adds test case for list.id operator

* Revert "adds entries.list.id field in the searchable event filters fields list"

This reverts commit 45a66fd966.

* Revert "adds test case for list.id operator"

This reverts commit 9dba145df2.

* Disable large value list option in operators dropdown

* Refactor event filters form test to use context provider

* Fix ts checks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 12:06:55 +02:00
Ashokaditya
78cc089ec2
update linting doc (#105748)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-09 09:40:09 +02:00
Søren Louv-Jansen
b16d20b50a
[APM] Various improvements from #104851 (#107726) 2021-08-07 13:22:47 +02:00
renovate[bot]
244d7579e6
Update dependency @elastic/charts to v33.2.0 (master) (#107842)
* Update dependency @elastic/charts to v33.2.0

* update jest snapshot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: nickofthyme <nick.ryan.partridge@gmail.com>
2021-08-06 19:01:47 -05:00
Dave Snider
957ef4ca95
Fix default route link on kibana homepage (#107809) 2021-08-06 09:32:21 -04:00
Dario Gieselaar
2407080cc2
[APM] Invalidate trackPageview on route change (#107741)
Closes #107728.
2021-08-06 13:04:00 +02:00
Nathan L Smith
43868ac125
Service map backend links (#107317)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-06 08:19:57 +02:00
Matthew Kime
d44df74598
[index patterns] index pattern create modal (#101853)
index pattern creation flyout
2021-08-05 22:58:57 -05:00
Xavier Mouligneau
923eca0adf
[RAC] integrating rbac search strategy with alert table (#107242)
### Summary

We are integrating alert search strategy with RBAC on top of alert tables for security solution and o11y.
2021-08-05 21:10:27 -04:00
Marshall Main
28084f858d
[Security Solution] Siem signals -> alerts as data field and index aliases (#106049)
* Add aliases mapping signal fields to alerts as data fields

* Add aliases mapping alerts as data fields to signal fields

* Replace siem signals templates per space and add AAD index aliases to siem signals indices

* Remove first version of new mapping json file

* Convert existing legacy siem-signals templates to new ES templates

* Catch 404 if siem signals templates were already updated

* Enhance error message when index exists but is not write index for alias

* Check if alias write index exists before creating new write index

* More robust write target creation logic

* Add RBAC required fields for AAD to siem signals indices

* Fix index name in index mapping update

* Throw errors if bulk retry fails or existing indices are not writeable

* Add new template to routes even without experimental rule registry flag enabled

* Check template version before updating template

* First pass at modifying routes to handle inserting field aliases

* Always insert field aliases when create_index_route is called

* Update snapshot test

* Remove template update logic from plugin setup

* Use aliases_version field to detect if aliases need update

* Fix bugs

* oops update snapshot

* Use internal user for PUT alias to fix perms issue

* Update comment

* Disable new resource creation if ruleRegistryEnabled

* Only attempt to add aliases if siem-signals index already exists

* Fix types, add aliases to aad indices, use package field names

* Undo adding aliases to AAD indices

* Remove unused import

* Update test and snapshot oops

* Filter out kibana.* fields from generated signals

* Update cypress test to account for new fields in table

* Properly handle space ids with dashes in them

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-05 18:11:17 -04:00
Zacqary Adam Xeper
eed9723c85
[Metrics UI] Add checkbox to optionally drop partial buckets (#107676) 2021-08-05 14:23:33 -07:00
Zacqary Adam Xeper
e9913264c7
[Metrics UI] Fix metric threshold preview regression (#107674) 2021-08-05 13:39:22 -07:00
Alejandro Fernández Haro
74107a1fbd
Disable Product check in @elastic/elasticsearch-js (#107642)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-05 15:55:41 -04:00
Byron Hulcher
125a22c233
[App Search] Migrate Crawler Status Indicator, Crawler Status Banner, and Crawl Request polling (#107603) 2021-08-05 15:53:31 -04:00
Ryland Herrick
8665f36cf3
[Security Solution, Lists] Replace legacy imports from 'elasticsearch' package (#107226)
* Remove legacy imports from 'elasticsearch' package

This prefers the newer types from '@elastic/elasticsearch'.

There was one instance where mock data was insufficient to satisfy the
newer analogous types; in all other cases this was just a find/replace.

* Fix type errors with a null guard

We know that this mock has hits with _source values, but we cannot
convey this to typescript as null assertions are disabled within this
project. This seems like the next best solution, preferable to a
@ts-expect-error.

* Fix a few more type errors

* Replace legacy type imports in integration tests

* refactors destructuring due to _source being properly declared as
  conditional

* Update more integration tests to account for our optional _source

Changes here fall into one of two categories:

* If the test was making an assertion on a value from _source, we simply
null chain and continue to assert on a possibly undefined value.

* If the test logic depends on _source being present, we first assert that
presence, and exit the test early if absent.

* Fix more type errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-05 15:36:44 -04:00
Nathan Reese
500905c2b1
[maps] asset tracking tutorial (#104552)
* [maps] asset tracking tutoral

* fix image link

* fix link to tutorial in index.asciidoc

* use ref link for ece-cloud-id link

* use ece link

* fix code blocks

* fix screenshot

* finish part 1

* add tracks layer

* top hits step

* clean up part 2

* clean up part 2

* draw construction zones

* fix image name

* create alert

* add alerts to map

* add newline after code blocks

* remove to get build working again

* add back part 3 with header fix

* use server log connector

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* review feedback for part 1

* add Console

* part 2 feedback

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* part 3 review feedback

* one more fix

* intro paragraphs

* intro paragraph review feedback

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update docs/maps/asset-tracking-tutorial.asciidoc

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2021-08-05 13:27:25 -06:00
Spencer
02c571e362
[scripts/build_ts_refs] when using --clean initialize caches (#107777)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-05 12:09:56 -07:00
Chandler Prall
c2e834353e
Upgrade EUI to v36.1.0 (#107231)
* Upgrade eui to v36.1.0

* Jest snapshots

* More jest snapshots; one test assertion update

* Bump core page load limit

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-05 13:00:32 -06:00
Andrew Goldstein
5f409bc339
[RAC] [TGrid] Implements cell actions in the TGrid (#107771)
## Summary

This PR implements cell actions in the `TGrid`, rendering them via `EuiDataGrid`, per the `Before` and `After` screenshots below:

### Before

Users previously hovered over a draggable field to view and trigger cell actions:

<img width="1348" alt="legacy_cell_actions" src="https://user-images.githubusercontent.com/4459398/128351498-49b4d224-6c51-4293-b14f-46bbb58f7cb3.png">

_Above: legacy `TGrid` cell action rendering_

### After

Cell actions are now rendered via `EuiDataGrid` cell actions:

<img width="997" alt="euidatagrid_cell_actions" src="https://user-images.githubusercontent.com/4459398/128358847-c5540ea4-8ba1-4b35-ab6b-3b3e39ae54ce.png">

_Above: new `TGrid` cell action rendering via `EuiDataGrid`_

## Technical Details

Every instance of the `TGrid` on a page can specify its own set of cell actions via `defaultCellActions` when calling the `timelines.getTGrid()` function to create an instance.

For example, the Observability Alerts `TGrid` is initialized in with a default set of actions in `x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx`, as shown in the code below:

```ts
      {timelines.getTGrid<'standalone'>({
        type: 'standalone',
        columns,
        deletedEventIds: [],
        defaultCellActions: getDefaultCellActions({ enableFilterActions: false }), // <-- defaultCellActions
        // ...
    </>
```

The type of the `defaultCellActions` is:

```ts
defaultCellActions?: TGridCellAction[];
```

and the definition of `TGridCellAction` is in `x-pack/plugins/timelines/common/types/timeline/columns/index.tsx`:

```ts
/**
 * A `TGridCellAction` function accepts `data`, where each row of data is
 * represented as a `TimelineNonEcsData[]`. For example, `data[0]` would
 * contain a `TimelineNonEcsData[]` with the first row of data.
 *
 * A `TGridCellAction` returns a function that has access to all the
 * `EuiDataGridColumnCellActionProps`, _plus_ access to `data`,
 *  which enables code like the following example to be written:
 *
 * Example:
 * ```
 * ({ data }: { data: TimelineNonEcsData[][] }) => ({ rowIndex, columnId, Component }) => {
 *   const value = getMappedNonEcsValue({
 *     data: data[rowIndex], // access a specific row's values
 *     fieldName: columnId,
 *   });
 *
 *   return (
 *     <Component onClick={() => alert(`row ${rowIndex} col ${columnId} has value ${value}`)} iconType="heart">
 *       {'Love it'}
 *      </Component>
 *   );
 * };
 * ```
 */
export type TGridCellAction = ({
  browserFields,
  data,
}: {
  browserFields: BrowserFields;
  /** each row of data is represented as one TimelineNonEcsData[] */
  data: TimelineNonEcsData[][];
}) => (props: EuiDataGridColumnCellActionProps) => ReactNode;
```

For example, the following `TGridCellAction[]` defines the `Copy to clipboard` action for the Observability Alerts table in `x-pack/plugins/observability/public/pages/alerts/default_cell_actions.tsx`:

```ts
/** actions common to all cells (e.g. copy to clipboard) */
const commonCellActions: TGridCellAction[] = [
  ({ data }: { data: TimelineNonEcsData[][] }) => ({ rowIndex, columnId, Component }) => {
    const { timelines } = useKibanaServices();

    const value = getMappedNonEcsValue({
      data: data[rowIndex],
      fieldName: columnId,
    });

    return (
      <>
        {timelines.getHoverActions().getCopyButton({
          Component,
          field: columnId,
          isHoverAction: false,
          ownFocus: false,
          showTooltip: false,
          value,
        })}
      </>
    );
  },
];
```

Note that an _implementation_ of the copy to clipboard cell action, including the button, is available for both the Observability and Security solutions to use via `timelines.getHoverActions().getCopyButton()`, (and both solutions use it in this PR), but there's no requirement to use that specific implementation of the copy action.

### Security Solution cell actions

All previously-available hover actions in the Security Solution are now available as cell actions, i.e.:

- Filter for value
- Filter out value
- Add to timeline investigation
- Show Top `<field>` (only enabled for some data types)
- Copy to clipboard

### Observability cell actions

In this PR:

- Only the `Copy to clipboard` cell action is enabled by default in the Observability Alerts table
- The `Filter for value` and `Filter out value` cell actions may be enabled in the `Observability` solution by changing a single line of code, (setting `enableFilterActions` to true), on the following line in `x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx`:

```js
defaultCellActions: getDefaultCellActions({ enableFilterActions: false }), // <-- set this to `true` to enable the filter actions
```

`enableFilterActions` is set to `false` in this PR because the Observability Alerts page's search bar, defined in `x-pack/plugins/observability/public/pages/alerts/alerts_search_bar.tsx`:

```ts
  return (
    <SearchBar
      indexPatterns={dynamicIndexPattern}
      placeholder={i18n.translate('xpack.observability.alerts.searchBarPlaceholder', {
        defaultMessage: 'kibana.alert.evaluation.threshold > 75',
      })}
      query={{ query: query ?? '', language: queryLanguage }}
      // ...
    />
````

must be integrated with a `filterManager` to display the filters. A `filterManager` instance may be obtained in the Observability solution via the following boilerplate:

```ts
  const {
    services: {
      data: {
        query: { filterManager },
      },
    },
  } = useKibana<ObservabilityPublicPluginsStart>();
```

## Desk testing

To desk test this PR, you must enable feature flags in the Observability and Security Solution:

- To desk test the `Observability > Alerts` page, add the following settings to `config/kibana.dev.yml`:

```
xpack.observability.unsafe.cases.enabled: true
xpack.observability.unsafe.alertingExperience.enabled: true
xpack.ruleRegistry.write.enabled: true
```

- To desk test the TGrid in the following Security Solution, edit `x-pack/plugins/security_solution/common/experimental_features.ts` and in the `allowedExperimentalValues` section set:

```typescript
tGridEnabled: true,
```

cc @mdefazio
2021-08-05 12:46:07 -06:00
Domenico Andreoli
764388e713
Realign cypress/ccs_integration with cypress/integration (#107743) 2021-08-05 13:23:44 -05:00
Joe Portner
66dbb88451
Allow optional OSS to X-Pack dependencies (#107432) 2021-08-05 13:58:24 -04:00
Joe Portner
7fe2d177a1
Add SavedObjectsUtils.getConvertedObjectId function (#107767) 2021-08-05 13:49:22 -04:00
Dario Gieselaar
bf0c799480
[APM] Service view for all dependencies (#107627)
* [APM] Service view for all dependencies

Closes #103257.

* Update API tests

* Fix type issue
2021-08-05 12:40:50 -05:00
Alexander Wert
baec132a4d
Visualizing composite spans. (#106862)
* Visualizing composite spans.

* fixed reviews comments

* replaced var usage with let

* Fixed display of compositeSpanDurationSummary

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-05 13:39:52 -04:00
Mark Hopkin
a2b849b458
test: add unit tests for is_managed behaviour (#107759) 2021-08-05 18:14:30 +01:00
Byron Hulcher
a51787d5f6
[App Search] Empty Crawler Single Domain view (#107694)
* New route to retreive data for a single domain

* New CrawlerSingleDomainLogic logic

* New CrawlerSingleDomain view component

* Add CrawlerSingleDomain to CrawlerRouter

* Use different default text for page title while loading

* Apply suggestions from code review

Co-authored-by: Orhan Toy <toyorhan@gmail.com>

Co-authored-by: Orhan Toy <toyorhan@gmail.com>
2021-08-05 13:09:28 -04:00
Sandra G
c695a13270
[Stack Monitoring] update docs for changes in stack monitoring rules (#107670)
* update docs for changes in stack monitoring rules

* fix grammatical error

* update
2021-08-05 13:05:08 -04:00
Lisa Cawley
e160532a41
[SECURITY] Replaces hard-coded links with doc link service (#103823) 2021-08-05 10:04:35 -07:00
Cauê Marcondes
ca6182cd20
[APM] Remove the feature flag for the Service overview (Kibana advanced setting) (#107657) 2021-08-05 18:11:01 +02:00
Nicolas Chaulet
3438a70ec3
[Fleet] Replace usages of EuiCodeEditor by CodeEditor (#107434) 2021-08-05 11:40:40 -04:00
Dima Arnautov
39bd188818
[ML] Delayed data test for Anomaly Detection jobs health rule type (#107183)
* [ML] enable test selection

* [ML] executor update for annotations

* [ML] update unit tests

* [ML] fix i18n

* [ML] update schema

* [ML] fix ts

* [ML] account for docs count, update unit tests

* [ML] update translation strings

* [ML] add types

* [ML] fetch the latest annotation sorted by modified_time

* [ML] getDelayedDataAnnotations

* [ML] update unit tests

* [ML] set default number of docs to 1, update schema validation

* [ML] getDelayedDataLookbackTimestamp

* [ML] filter null values, update unit tests

* [ML] account for query delay, refactor with memoize

* [ML] update unit test

* [ML] remove previousStartedAt

* [ML] filter based on the job config

* [ML] fix tests

* [ML] add maps

* [ML] combine filters

* [ML] move range query inside of a filter

* [ML] filter out jobs with missing datafeed

* [ML] resolveLookbackInterval only from jobs with datafeeds

* [ML] do not show an error on empty time interval

* [ML] add help tooltips

* [ML] update description for the datafeed check
2021-08-05 10:31:51 -04:00
Anton Dosov
af3a976e17
[FieldFormats] Break from data plugin (#107173) 2021-08-05 16:25:22 +02:00
Ahmad Bamieh
b6a9f0323b
[Telemetry] Add telemetry.sendUsageTo config (#107396) 2021-08-05 17:15:37 +03:00