Skip to content

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

Merged
spong merged 13 commits intoelastic:mainfrom
spong:fix-installed-integrations
Mar 1, 2023
Merged

[Security Solution] Fixes Related Integrations showing as not installed or enabled when they actually are#152055
spong merged 13 commits intoelastic:mainfrom
spong:fix-installed-integrations

Conversation

@spong
Copy link
Copy Markdown
Member

@spong spong commented Feb 24, 2023

Summary

Resolves: #142081 #149970 #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:

After

Checklist

Delete any items that are not applicable to this PR.

@spong spong added release_note:fix Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team v8.7.0 v8.8.0 Feature:Related Integrations Security Solution Detection Rules Related Integrations feature labels Feb 24, 2023
@spong spong requested a review from banderror February 24, 2023 01:02
@spong spong self-assigned this Feb 24, 2023
@spong spong marked this pull request as ready for review February 24, 2023 23:23
@spong spong requested review from a team as code owners February 24, 2023 23:23
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Feb 24, 2023
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

const packageInfo = getPackageInfoFromPolicy(policy);
const integrationsInfo = getIntegrationsInfoFromPolicy(policy, packageInfo);
const packageKey = `${packageInfo.package_name}:${packageInfo.package_version}`;
const packageKey = `${packageInfo.package_name}`;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the description, I removed package_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 (just one for each package+integration combination).

@nchaulet nchaulet self-requested a review February 27, 2023 18:05
Copy link
Copy Markdown
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fleet changes LGTM 🚀

@banderror banderror added the bug Fixes for quality problems that affect the customer experience label Feb 28, 2023
Copy link
Copy Markdown
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the fix locally, reviewed the diff, and pushed a few improvements to the code.
Thank you for figuring out how to fetch all the packages, that should allow us to fix the rest of the issues with related integrations which is awesome 🚀

@spong spong requested a review from a team as a code owner February 28, 2023 22:39
@spong spong added the v8.6.3 label Feb 28, 2023
@spong spong enabled auto-merge (squash) February 28, 2023 22:46
Copy link
Copy Markdown
Contributor

@dplumlee dplumlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@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 984 989 +5
Unknown metric groups

API count

id before after diff
fleet 1089 1094 +5

ESLint disabled line counts

id before after diff
securitySolution 428 430 +2

Total ESLint disabled count

id before after diff
securitySolution 506 508 +2

History

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

cc @spong

