mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Security Solution] List all policies to display integrations properly (#205103)
**Resolves: #200167** ## Summary Increase number of fetched package policies to the maximum. Currently only the first 20 policies (the first page) are returned, which results in treating all remaining ones as disabled. I am proposing the simplest change of increasing the limit here to the maximum. There shouldn't be too many policies there, e.g. in the reproduction I am running there are 23 instead of 20. If that is not enough, however, the alternative would be to discover that there are more policies than the specified limit and the next page(s) would have to be collected and the results added to the final list. #BEFORE  #AFTER  ### Checklist - [ ] [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
This commit is contained in:
parent
4ba5879fa9
commit
6d49348db8
1 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import { transformError } from '@kbn/securitysolution-es-utils';
|
||||
import { SO_SEARCH_LIMIT } from '@kbn/fleet-plugin/common/constants';
|
||||
import { PREBUILT_RULES_PACKAGE_NAME } from '../../../../../../common/detection_engine/constants';
|
||||
import { buildSiemResponse } from '../../../routes/utils';
|
||||
import type { SecuritySolutionPluginRouter } from '../../../../../types';
|
||||
|
@ -43,7 +44,9 @@ export const getAllIntegrationsRoute = (router: SecuritySolutionPluginRouter) =>
|
|||
|
||||
const [packages, packagePolicies] = await Promise.all([
|
||||
fleet.packages.getPackages(),
|
||||
fleet.packagePolicy.list(fleet.savedObjects.createInternalScopedSoClient(), {}),
|
||||
fleet.packagePolicy.list(fleet.savedObjects.createInternalScopedSoClient(), {
|
||||
perPage: SO_SEARCH_LIMIT,
|
||||
}),
|
||||
]);
|
||||
// Elastic prebuilt rules is a special package and should be skipped
|
||||
const packagesWithoutPrebuiltSecurityRules = packages.filter(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue