Commit graph

406 commits

Author SHA1 Message Date
Kyle Pollich
827e50d184
Improve error message for duplicate package policies (#126170) (#126452)
(cherry picked from commit 2b8b331271)

# Conflicts:
#	x-pack/plugins/fleet/server/services/package_policy.ts
2022-02-28 07:05:06 -07:00
Kibana Machine
cd88dc09b5
[Fleet] Fix package policy name verification on update (#126356) (#126372)
(cherry picked from commit 43a2622b97)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-02-24 11:59:17 -07:00
Kibana Machine
b869b7f245
[Fleet] Reset preconfiguration delete preconfiguration deletion record (#126273) (#126286)
(cherry picked from commit 448436f89f)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-02-23 13:48:47 -07:00
Kibana Machine
3e97bfe1c2
[Fleet] Fix preconfiguration inputs enablement (#126205) (#126246)
(cherry picked from commit b1444ca4be)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-02-23 08:09:49 -07:00
Kibana Machine
090f7aab59
[Fleet] Use package policy version to determine managed policy upgrades (#125788) (#125826)
(cherry picked from commit 3dd2d75bce)

Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
2022-02-16 11:21:39 -07:00
Kibana Machine
226be06574
[8.0] [Fleet] Avoid breaking setup when compatible package is not available in registry (#125525) (#125672)
* [Fleet] Avoid breaking setup when compatible package is not available in registry (#125525)

(cherry picked from commit 928638e395)

* [Fleet] Use registry version check on main (#125495)

* [Fleet] Get package info should not store the whole package (#123509)

Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-02-16 05:41:23 -07:00
Kibana Machine
664b0e98f0
[Fleet] Add retries when starting docker registry in integration tests (#125530) (#125575)
(cherry picked from commit 57aefd0a6b)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-02-14 15:10:37 -07:00
Kibana Machine
34348522ca
[Fleet] Fix invalid permission entry if the elastic agent package is not installed (#125447) (#125529)
(cherry picked from commit d383bda82e)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-02-14 10:43:35 -07:00
Kyle Pollich
09d2cd1ce5
[Fleet] Fix preconfiguration error when renaming a preconfigured policy (#124953) (#125075)
* Fix preconfiguration error when renaming a preconfigured policy

* Add test + only compare on ID if it's defined on the preconfigured policy

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 94fbacc6bd)

# Conflicts:
#	x-pack/plugins/fleet/server/services/preconfiguration.test.ts
2022-02-09 08:17:45 -07:00
Kibana Machine
88a3d35f7b
[Fleet] Fix docker registry timeout in integration tests (#124889) (#124958)
(cherry picked from commit df6d386d50)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-02-08 08:47:48 -07:00
Nicolas Chaulet
87e84d6025
[8.0] [Fleet] Use a docker registry for fleet integration test (#124405) (#124568)
* [Fleet] Use a docker registry for fleet integration test (#124405)

(cherry picked from commit 4f6be55f0e)

# Conflicts:
#	x-pack/plugins/fleet/server/integration_tests/reset_preconfiguration.test.ts

* Fix merge typo
2022-02-03 12:37:08 -07:00
Kibana Machine
9c84992e76
fixing bug with preconfigured fleet server policy missing input, updated README (#124363) (#124400)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 1f507c99d4)

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2022-02-02 13:29:34 -07:00
Kibana Machine
f9acef896c
Fix package policy merge logic for boolean values (#123974) (#123979)
(cherry picked from commit 159825a476)

Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
2022-01-28 09:02:31 +01:00
Kibana Machine
9468e62130
[Fleet] Use admin user for jest integration tests (#123871) (#123940)
(cherry picked from commit 3d8697d967)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-01-27 09:41:05 -07:00
Tyler Smalley
73708fda30
Support for superuser not having write access (#123337) (#123639)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 23739f5f4d)

# Conflicts:
#	src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-24 14:34:08 -07:00
Kibana Machine
dea718b334
[Fleet] Disable custom source_uri option on upgrade APIs by default (#123464) (#123600)
(cherry picked from commit 79ff195d76)

Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
2022-01-24 08:19:25 -07:00
Kibana Machine
6bb2f9e0fc
[Fleet] Remove output id from agent policy APIs (#123403) (#123458)
(cherry picked from commit 7fba1feaf3)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-01-20 07:45:15 -07:00
Kibana Machine
2ae242d4e5
[Fleet] Validate package policy on create or update APIs (#123261) (#123394)
(cherry picked from commit d7dbf15919)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-01-19 12:45:42 -07:00
Kibana Machine
debd4cee0a
[Fleet] Validate policy id when creating an enrollment token (#123298) (#123380)
(cherry picked from commit d40c0abe5b)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-01-19 10:35:50 -07:00
Kibana Machine
96d69c8ffb
[Osquery] Remove agent policy reference from pack on integration deletion (#122082) (#123163)
(cherry picked from commit 426ac6a012)

Co-authored-by: Tomasz Ciecierski <tomasz.ciecierski@elastic.co>
2022-01-17 08:58:17 -07:00
Nicolas Chaulet
229921bf3f
[8.0] [Fleet] Fix reset one preconfiguration API (#122963) (#122992)
* [Fleet] Fix reset one preconfiguration API (#122963)

(cherry picked from commit cfd7cc330b)

# Conflicts:
#	x-pack/plugins/fleet/server/routes/preconfiguration/handler.ts
#	x-pack/plugins/fleet/server/routes/preconfiguration/index.ts

* fix linting
2022-01-13 14:21:57 -07:00
Nicolas Chaulet
3580bd61e9
[8.0] [Fleet] Add reset preconfigured policies API (#122467) (#122950)
* [Fleet] Add reset preconfigured policies API (#122467)

(cherry picked from commit d0850b0dd1)

# Conflicts:
#	x-pack/plugins/fleet/server/routes/preconfiguration/index.ts

* Fix merge linting

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-13 12:22:17 -07:00
Kibana Machine
a495bf50ae
[Fleet] Fix enrollment api key application name (#122798) (#122863)
(cherry picked from commit c180aac1f3)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-01-12 12:32:47 -07:00
Kibana Machine
3d5383c6b8
[Fleet] Use uuidv5 value if preconfigured agent policy id is not provided (#122350) (#122377)
* Use uuidv5 value if preconfigured agent policy id is not provided

* Add tests for preconfigured policy id logic

Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
2022-01-05 13:20:03 -07:00
Kibana Machine
d2ddf24391
Fix elastic/fleet-server access to agent policies (#122320) (#122334)
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
2022-01-05 08:09:28 -07:00
Kibana Machine
b707eef56a
[Fleet] Fix bumpAllPolicy to fetch all policies (#122277) (#122331)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2022-01-05 07:57:31 -07:00
Cristina Amico
cc268446fa
[8.0] [Fleet] Remove code that handles Security plugin being disabled (#121779) (#122255)
* [Fleet] Remove code that handles Security plugin being disabled (#121779)

* [Fleet] Remove code that handles Security plugin being disabled

* Fix test and make properties required

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/fleet/server/plugin.ts
#	x-pack/plugins/fleet/server/routes/security.test.ts

* Fix jest test
2022-01-04 09:52:48 -07:00
Kibana Machine
0846cde660
[Fleet] Sort correctly name before incrementing package policy name (#121965) (#121971)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-23 13:30:48 -07:00
Kibana Machine
93aa2a13a9
[Fleet] Fix updateCurrentWriteIndices to work with datastream with prefix (#121884) (#121898)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-22 11:28:45 -07:00
Josh Dover
1ef87700b1
[8.0] [Fleet] Add installed_kibana_space_id to epm-packages saved objects (#120517) (#121553)
* [Fleet] Add `installed_kibana_space_id` to `epm-packages` saved objects (#120517)

# Conflicts:
#	x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts
#	x-pack/plugins/fleet/server/routes/preconfiguration/index.ts

* fix handler types

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-20 04:13:47 -07:00
Dominique Clarke
6b2861c240
[Fleet] index templates - add support for wildcard multi-fields (#121088) (#121332)
* fleet - index templates - add support for wildcard multi-fields

* adjust types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-15 12:08:00 -07:00
Kibana Machine
0cd4bcab3b
[Fleet] added kibana version to user-agent (#121297) (#121315)
* added kibana version to user-agent

* Update x-pack/plugins/fleet/server/services/epm/registry/requests.ts

Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com>

Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com>

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Co-authored-by: Nicolas Chaulet <n.chaulet@gmail.com>
2021-12-15 09:50:24 -07:00
Kibana Machine
6ec6fd2edf
[Fleet] Do not udpate or rollover replicated datastream (#121235) (#121307)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-15 08:25:59 -07:00
Kibana Machine
81aa41734a
[Fleet] fix bug when dryrun gave error on latest package policy version (#121094) (#121173)
* fix bug when dryrun gave error on latest package policy version

* fix bug when package is older than policy

* added unit tests

* fix test

* fix tests

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2021-12-14 06:05:43 -07:00
Kibana Machine
c918e7a620
[Fleet] Fix increment package policy name (#121101) (#121133)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-13 14:28:28 -07:00
Kibana Machine
43bf13d2ab
fix setup error during test (#120917) (#121029)
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2021-12-10 02:16:00 -07:00
Nicolas Chaulet
ca44293157
[Fleet] Configure ca trusted fingerprint for on prem users (#120549) (#120984) 2021-12-09 12:52:49 -07:00
Kibana Machine
d9aed2a8de
[Fleet] Fix bug caused by API changes (#120886) (#120919)
* fix endpoint integration

* added test

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2021-12-09 09:20:58 -07:00
Kibana Machine
d9d360c2fe
[Fleet] Use deterministic UUID's for default policies (#120776) (#120842)
* Use deterministic UUID's for default policies

* Alter lookup strategy for preconfigured agent policies

* Fix ID check

* Pass ID even when creating default policies

Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
2021-12-08 15:24:55 -07:00
Kibana Machine
b3b613a1d5
[Fleet] make put component template idempotent for @custom and fleet global (#120819) (#120834)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-08 14:42:07 -07:00
Kibana Machine
32fe956760
[8.0] [Fleet] Make API responses consistent (#119494) (#120753)
* [Fleet] Make API responses consistent (#119494)

* make apis consistent

* UI and test fixes

* test fixes

* fixed test

* fix tests

* fix test

* removed deprecated shared_id from openapi spec

* added back list prop as deprecated

* renamed apis with hyphens

* openapi update

* fix checks

* fix test

* renamed epm api path and response

* fix tests

* fix ml

* moved splitPkgKey

* fixed edit package policy page

* fixed storybook

* fix prettier after conflict

* fix tests

* fix tests

* fix tests

* fix test

* fix test

* added back semver validation

* fix test

* pkgVersion optional

* fix tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

* fixed tests

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Co-authored-by: Julia Bardi <julia.bardi@elastic.co>
2021-12-08 10:51:49 -07:00
Kibana Machine
160e56d9d5
[Fleet] Handle ID's for preconfigured package policies (#120664) (#120685)
* Handle ID's for preconfigured package policies

- For Fleet's default policies, add a hard-coded ID to the generated
  package policies
- Require an ID value for all preconfigured package policies

Resolves #120612

* Add required package_policies.id field to docs

* Specify that id is unique in docs

* Tweak docs

* Fall back to UUID value if no preconfigured ID

* Fix default fleet server policy id

Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
2021-12-08 09:02:28 -05:00
Kibana Machine
cab8019916
[Fleet] Use a fixed id for settings saved object (#120681) (#120695)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-07 16:40:35 -07:00
Kibana Machine
ec8181821b
[Fleet] Fix Fleet server authz (#120548) (#120587)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-07 05:23:51 -07:00
Kibana Machine
ef882c219b
[Fleet] Simplified package policy create API, enriching default values (#119739) (#120576)
* simplified api, enriching default values

* removed comment

* reverted changes in common models

* fixed handlers test

* separated create schema

* fixed test

* removed throwing error

* getting package info from registry only

* fix type

* fix test and new tests

* simplified update api

* updated open api spec

* fixed compiled_input

* added policy_template enrich

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2021-12-07 02:09:47 -07:00
Kibana Machine
ccb88b70dc
Don't mark Fleet as degraded pre-setup (#120501) (#120526)
Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
2021-12-06 11:48:53 -07:00
Kibana Machine
626af079ba
[Fleet] Handle Saved Object ID changes (#108959) (#119527) (#120481)
* Do not add fields to index patterns

* remove redundant tests

* install index patterns before package install

* update remove comment

* use import to create package assets

Here I have also moved to importing all assets at once. This is essential when importing to ensure that all saved objects references are imported at once. There is also an efficiencey improvement.

* Import index patterns

* use resolve when deleting index patterns

* fix: asset type validation

* add option to override supported import types

* make ml-module importable

* Revert "add option to override supported import types"

This reverts commit 1f48e6ee193fea5e5cb0f37c70cbfa7ae47eeab5.

* remove hidden: false from ml-module

* use resolve when deleting assets

* make security-rule SO type importable

* use bulkResolve to get package assets

* fix tests

* fix 'multiple' tests

* remove unused function

* create index patterns at the same time as other assets

* remove unused test

* Fix integration tests
We were checking for an error before the import was complete.

* tidy for PR

* add missing test assets

* do not attempt to delete missing assets

* resolve any reference errors that occur on import

* await installKibanaAssets immediately

* show assets not found when assets installed in a different space

* fix delete asset check on force upgrade

* add comment about reference errors

* remove a couple of appContextService dependencies

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
2021-12-06 07:53:13 -07:00
Kibana Machine
f8cb87be7d
[Fleet] Use predefined id for default output (#120158) (#120447)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
2021-12-04 16:43:22 -07:00
Paul Tavares
f89346697b
[Security Solution][Endpoint] Remove checks for superuser role and instead look at fleet kibana privileges (#120027) (#120380)
* Change endpoint privileges to use fleet authz instead of checking for superuser
* split user privileges react context component from hook in order to better support mocking
* remove `isPlatinumPlus` from endpoint privileges and refactor to use `useUserPrivileges()` hook instead
* add `endpointAuthz` to the Server API route handler context
* moved fleet's `createFleetAuthzMock` to `fleet/common`

# Conflicts:
#	x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.tsx
2021-12-03 11:41:51 -07:00
Kibana Machine
a7b09bd991
[Fleet] Wire Fleet setup status to core Kibana status API (#120020) (#120381)
* Wire Fleet setup status to core Kibana status API

* Remove fake error from testing 🙃

* Apply suggestion for PR review

Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>

* Add error message to meta upon Fleet setup failure

* Mark fleet as available if setup fails - for now

* Fix failing API key tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>

Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
2021-12-03 11:19:34 -07:00