[8.6] [Security Solution] Fixes certain Related Integrations showing as not installed even when they are (#149646) (#151535)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Security Solution] Fixes certain Related Integrations showing as
`not installed` even when they are
(#149646)](https://github.com/elastic/kibana/pull/149646)

<!--- 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-02-16T23:53:26Z","message":"[Security
Solution] Fixes certain Related Integrations showing as `not installed`
even when they are (#149646)\n\n## Summary\r\n\r\nResolves
https://github.com/elastic/kibana/issues/149644 by adding a\r\nfallback
for package policies without a
policy_template.","sha":"ba5634eda6b18ae3d809ba50d21878526c97a8dc","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Endpoint
Response","Feature:Detection Rules","Team:
SecuritySolution","Team:Detection
Rules","backport:prev-minor","v8.6.0","v8.7.0","v8.8.0"],"number":149646,"url":"https://github.com/elastic/kibana/pull/149646","mergeCommit":{"message":"[Security
Solution] Fixes certain Related Integrations showing as `not installed`
even when they are (#149646)\n\n## Summary\r\n\r\nResolves
https://github.com/elastic/kibana/issues/149644 by adding a\r\nfallback
for package policies without a
policy_template.","sha":"ba5634eda6b18ae3d809ba50d21878526c97a8dc"}},"sourceBranch":"main","suggestedTargetBranches":["8.6","8.7"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"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/149646","number":149646,"mergeCommit":{"message":"[Security
Solution] Fixes certain Related Integrations showing as `not installed`
even when they are (#149646)\n\n## Summary\r\n\r\nResolves
https://github.com/elastic/kibana/issues/149644 by adding a\r\nfallback
for package policies without a
policy_template.","sha":"ba5634eda6b18ae3d809ba50d21878526c97a8dc"}}]}]
BACKPORT-->

Co-authored-by: Garrett Spong <spong@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2023-02-16 20:24:14 -05:00 committed by GitHub
parent 36832ed0ff
commit 76615e0860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,7 +126,7 @@ const getIntegrationsInfoFromPolicy = (
packageInfo: InstalledPackageBasicInfo
): InstalledIntegrationBasicInfo[] => {
return policy.inputs.map((input) => {
const integrationName = normalizeString(input.policy_template); // e.g. 'cloudtrail'
const integrationName = normalizeString(input.policy_template ?? input.type); // e.g. 'cloudtrail'
const integrationTitle = `${packageInfo.package_title} ${capitalize(integrationName)}`; // e.g. 'AWS Cloudtrail'
return {
integration_name: integrationName,