Skip to content

[8.7] [Security Solution] Fixes Related Integrations showing as not installed or enabled when they actually are (#152055)#152412

Merged
kibanamachine merged 1 commit intoelastic:8.7from
kibanamachine:backport/8.7/pr-152055
Mar 1, 2023
Merged

[8.7] [Security Solution] Fixes Related Integrations showing as not installed or enabled when they actually are (#152055)#152412
kibanamachine merged 1 commit intoelastic:8.7from
kibanamachine:backport/8.7/pr-152055

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.7:

Questions ?

Please refer to the Backport tool documentation

…ed or enabled when they actually are (elastic#152055)

## Summary

Resolves: elastic#142081
elastic#149970
elastic#150968

By adding an initial query for installed integrations and augments the
existing `InstalledIntegrationArray` constructed using
`PackagePolicy`'s. Also removes `version` from the `packageKey` when
calculating installed integrations as there can be mis-matches between
different policy versions and the integration itself, and I believe the
intended behavior here is to not have multiple `relatedIntegrations`
returned for different versions. We may want to expand the response here
to include all the different policy versions that exist (and perhaps #
of agents assigned the policy).

Lastly, updates `getIntegrationsInfoFromPolicy()` to also pull the base
`package` details in addition to the policy_template details, as this is
what ensure base packages show as `Installed: enabled` if they have an
integration policy assigned (vs just showing as `Installed` like when
there isn't an integration policy).

Note: This PR also adds the `getPackages()` method to the
`PackageClient` as it didn't currently exist, and was only available via
the fleet API via the `/api/fleet/epm/packages` route.

### Before:
<p align="center">
<img width="500"
src="https://user-images.githubusercontent.com/2946766/221066781-be7aa1c6-1728-4200-98b2-d40946e48bbe.png"
/>
</p>

### After
<p align="center">
<img width="500"
src="https://user-images.githubusercontent.com/2946766/221323469-e24081f9-0741-41fd-8227-9e319c98b0d3.png"
/>
</p>

---------

Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
(cherry picked from commit b833b10)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Mar 1, 2023
@kibanamachine kibanamachine enabled auto-merge (squash) March 1, 2023 01:51
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 1, 2023
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibanamachine kibanamachine merged commit 6d34cf8 into elastic:8.7 Mar 1, 2023
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 972 977 +5
Unknown metric groups

API count

id before after diff
fleet 1077 1082 +5

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @spong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants