@Test public void getVulnerabilitySummaryByAssetsTest() throws Exception { ReflectionTestUtils.setField(vulnerabilityService, "vulnTypes", "ec2,onpremserver"); when(vulnerabilityRepository.getRunningInstancesCount(anyString(), anyString())).thenReturn(10L); when(vulnerabilityRepository.getExemptedByRuleCount(anyString(), anyString())).thenReturn(1L); ResponseWithOrder responseWithOrder = new ResponseWithOrder(); List<LinkedHashMap<String, Object>> response = new ArrayList<>(); LinkedHashMap<String, Object> obj = new LinkedHashMap<>(); obj.put("assetsScanned", 5); obj.put("failed", 2); obj.put("passed", 2); response.add(obj); responseWithOrder.setResponse(response); Map<String, Object> responseMap = new HashMap<>(); responseMap.put("response", response); ResponseEntity<Object> nonCompliancePolicyRuleresponse = ResponseUtils.buildSucessResponse(responseMap); when(complianceServiceClient.getNonCompliancePolicyByRule(any(Request.class))) .thenReturn(nonCompliancePolicyRuleresponse); Map<String, Object> compliant = new HashMap<>(); compliant.put("S3", 2); compliant.put("S4", 2); Map<String, Object> nonCompliant = new HashMap<>(); nonCompliant.put("S3", 3); nonCompliant.put("S4", 2); nonCompliant.put("S5", 1); when(vulnerabilityRepository.getNonCompliantResourceIds(anyString())).thenReturn(new ArrayList<>()); when(vulnerabilityRepository.getCompliantHostsBySeverity(anyString())).thenReturn(compliant); when(vulnerabilityRepository.getUniqueHostBySeverity(anyString(), anyString())).thenReturn(nonCompliant); assertThat(vulnerabilityService.getVulnerabilitySummaryByAssets("ag").get(Constants.COUNT), is(20L)); }
public Map<String, Object> getVulnerabilitySummaryByAssets(String assetGroup) throws ServiceException, DataException { List<String> vulnTargetTypes = getVulnTargetTypes(assetGroup); long totalCount = 0; long exemptedCount = 0; long inscopeCount = 0; long scannedCount = 0; long unscannedCount = 0; for (String vulnType : vulnTargetTypes) { try { long tempTotalCount = vulnerabilityRepository.getRunningInstancesCount(assetGroup, vulnType); long exemptedByRule = vulnerabilityRepository.getExemptedByRuleCount(assetGroup, vulnType); Request request = new Request(); request.setAg(assetGroup); Map<String, String> filter = new HashMap<>(); filter.put("domain", "Infra & Platforms"); if (vulnType.equals(EC2)) { filter.put("ruleId.keyword", EC2_QUALYS_RULEID); } else if (vulnType.equals(VIRTUALMACHINE)) { filter.put("ruleId.keyword", VIRTUALMACHINE_QUALYS_RULEID); } else { filter.put("ruleId.keyword", ONPREM_QUALYS_RULEID); } request.setFilter(filter); List<LinkedHashMap<String, Object>> responses = new ArrayList<>(); Map<String, Object> response = new HashMap<>(); ResponseEntity<Object> nonCompliancePolicyRuleresponse = complianceServiceClient .getNonCompliancePolicyByRule(request); if (nonCompliancePolicyRuleresponse != null) { Map<String, Object> responseBody = (Map<String, Object>) nonCompliancePolicyRuleresponse.getBody(); Map<String, Object> dataResponseMap = (Map<String, Object>) responseBody.get("data"); responses = (List<LinkedHashMap<String, Object>>) dataResponseMap.get("response"); if (responses.size() > 0) { response = responses.get(0); long inScopeRule = Long.valueOf(response.get("assetsScanned").toString()); long exemptedByAge = tempTotalCount - inScopeRule; totalCount += tempTotalCount; exemptedCount += exemptedByAge + exemptedByRule; inscopeCount += inScopeRule - exemptedByRule; scannedCount += Long.valueOf(response.get("passed").toString()) - exemptedByRule; unscannedCount += Long.valueOf(response.get("failed").toString()); } } } catch (Exception e) { throw new ServiceException(e); } } long nonCompliantCount = vulnerabilityRepository.getNonCompliantResourceIds(assetGroup).size(); Map<String, Object> compliant = vulnerabilityRepository.getCompliantHostsBySeverity(assetGroup); Map<String, Object> noncompliant = vulnerabilityRepository.getUniqueHostBySeverity(assetGroup, "3,4,5"); noncompliant.put("S3", Long.valueOf(noncompliant.get("S3").toString()) - Long.valueOf(compliant.get("S3").toString())); noncompliant.put("S4", Long.valueOf(noncompliant.get("S4").toString()) - Long.valueOf(compliant.get("S4").toString())); for (String key : compliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(compliant.get(key).toString())); compliant.put(key, countMap); } for (String key : noncompliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(noncompliant.get(key).toString())); noncompliant.put(key, countMap); } Map<String, Object> response = new HashMap<>(); response.put(COUNT, totalCount); Map<String, Object> exempted = new HashMap<>(); exempted.put(COUNT, exemptedCount); response.put("exempted", exempted); Map<String, Object> inscope = new HashMap<>(); inscope.put(COUNT, inscopeCount); Map<String, Object> unscanned = new HashMap<>(); unscanned.put(COUNT, unscannedCount); inscope.put("unscanned", unscanned); Map<String, Object> scanned = new HashMap<>(); scanned.put(COUNT, scannedCount); compliant.put(COUNT, scannedCount - nonCompliantCount); scanned.put("compliant", compliant); noncompliant.put(COUNT, nonCompliantCount); scanned.put("noncompliant", noncompliant); inscope.put("scanned", scanned); response.put("inscope", inscope); return response; }
VulnerabilityService implements Constants { public Map<String, Object> getVulnerabilitySummaryByAssets(String assetGroup) throws ServiceException, DataException { List<String> vulnTargetTypes = getVulnTargetTypes(assetGroup); long totalCount = 0; long exemptedCount = 0; long inscopeCount = 0; long scannedCount = 0; long unscannedCount = 0; for (String vulnType : vulnTargetTypes) { try { long tempTotalCount = vulnerabilityRepository.getRunningInstancesCount(assetGroup, vulnType); long exemptedByRule = vulnerabilityRepository.getExemptedByRuleCount(assetGroup, vulnType); Request request = new Request(); request.setAg(assetGroup); Map<String, String> filter = new HashMap<>(); filter.put("domain", "Infra & Platforms"); if (vulnType.equals(EC2)) { filter.put("ruleId.keyword", EC2_QUALYS_RULEID); } else if (vulnType.equals(VIRTUALMACHINE)) { filter.put("ruleId.keyword", VIRTUALMACHINE_QUALYS_RULEID); } else { filter.put("ruleId.keyword", ONPREM_QUALYS_RULEID); } request.setFilter(filter); List<LinkedHashMap<String, Object>> responses = new ArrayList<>(); Map<String, Object> response = new HashMap<>(); ResponseEntity<Object> nonCompliancePolicyRuleresponse = complianceServiceClient .getNonCompliancePolicyByRule(request); if (nonCompliancePolicyRuleresponse != null) { Map<String, Object> responseBody = (Map<String, Object>) nonCompliancePolicyRuleresponse.getBody(); Map<String, Object> dataResponseMap = (Map<String, Object>) responseBody.get("data"); responses = (List<LinkedHashMap<String, Object>>) dataResponseMap.get("response"); if (responses.size() > 0) { response = responses.get(0); long inScopeRule = Long.valueOf(response.get("assetsScanned").toString()); long exemptedByAge = tempTotalCount - inScopeRule; totalCount += tempTotalCount; exemptedCount += exemptedByAge + exemptedByRule; inscopeCount += inScopeRule - exemptedByRule; scannedCount += Long.valueOf(response.get("passed").toString()) - exemptedByRule; unscannedCount += Long.valueOf(response.get("failed").toString()); } } } catch (Exception e) { throw new ServiceException(e); } } long nonCompliantCount = vulnerabilityRepository.getNonCompliantResourceIds(assetGroup).size(); Map<String, Object> compliant = vulnerabilityRepository.getCompliantHostsBySeverity(assetGroup); Map<String, Object> noncompliant = vulnerabilityRepository.getUniqueHostBySeverity(assetGroup, "3,4,5"); noncompliant.put("S3", Long.valueOf(noncompliant.get("S3").toString()) - Long.valueOf(compliant.get("S3").toString())); noncompliant.put("S4", Long.valueOf(noncompliant.get("S4").toString()) - Long.valueOf(compliant.get("S4").toString())); for (String key : compliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(compliant.get(key).toString())); compliant.put(key, countMap); } for (String key : noncompliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(noncompliant.get(key).toString())); noncompliant.put(key, countMap); } Map<String, Object> response = new HashMap<>(); response.put(COUNT, totalCount); Map<String, Object> exempted = new HashMap<>(); exempted.put(COUNT, exemptedCount); response.put("exempted", exempted); Map<String, Object> inscope = new HashMap<>(); inscope.put(COUNT, inscopeCount); Map<String, Object> unscanned = new HashMap<>(); unscanned.put(COUNT, unscannedCount); inscope.put("unscanned", unscanned); Map<String, Object> scanned = new HashMap<>(); scanned.put(COUNT, scannedCount); compliant.put(COUNT, scannedCount - nonCompliantCount); scanned.put("compliant", compliant); noncompliant.put(COUNT, nonCompliantCount); scanned.put("noncompliant", noncompliant); inscope.put("scanned", scanned); response.put("inscope", inscope); return response; } }
VulnerabilityService implements Constants { public Map<String, Object> getVulnerabilitySummaryByAssets(String assetGroup) throws ServiceException, DataException { List<String> vulnTargetTypes = getVulnTargetTypes(assetGroup); long totalCount = 0; long exemptedCount = 0; long inscopeCount = 0; long scannedCount = 0; long unscannedCount = 0; for (String vulnType : vulnTargetTypes) { try { long tempTotalCount = vulnerabilityRepository.getRunningInstancesCount(assetGroup, vulnType); long exemptedByRule = vulnerabilityRepository.getExemptedByRuleCount(assetGroup, vulnType); Request request = new Request(); request.setAg(assetGroup); Map<String, String> filter = new HashMap<>(); filter.put("domain", "Infra & Platforms"); if (vulnType.equals(EC2)) { filter.put("ruleId.keyword", EC2_QUALYS_RULEID); } else if (vulnType.equals(VIRTUALMACHINE)) { filter.put("ruleId.keyword", VIRTUALMACHINE_QUALYS_RULEID); } else { filter.put("ruleId.keyword", ONPREM_QUALYS_RULEID); } request.setFilter(filter); List<LinkedHashMap<String, Object>> responses = new ArrayList<>(); Map<String, Object> response = new HashMap<>(); ResponseEntity<Object> nonCompliancePolicyRuleresponse = complianceServiceClient .getNonCompliancePolicyByRule(request); if (nonCompliancePolicyRuleresponse != null) { Map<String, Object> responseBody = (Map<String, Object>) nonCompliancePolicyRuleresponse.getBody(); Map<String, Object> dataResponseMap = (Map<String, Object>) responseBody.get("data"); responses = (List<LinkedHashMap<String, Object>>) dataResponseMap.get("response"); if (responses.size() > 0) { response = responses.get(0); long inScopeRule = Long.valueOf(response.get("assetsScanned").toString()); long exemptedByAge = tempTotalCount - inScopeRule; totalCount += tempTotalCount; exemptedCount += exemptedByAge + exemptedByRule; inscopeCount += inScopeRule - exemptedByRule; scannedCount += Long.valueOf(response.get("passed").toString()) - exemptedByRule; unscannedCount += Long.valueOf(response.get("failed").toString()); } } } catch (Exception e) { throw new ServiceException(e); } } long nonCompliantCount = vulnerabilityRepository.getNonCompliantResourceIds(assetGroup).size(); Map<String, Object> compliant = vulnerabilityRepository.getCompliantHostsBySeverity(assetGroup); Map<String, Object> noncompliant = vulnerabilityRepository.getUniqueHostBySeverity(assetGroup, "3,4,5"); noncompliant.put("S3", Long.valueOf(noncompliant.get("S3").toString()) - Long.valueOf(compliant.get("S3").toString())); noncompliant.put("S4", Long.valueOf(noncompliant.get("S4").toString()) - Long.valueOf(compliant.get("S4").toString())); for (String key : compliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(compliant.get(key).toString())); compliant.put(key, countMap); } for (String key : noncompliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(noncompliant.get(key).toString())); noncompliant.put(key, countMap); } Map<String, Object> response = new HashMap<>(); response.put(COUNT, totalCount); Map<String, Object> exempted = new HashMap<>(); exempted.put(COUNT, exemptedCount); response.put("exempted", exempted); Map<String, Object> inscope = new HashMap<>(); inscope.put(COUNT, inscopeCount); Map<String, Object> unscanned = new HashMap<>(); unscanned.put(COUNT, unscannedCount); inscope.put("unscanned", unscanned); Map<String, Object> scanned = new HashMap<>(); scanned.put(COUNT, scannedCount); compliant.put(COUNT, scannedCount - nonCompliantCount); scanned.put("compliant", compliant); noncompliant.put(COUNT, nonCompliantCount); scanned.put("noncompliant", noncompliant); inscope.put("scanned", scanned); response.put("inscope", inscope); return response; }  }
VulnerabilityService implements Constants { public Map<String, Object> getVulnerabilitySummaryByAssets(String assetGroup) throws ServiceException, DataException { List<String> vulnTargetTypes = getVulnTargetTypes(assetGroup); long totalCount = 0; long exemptedCount = 0; long inscopeCount = 0; long scannedCount = 0; long unscannedCount = 0; for (String vulnType : vulnTargetTypes) { try { long tempTotalCount = vulnerabilityRepository.getRunningInstancesCount(assetGroup, vulnType); long exemptedByRule = vulnerabilityRepository.getExemptedByRuleCount(assetGroup, vulnType); Request request = new Request(); request.setAg(assetGroup); Map<String, String> filter = new HashMap<>(); filter.put("domain", "Infra & Platforms"); if (vulnType.equals(EC2)) { filter.put("ruleId.keyword", EC2_QUALYS_RULEID); } else if (vulnType.equals(VIRTUALMACHINE)) { filter.put("ruleId.keyword", VIRTUALMACHINE_QUALYS_RULEID); } else { filter.put("ruleId.keyword", ONPREM_QUALYS_RULEID); } request.setFilter(filter); List<LinkedHashMap<String, Object>> responses = new ArrayList<>(); Map<String, Object> response = new HashMap<>(); ResponseEntity<Object> nonCompliancePolicyRuleresponse = complianceServiceClient .getNonCompliancePolicyByRule(request); if (nonCompliancePolicyRuleresponse != null) { Map<String, Object> responseBody = (Map<String, Object>) nonCompliancePolicyRuleresponse.getBody(); Map<String, Object> dataResponseMap = (Map<String, Object>) responseBody.get("data"); responses = (List<LinkedHashMap<String, Object>>) dataResponseMap.get("response"); if (responses.size() > 0) { response = responses.get(0); long inScopeRule = Long.valueOf(response.get("assetsScanned").toString()); long exemptedByAge = tempTotalCount - inScopeRule; totalCount += tempTotalCount; exemptedCount += exemptedByAge + exemptedByRule; inscopeCount += inScopeRule - exemptedByRule; scannedCount += Long.valueOf(response.get("passed").toString()) - exemptedByRule; unscannedCount += Long.valueOf(response.get("failed").toString()); } } } catch (Exception e) { throw new ServiceException(e); } } long nonCompliantCount = vulnerabilityRepository.getNonCompliantResourceIds(assetGroup).size(); Map<String, Object> compliant = vulnerabilityRepository.getCompliantHostsBySeverity(assetGroup); Map<String, Object> noncompliant = vulnerabilityRepository.getUniqueHostBySeverity(assetGroup, "3,4,5"); noncompliant.put("S3", Long.valueOf(noncompliant.get("S3").toString()) - Long.valueOf(compliant.get("S3").toString())); noncompliant.put("S4", Long.valueOf(noncompliant.get("S4").toString()) - Long.valueOf(compliant.get("S4").toString())); for (String key : compliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(compliant.get(key).toString())); compliant.put(key, countMap); } for (String key : noncompliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(noncompliant.get(key).toString())); noncompliant.put(key, countMap); } Map<String, Object> response = new HashMap<>(); response.put(COUNT, totalCount); Map<String, Object> exempted = new HashMap<>(); exempted.put(COUNT, exemptedCount); response.put("exempted", exempted); Map<String, Object> inscope = new HashMap<>(); inscope.put(COUNT, inscopeCount); Map<String, Object> unscanned = new HashMap<>(); unscanned.put(COUNT, unscannedCount); inscope.put("unscanned", unscanned); Map<String, Object> scanned = new HashMap<>(); scanned.put(COUNT, scannedCount); compliant.put(COUNT, scannedCount - nonCompliantCount); scanned.put("compliant", compliant); noncompliant.put(COUNT, nonCompliantCount); scanned.put("noncompliant", noncompliant); inscope.put("scanned", scanned); response.put("inscope", inscope); return response; }  List<Map<String, Object>> getVulnerabilitiesDetails(String assetGroup, Map<String, String> filter); @SuppressWarnings("unchecked") List<Map<String, Object>> getAllVulnerabilitiesDetailsByAssetGroup(String assetGroup,
			Map<String, String> filter,String applicationFilter,String environmentFilter, String searchText, int from, int size); List<Map<String, Object>> getResourcedetailsByResourceId(String assetGroup,
			List<String> listDistinctResourceId, boolean flag); @SuppressWarnings({ "unchecked" }) Map<String, Object> getVulnerabilitySummary(String assetGroup, String reqSeverity); List<Map<String, Object>> getVulnerabilityByAppAndEnv(String assetGroup, String filter, String application); List<Map<String, Object>> getVulnerabilityTrend(String assetGroup, Map<String, String> filter, Date from,
			Date to); List<Map<String, Object>> getVulnerabilityNewOpenTrend(String assetGroup, String severity, Date from); List<Map<String, Object>> getVulnerabilitiesDistribution(String assetGroup); Object filterMatchingCollectionElements(List<Map<String, Object>> masterDetailList, String searchText,
			boolean b); Map<String, Object> getVulnerabilitysummaryByResourceId(String instanceId); List<Map<String, Object>> getVulnerabilityDetailsByResourceId(String instanceId); List<Map<String, Object>> getAgingSummary(String assetGroup); List<Map<String, Object>> getVulnerabilityByQid(String qid); @SuppressWarnings("unchecked") Map<String, Integer> getHighestLowestPerformers(String assetGroup, String severity, String type); List<Map<String, Object>> getDistributionSummaryByInfraType(String assetGroup, String severity); List<Map<String, Object>> getDistributionSummaryByEnv(String assetGroup, String severity); List<Map<String, Object>> getDistributionSummaryByVulnType(String assetGroup, String severity); List<Map<String, Object>> getRemediationActionsSummary(String assetGroup, String severity); boolean createTrendAnnotation(TrendNote request); List<Map<String, Object>> getTrendAnnotations(String assetGroup, Date from); boolean deleteTrendAnnotation(String noteId); Map<String, Object> getVulnerabilitySummaryByAssets(String assetGroup); List<Map<String, Object>> getVulnerabilityAssetsTrend(String assetGroup, String severity, Date from); Map<String, Map<String, String>> getDirectorsForAGByApp(Set<String> appNames); ResponseEntity<Object> formatException(ServiceException e); Map<String, Object> getTrendProgress(String assetGroup, String ruleId, LocalDate startDate,
			LocalDate endDate, String trendCategory); void useRealTimeDataForLatestDate(List<Map<String, Object>> trendList, String ag, String trendCategory,
			String ruleId, String domain); List<String> getResourceId(List<Map<String, Object>> vulnerabilityOccuranceList); List<Map<String, Object>> getCartesianProduct(List<Map<String, Object>> vulnerabilityOccuranceList,
			List<Map<String, Object>> resourceIdDetails); int vulnerabilityAssetCount(String assetGroup, Map<String, String> termsFilter, String applicationFilter,
			String environmentFilter, int from, int size); int countForTargetType(String assetGroup, String parentType, Map<String, String> termsFilter,
			String applicationFilter, String environmentFilter, int from, int size); }
VulnerabilityService implements Constants { public Map<String, Object> getVulnerabilitySummaryByAssets(String assetGroup) throws ServiceException, DataException { List<String> vulnTargetTypes = getVulnTargetTypes(assetGroup); long totalCount = 0; long exemptedCount = 0; long inscopeCount = 0; long scannedCount = 0; long unscannedCount = 0; for (String vulnType : vulnTargetTypes) { try { long tempTotalCount = vulnerabilityRepository.getRunningInstancesCount(assetGroup, vulnType); long exemptedByRule = vulnerabilityRepository.getExemptedByRuleCount(assetGroup, vulnType); Request request = new Request(); request.setAg(assetGroup); Map<String, String> filter = new HashMap<>(); filter.put("domain", "Infra & Platforms"); if (vulnType.equals(EC2)) { filter.put("ruleId.keyword", EC2_QUALYS_RULEID); } else if (vulnType.equals(VIRTUALMACHINE)) { filter.put("ruleId.keyword", VIRTUALMACHINE_QUALYS_RULEID); } else { filter.put("ruleId.keyword", ONPREM_QUALYS_RULEID); } request.setFilter(filter); List<LinkedHashMap<String, Object>> responses = new ArrayList<>(); Map<String, Object> response = new HashMap<>(); ResponseEntity<Object> nonCompliancePolicyRuleresponse = complianceServiceClient .getNonCompliancePolicyByRule(request); if (nonCompliancePolicyRuleresponse != null) { Map<String, Object> responseBody = (Map<String, Object>) nonCompliancePolicyRuleresponse.getBody(); Map<String, Object> dataResponseMap = (Map<String, Object>) responseBody.get("data"); responses = (List<LinkedHashMap<String, Object>>) dataResponseMap.get("response"); if (responses.size() > 0) { response = responses.get(0); long inScopeRule = Long.valueOf(response.get("assetsScanned").toString()); long exemptedByAge = tempTotalCount - inScopeRule; totalCount += tempTotalCount; exemptedCount += exemptedByAge + exemptedByRule; inscopeCount += inScopeRule - exemptedByRule; scannedCount += Long.valueOf(response.get("passed").toString()) - exemptedByRule; unscannedCount += Long.valueOf(response.get("failed").toString()); } } } catch (Exception e) { throw new ServiceException(e); } } long nonCompliantCount = vulnerabilityRepository.getNonCompliantResourceIds(assetGroup).size(); Map<String, Object> compliant = vulnerabilityRepository.getCompliantHostsBySeverity(assetGroup); Map<String, Object> noncompliant = vulnerabilityRepository.getUniqueHostBySeverity(assetGroup, "3,4,5"); noncompliant.put("S3", Long.valueOf(noncompliant.get("S3").toString()) - Long.valueOf(compliant.get("S3").toString())); noncompliant.put("S4", Long.valueOf(noncompliant.get("S4").toString()) - Long.valueOf(compliant.get("S4").toString())); for (String key : compliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(compliant.get(key).toString())); compliant.put(key, countMap); } for (String key : noncompliant.keySet()) { Map<String, Long> countMap = new HashMap<>(); countMap.put(COUNT, Long.valueOf(noncompliant.get(key).toString())); noncompliant.put(key, countMap); } Map<String, Object> response = new HashMap<>(); response.put(COUNT, totalCount); Map<String, Object> exempted = new HashMap<>(); exempted.put(COUNT, exemptedCount); response.put("exempted", exempted); Map<String, Object> inscope = new HashMap<>(); inscope.put(COUNT, inscopeCount); Map<String, Object> unscanned = new HashMap<>(); unscanned.put(COUNT, unscannedCount); inscope.put("unscanned", unscanned); Map<String, Object> scanned = new HashMap<>(); scanned.put(COUNT, scannedCount); compliant.put(COUNT, scannedCount - nonCompliantCount); scanned.put("compliant", compliant); noncompliant.put(COUNT, nonCompliantCount); scanned.put("noncompliant", noncompliant); inscope.put("scanned", scanned); response.put("inscope", inscope); return response; }  List<Map<String, Object>> getVulnerabilitiesDetails(String assetGroup, Map<String, String> filter); @SuppressWarnings("unchecked") List<Map<String, Object>> getAllVulnerabilitiesDetailsByAssetGroup(String assetGroup,
			Map<String, String> filter,String applicationFilter,String environmentFilter, String searchText, int from, int size); List<Map<String, Object>> getResourcedetailsByResourceId(String assetGroup,
			List<String> listDistinctResourceId, boolean flag); @SuppressWarnings({ "unchecked" }) Map<String, Object> getVulnerabilitySummary(String assetGroup, String reqSeverity); List<Map<String, Object>> getVulnerabilityByAppAndEnv(String assetGroup, String filter, String application); List<Map<String, Object>> getVulnerabilityTrend(String assetGroup, Map<String, String> filter, Date from,
			Date to); List<Map<String, Object>> getVulnerabilityNewOpenTrend(String assetGroup, String severity, Date from); List<Map<String, Object>> getVulnerabilitiesDistribution(String assetGroup); Object filterMatchingCollectionElements(List<Map<String, Object>> masterDetailList, String searchText,
			boolean b); Map<String, Object> getVulnerabilitysummaryByResourceId(String instanceId); List<Map<String, Object>> getVulnerabilityDetailsByResourceId(String instanceId); List<Map<String, Object>> getAgingSummary(String assetGroup); List<Map<String, Object>> getVulnerabilityByQid(String qid); @SuppressWarnings("unchecked") Map<String, Integer> getHighestLowestPerformers(String assetGroup, String severity, String type); List<Map<String, Object>> getDistributionSummaryByInfraType(String assetGroup, String severity); List<Map<String, Object>> getDistributionSummaryByEnv(String assetGroup, String severity); List<Map<String, Object>> getDistributionSummaryByVulnType(String assetGroup, String severity); List<Map<String, Object>> getRemediationActionsSummary(String assetGroup, String severity); boolean createTrendAnnotation(TrendNote request); List<Map<String, Object>> getTrendAnnotations(String assetGroup, Date from); boolean deleteTrendAnnotation(String noteId); Map<String, Object> getVulnerabilitySummaryByAssets(String assetGroup); List<Map<String, Object>> getVulnerabilityAssetsTrend(String assetGroup, String severity, Date from); Map<String, Map<String, String>> getDirectorsForAGByApp(Set<String> appNames); ResponseEntity<Object> formatException(ServiceException e); Map<String, Object> getTrendProgress(String assetGroup, String ruleId, LocalDate startDate,
			LocalDate endDate, String trendCategory); void useRealTimeDataForLatestDate(List<Map<String, Object>> trendList, String ag, String trendCategory,
			String ruleId, String domain); List<String> getResourceId(List<Map<String, Object>> vulnerabilityOccuranceList); List<Map<String, Object>> getCartesianProduct(List<Map<String, Object>> vulnerabilityOccuranceList,
			List<Map<String, Object>> resourceIdDetails); int vulnerabilityAssetCount(String assetGroup, Map<String, String> termsFilter, String applicationFilter,
			String environmentFilter, int from, int size); int countForTargetType(String assetGroup, String parentType, Map<String, String> termsFilter,
			String applicationFilter, String environmentFilter, int from, int size);  }