Commit graph

11 commits

Author SHA1 Message Date
John Schulz 868ae59c93
[Fleet] Support user overrides in composable templates (#101769)
## Summary
Closes #90454
Closes https://github.com/elastic/kibana/issues/72959

 * Rename the component templates which are [installed for some packages](https://github.com/elastic/kibana/blob/master/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts#L197-L213) from `${templateName}-mappings` and `${templateName}-settings` to `${templateName}@mappings` and `${templateName}@settings`
 * When any package is installed, add a component template named `${templateName}@custom`
 * Any of above templates also include a `_meta` property with `{ package: { name: packageName } }`
 * On package installation, add any installed component templates to the `installed_es` property of the `epm-packages` saved object
 * On package removal, remove any installed component templates from the `installed_es` property of the `epm-packages` saved object

<details><summary>Kibana logs showing component templates added for package</summary>

```
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.file@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.registry@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [.logs-endpoint.diagnostic.collection@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.library@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.security@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.network@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.alerts@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metrics@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.process@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.policy@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metadata@mappings]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.registry@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [.logs-endpoint.diagnostic.collection@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.security@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.file@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.library@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.network@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.alerts@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metrics@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.policy@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [logs-endpoint.events.process@custom]
   │ info [o.e.c.m.MetadataIndexTemplateService] [JFSIII.local] adding component template [metrics-endpoint.metadata@custom]
```

</details>

<details><summary>screenshot - component templates are editable in the Stack Management UI</summary>
<img width="1342" alt="Screen Shot 2021-06-17 at 4 06 24 PM" src="https://user-images.githubusercontent.com/57655/122465421-1502bb80-cf86-11eb-94f4-9880cb3ea844.png">
</details>


### Checklist

Delete any items that are not applicable to this PR.

- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials
- [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-06-23 06:57:39 -04:00
Alejandro Fernández Gómez cd5cd65fb2
[Fleet] Improve performance of Fleet setup (#102219)
* Remove endpoint from the default packages

* Change the default spinner for the initial load

* Export fleet endpoint package as a constant

* Use constants for special packages

* Simplify type signature of `isRequiredPackage`

* Remove unused types

* Simplify required and default package definitions

* Treat REQUIRED_PACKAGES as independent from DEFAULT_PACKAGES

We want to keep the assumption that the lists contain the same packages
only in `epm/constants.ts`

* Install all default packages, not only the required ones

* Document the purpose of each package list

* Handle auto-update for non-default packages

* Make `endpoint` non-removable

* Make endpoint package be installed by default in tests

* Rename requiredPackages to unremovablePackages

* Fix type check

* Add Endpoint to be installed by default on Fleet tests too

Co-authored-by: Jen Huang <its.jenetic@gmail.com>
2021-06-17 11:58:41 -07:00
John Schulz db34f0c6af
[Fleet] Update docker image of registry used in integration tests (#101911)
## Summary

 * Use a more recent Docker image for package registry used in integration/API tests. 
    * [New image](https://container-library.elastic.co/r/package-registry/distribution:fc104ac437370d80518e24da6d0b84370edf0c0c) is from Jun-14 [old image](https://container-library.elastic.co/r/package-registry/distribution:b6a53ac9300333a4a45f3f7d350c9aed72061a66) is from Apr-14
 * Add support for using a custom Docker registry using `FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE` env var
    * e.g. `production` tag
    ```
    FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE='docker.elastic.co/package-registry/distribution:production' FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner
    ```
    or a personal one
    ```
    FLEET_PACKAGE_REGISTRY_DOCKER_IMAGE='docker.elastic.co/employees/jfsiii/package-registry-distribution:kb90454' FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner

    ```

- [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-06-17 14:55:17 -04:00
Spencer f466ebf1a3
[esArchiver] drop support for --dir, use repo-relative paths instead (#101345)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-06-08 17:37:42 -04:00
Spencer 808b44f2c1
[kbn/test] move types/ftr into src (#99555)
* [kbn/test] move types/ftr into src

* Apply eslint updates

* fix import of Lifecycle type

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-05-17 09:51:53 -07:00
Ross Wolf 1925cea9a2
[Security][Fleet] Install the security_detection_engine package automatically (#97191)
* Automatically install the security_detection_engine package via fleet
* Update dockerImage to include the security_detection_engine package
* Update api/fleet/setup install test
* Update test data for Endpoint package
* Fix JSON token
* Update firis json entry in destination_index
* Update destination_index structure
* Update destination_index structure
* Change KQL query to unblock testing
* Restore KQL and fix JSON instead
* update timestamps to pass tests
2021-04-20 13:07:11 -04:00
Nicolas Chaulet f4caf8727d
[Fleet] Remove fleetServerEnabled feature flag and use fleet system indices (#92422) 2021-03-08 07:40:09 -05:00
Nicolas Chaulet fe35e0de3b
[Fleet] Install Elastic Agent integration by default during setup (#91676) 2021-02-18 18:45:15 -05:00
Shaunak Kashyap f3a9c763df
Updating package registry snapshot distribution version (#89776) 2021-02-04 08:40:18 -05:00
Brandon Kobel 4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00
Nicolas Chaulet fed9a4fddc
[Fleet] Rename ingest_manager_api_integration tests fleet_api_integration (#83011) 2020-11-12 13:50:59 -05:00
Renamed from x-pack/test/ingest_manager_api_integration/config.ts (Browse further)