Commit graph

38684 commits

Author SHA1 Message Date
Alison Goryachev
f8edc51ece
Implement error reporting in monaco for painless language (#84695) 2020-12-08 10:07:07 -05:00
Mike Côté
5cc9bf82d2
Add capability of defining message variables that don't escape (#84357)
* Add capability of defining message variables that don't escape

* Fix ESLint

* Rename noEscape to useWithTripleBracesInTemplates

* Add unit tests pt 1

* Add unit tests pt 2

* Fix tests

* Fix test failures

* Docs

* PR feedback
2020-12-08 09:46:04 -05:00
Diana Derevyankina
559cfcb8ca
[TSVB] Tests for Y-axis formatting depending on series formatters (#85125)
* [TSVB] Tests for Y-axis formatting depending on series formatters

* Fix path to getFieldFormatsRegistry

* Refactor some objects

* Add test case for custom formatter
2020-12-08 17:05:38 +03:00
MadameSheema
bdd0e25359
fixes and unskips failing tests (#85243) 2020-12-08 14:50:31 +01:00
MadameSheema
e291b84f4d
unskips indicator match rule (#85240) 2020-12-08 14:49:34 +01:00
MadameSheema
273363a85b
fixes and unskips failing test (#85235) 2020-12-08 14:48:51 +01:00
MadameSheema
f46eaf889d
fixes and unskips failing tests (#85232)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-08 14:47:48 +01:00
Vincent Fuchs
067efa4552
fixed path to config file (#85257) 2020-12-08 08:36:20 -05:00
DeFazio
0a0ead802c
Update widths on columns in Alert Detail view (#83823)
* Update widths on columns

* Add custom class for truncation fix

* Use euiTruncate mixin and shrink column width of status column

* Update imports to fix checks

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-08 08:02:07 -05:00
Aleh Zasypkin
caa14d44ef
Increase waiting delay in session cleanup tests. (#85127) 2020-12-08 13:55:22 +01:00
Patryk Kopyciński
e4b89d42d8
[Security Solution] Unskip persistent timeline cypress tests (#82972) 2020-12-08 11:48:25 +01:00
Dima Arnautov
b6fe6d0fea
[ML] Fix watcher URL to the Anomaly Explorer page (#85123)
* [ML] fix watcher url to the anomaly explorer page

* [ML] remove refreshInterval from the watcher url to the anomaly explorer page
2020-12-08 11:30:54 +01:00
Wylie Conlon
0fdf76e779
[Lens] Don't assign dimension until it becomes valid (#84972) 2020-12-08 11:29:07 +01:00
Vadim Dalecky
9bef95a6fb
HTTP CRUD+ API for Index Patterns (#83576)
* refactor: 💡 extract out createIndexPatternsService() method

* feat: 🎸 add create index pattern route

* feat: 🎸 add index patterns http context

* feat: 🎸 add schema for index pattern create method

* refactor: 💡 compose schema out of variables

* feat: 🎸 allow to not make the new index pattern a default one

* feat: 🎸 implement index pattern create endpoint

* docs: ✏️ add index pattern create endpoint docs

* fix: 🐛 add error handling wrapper

* feat: 🎸 add index pattern GET route

* docs: ✏️ add index pattern GET mention to docs

* feat: 🎸 add higher order route handler to check for context

* feat: 🎸 add index pattern deletion endpoint

* docs: ✏️ add delete endpoint docs entry

* feat: 🎸 add index pattern update route

* feat: 🎸 add ability to update timeFieldName

* feat: 🎸 add ability to edit intervalName, sourceFilters, fields

* feat: 🎸 allow updating index pattern type and typeMeta

* feat: 🎸 add ability to update index_pattern fields

* docs: ✏️ add index pattern update endpoint docs

* docs: ✏️ fix typo

* feat: 🎸 disable XSRF and add Content-Type

* fix: 🐛 enable xsrf

* feat: 🎸 send 404 status code when index pattern is not found

* fix: 🐛 correctly report empty change set error

* feat: 🎸 fields API add route for adding field to IP

* docs: ✏️ add index pattern field create route

* fix: 🐛 throw on creating an existing index pattern field

* feat: 🎸 add field upsert route

* feat: 🎸 add field get api endpoint

* feat: 🎸 add field delete endpoint

* refactor: 💡 improve 404 error handling

* refactor: 💡 improve index pattern 404 error class

* feat: 🎸 add field update api endpoint

* docs: ✏️ typo

* refactor: 💡 rename ski_field_refresh to refresh_fields in creat

* refactor: 💡 rename to refresh_fields param in update call

* refactor: 💡 rename parameter to refresh_fields in fields api

* feat: 🎸 allow creating and deleting only scripted fields

* style: 💄 fix TypeScript/Prettier error

* test: 💍 add index pattern creation negative tests

* test: 💍 add index pattern create method tests

* feat: 🎸 remove make_default flag

* docs: ✏️ update docs

* test: 💍 add index patter api get tests

* test: 💍 add delete index pattern tests

* fix: 🐛 fix TypeScript error after refactor

* docs: ✏️ update autogenerated docs

* docs: ✏️ update autogenerated docs

* refactor: 💡 change Fields API to Scripted Fields API

* feat: 🎸 allow only scripted fields in Scripted Fields API

* test: 💍 add index patter api update tests

* test: 💍 add scripted field create api tests

* test: 💍 add scripted field delete api tests

* test: 💍 add scripted fields fetch api tests

* test: 💍 add scripted field field put api tests

* test: 💍 add scripted field update api test

* feat: 🎸 add index pattern field update endpoint

* feat: 🎸 improve index patterns fields api

* test: 💍 fix test

* docs: ✏️ update docs README

* test: 💍 add field metadata deletion teests

* docs: ✏️ improve index pattern api readme

* fix: 🐛 fix TypeScript errors

* test: 💍 update jest tests

* docs: ✏️ update auto-generated docs

* feat: 🎸 remove intervalName from index pattern create API

* test: 💍 fix integration tests

* fix: 🐛 make refresh_fields default to false

* chore: 🤖 remove searchable and aggregatable from public API

* chore: 🤖 remove various field properties

* chore: 🤖 remove "index" attribute from public field schema

* docs: ✏️ update docs to match API

* chore: 🤖 fix TypeScript errors

* test: 💍 try fixing functional tests

* docs: ✏️ update auto-generated docs

* chore: 🤖 check if this fixes security tests

* fix: 🐛 create index patterns context only if user is authc

* fix: 🐛 assert on index patterns service

* test: 💍 try fixing integration tests

* fix: 🐛 try fixing integration tests

* chore: 🤖 update auto-generated docs

* refactor: 💡 directly inject index pattern provider into create

* refactor: 💡 create index pattern service directly in each route

* refactor: 💡 remove index pattern route context provider

* chore: 🤖 remove unused code

* chore: 🤖 remove refresh_fields from scripted fields

* style: 💄 change template param names

* refactor: 💡 make field.count always be an integer

* docs: ✏️ update auto-generated docs

* refactor: 💡 inject index patterns using getStartServices

* docs: ✏️ update autogenerated docs

* docs: ✏️ update docs
2020-12-08 10:33:18 +01:00
Thomas Watson
1d3028301b
Don't list packages in devDependencies already listed in dependencies (#85120) 2020-12-08 09:59:20 +01:00
Thomas Watson
f66a80a677
Remove unused devDependencies (#85121) 2020-12-08 09:58:18 +01:00
Jean-Louis Leysens
fac1f1204d
[ILM] Reposition form toggles (#85143)
* merged toggleable field and described form component and moved toggle to left

* moved all toggles to left, renamed DescribedFormField -> DescribedFormRow and added new ToggleFieldWithDescribedFormRow component

* added new prop fieldNotices to render callouts in correct position on the left
2020-12-08 08:47:26 +01:00
Dario Gieselaar
213b934386
[APM] Make sure jest script can be run from anywhere (#85111) 2020-12-08 07:55:24 +01:00
Scotty Bollinger
62e79eec70
Add EuiButtonEmptyTo components (#85213)
This PR adds another wrapper component for internal routing, the EuiButtonEmptyTo component.
2020-12-07 21:03:10 -06:00
Tiago Costa
568ce65039
skip flaky suite (#85216) 2020-12-08 02:29:41 +00:00
Tiago Costa
eb1c29e656
skip flaky suite (#83775) 2020-12-08 02:27:07 +00:00
Tiago Costa
cd1be91343
skip flaky suite (#83774) 2020-12-08 02:24:26 +00:00
Tiago Costa
eeb68132b3
skip flaky suite (#83773) 2020-12-08 02:22:15 +00:00
Tiago Costa
f667b12cec
skip flaky suite (#83793) 2020-12-08 02:16:52 +00:00
Tiago Costa
8dcbac5518
skip flaky suite (#85215) 2020-12-08 02:12:55 +00:00
Tiago Costa
1a6b88c02c
skip flaky suite (#85217) 2020-12-08 02:10:59 +00:00
Catherine Liu
99ae137f63
[Usage Collection] Kibana Overview Page UI Metrics (#81937)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 18:52:52 -07:00
Yuliia Naumenko
6757b95b1e
[Alerting UI] Replaced AlertsContextProvider with KibanaContextProvider and exposed components in API (#84604)
* [Alerting UI] Replaced AlertsContextProvider with KibanaContextProvider and exposed components in API

* removed AlertContextProvider

* exposed AlertAdd and EditAlert flyouts with triggers_actions_ui plugin start

* fixed type check

* fixed tests

* fixed typechecks

* fixed wrong consumer

* fixed monitoring flyout flickering

* fixed due to comments

* fixed typechecks

* fixed typechecks

* fixed typechecks

* fixed typechecks

* fixed due to comments
2020-12-07 16:44:40 -08:00
Tiago Costa
a6a8cc2175
skip flaky suite (#85208) 2020-12-07 23:42:11 +00:00
Frank Hassanabad
1bc42b9171
[Security Solutions][Detection Engine] Fixes cypress errors by using latest signals mapping (#84600)
## Summary

Fixes issues within Cypress whenever developers would re-run tests they could become blocked as some of the tests cause a migration/roll over of the signals.
 
To reproduce the error off of master:

Start Cypress 
```ts
cd ./kibana/x-pack/plugins/security_solution
yarn cypress:open-as-ci
```

Then run the export test twice. The first time it will run ok. The second time the test will refuse to run.

<img width="585" alt="Screen Shot 2020-11-30 at 1 57 24 PM" src="https://user-images.githubusercontent.com/1151048/100683706-2233c200-3336-11eb-949f-48f86e884d8b.png">

The second time that you run the test you will get these errors from Cypress and will be blocked until you do workarounds such as logging into `https://localhost:5620` and manually changing the indexes manually or restarting Cypress altogether.
<img width="1067" alt="Screen Shot 2020-11-30 at 6 05 07 PM" src="https://user-images.githubusercontent.com/1151048/100683945-9a9a8300-3336-11eb-9d49-187dee4fc1dc.png">

What is going on with the errors is that a migration is occurring since the existing signals mapping for the tests are not the newer migrated version and these are creating a new index named `.siem-signals-default-0000002` like so:
<img width="1242" alt="Screen Shot 2020-11-30 at 1 57 12 PM" src="https://user-images.githubusercontent.com/1151048/100684145-fcf38380-3336-11eb-8fe1-b29d3462a1ae.png">

This index is not being cleaned up and when the next time we do an es_archive load we are marking two indexes as being writable


file: x-pack/test/security_solution_cypress/es_archives/alerts/mappings.json
```ts
".siem-signals-default": {
  "is_write_index": true
  }
},
"index": ".siem-signals-default-000001",
```

which leads to the stack trace and the Cypress errors on the front end:

```ts
MacBook-Pro.local] path: /.siem-signals-default-000001, params: {index=.siem-signals-default-000001}
     │      java.lang.IllegalStateException: alias [.siem-signals-default] has more than one write index [.siem-signals-default-000002,.siem-signals-default-000001]
     │          at org.elasticsearch.cluster.metadata.IndexAbstraction$Alias.computeAndValidateAliasProperties(IndexAbstraction.java:276) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
```

This fixes that by updating the mapping and migration number. Each time we migrate/change the signals mapping we will have to perform a PR like this to update each location.

At the moment this is 5 different locations we have to update with the latest mappings.

### 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
2020-12-07 15:51:12 -07:00
Dave Snider
1f75d0b79f
Small fixes to Kibana search bar (#85079)
* Small fixes to Kibana search bar

* Animate width

* tweak for ipad breakpoint

Co-authored-by: Ryan Keairns <contactryank@gmail.com>
2020-12-07 12:59:45 -08:00
DeDe Morton
28ea225bef
Change link text to say Fleet (#85083) 2020-12-07 12:54:41 -08:00
Zacqary Adam Xeper
de289de6c1
[Metrics UI] Refactor Process List API to fetch only top processes (#84716)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 14:46:26 -06:00
Spencer
a7c5b49343
[esArchiver] support kibana and es ssl from cli (#85073)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 13:20:15 -07:00
John Schulz
81a340e681
[Fleet][EPM] Save installed package assets in ES (#83391)
## Summary
Store package assets (from Registry or local upload) in Elasticsearch. Related to proposal [issue](https://github.com/elastic/kibana/issues/83426) & [document](https://docs.google.com/document/d/18XoS6CSl9UxxPPBt9LXuJngf1Jv-4tl3jY6l19U1yH8)

 * New `epm-packages-assets` saved objects are stored on `.kibana` index, like our existing saved object `epm-packages`
 * Asset id is uuid v5 based on the package name, package version & file path. See 1974324
 * Add a list of IDs of all the installed assets, to `epm-packages` saved object. Like the existing `installed_` properties.  [Example](https://github.com/elastic/kibana/pull/83391/files#diff-fa07cac51b6a49bf1e4824bc2250c9a77dac6c7d6b0a56020f559ef1ff9be25fR491-R512) from a test

<details><summary>Mapping for new Saved Object</summary>

37f7b6ded7/x-pack%2Fplugins%2Ffleet%2Fserver%2Fsaved_objects%2Findex.ts (L329-L339)
</details>

<details><summary>Additional property on existing <code>epm-packages</code> Saved Object</summary>

c4f27ab257/x-pack/plugins/fleet/server/saved_objects/index.ts (L306-L312)

 I don't think the saved object changes are strictly required. It can be removed without changing much about how things work

- Pros: 
      - Preserves accurate record of the assets added at installation time. Separates what assets are currently available for package-version from what was installed. They _should_ be the same, but things happen.
      - Avoids a query to get the installed assets before operating on them
- Cons:
      - size/noise? Could be tens or hundreds of ids
      - migration?
</details>

### More details

**When are saved objects added?**
During installation, after all other actions have succeeded, just before marking the save object as installed, we commit all the files from the package to ES

37f7b6ded7/x-pack%2Fplugins%2Ffleet%2Fserver%2Fservices%2Fepm%2Fpackages%2F_install_package.ts (L193-L198)

**When are documents removed from the index?**

In the `removeInstallation` function which is called in response to a `DELETE /api/fleet/epm/packages/pkgkey`

37f7b6ded7/x-pack%2Fplugins%2Ffleet%2Fserver%2Fservices%2Fepm%2Fpackages%2Fremove.ts (L72)

or a failed package (re-)installation

bf068739ac/x-pack%2Fplugins%2Ffleet%2Fserver%2Fservices%2Fepm%2Fpackages%2Finstall.ts (L145)




**How are we using these assets?**
We're not, currently. Here's an example showing how we could update [`getFileHandler`](514b50e4c2/x-pack%2Fplugins%2Ffleet%2Fserver%2Froutes%2Fepm%2Fhandlers.ts (L101)) to check for local assets before reaching out to the Registry if we wished. It's not DRY, but it does work

```typescript
const esDocRoot = `http://elastic:changeme@localhost:9200/${PACKAGE_ASSETS_INDEX_NAME}/_doc`;
const escapedDocId = encodeURIComponent(`${pkgName}-${pkgVersion}/${filePath}`);
const esRes = await fetch(`${esDocRoot}/${escapedDocId}`);
const esJson = await esRes.json();
if (esJson.found) {
  const asset: PackageAsset = esJson._source;
  const body = asset.data_utf8 || Buffer.from(asset.data_base64, 'base64');
  return response.ok({
    body,
    headers: {
      'content-type': asset.media_type,
      // should add our own `cache-control` header here
      // kibana default is prevents caching: `private, no-cache, no-store, must-revalidate`
      // https://github.com/elastic/kibana/issues/83631
    },
  });
}
```

### Checklist
_updated tests to include new saved object output, no tests added yet_
- [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
2020-12-07 15:11:09 -05:00
Tiago Costa
f961e90ea7
chore(NA): remove scripts on plugins to find circular deps (#84852)
* chore(NA): remove extra scripts on plugins to find circular deps

* chore(NA): remove madge as dependency

* Move cyclic dep jobs

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 19:41:38 +00:00
Christiane (Tina) Heiligers
3604995ac2
[Docs] Adds docs on how to run Kibana with the APM agent locally (#84700)
Co-authored-by: Vignesh Shanmugam <vignesh.shanmugam22@gmail.com>
2020-12-07 12:39:48 -07:00
Spencer
b01f33eeb0
[cli/dev] make optimizer delays more obvious and hide proxy target url (#84835)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 11:34:59 -07:00
Davis Plumlee
3d3eb40964
[Security Solution][Detection Rules] Mitre subtechniques (#83511) 2020-12-07 13:34:15 -05:00
Spencer
8aec85cf3d
[dev/cli] don't filter inspect flags (#85156)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-12-07 11:17:48 -07:00
Alison Goryachev
079a7e82ba
Integrate painless autocomplete in runtime fields editor (#84943) 2020-12-07 12:55:53 -05:00
igoristic
d19b558c88
[Monitoring][Alerting] Added core features to Kibana services UPDATED (#85074)
* added core features to kibana services

* Added test for alert form

* Added mocking of legacy shims and actions

* Fixed typing

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 12:25:28 -05:00
Thomas Neirynck
4a44804041
[Maps] Disallow on-prem EMS when proxyElasticMapsServiceInMaps is turned on (#85049)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 12:06:46 -05:00
ymao1
46e8c540aa
[Alerting] Fixes Failing test: X-Pack Alerting API Integration Tests.x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting - alerting api integration security and spaces enabled Alerts do stuff when AAD is broken (#84707)
* Adding delay between creating and updating alert to avoid 409 conflicts

* Unskipping update test

* Using retry.try instead of delay

* PR fixes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 11:52:37 -05:00
igoristic
008c6a0e19
Safegaurding alerts in case they come back undefined (#85108) 2020-12-07 11:24:44 -05:00
Wylie Conlon
2466dd634a
[Lens] Fix functional test failures (#84979) 2020-12-07 17:10:04 +01:00
Lukas Olson
e48e7446c0
[data.search] Move background session service to data enhanced plugin (#84837)
* [data.search] Move search method inside session service and add tests

* Move background session service to data_enhanced plugin

* Fix types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 08:51:19 -07:00
Robert Oskamp
0366a892b3
[ML] Initial API integration tests for ML jobs in spaces (#84789)
This PR adds initial API integration tests for the endpoints related to ML jobs in spaces.
2020-12-07 16:26:57 +01:00
Søren Louv-Jansen
cee681afb3
[APM] Improve pointer event hook (#85117) 2020-12-07 15:43:58 +01:00
Søren Louv-Jansen
e0d07c227f
[APM] Add ignore_unavailable to avoid querying closed indices (#84813) 2020-12-07 15:43:33 +01:00