Commit graph

40362 commits

Author SHA1 Message Date
Sonja Krause-Harder 9870ade971
[Fleet] Reduce permissions. (#90302)
* Reduce permissions.

* Change permissions back.

* Reducing permissions on fleet_enroll role

- 'write', 'create_index' -> 'auto_configure', 'create_doc'

* Remove indices:admin/auto_create from privileges.
2021-02-11 09:33:51 +01:00
renovate[bot] 57d9dd1419
Update dependency @elastic/charts to v24.5.1 (#89822)
Updates @elastic/charts to 24.5.1 with some Kibana related fixes:
- align tooltip z-index to EUI tooltip z-index
- external tooltip legend extra value sync
- legend: hierarchical legend order should follow the tree paths


fix #84307

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-11 09:18:48 +01:00
Alexey Antonov 7d9b4ed9dc
[Create index pattern] Can't create single character index without wildcard (#90919) 2021-02-11 11:11:45 +03:00
Spencer c0a974aa0e
[ts/build_ts_refs] add support for --clean flag (#91060)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-10 22:38:06 -07:00
Nathan L Smith d9abaa180b
Don't clean when running e2e tests (#91057)
I don't think this is necessary, and since it's run before `bootstrap`, the Bazel tools aren't installed so it fails silently.

Example: https://apm-ci.elastic.co/blue/organizations/jenkins/apm-ui%2Fapm-ui-e2e-tests-mbp%2FPR-89647/detail/PR-89647/21/pipeline/124/

Should fix APM E2E failures.
2021-02-10 23:34:36 -06:00
Frank Hassanabad f9f8562a53
Fixes track_total_hits in the body not having an effect when using search strategy (#91068)
## Summary

Moves `track_total_hits` from body messages of our queries into the params section of our queries.

Several of our `track_total_hits: false` were not taking effect and instead were being set to `track_total_hits: true` when being executed within the Kibana search strategy vs. previously when they were regular Elasticsearch queries and always took effect.  

When teams port over their searches to the search strategies provided by Kibana, they are required to move any and all `track_total_hits` from their `body` sections of their code into the `params` part of their code. The reason for this is that the search strategy maintains a backwards compatibility with earlier versions of searches before Elasticsearch introduced the `track_total_hits`. However, the code does not detect if you put the `track_total_hits` in your body, it only checks the params section and forces it to `true` if it is not found in the params section.

If the search strategy does not see a `track_total_hits` within the params section of the query, it will force add one and that one will override any within the body of the query. For example, if you had a `track_total_hits` in your body and not in the params section, then search strategy would execute the query like so:

```ts
GET someindex-*/_search?track_total_hits=true
{
  // some query here
  "track_total_hits": false
}
``` 

The forced parameter of `?track_total_hits=true` overrides the `track_total_hits: false` within the body of your query regardless of what the `track_total_hits` is set to and you always get the true. This bug has existed since 7.10.0 when we ported over queries to search strategy.

You can see the code which sets this parameter if you do not here for master, 7.11, 7.10:
https://github.com/elastic/kibana/blob/master/src/plugins/data/server/search/es_search/request_utils.ts#L31
https://github.com/elastic/kibana/blob/7.11/src/plugins/data/server/search/es_search/request_utils.ts#L31
https://github.com/elastic/kibana/blob/7.10/src/plugins/data/server/search/es_search/get_default_search_params.ts#L42

Comments about the behavior from 7.10:
https://github.com/elastic/kibana/pull/75728#pullrequestreview-479367296


When running this code you can open dev tools and inspect the data and now notice when the total hits does not get set vs. before when it was getting set:

before fix where total shows up for queries with `track_total_hits` in the body:
<img width="1370" alt="event_view_before" src="https://user-images.githubusercontent.com/1151048/107594265-bfc92e80-6bce-11eb-8526-8a9aa24e7b3a.png">

after fix where total no longer shows up for queries with `track_total_hits` moved to the params section:
<img width="1309" alt="event_view_after" src="https://user-images.githubusercontent.com/1151048/107594274-c5bf0f80-6bce-11eb-9d8e-698ed430c953.png">

### 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
2021-02-10 21:27:33 -07:00
Garrett Spong b11b8b8c9b
[Security Solution][Detections] Adds list plugin Saved Objects to Security feature privilege (#90895)
## Summary

Add's the list plugins Saved Objects (`exception-list` and `exception-list-agnostic`) to the `Security` feature privilege.

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

### Test Instructions
Load pre-packaged roles/users, and ensure only those with the Kibana Space privilege `Security:All` have the ability to create/edit rules and exception lists (space-aware/agnostic). Users with `Security:Read` should only be able to view rules/exception lists. Pre-packaged security roles should no longer be granted the `Saved Objects Management` feature privilege, and this feature privilege should no longer be required to use any of the Detections features.

To add test users:

t1_analyst (`"siem": ["read"]`):
``` bash
cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts/
./roles_users/t1_analyst/post_detections_role.sh roles_users/t1_analyst/detections_role.json
./roles_users/t1_analyst/post_detections_user.sh roles_users/t1_analyst/detections_user.json
```

hunter (`"siem": ["all"]`):
``` bash
cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts/
./roles_users/t1_analyst/post_detections_role.sh roles_users/hunter/detections_role.json
./roles_users/t1_analyst/post_detections_user.sh roles_users/hunter/detections_user.json
```

Note: Be sure to remove these users after testing if using a public cluster.

### Checklist

Delete any items that are not applicable to this PR.

- [X] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials -- `docs` label added, will work with @jmikell821 on doc changes
- [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
2021-02-10 22:20:55 -05:00
Brandon Kobel 8c4af6fc5e
Removing the code plugin entirely for 8.0 (#77940)
* Removing the code app entirely for 8.0

* Updating plugin list docs

* Using a test plugin for the code_coverage integration tests

* Fix borked test.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tre' Seymour <wayne.seymour@elastic.co>
2021-02-10 18:32:29 -05:00
Tiago Costa 9fe8ccce47
chore(NA): move the instruction to remove yarn global bazelisk package into the first place on install bazel tools (#91026) 2021-02-10 22:40:21 +00:00
Spencer 591bcc1c71
[jest/ci] remove max-old-space-size override to use 4gb default (#91020)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-10 17:13:49 -05:00
John Schulz c92af5a4d5
[Fleet] Restrict integration changes for managed policies (#90675)
## Summary

- [x] Integrations cannot be added ~~, unless with a force flag~~
  - [x] API
  - [x] UI
  - [x] tests
- [x] Integrations cannot be removed ~~, unless with a force flag~~
  - [x] API
  - [x] UI
  - [x] tests

closes https://github.com/elastic/kibana/issues/90445
refs https://github.com/elastic/kibana/issues/89617

### Cannot add integrations to managed policy

<img height="400" alt="Screen Shot 2021-02-08 at 1 56 32 PM" src="https://user-images.githubusercontent.com/57655/107277261-25c48300-6a22-11eb-936a-0a7361667093.png">

### Cannot delete integrations from managed policy

<img  alt="Screen Shot 2021-02-08 at 3 05 16 PM" src="https://user-images.githubusercontent.com/57655/107277318-337a0880-6a22-11eb-836f-fc66b510d257.png">

### 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
2021-02-10 17:04:01 -05:00
Brian Seeders 4cd0548f48
[CI] Fix auto-backport condditions so that it doesn't trigger for other labels (#91042) 2021-02-10 16:42:00 -05:00
gchaps b18e4ec9b8
[DOCS] Uses variable to refer to query profiler (#90976) 2021-02-10 13:05:33 -08:00
Jason Stoltzfus a9e6cff88d
[App Search] Relevance Tuning logic listeners (#89461) 2021-02-10 15:35:56 -05:00
Zacqary Adam Xeper 65a3f16c0f
[Metrics UI] Fix saving/loading saved views from URL (#90216)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 15:20:09 -05:00
Dario Gieselaar d0900f844d
Limit cardinality of transaction.name (#90955) 2021-02-10 21:18:41 +01:00
Uladzislau Lasitsa 4c878be613
Bump "monaco-editor" and "react-monaco-editor" to latest versions (#90158)
* Update version of react-monaco-editor and monaco-editor libraries

* Fix yarn lock file

* Fix CI

* Fix unit tests

* Fix CI

* Fix comment

* move monaco instance in window.MonacoEnvironment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 23:05:46 +03:00
Jen Huang c2b41c484b
[Fleet] Revamp integration detail page (#90887)
* Extract integration detail page changes from POC

* Remove unneccessary link wrappers

* Remove unused import

* Fix method name

* Fix linting
2021-02-10 12:03:34 -08:00
Zacqary Adam Xeper f3debcd084
[Metrics UI] Fix node details overlay title with long host name (#90825) 2021-02-10 14:40:21 -05:00
Larry Gregory 9778060ae8
Don't register management section if capabilities are not granted (#90782)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 14:10:28 -05:00
Poff Poffenberger 4ee5f094ce
[Time to Visualize] Add functional tests for adding visualizations from Visualize, Lens, and Maps and adjust capabilities for new modal (#89245)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 12:48:32 -06:00
Spencer 4f38d163bf
ignore CI Stats failures in flaky test jobs (#90999)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-10 13:45:32 -05:00
Clint Andrew Hall 20ddd39610
Remove custom plot plugins when Canvas is unmounted (#90722)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 12:19:13 -06:00
Pete Harverson 4881306419
[ML] Stops new line on enter key press for KQL query bars (#90960) 2021-02-10 17:22:37 +00:00
Patryk Kopyciński c058d9b024
[Asset Management] Migrate Osquery plugin to TS project references (#90916) 2021-02-10 17:48:42 +01:00
Jessica David d1653bc425
Adding new fields to the allowlist for alert telemetry (#90868) 2021-02-10 11:26:58 -05:00
Kevin Qualters f563a82903
[Security Solution] Use sourcerer selected indices in resolver (#90727)
* Use sourcer indices

* Add indices to panel requests

* Use a separate indices selector for resolver events

* Use valid timeline id in tests

* Update TimelineId type usage, make selector test clearer

* Update tests to use TimelineId type
2021-02-10 11:15:21 -05:00
Felix Stürmer 874960e1c5
[Logs UI] Handle undefined composite key in category dataset response (#90472)
This fixes the handling of Elasticsearch responses that don't contain a composite key when querying for the available category datasets.
2021-02-10 17:13:05 +01:00
Joe Reuter 0fc9467e51
fix popover state (#90942) 2021-02-10 17:08:38 +01:00
Jonathan Budzenski ec8305baa7
[docs] Include setup instructions for environment variable KBN_PATH_CONF (#90794) 2021-02-10 10:01:49 -06:00
Melissa Alvarez 2a93ebe43b
[ML] Data Frame Analytics creation wizard: adds support for extended hyper-parameters (#90843)
* add support for new hyperparameters in the creation wizard

* fix translation error
2021-02-10 10:52:46 -05:00
Bohdan Tsymbala e94a164b7e
Initial version of adding artifacts per policy to the manifest. (#89130)
* Initial version of adding artifacts per policy to the manifest.

* Minor renaming to convey the purpose of the variable.

* Added ability to override list item mock data.

* Changed function signature to be more reusable.

* Implementationg of support of artifacts per policy in the manifest data structure.

* Added saved objects migrations.

* Renamed the endpoint to reflect that it's artifacts endpoint.

* Fixed tests.

* Fixed the manifest data.

* Fixed linting errors (result of merge).

* Updated ES mappings for manifest in all test setups.

* Updated hash in the mappings.

* Fixed the typo that lead to failing test.

* Fixed the problem with manifest not being dispatched to policies if there are same artifact names but different content. Artifact name in the ManifestSchema is not unique id, hence added decoded_sha256 to the comparison. Added test case to cover this.

* Fixed the problem with the task flow when failure to dispatch to policies will result in commited manifest and no redispatch on next task run. Changed tests to reflect new flow (actually restored previous flow).

* Forgot to commit changes in mock.

* Made other tests more readable using same varialbe naming pattern.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 16:47:56 +01:00
Aaron Caldwell bcdc022efe
[Maps] Add redux devtools back to Maps (#90863) 2021-02-10 08:40:13 -07:00
Angela Chuang a60e475260
[Security Solution] Split test cases into blocks (#89978)
* split test cases into blocks

* run tests individually

* fix up timeline creation

* fix up timeline creation

* add assertions for timeline creation

* create timeline by api

* create timeline by api

* fix lint error

* add selector to timeline screen

* fix type error

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 15:30:43 +00:00
Ahmad Bamieh fa18be9beb
[Telemetry] use fresh keys (#90446)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 17:19:34 +02:00
Scotty Bollinger 4aabf358b0
[Workplace Search] Fix error message in Schema (#90869)
In SchemaErrors, we have an edge case where a user navigates to a non-existent error message state. When migrating I took a stab at passing the custom message to the `flashAPIErrors` helper. It turns out that since we don’t have to parse an error object, we can just set the error message directly
2021-02-10 09:08:59 -06:00
Matthias Wilhelm 40f44a91c8
[Discover] Add "Hide chart" / "Show chart" persistence (#88603) 2021-02-10 16:08:20 +01:00
Marta Bondyra a87535624d
[Lens] (performance) replace operationsSupportMatrix by getOperationsByField for drag and drop (#90744) 2021-02-10 15:25:47 +01:00
Alejandro Fernández Haro 3497c04d28
Exclude telemetry schemas from the distributables (#90819) 2021-02-10 14:18:11 +00:00
Alejandro Fernández Haro 061cb50c71
[Telemetry] Add stakeholders to schema changes (#90143)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 14:13:27 +00:00
Nicolas Chaulet f95bfe83b7
[Fleet] Use Fleet Server indices in the search bar (#90835) 2021-02-10 08:28:22 -05:00
Liza Katz 7e80bb3274
[Search Sessions] added an info flyout to session management (#90559)
* added an info flyout to session management

* better filter serialization

* Fix jest tests

* jest

* display the originalState as a json object

* code review

* Text improvements

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 15:26:25 +02:00
Jean-Louis Leysens e17878ef33
[ILM] Revisit searchable snapshot field after new redesign (#90793)
* moved searchable snapshot field out of cold phase accordian

* refactor styling to padding top and bottom to get advanced settings drop down to sit flush with side of panel

* Error clearing fix and cosmetic changes

- the error state of the form would not clear correctly if the
  erroring field was unmounted. The logic for clearing form errors
  was also incorrectly using "keys" instead of "values".
- updated the width of wait for snapshot policy field to be the
  same as other fields

* fix hook dependency causing clearError to be called

* slight improvement to component integration test

* re-add singleSelection to snapshot policiy field config

* refactored Phase component API and fixed typo in comment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 14:25:53 +01:00
ymao1 3e91bc728d
[Alerting] License Errors on Alert List View (#89920)
* Adding tooltips to alert list and modal for license upgrade

* Fixing typings

* Custom License Error status. Moving modal to alerts list page

* Adding unit test

* Cleanup

* Unit tests

* Removing tooltip from alert name

* License

* PR fixes

* Updating modal wording

* Updating license state error message

* i18n fix

* Fixing functional test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 08:06:09 -05:00
Rudolf Meijering ce441bdc32
RFC Improve saved object migrations algorithm (#84333)
* Instead of cloning, reindex legacy index

* Reindex for every v2 migration

* Use _reindex?require_alias=true and a write block toggle to prevent lost deletes

* Use a ..._reindex_in_progress alias so that waiting for and preventing other reindex operations is idempotent

The first version of the reindex block had only the instance which was able to mark the migration as complete
set and remove the write block. This means other instances couldn't know if any reindex operaitons were in
progress if the migration was already marked as complete. It also meant that a failure in this critical step
could result in a permanent write block.

* Revert "Use a ..._reindex_in_progress alias so that waiting for and preventing other reindex operations is idempotent"

This reverts commit 8baf9b13db.

* Revert "Use _reindex?require_alias=true and a write block toggle to prevent lost deletes"

This reverts commit d7237ca42c.

* Use reindex + clone as a way to prevent lost deletes

* Fix numbering and ignore index_not_found_exceptionfor temporary index

* Apply suggestions from code review

Co-authored-by: Josh Dover <me@joshdover.com>

Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 13:54:52 +01:00
Marta Bondyra df3e14dbbd
[Lens] (Accessibility) Fix focus on drag and drop actions (#90561) 2021-02-10 13:50:41 +01:00
Sonja Krause-Harder 4ee9603801
Use new shortcut links to Fleet discuss forums. (#90786)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-10 11:33:17 +01:00
Aleh Zasypkin 03a53b9f39
Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
Nicolas Ruflin 634c0b3424
[Fleet] Use staging registry for snapshot builds (#90327)
The staging registry is used in Kibana builds which are not built of the master branch or release version. This means, any build ending with `-SNAPSHOT` not the master branch will use the staging registry.

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

Co-authored-by: Jen Huang <its.jenetic@gmail.com>
2021-02-10 09:57:09 +01:00
Brandon Kobel 240da2bf2a
Actually deleting x-pack/tsconfig.refs.json (#90898) 2021-02-10 09:38:37 +01:00