コード例 #1
0
  @RequestMapping(value = "/snapshot/averageAge", method = RequestMethod.POST)
  public @ResponseBody RestResponse<Map<String, Object>> getPointInTimeAge(
      @ModelAttribute VulnerabilitySearchParameters reportParameters) throws IOException {
    long start = System.currentTimeMillis();

    log.info("Generating Average Age in Point In Time report");
    reportParameters.setShowHidden(false);
    reportParameters.setShowFalsePositive(false);
    reportParameters.setShowClosed(false);
    reportParameters.setShowOpen(true);
    Map<String, Object> map =
        vulnerabilitySearchService.generatePointInTimeAgeReport(reportParameters);

    log.info(
        "Get Average Age in Point In Time took " + (System.currentTimeMillis() - start) + " ms");
    return RestResponse.success(map);
  }
コード例 #2
0
  @RequestMapping(value = "/snapshot/progressByType", method = RequestMethod.POST)
  public @ResponseBody Object getProgressByType(
      @ModelAttribute VulnerabilitySearchParameters reportParameters) throws IOException {
    long start = System.currentTimeMillis();

    log.info("Generating Vulnerability Progress By Type report");
    reportParameters.setShowHidden(false);
    reportParameters.setShowFalsePositive(false);
    reportParameters.setShowClosed(true);
    reportParameters.setShowOpen(true);

    List<Object> map = vulnerabilitySearchService.generateProgressByTypeReport(reportParameters);
    log.info(
        "Vulnerability Progress By Type report took "
            + (System.currentTimeMillis() - start)
            + " ms");
    return RestResponse.success(map);
  }