@spong spong merged commit b833b10 into elastic:main Mar 1, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 1, 2023
…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 pushed a commit to kibanamachine/kibana that referenced this pull request Mar 1, 2023
…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
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.6
8.7

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@spong spong deleted the fix-installed-integrations branch March 1, 2023 02:02
kibanamachine added a commit that referenced this pull request Mar 1, 2023
…nstalled or enabled when they actually are (#152055) (#152411)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Security Solution] Fixes Related Integrations showing as not
installed or enabled when they actually are
(#152055)](#152055)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Garrett
Spong","email":"spong@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-03-01T01:47:28Z","message":"[Security
Solution] Fixes Related Integrations showing as not installed or enabled
when they actually are (#152055)\n\n## Summary\r\n\r\nResolves:
https://github.com/elastic/kibana/issues/142081\r\nhttps://github.com/elastic/kibana/issues/149970\r\nhttps://github.com/elastic/kibana/issues/150968\r\n\r\nBy
adding an initial query for installed integrations and augments
the\r\nexisting `InstalledIntegrationArray` constructed
using\r\n`PackagePolicy`'s. Also removes `version` from the `packageKey`
when\r\ncalculating installed integrations as there can be mis-matches
between\r\ndifferent policy versions and the integration itself, and I
believe the\r\nintended behavior here is to not have multiple
`relatedIntegrations`\r\nreturned for different versions. We may want to
expand the response here\r\nto include all the different policy versions
that exist (and perhaps #\r\nof agents assigned the
policy).\r\n\r\nLastly, updates `getIntegrationsInfoFromPolicy()` to
also pull the base\r\n`package` details in addition to the
policy_template details, as this is\r\nwhat ensure base packages show as
`Installed: enabled` if they have an\r\nintegration policy assigned (vs
just showing as `Installed` like when\r\nthere isn't an integration
policy).\r\n\r\nNote: This PR also adds the `getPackages()` method to
the\r\n`PackageClient` as it didn't currently exist, and was only
available via\r\nthe fleet API via the `/api/fleet/epm/packages`
route.\r\n\r\n\r\n### Before:\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221066781-be7aa1c6-1728-4200-98b2-d40946e48bbe.png\"\r\n/>\r\n</p>\r\n\r\n\r\n\r\n###
After\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221323469-e24081f9-0741-41fd-8227-9e319c98b0d3.png\"\r\n/>\r\n</p>\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
Georgii Gorbachev
<georgii.gorbachev@elastic.co>","sha":"b833b108215c858177535fd3feee406cc628bca8","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Fleet","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection
Rules","v8.7.0","v8.8.0","v8.6.3","Feature:Related
Integrations"],"number":152055,"url":"https://github.com/elastic/kibana/pull/152055","mergeCommit":{"message":"[Security
Solution] Fixes Related Integrations showing as not installed or enabled
when they actually are (#152055)\n\n## Summary\r\n\r\nResolves:
https://github.com/elastic/kibana/issues/142081\r\nhttps://github.com/elastic/kibana/issues/149970\r\nhttps://github.com/elastic/kibana/issues/150968\r\n\r\nBy
adding an initial query for installed integrations and augments
the\r\nexisting `InstalledIntegrationArray` constructed
using\r\n`PackagePolicy`'s. Also removes `version` from the `packageKey`
when\r\ncalculating installed integrations as there can be mis-matches
between\r\ndifferent policy versions and the integration itself, and I
believe the\r\nintended behavior here is to not have multiple
`relatedIntegrations`\r\nreturned for different versions. We may want to
expand the response here\r\nto include all the different policy versions
that exist (and perhaps #\r\nof agents assigned the
policy).\r\n\r\nLastly, updates `getIntegrationsInfoFromPolicy()` to
also pull the base\r\n`package` details in addition to the
policy_template details, as this is\r\nwhat ensure base packages show as
`Installed: enabled` if they have an\r\nintegration policy assigned (vs
just showing as `Installed` like when\r\nthere isn't an integration
policy).\r\n\r\nNote: This PR also adds the `getPackages()` method to
the\r\n`PackageClient` as it didn't currently exist, and was only
available via\r\nthe fleet API via the `/api/fleet/epm/packages`
route.\r\n\r\n\r\n### Before:\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221066781-be7aa1c6-1728-4200-98b2-d40946e48bbe.png\"\r\n/>\r\n</p>\r\n\r\n\r\n\r\n###
After\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221323469-e24081f9-0741-41fd-8227-9e319c98b0d3.png\"\r\n/>\r\n</p>\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
Georgii Gorbachev
<georgii.gorbachev@elastic.co>","sha":"b833b108215c858177535fd3feee406cc628bca8"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.6"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/152055","number":152055,"mergeCommit":{"message":"[Security
Solution] Fixes Related Integrations showing as not installed or enabled
when they actually are (#152055)\n\n## Summary\r\n\r\nResolves:
https://github.com/elastic/kibana/issues/142081\r\nhttps://github.com/elastic/kibana/issues/149970\r\nhttps://github.com/elastic/kibana/issues/150968\r\n\r\nBy
adding an initial query for installed integrations and augments
the\r\nexisting `InstalledIntegrationArray` constructed
using\r\n`PackagePolicy`'s. Also removes `version` from the `packageKey`
when\r\ncalculating installed integrations as there can be mis-matches
between\r\ndifferent policy versions and the integration itself, and I
believe the\r\nintended behavior here is to not have multiple
`relatedIntegrations`\r\nreturned for different versions. We may want to
expand the response here\r\nto include all the different policy versions
that exist (and perhaps #\r\nof agents assigned the
policy).\r\n\r\nLastly, updates `getIntegrationsInfoFromPolicy()` to
also pull the base\r\n`package` details in addition to the
policy_template details, as this is\r\nwhat ensure base packages show as
`Installed: enabled` if they have an\r\nintegration policy assigned (vs
just showing as `Installed` like when\r\nthere isn't an integration
policy).\r\n\r\nNote: This PR also adds the `getPackages()` method to
the\r\n`PackageClient` as it didn't currently exist, and was only
available via\r\nthe fleet API via the `/api/fleet/epm/packages`
route.\r\n\r\n\r\n### Before:\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221066781-be7aa1c6-1728-4200-98b2-d40946e48bbe.png\"\r\n/>\r\n</p>\r\n\r\n\r\n\r\n###
After\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221323469-e24081f9-0741-41fd-8227-9e319c98b0d3.png\"\r\n/>\r\n</p>\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
Georgii Gorbachev
<georgii.gorbachev@elastic.co>","sha":"b833b108215c858177535fd3feee406cc628bca8"}},{"branch":"8.6","label":"v8.6.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Mar 1, 2023
…nstalled or enabled when they actually are (#152055) (#152412)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Security Solution] Fixes Related Integrations showing as not
installed or enabled when they actually are
(#152055)](#152055)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Garrett
Spong","email":"spong@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-03-01T01:47:28Z","message":"[Security
Solution] Fixes Related Integrations showing as not installed or enabled
when they actually are (#152055)\n\n## Summary\r\n\r\nResolves:
https://github.com/elastic/kibana/issues/142081\r\nhttps://github.com/elastic/kibana/issues/149970\r\nhttps://github.com/elastic/kibana/issues/150968\r\n\r\nBy
adding an initial query for installed integrations and augments
the\r\nexisting `InstalledIntegrationArray` constructed
using\r\n`PackagePolicy`'s. Also removes `version` from the `packageKey`
when\r\ncalculating installed integrations as there can be mis-matches
between\r\ndifferent policy versions and the integration itself, and I
believe the\r\nintended behavior here is to not have multiple
`relatedIntegrations`\r\nreturned for different versions. We may want to
expand the response here\r\nto include all the different policy versions
that exist (and perhaps #\r\nof agents assigned the
policy).\r\n\r\nLastly, updates `getIntegrationsInfoFromPolicy()` to
also pull the base\r\n`package` details in addition to the
policy_template details, as this is\r\nwhat ensure base packages show as
`Installed: enabled` if they have an\r\nintegration policy assigned (vs
just showing as `Installed` like when\r\nthere isn't an integration
policy).\r\n\r\nNote: This PR also adds the `getPackages()` method to
the\r\n`PackageClient` as it didn't currently exist, and was only
available via\r\nthe fleet API via the `/api/fleet/epm/packages`
route.\r\n\r\n\r\n### Before:\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221066781-be7aa1c6-1728-4200-98b2-d40946e48bbe.png\"\r\n/>\r\n</p>\r\n\r\n\r\n\r\n###
After\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221323469-e24081f9-0741-41fd-8227-9e319c98b0d3.png\"\r\n/>\r\n</p>\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
Georgii Gorbachev
<georgii.gorbachev@elastic.co>","sha":"b833b108215c858177535fd3feee406cc628bca8","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Fleet","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection
Rules","v8.7.0","v8.8.0","v8.6.3","Feature:Related
Integrations"],"number":152055,"url":"https://github.com/elastic/kibana/pull/152055","mergeCommit":{"message":"[Security
Solution] Fixes Related Integrations showing as not installed or enabled
when they actually are (#152055)\n\n## Summary\r\n\r\nResolves:
https://github.com/elastic/kibana/issues/142081\r\nhttps://github.com/elastic/kibana/issues/149970\r\nhttps://github.com/elastic/kibana/issues/150968\r\n\r\nBy
adding an initial query for installed integrations and augments
the\r\nexisting `InstalledIntegrationArray` constructed
using\r\n`PackagePolicy`'s. Also removes `version` from the `packageKey`
when\r\ncalculating installed integrations as there can be mis-matches
between\r\ndifferent policy versions and the integration itself, and I
believe the\r\nintended behavior here is to not have multiple
`relatedIntegrations`\r\nreturned for different versions. We may want to
expand the response here\r\nto include all the different policy versions
that exist (and perhaps #\r\nof agents assigned the
policy).\r\n\r\nLastly, updates `getIntegrationsInfoFromPolicy()` to
also pull the base\r\n`package` details in addition to the
policy_template details, as this is\r\nwhat ensure base packages show as
`Installed: enabled` if they have an\r\nintegration policy assigned (vs
just showing as `Installed` like when\r\nthere isn't an integration
policy).\r\n\r\nNote: This PR also adds the `getPackages()` method to
the\r\n`PackageClient` as it didn't currently exist, and was only
available via\r\nthe fleet API via the `/api/fleet/epm/packages`
route.\r\n\r\n\r\n### Before:\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221066781-be7aa1c6-1728-4200-98b2-d40946e48bbe.png\"\r\n/>\r\n</p>\r\n\r\n\r\n\r\n###
After\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221323469-e24081f9-0741-41fd-8227-9e319c98b0d3.png\"\r\n/>\r\n</p>\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
Georgii Gorbachev
<georgii.gorbachev@elastic.co>","sha":"b833b108215c858177535fd3feee406cc628bca8"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.6"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/152055","number":152055,"mergeCommit":{"message":"[Security
Solution] Fixes Related Integrations showing as not installed or enabled
when they actually are (#152055)\n\n## Summary\r\n\r\nResolves:
https://github.com/elastic/kibana/issues/142081\r\nhttps://github.com/elastic/kibana/issues/149970\r\nhttps://github.com/elastic/kibana/issues/150968\r\n\r\nBy
adding an initial query for installed integrations and augments
the\r\nexisting `InstalledIntegrationArray` constructed
using\r\n`PackagePolicy`'s. Also removes `version` from the `packageKey`
when\r\ncalculating installed integrations as there can be mis-matches
between\r\ndifferent policy versions and the integration itself, and I
believe the\r\nintended behavior here is to not have multiple
`relatedIntegrations`\r\nreturned for different versions. We may want to
expand the response here\r\nto include all the different policy versions
that exist (and perhaps #\r\nof agents assigned the
policy).\r\n\r\nLastly, updates `getIntegrationsInfoFromPolicy()` to
also pull the base\r\n`package` details in addition to the
policy_template details, as this is\r\nwhat ensure base packages show as
`Installed: enabled` if they have an\r\nintegration policy assigned (vs
just showing as `Installed` like when\r\nthere isn't an integration
policy).\r\n\r\nNote: This PR also adds the `getPackages()` method to
the\r\n`PackageClient` as it didn't currently exist, and was only
available via\r\nthe fleet API via the `/api/fleet/epm/packages`
route.\r\n\r\n\r\n### Before:\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221066781-be7aa1c6-1728-4200-98b2-d40946e48bbe.png\"\r\n/>\r\n</p>\r\n\r\n\r\n\r\n###
After\r\n<p align=\"center\">\r\n<img
width=\"500\"\r\nsrc=\"https://user-images.githubusercontent.com/2946766/221323469-e24081f9-0741-41fd-8227-9e319c98b0d3.png\"\r\n/>\r\n</p>\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
Georgii Gorbachev
<georgii.gorbachev@elastic.co>","sha":"b833b108215c858177535fd3feee406cc628bca8"}},{"branch":"8.6","label":"v8.6.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes for quality problems that affect the customer experience Feature:Related Integrations Security Solution Detection Rules Related Integrations feature release_note:fix Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team:Fleet Team label for Observability Data Collection Fleet team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.6.3 v8.7.0 v8.8.0

Projects

None yet

7 participants