[Cloud Security] Adding vuln filter to the scores index (#161648)

This commit is contained in:
Jordan 2023-07-12 12:09:41 +03:00 committed by GitHub
parent ea1e6ed240
commit 47d099e22f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ import {
import { SearchRequest } from '@kbn/data-plugin/common';
import { ElasticsearchClient } from '@kbn/core/server';
import type { Logger } from '@kbn/core/server';
import { getSafeVulnerabilitiesQueryFilter } from '../../common/utils/get_safe_vulnerabilities_query_filter';
import { getSafePostureTypeRuntimeMapping } from '../../common/runtime_mappings/get_safe_posture_type_runtime_mapping';
import { getIdentifierRuntimeMapping } from '../../common/runtime_mappings/get_identifier_runtime_mapping';
import {
@ -181,9 +182,7 @@ const getScoreQuery = (): SearchRequest => ({
const getVulnStatsTrendQuery = (): SearchRequest => ({
index: LATEST_VULNERABILITIES_INDEX_DEFAULT_NS,
size: 0,
query: {
match_all: {},
},
query: getSafeVulnerabilitiesQueryFilter(),
aggs: {
critical: {
filter: { term: { 'vulnerability.severity': VULNERABILITIES_SEVERITY.CRITICAL } },